From a2fddca865756e374864cf0b4b8dbc6e5a5a6c36 Mon Sep 17 00:00:00 2001 From: KF-Art Date: Mon, 8 Aug 2022 20:21:18 -0400 Subject: [PATCH] New Package: lpkg-10.1_1 --- srcpkgs/lpkg/INSTALL.msg | 13 ++++++++++ srcpkgs/lpkg/REMOVE | 21 +++++++++++++++ srcpkgs/lpkg/REMOVE.msg | 2 ++ srcpkgs/lpkg/template | 55 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 91 insertions(+) create mode 100644 srcpkgs/lpkg/INSTALL.msg create mode 100644 srcpkgs/lpkg/REMOVE create mode 100644 srcpkgs/lpkg/REMOVE.msg create mode 100644 srcpkgs/lpkg/template diff --git a/srcpkgs/lpkg/INSTALL.msg b/srcpkgs/lpkg/INSTALL.msg new file mode 100644 index 0000000..132e8b1 --- /dev/null +++ b/srcpkgs/lpkg/INSTALL.msg @@ -0,0 +1,13 @@ +==> IMPORTANT NOTE: +LPKG is a low-level package manager. This means that it will not install automatically dependencies. +Instead of that, you will have to look yourself for them. + +At Cereus Linux Team we'll provide some packages dependencies, but this may be outdated over the time. +You can find our list at: https://github.com/CereusLinuxProject/lpkg-list + +==> WARNING: +* You MUST NOT install a package twice in LPKG and XBPS, this will cause conflicts and probably BREAK YOUR SYSTEM. +* To avoid conflicts, when removing LPKG it will automatically remove all your LPKG packages. + + + diff --git a/srcpkgs/lpkg/REMOVE b/srcpkgs/lpkg/REMOVE new file mode 100644 index 0000000..68e440b --- /dev/null +++ b/srcpkgs/lpkg/REMOVE @@ -0,0 +1,21 @@ +# REMOVE +case "$ACTION" in + +pre) + +# +# Remove all installed LPKG packages to avoid conflicts +# + for pkg in $(lpkg -i | cut -d "-" -f1 | tail -n +3); + do lpkg remove ${pkg} + done + ;; +post) + +# +# After removing opt/Loc-OS-LPKG, xbps removes opt if empty! +# This script restores opt +# + mkdir -p opt + ;; +esac diff --git a/srcpkgs/lpkg/REMOVE.msg b/srcpkgs/lpkg/REMOVE.msg new file mode 100644 index 0000000..b4bf063 --- /dev/null +++ b/srcpkgs/lpkg/REMOVE.msg @@ -0,0 +1,2 @@ +==> IMPORTANT NOTE: +To avoid conflicts, before XBPS removes LPKG it will uninstall all packages installed through it. diff --git a/srcpkgs/lpkg/template b/srcpkgs/lpkg/template new file mode 100644 index 0000000..a703d7c --- /dev/null +++ b/srcpkgs/lpkg/template @@ -0,0 +1,55 @@ +# Template file for 'lpkg' +pkgname=lpkg +version=10.1 +revision=1 +archs="x86_64 i686" +build_style=fetch +hostmakedepends="bsdtar wget" +depends="pv psmisc" +repository="cereus-extra" +short_desc="Low-level package manager developed by Loc-OS team" +maintainer="KF-Art " +license="GPL-3.0" +homepage="https://gitlab.com/loc-os_linux/updates" +nostrip=yes +checksum="ede89ebac1fa7d088b7e86b784cc911d2ad8965f6b0e46cd1993c512d937caf9" +distfiles="https://github.com/CereusLinuxProject/lpkg-list/releases/download/${version}/${pkgname}.tar.gz" + +do_install() { + # Create dirs + for dir in opt/Loc-OS-LPKG usr/{bin,share/icons}; do + vmkdir ${dir} + done + + # Extract distfile + bsdtar -xf lpkg.tar.gz + + # Copy lpkg and icons to destdir + vcopy Loc-OS-LPKG /opt/ + vcopy Loc-OS-LPKG/usr/share/icons/* usr/share/icons/ + + # Link lpkg binaries to PATH + ln -sf /opt/Loc-OS-LPKG/usr/sbin/{removelpkg,lpkg,installlpkg,createlpkg} ${DESTDIR}/usr/bin/ + + # Remove unnecesary binary + rm ${DESTDIR}/opt/Loc-OS-LPKG/usr/bin/killall + + # Define repository list depending of target architecture + if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then + _repo="locosporlinux/lpkg-list" + elif [ "$XBPS_TARGET_MACHINE" = "i686" ]; then + _repo="loc-os_linux/lpkg-list32" + fi + + # Fetch repository list + wget "https://gitlab.com/${_repo}/-/raw/main/ListGitLabLocOS.LpkgRepo" + + # Install repository list + vinstall ListGitLabLocOS.LpkgRepo 0644 opt/Loc-OS-LPKG/Repos/ + + # Install desktop launcher + vinstall Loc-OS-LPKG/LocOSLpkg.desktop 0644 usr/share/applications/ lpkggui.desktop + + # Install license + vlicense Loc-OS-LPKG/LICENSE +}