# This is the source.sh script. It is executed by BPM in a temporary directory when compiling a source package # BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE # BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT # The build function is executed in the source directory # This function is used to compile the source code build() { export CFLAGS="$CFLAGS -Wno-error=unused-macros" export CPPFLAGS="$CPPFLAGS -Wno-error=unused-macros" for i in Bundles/{Alone,Alone7z,Format7zF,SFXCon} UI/Console; do make -C CPP/7zip/$i -f ../../cmpl_gcc.mak \ LFLAGS_STRIP= \ CC="cc $CPPFLAGS $CFLAGS $LDFLAGS" \ CXX="g++ $CPPFLAGS $CXXFLAGS $LDFLAGS" done } # The package function is executed in the source directory # This function is used to move the compiled files into the output directory package() { install -Dm755 CPP/7zip/Bundles/Alone{/b/g/7za,7z/b/g/7zr} \ CPP/7zip/Bundles/Format7zF/b/g/7z.so \ CPP/7zip/UI/Console/b/g/7z \ -t "$BPM_OUTPUT"/usr/lib/7zip/ install -Dm755 CPP/7zip/Bundles/SFXCon/b/g/7zCon "$BPM_OUTPUT"/usr/lib/7zip/7zCon.sfx for _prog in 7za 7zr 7z; do printf '#!/bin/sh\nexec /usr/lib/7zip/%s "$@"\n' "$_prog" | install -D /dev/stdin "$BPM_OUTPUT"/usr/bin/"$_prog" done # Install package licenses install -Dm644 "$BPM_SOURCE"/DOC/License.txt "$BPM_OUTPUT"/usr/share/licenses/7zip/License.txt install -Dm644 "$BPM_SOURCE"/DOC/unRarLicense.txt "$BPM_OUTPUT"/usr/share/licenses/7zip/unRarLicense.txt }