build.deb.sh 1.04 KB
Newer Older
Benito van der Zander's avatar
Benito van der Zander committed
1
#!/bin/bash
Benito van der Zander's avatar
Benito van der Zander committed
2
umask 0022
3 4 5 6 7
builddir=/tmp/xideldebbuild
rm -rf $builddir/
mkdir -p $builddir/DEBIAN $builddir/usr/bin $builddir/usr/share/doc/xidel $builddir/usr/share/man/man1/
./install.sh $builddir
cp -r meta/debian/control meta/debian/conffiles $builddir/DEBIAN/
8 9
gzip -9 -n -c meta/debian/changelog > $builddir/usr/share/doc/xidel/changelog.gz
gzip -9 -n -c meta/xidel.1 > $builddir/usr/share/man/man1/xidel.1.gz
10 11
cp meta/debian/copyright $builddir/usr/share/doc/xidel/copyright

Benito van der Zander's avatar
Benito van der Zander committed
12 13 14 15 16
mkdir -p $builddir/usr/share/lintian/overrides/
cat <<<'usr/bin/xidel: program-not-linked-against-libc
usr/bin/xidel: hardening-no-relro
' > $builddir/usr/share/lintian/overrides/xidel

Benito van der Zander's avatar
Benito van der Zander committed
17
version=$(./xidel --version | head -1 | grep -oE "[0-9.]+")
18
sed -Ee "s/Version:.*/Version: $version/" -i $builddir/DEBIAN/control
Benito van der Zander's avatar
Benito van der Zander committed
19 20 21
if file xidel | grep x86-64; then arch=amd64; 
else if file xidel | grep ARM; then arch=arm; else arch=i386; 
fi; fi
22 23 24 25 26 27
sed -Ee "s/Architecture:.*/Architecture: $arch/" -i $builddir/DEBIAN/control

pkg=xidel_$version-1_$arch.deb
fakeroot dpkg-deb -b $builddir/ $pkg

echo $pkg