[WIP] refactor generate_deb

This commit is contained in:
leafee98 2023-03-24 15:51:39 +08:00
parent bc221500b8
commit fd8b089522

16
makedeb
View file

@ -2,8 +2,8 @@
WORKSPACE=$(pwd -P) WORKSPACE=$(pwd -P)
export srcdir="${WORKSPACE}/src/" export srcdir="${WORKSPACE}/src"
export pkgdir="${WORKSPACE}/pkg/" export pkgdir="${WORKSPACE}/pkg"
FAKE_PACKAGE=0 FAKE_PACKAGE=0
OVERRIDE_SOURCE=0 OVERRIDE_SOURCE=0
@ -59,12 +59,14 @@ EOF
function generate_deb { function generate_deb {
( (
cd "${pkgdir}" find "${pkgdir}" -mindepth 1 -not -type d -not -path "${pkgdir}/DEBIAN*" -printf "%P\n" |
tar czf ../data.tar.gz [a-z]* tar -czf data.tar.gz -C "${pkgdir}" -T -
cd DEBIAN
tar czf ../../control.tar.gz * find "${pkgdir}/DEBIAN" -mindepth 1 -not -type d -printf "%P\n" |
cd ../.. tar -czf control.tar.gz -C "${pkgdir}/DEBIAN" -T -
echo 2.0 > debian-binary echo 2.0 > debian-binary
ar r "${pkgname}${pkgver:+-}${pkgver}.deb" debian-binary control.tar.gz data.tar.gz ar r "${pkgname}${pkgver:+-}${pkgver}.deb" debian-binary control.tar.gz data.tar.gz
rm debian-binary control.tar.gz data.tar.gz rm debian-binary control.tar.gz data.tar.gz
) )