32 lines
611 B
Bash
32 lines
611 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
function clean_exit() {
|
||
|
echo "Cleaning up"
|
||
|
sed -i "s/$VERSION/VERSION/" debian/DEBIAN/control
|
||
|
sed -i "s/$INSTALLSIZE/INSTALLSIZE/" debian/DEBIAN/control
|
||
|
exit 0
|
||
|
}
|
||
|
trap "clean_exit" 2
|
||
|
|
||
|
mkdir -p out
|
||
|
|
||
|
VERSION=$(cat version)
|
||
|
REVISION=1
|
||
|
FILENAME="usb-udev-helper_$VERSION-${REVISION}_all.deb"
|
||
|
INSTALLSIZE=0
|
||
|
|
||
|
sed -i "s/VERSION/$VERSION/" debian/DEBIAN/control
|
||
|
|
||
|
INSTALLSIZE=$(du -ks debian|cut -f 1)
|
||
|
|
||
|
sed -i "s/INSTALLSIZE/$INSTALLSIZE/" debian/DEBIAN/control
|
||
|
|
||
|
chmod 755 debian/usr/bin/getudevid
|
||
|
chown root:root debian/usr/bin/getudevid
|
||
|
|
||
|
mkdir -p out
|
||
|
|
||
|
dpkg-deb -b debian "out/$FILENAME"
|
||
|
|
||
|
clean_exit
|