extra-repo-book/build.sh

26 lines
452 B
Bash
Raw Normal View History

2023-10-07 17:58:23 +08:00
#!/bin/bash
if [ -d unpack ]; then
sudo rm -rf unpack
fi
2024-11-08 15:09:46 +08:00
version="1.0.8"
2023-10-07 17:58:23 +08:00
mkdir -p unpack/DEBIAN
cp debian/control unpack/DEBIAN/
cp -r usr unpack/
cd unpack
find usr -type f | xargs md5sum > DEBIAN/md5sums
_size=$(du -d 0 usr | cut -f1)
sed -i "s/{{size}}/${_size}/" DEBIAN/control
sed -i "s/{{version}}/${version}/" DEBIAN/control
cd ..
sudo chown -R root:root unpack/
dpkg-deb -b unpack/ "extra-repo-book_${version}.deb"
sudo rm -rf unpack