33 lines
713 B
Bash
33 lines
713 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
if [ -d unpack ]; then
|
||
|
sudo rm -rf unpack
|
||
|
fi
|
||
|
|
||
|
version="3.0.0"
|
||
|
|
||
|
mkdir -p unpack/DEBIAN
|
||
|
|
||
|
cp debian/control unpack/DEBIAN/
|
||
|
cp -r usr unpack/
|
||
|
|
||
|
mkdir -p unpack/usr/share/icons/hicolor/128x128/apps
|
||
|
mkdir -p unpack/usr/share/icons/hicolor/256x256/apps
|
||
|
|
||
|
cp icons/128x128.png unpack/usr/share/icons/hicolor/128x128/apps/hosts-switch.png
|
||
|
cp icons/256x256.png unpack/usr/share/icons/hicolor/256x256/apps/hosts-switch.png
|
||
|
|
||
|
cd unpack
|
||
|
find usr -type f | xargs md5sum > DEBIAN/md5sums
|
||
|
|
||
|
_size=$(du -d 0 usr | cut -f1)
|
||
|
du -d 0 usr
|
||
|
echo $_size
|
||
|
|
||
|
sed -i "s/{{size}}/${_size}/" DEBIAN/control
|
||
|
sed -i "s/{{version}}/${version}/" DEBIAN/control
|
||
|
|
||
|
cd ..
|
||
|
dpkg-deb -b unpack/ "hosts-switch-${version}.deb"
|
||
|
|
||
|
sudo rm -rf unpack
|