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