packages: Move remove(), pre_install(), post_install() to debfetcher

This commit is contained in:
Albert S. 2023-04-09 15:59:54 +02:00
джерело 6240cb0a34
коміт ff810caf10
4 змінених файлів з 24 додано та 73 видалено

@ -88,6 +88,30 @@ verify_sig()
# default presets for templates
remove()
{
rm -rf -- "${DEBFETCHER_INSTALL_DESTDIR}/${THIS_BASEDIR}"
}
pre_install()
{
CURRENT_DIR="${DEBFETCHER_INSTALL_DESTDIR}${THIS_BASEDIR}"
if [ -d "${CURRENT_DIR}" ] ; then
mv -- "${DEBFETCHER_INSTALL_DESTDIR}${THIS_BASEDIR}" "${DEBFETCHER_INSTALL_DESTDIR}${THIS_BASEDIR}_${TS}"
fi
}
post_install()
{
if [ ${KEEP_OLD} -eq 0 ] ; then
rm -rf -- "${DEBFETCHER_INSTALL_DESTDIR}${THIS_BASEDIR}_${TS}"
fi
}
debfetcher_install()
{
TEMPLATE_NAME=$(basename "$1")

@ -7,22 +7,6 @@ PACKAGE="brave-browser"
TS=$(date +%s)
THIS_BASEDIR="/opt/brave.com"
remove()
{
rm -rf -- "${DEBFETCHER_INSTALL_DESTDIR}/${THIS_BASEDIR}"
}
pre_install()
{
CURRENT_DIR="${DEBFETCHER_INSTALL_DESTDIR}${THIS_BASEDIR}"
if [ -d "${CURRENT_DIR}" ] ; then
mv -- "${DEBFETCHER_INSTALL_DESTDIR}${THIS_BASEDIR}" "${DEBFETCHER_INSTALL_DESTDIR}${THIS_BASEDIR}_${TS}"
fi
}
install()
{
cp -a --parents -- opt/brave.com "${DEBFETCHER_INSTALL_DESTDIR}"
@ -31,14 +15,3 @@ install()
}
post_install()
{
if [ ${KEEP_OLD} -eq 0 ] ; then
rm -rf -- "${DEBFETCHER_INSTALL_DESTDIR}/opt/brave.com_${TS}"
fi
sourcepath=$(realpath "${DEBFETCHER_INSTALL_DESTDIR}${THIS_BASEDIR}/brave/brave-browser")
ln -sf "${sourcepath}" "${DEBFETCHER_BIN_SYMLINK_DIR}/"
sed -e "s;Exec=/;Exec=${DEBFETCHER_BIN_SYMLINK_DIR};" -i "${DEBFETCHER_INSTALL_DESTDIR}"/usr/share/applications/brave-browser.desktop
}

@ -7,21 +7,6 @@ PACKAGE="signal-desktop"
TS=$(date +%s)
THIS_BASEDIR="/opt/Signal"
remove()
{
rm -rf -- "${DEBFETCHER_INSTALL_DESTDIR}/${THIS_BASEDIR}"
}
pre_install()
{
CURRENT_DIR="${DEBFETCHER_INSTALL_DESTDIR}${THIS_BASEDIR}"
if [ -d "${CURRENT_DIR}" ] ; then
mv -- "${DEBFETCHER_INSTALL_DESTDIR}${THIS_BASEDIR}" "${DEBFETCHER_INSTALL_DESTDIR}${THIS_BASEDIR}_${TS}"
fi
}
install()
{
#Inspired by Gentoo's ebuild
@ -34,11 +19,3 @@ install()
ln -sf ${DEBFETCHER_INSTALL_DESTDIR}/opt/Signal/signal-desktop "${DEBFETCHER_BIN_SYMLINK_DIR}"
}
post_install()
{
if [ ${KEEP_OLD} -eq 0 ] ; then
rm -rf -- "${DEBFETCHER_INSTALL_DESTDIR}${THIS_BASEDIR}_${TS}"
fi
}

@ -7,21 +7,6 @@ PACKAGE="spotify-client"
TS=$(date +%s)
THIS_BASEDIR="/opt/spotify"
remove()
{
rm -rf -- "${DEBFETCHER_INSTALL_DESTDIR}/${THIS_BASEDIR}"
}
pre_install()
{
CURRENT_DIR="${DEBFETCHER_INSTALL_DESTDIR}${THIS_BASEDIR}"
if [ -d "${CURRENT_DIR}" ] ; then
mv -- "${DEBFETCHER_INSTALL_DESTDIR}${THIS_BASEDIR}" "${DEBFETCHER_INSTALL_DESTDIR}${THIS_BASEDIR}_${TS}"
fi
}
install()
{
mkdir -p ${DEBFETCHER_INSTALL_DESTDIR}/${THIS_BASEDIR}
@ -30,11 +15,3 @@ install()
ln -sf ${DEBFETCHER_INSTALL_DESTDIR}/opt/spotify/spotify "${DEBFETCHER_BIN_SYMLINK_DIR}"
}
post_install()
{
if [ ${KEEP_OLD} -eq 0 ] ; then
rm -rf -- "${DEBFETCHER_INSTALL_DESTDIR}${THIS_BASEDIR}_${TS}"
fi
}