blob: 6186c708ec9175b6ad7c1d63b413d2f701719d60 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
#!/bin/sh
# Helper script which will create the port / distfiles
# from a checked out git repo
# Set the distfile URL we will fetch from
DURL="http://www.pcbsd.org/~kris/software/"
get_last_rev_git()
{
oPWD=`pwd`
cd "${1}"
rev=0
rev=`git log -n 1 --date=raw | grep 'Date:' | awk '{print $2}'`
cd $oPWD
if [ $rev -ne 0 ] ; then
echo "$rev"
return 0
fi
return 1
}
if [ -z "$1" ] ; then
echo "Usage: ./mkports.sh <outdir>"
exit 1
fi
if [ ! -d "${1}" ] ; then
echo "Invalid directory: $1"
exit 1
fi
portsdir="${1}"
distdir="${1}/distfiles"
if [ ! -d "$portsdir" ] ; then
mkdir ${portsdir}
fi
if [ ! -d "$portsdir/sysutils" ] ; then
mkdir ${portsdir}/sysutils
fi
if [ ! -d "$distdir" ] ; then
mkdir ${distdir}
fi
REV=`get_last_rev_git "."`
# Make the dist files
rm ${distdir}/lumina*.tar.bz2 2>/dev/null
echo "Creating lumina dist file for version: $REV"
cd ..
tar cvjf ${distdir}/lumina-${REV}.tar.bz2 --exclude .git lumina 2>/dev/null
cd lumina
# Copy ports files
rm -rf ${portsdir}/x11/lumina 2>/dev/null
cp -r port-files ${portsdir}/x11/lumina
# Set the version numbers
sed -i '' "s|CHGVERSION|${REV}|g" ${portsdir}/x11/lumina/Makefile
# Set the mirror to use
sed -i '' "s|http://www.pcbsd.org/~kris/software/|${DURL}|g" ${portsdir}/x11/lumina/Makefile
# Create the makesums / distinfo file
cd ${distdir}
sha256 lumina-${REV}.tar.bz2 > ${portsdir}/x11/lumina/distinfo
echo "SIZE (lumina-${REV}.tar.bz2) = `stat -f \"%z\" lumina-${REV}.tar.bz2`" >> ${portsdir}/x11/lumina/distinfo
|