From 21c5eeab326fd9f6a08b8a960ef9dd58e6d3e2e5 Mon Sep 17 00:00:00 2001 From: hippoz Date: Thu, 1 Jul 2021 18:18:02 +0300 Subject: [PATCH] switch to using package scripts instead of makefiles --- spkg | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/spkg b/spkg index 05c58f8..75f711f 100755 --- a/spkg +++ b/spkg @@ -12,7 +12,10 @@ removepkg() { pkgname=$1 prefix=$2 cd /usr/src/"${pkgname}" || exit 2 - make uninstall + { + source ./PACKAGE + "pkg_uninstall" "${prefix}" + } sed "s/${pkgname} $(${pkgname} --version)//" "${prefix}"/var/cache/spkg.cache } instpkg() { @@ -21,13 +24,14 @@ instpkg() { mkdir -p "${tmpdir}"/spkg/work/"${1}"-work/ cd "${tmpdir}"/spkg/work/"${1}"-work/ || exit 2 mkdir -p "${prefix}"/usr/src/"${pkgname}" - wget "${prefix}"/usr/src/"${pkgname}" "${source}"/"${pkgname}"/Makefile + wget "${prefix}"/usr/src/"${pkgname}" "${source}"/"${pkgname}"/PACKAGE cd "${prefix}"/usr/src/"${pkgname}" || exit 2 export PREFIX="${prefix}" export PKGNAME="${pkgname}" - make prepare - make - make install + { + source ./PACKAGE + "pkg_install" "${prefix}" + } sed a\ "${pkgname} $(${pkgname} --version)" "${prefix}"/var/cache/spkg.cache > "${prefix}"/var/cache/spkg.cache } update() {