switch to using package scripts instead of makefiles

This commit is contained in:
hippoz 2021-07-01 18:18:02 +03:00
parent 79d6b7881b
commit 21c5eeab32

14
spkg
View file

@ -12,7 +12,10 @@ removepkg() {
pkgname=$1 pkgname=$1
prefix=$2 prefix=$2
cd /usr/src/"${pkgname}" || exit 2 cd /usr/src/"${pkgname}" || exit 2
make uninstall {
source ./PACKAGE
"pkg_uninstall" "${prefix}"
}
sed "s/${pkgname} $(${pkgname} --version)//" "${prefix}"/var/cache/spkg.cache sed "s/${pkgname} $(${pkgname} --version)//" "${prefix}"/var/cache/spkg.cache
} }
instpkg() { instpkg() {
@ -21,13 +24,14 @@ instpkg() {
mkdir -p "${tmpdir}"/spkg/work/"${1}"-work/ mkdir -p "${tmpdir}"/spkg/work/"${1}"-work/
cd "${tmpdir}"/spkg/work/"${1}"-work/ || exit 2 cd "${tmpdir}"/spkg/work/"${1}"-work/ || exit 2
mkdir -p "${prefix}"/usr/src/"${pkgname}" 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 cd "${prefix}"/usr/src/"${pkgname}" || exit 2
export PREFIX="${prefix}" export PREFIX="${prefix}"
export PKGNAME="${pkgname}" export PKGNAME="${pkgname}"
make prepare {
make source ./PACKAGE
make install "pkg_install" "${prefix}"
}
sed a\ "${pkgname} $(${pkgname} --version)" "${prefix}"/var/cache/spkg.cache > "${prefix}"/var/cache/spkg.cache sed a\ "${pkgname} $(${pkgname} --version)" "${prefix}"/var/cache/spkg.cache > "${prefix}"/var/cache/spkg.cache
} }
update() { update() {