-
Notifications
You must be signed in to change notification settings - Fork 4
/
package.sh
executable file
·51 lines (36 loc) · 938 Bytes
/
package.sh
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
if $(test -f ./gpp.out); then
GPP_PATH=./gpp.out;
elif $(test -f ../gpp.out); then
GPP_PATH=../gpp.out;
else
GPP_PATH=$(which gpp);
fi
echo "Using gpp:"
echo $GPP_PATH
VERSION=$(./version.sh)
PKGNAME=fjb_$VERSION
rm -rf $PKGNAME
echo "Creating $PKGNAME"
mkdir $PKGNAME
mkdir $PKGNAME/usr
mkdir $PKGNAME/usr/local
mkdir $PKGNAME/usr/local/bin
mkdir $PKGNAME/usr/local/lib
mkdir $PKGNAME/usr/local/include
cp ./fjb.out $PKGNAME/usr/local/bin/fjb
cp ./libjson.a $PKGNAME/usr/local/lib/.
cp ./libhashmap.a $PKGNAME/usr/local/lib/.
cp ./libscss.a $PKGNAME/usr/local/lib/.
cp -r src/include $PKGNAME/usr/local/include/fjb
mkdir $PKGNAME/DEBIAN
$GPP_PATH ./pkg.gpp > $PKGNAME/DEBIAN/control
echo "Building..."
dpkg-deb --build $PKGNAME
echo "Done"
TAG=$PKGNAME-amd64-linux
read -p "Publish $PKGNAME.deb $TAG to Github? (Y/n)" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
gh release create $TAG $PKGNAME.deb --title $TAG
fi