mkdeb.sh 1.64 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 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 40
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
41

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