-
Notifications
You must be signed in to change notification settings - Fork 33
/
mkdeb.sh
executable file
·46 lines (39 loc) · 1.37 KB
/
mkdeb.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
#!/bin/sh
# a code archive should already be available
TOP=$(pwd)
CODE_ARCHIVE="$1-$2.tar.xz"
CODE_DIR="$1-$2"
INSTALL_DIR="$TOP/debian"
DEBIAN_CTRL_DIR="$TOP/debian/DEBIAN"
DEBIAN_CTRL_DIR+="/debian/DEBIAN"
echo "*****************************************"
echo "code archive: $CODE_ARCHIVE"
echo "code directory: $CODE_DIR"
echo "install directory: $INSTALL_DIR"
echo "debian control directory: $DEBIAN_CTRL_DIR"
echo "*****************************************"
tar -xJvf "$CODE_ARCHIVE"
mkdir -p "$INSTALL_DIR"
cd "$CODE_DIR"
./configure --prefix=/usr
make -j4
DESTDIR=$INSTALL_DIR make install-strip
cd ..
echo "*****************************************"
SIZE=$(du -s debian/usr)
echo "install size $SIZE"
echo "*****************************************"
INSTALL_DIR="$TOP/debian/usr"
mv "$INSTALL_DIR/share/doc/firetools/RELNOTES" "$INSTALL_DIR/share/doc/firetools/changelog.Debian"
gzip -9 -n "$INSTALL_DIR/share/doc/firetools/changelog.Debian"
rm "$INSTALL_DIR/share/doc/firetools/COPYING"
cp platform/debian/copyright "$INSTALL_DIR/share/doc/firetools/."
mkdir -p "$DEBIAN_CTRL_DIR"
sed "s/FIRETOOLSVER/$2/g" platform/debian/control > "$DEBIAN_CTRL_DIR/control"
find ./debian -type d -exec chmod 755 {} +
dpkg-deb --build debian
lintian debian.deb
mv debian.deb "firetools_$2_1_amd64.deb"
echo "if building a 32bit package, rename the deb file manually"
rm -fr debian
rm -fr "$CODE_DIR"