mkdeb.sh 1.46 KB
Newer Older
netblue30's avatar
netblue30 committed
1
#!/bin/bash
netblue30's avatar
netblue30 committed
2
# based on http://tldp.org/HOWTO/html_single/Debian-Binary-Package-Building-HOWTO/
netblue30's avatar
netblue30 committed
3 4 5 6 7
# a code archive should already be available

TOP=`pwd`
CODE_ARCHIVE="$1-$2.tar.bz2"
CODE_DIR="$1-$2"
netblue30's avatar
netblue30 committed
8 9
INSTALL_DIR+="$CODE_DIR/debian"
DEBIAN_CTRL_DIR+="$CODE_DIR/debian/DEBIAN"
netblue30's avatar
netblue30 committed
10 11 12 13 14 15 16

echo "*****************************************"
echo "code archive: $CODE_ARCHIVE"
echo "code directory: $CODE_DIR"
echo "install directory: $INSTALL_DIR"
echo "debian control directory: $DEBIAN_CTRL_DIR"
echo "*****************************************"
netblue30's avatar
netblue30 committed
17

netblue30's avatar
netblue30 committed
18
tar -xjvf $CODE_ARCHIVE
netblue30's avatar
netblue30 committed
19
#mkdir -p $INSTALL_DIR
netblue30's avatar
netblue30 committed
20 21 22
cd $CODE_DIR
./configure --prefix=/usr
make
netblue30's avatar
netblue30 committed
23 24
mkdir debian
DESTDIR=debian make install-strip
netblue30's avatar
netblue30 committed
25 26 27

cd ..
echo "*****************************************"
netblue30's avatar
netblue30 committed
28
SIZE=`du -s $INSTALL_DIR`
netblue30's avatar
netblue30 committed
29 30 31
echo "install size $SIZE"
echo "*****************************************"

netblue30's avatar
netblue30 committed
32 33 34 35
mv $INSTALL_DIR/usr/share/doc/firejail/RELNOTES $INSTALL_DIR/usr/share/doc/firejail/changelog.Debian
gzip -9 $INSTALL_DIR/usr/share/doc/firejail/changelog.Debian
rm $INSTALL_DIR/usr/share/doc/firejail/COPYING
cp platform/debian/copyright $INSTALL_DIR/usr/share/doc/firejail/.
netblue30's avatar
netblue30 committed
36 37
mkdir -p $DEBIAN_CTRL_DIR
sed "s/FIREJAILVER/$2/g"  platform/debian/control > $DEBIAN_CTRL_DIR/control
netblue30's avatar
netblue30 committed
38 39


netblue30's avatar
netblue30 committed
40
cp platform/debian/conffiles $DEBIAN_CTRL_DIR/.
netblue30's avatar
netblue30 committed
41 42 43
find $INSTALL_DIR  -type d | xargs chmod 755
cd $CODE_DIR
fakeroot dpkg-deb --build debian
netblue30's avatar
netblue30 committed
44
lintian debian.deb
netblue30's avatar
netblue30 committed
45
mv debian.deb ../firejail_$2_1_amd64.deb
netblue30's avatar
netblue30 committed
46 47 48 49 50 51 52 53 54
echo "if building a 32bit package, rename the deb file manually"
rm -fr $CODE_DIR