mkdeb.sh 1.68 KB
Newer Older
1
#!/bin/sh
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
# a code archive should already be available

TOP=`pwd`
6
CODE_ARCHIVE="$1-$2.tar.xz"
netblue30's avatar
netblue30 committed
7
CODE_DIR="$1-$2"
8 9
INSTALL_DIR="${INSTALL_DIR}${CODE_DIR}/debian"
DEBIAN_CTRL_DIR="${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

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

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

netblue30's avatar
netblue30 committed
34 35 36 37
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
38 39
mkdir -p $DEBIAN_CTRL_DIR
sed "s/FIREJAILVER/$2/g"  platform/debian/control > $DEBIAN_CTRL_DIR/control
netblue30's avatar
netblue30 committed
40

41 42
mkdir -p $INSTALL_DIR/usr/share/lintian/overrides/
cp platform/debian/firejail.lintian-overrides $INSTALL_DIR/usr/share/lintian/overrides/firejail
netblue30's avatar
netblue30 committed
43

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