feat(build-package.sh): create debscripts for haskell packages
Signed-off-by: Aditya Alok <dev.aditya.alok@gmail.com>
This commit is contained in:
parent
0590811415
commit
f58de40f2e
|
@ -268,14 +268,24 @@ termux_step_post_massage() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create debscripts for haskell packages. This only executes for haskell lib packages.
|
|
||||||
# shellcheck source=scripts/build/haskell-build/termux_create_haskell_debscripts.sh
|
|
||||||
source "$TERMUX_SCRIPTDIR/scripts/build/haskell-build/termux_create_haskell_debscripts.sh"
|
|
||||||
|
|
||||||
# Hook function to create {pre,post}install, {pre,post}rm-scripts and similar
|
# Hook function to create {pre,post}install, {pre,post}rm-scripts and similar
|
||||||
termux_step_create_debscripts() {
|
termux_step_create_debscripts() {
|
||||||
# This function is written here as it will allow overriding from build.sh.
|
# Create debscripts for haskell packages.
|
||||||
termux_create_haskell_debscripts
|
if ls "${TERMUX_PKG_SRCDIR}"/*.cabal &>/dev/null && [ "${TERMUX_PKG_IS_HASKELL_LIB}" = true ]; then
|
||||||
|
cat <<-EOF >./postinst
|
||||||
|
#!${TERMUX_PREFIX}/bin/sh
|
||||||
|
sh ${TERMUX_PREFIX}/share/haskell/register/${TERMUX_PKG_NAME}.sh
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat <<-EOF >./prerm
|
||||||
|
#!${TERMUX_PREFIX}/bin/sh
|
||||||
|
if [ "${TERMUX_PACKAGE_FORMAT}" = "pacman" ] || [ "\$1" = "remove" ] || [ "\$1" = "update" ]; then
|
||||||
|
sh ${TERMUX_PREFIX}/share/haskell/unregister/${TERMUX_PKG_NAME}.sh
|
||||||
|
fi
|
||||||
|
EOF
|
||||||
|
else
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Convert Debian maintainer scripts into pacman-compatible installation hooks.
|
# Convert Debian maintainer scripts into pacman-compatible installation hooks.
|
||||||
|
|
Loading…
Reference in New Issue