diff options
author | Zeph | 2021-06-11 00:06:20 +0200 |
---|---|---|
committer | Zeph | 2021-06-11 00:06:20 +0200 |
commit | ff632da085f4b2e5f2e4fb291da8ca408fb27bd7 (patch) | |
tree | 9b99a78792e6750a789864c5621c55e7b04df162 | |
download | aur-ff632da085f4b2e5f2e4fb291da8ca408fb27bd7.tar.gz |
V11
-rw-r--r-- | .SRCINFO | 49 | ||||
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | PKGBUILD | 72 | ||||
-rw-r--r-- | fix-appstream-data.hook | 14 | ||||
-rw-r--r-- | fix-appstream-data.sh | 10 | ||||
-rw-r--r-- | pamac.install | 58 |
6 files changed, 208 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..08746bd76bce --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,49 @@ +pkgbase = libpamac-aur + pkgdesc = Pamac package manager library based on libalpm + pkgver = 11.0.0 + pkgrel = 1 + url = https://gitlab.manjaro.org/applications + install = pamac.install + arch = i686 + arch = x86_64 + arch = arm + arch = armv6h + arch = armv7h + arch = aarch64 + license = GPL3 + makedepends = gettext + makedepends = itstool + makedepends = vala>=0.46 + makedepends = asciidoc + makedepends = meson + makedepends = ninja + makedepends = gobject-introspection + depends = glib2>=2.42 + depends = json-glib + depends = libsoup + depends = dbus-glib + depends = polkit + depends = vte3>=0.38 + depends = libnotify + depends = pacman>=6.0 + depends = pacman<6.1 + depends = gnutls>=3.4 + depends = git + depends = appstream-glib>=0.7.18-1 + depends = archlinux-appstream-data + depends = git + provides = libpamac-aur=11.0.0-1 + conflicts = libpamac + conflicts = libpamac-all + replaces = libpamac + options = !emptydirs + options = !strip + backup = etc/pamac.conf + source = libpamac-11.0.0-1.tar.gz::https://gitlab.manjaro.org/applications/libpamac/-/archive/195bd5370c246df4dea6ea99ae1c2dce87a6a782/libpamac-195bd5370c246df4dea6ea99ae1c2dce87a6a782.tar.gz + source = fix-appstream-data.sh + source = fix-appstream-data.hook + sha256sums = 47fec10c979e010babe74767c2d6770243f76ecf045772696ce201bee7ea269b + sha256sums = e9fe7c14d15cbce1d337749cf317e4460bce485b102b5c228b7efa479998d4fa + sha256sums = c2b943318a01ba1f3dabbf32e48e6a6f4b4b774e167ab86c6bfee31aa4a3424c + +pkgname = libpamac-aur diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..81d8e834fb30 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +*.gz +*.tar +*.tar.* +/pkg/* +/src/* diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..8e45f2b90f35 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,72 @@ +# Contributor: Zeph <zeph33@gmail.com> +# Maintainer: Zeph <zeph33@gmail.com> +# https://gitlab.manjaro.org/packages/extra/pamac +ENABLE_FLATPAK=0 +ENABLE_SNAPD=0 + +pkgname=libpamac-aur +pkgver=11.0.0 +pkgrel=1 +_pkgfixver=$pkgver + +_commit='195bd5370c246df4dea6ea99ae1c2dce87a6a782' +sha256sums=('47fec10c979e010babe74767c2d6770243f76ecf045772696ce201bee7ea269b' + 'e9fe7c14d15cbce1d337749cf317e4460bce485b102b5c228b7efa479998d4fa' + 'c2b943318a01ba1f3dabbf32e48e6a6f4b4b774e167ab86c6bfee31aa4a3424c') + +pkgdesc="Pamac package manager library based on libalpm" +arch=('i686' 'x86_64' 'arm' 'armv6h' 'armv7h' 'aarch64') +url="https://gitlab.manjaro.org/applications" +license=('GPL3') +depends=('glib2>=2.42' 'json-glib' 'libsoup' 'dbus-glib' 'polkit' 'vte3>=0.38' + 'libnotify' 'pacman>=6.0' 'pacman<6.1' 'gnutls>=3.4' 'git' + 'appstream-glib>=0.7.18-1' 'archlinux-appstream-data' 'git') + +makedepends=('gettext' 'itstool' 'vala>=0.46' 'asciidoc' 'meson' 'ninja' 'gobject-introspection') +backup=('etc/pamac.conf') +conflicts=('libpamac' 'libpamac-all') +provides=("libpamac-aur=$pkgver-$pkgrel") +replaces=('libpamac') +options=(!emptydirs !strip) +install=pamac.install +source=("libpamac-$pkgver-$pkgrel.tar.gz::$url/libpamac/-/archive/$_commit/libpamac-$_commit.tar.gz" + fix-appstream-data.sh fix-appstream-data.hook) + +define_meson='' +if [ "${ENABLE_FLATPAK}" = 1 ]; then + depends+=('flatpak') + define_meson+=' -Denable-flatpak=true' +fi + +if [ "${ENABLE_SNAPD}" = 1 ]; then + depends+=('snapd' 'snapd-glib') + define_meson+=' -Denable-snap=true' +fi + +prepare() { + cd "$srcdir/libpamac-$_commit" + # adjust version string + sed -i -e "s|\"$_pkgfixver\"|\"$pkgver-$pkgrel\"|g" src/version.vala +} + +build() { + cd "$srcdir/libpamac-$_commit" + mkdir -p builddir + cd builddir + meson setup --buildtype=release \ + --prefix=/usr \ + -Denable-appindicator=true \ + --sysconfdir=/etc $define_meson + # build + ninja +} + +package() { + cd "$srcdir/libpamac-$_commit/builddir" + DESTDIR="$pkgdir" ninja install + # fix appstream issue + install -Dm644 "$srcdir/fix-appstream-data.hook" "$pkgdir/etc/pacman.d/hooks/fix-appstream-data.hook" + install -Dm755 "$srcdir/fix-appstream-data.sh" "$pkgdir/etc/pacman.d/hooks.bin/fix-appstream-data.sh" + +} +# vim:set ts=2 sw=2 et: diff --git a/fix-appstream-data.hook b/fix-appstream-data.hook new file mode 100644 index 000000000000..9bdff11a3a3e --- /dev/null +++ b/fix-appstream-data.hook @@ -0,0 +1,14 @@ +[Trigger] +Operation = Install +Operation = Upgrade +Type = Path +Target = usr/share/app-info/xmls/*.xml.gz + +# attention: hook name before: update-appstream-cache.hook + +[Action] +Description = fix appstream datas for pamac +When = PostTransaction +Depends = gzip +Exec = /etc/pacman.d/hooks.bin/fix-appstream-data.sh +NeedsTargets diff --git a/fix-appstream-data.sh b/fix-appstream-data.sh new file mode 100644 index 000000000000..e6c365c059b5 --- /dev/null +++ b/fix-appstream-data.sh @@ -0,0 +1,10 @@ +#!/bin/bash +tmp="/tmp/fix-appstream-data" +while read -r archive; do + if [[ $(zcat "${archive}" | grep -cm1 '<em>') == "1" ]]; then + zcat "${archive}" | sed 's|<em>||g;s|<\/em>||g;s|<strong>||g;s|<\/strong>||g' | gzip > "${tmp}" + cp "${tmp}" "${archive}" + rm "${tmp}" + echo " archive ${archive} fixed" + fi +done diff --git a/pamac.install b/pamac.install new file mode 100644 index 000000000000..e1a04ebc471e --- /dev/null +++ b/pamac.install @@ -0,0 +1,58 @@ +msg() { + ALL_OFF="\e[1;0m" + BOLD="\e[1;1m" + GREEN="${BOLD}\e[1;32m" + local mesg=$1; shift + printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2 +} + +restore_conf() { + PAMAC_NEW="$(date +%m%d%M%S)" + if [ -f "/etc/pamac.conf.pacsave" ]; then + msg "You had an old /etc/pamac.conf.pacsave file. We restore it for you." + msg "You can find your new pamac.conf saved as \`/etc/pamac-new-${PAMAC_NEW}.conf\`" + mv /etc/pamac.conf /etc/pamac-new-${PAMAC_NEW}.conf + mv /etc/pamac.conf.pacsave /etc/pamac.conf + fi +} + +post_install() { + # enable flatpak repo + if [ -f /usr/bin/flatpak ]; then + flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo + fi + # enable systemd timers + mkdir -p /etc/systemd/system/timers.target.wants + ln -sf /usr/lib/systemd/system/pamac-cleancache.timer /etc/systemd/system/timers.target.wants/pamac-cleancache.timer + /etc/pacman.d/hooks.bin/fix-appstream-data.sh + # restore old conf + restore_conf +} + +post_upgrade() { + # enable flatpak repo + if [ -f /usr/bin/flatpak ]; then + flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo + fi + # restore old conf + if [ "$(vercmp $2 7.3.5-3)" -lt 0 ]; then + restore_conf + fi + + if [ "$(vercmp $2 8.0.3-5)" -lt 0 ]; then + # remove wrong placed symlinks + msg "Updating timer symlinks" + [[ -e /etc/systemd/system/multi-user.target.wants/pamac-cleancache.timer ]] && rm -f /etc/systemd/system/multi-user.target.wants/pamac-cleancache.timer + # [[ -e /etc/systemd/system/multi-user.target.wants/pamac-mirrorlist.timer ]] && rm -f /etc/systemd/system/multi-user.target.wants/pamac-mirrorlist.timer + # enable systemd timers + mkdir -p /etc/systemd/system/timers.target.wants + ln -sf /usr/lib/systemd/system/pamac-cleancache.timer /etc/systemd/system/timers.target.wants/pamac-cleancache.timer + # ln -sf /usr/lib/systemd/system/pamac-mirrorlist.timer /etc/systemd/system/timers.target.wants/pamac-mirrorlist.timer + fi +} + +post_remove() { + # disable systemd timers + rm -f /etc/systemd/system/timers.target.wants/pamac-cleancache.timer + # rm -f /etc/systemd/system/timers.target.wants/pamac-mirrorlist.timer +} |