diff --git a/bin/build_package.sh b/bin/build_package.sh index e13152b6812838f792f168617e6c1e4a974cf550..5d4449a1bcd5128ed7dee11513e2faf53e4b2d52 100755 --- a/bin/build_package.sh +++ b/bin/build_package.sh @@ -20,6 +20,20 @@ function showHelp() { } +# The DEBIAN dir and post/pre inst/rm files should have the right +# permissions +function fixPerms() { + local pkg=$1 + + controlDir="$REPOROOT/$pkg/package/DEBIAN" + chmod 0755 $controlDir + for file in preinst prerm postinst postrm; do + if [ -f "$controlDir/$file" ]; then + chmod 0775 "$controlDir/$file" + fi + done +} + # This function is used to keep all the packages with their AUTHORS and # COPYING files up to date. function copyDoc() { @@ -97,6 +111,7 @@ function createPackage() { local ret=0 + fixPerms $pkg fakeroot dpkg -b $REPOROOT/$pkg/package/ $PACKAGESDEST/ return $?