pacman/PKGBUILD
2024-05-06 20:56:28 +08:00

89 lines
3.1 KiB
Bash

# This is an example PKGBUILD file. Use this as a start to creating your own,
# and remove these comments. For more information, see 'man PKGBUILD'.
# NOTE: Please fill out the license field for your package! If it is unknown,
# then please put 'unknown'.
# Maintainer: Future Linux Team <future_linux@163.com>
pkgname=pacman
pkgver=6.1.0
pkgrel=2
pkgdesc="A library-based package manager with dependency support"
arch=('x86_64')
url="https://www.archlinux.org/pacman/"
license=('GPL-2.0-or-later')
groups=('base' 'base-devel')
depends=('bash' 'glibc' 'libarchive' 'curl' 'gpgme'
'gettext' 'gawk' 'coreutils' 'gnupg' 'grep' 'zstd')
makedepends=('meson' 'python-asciidoc')
backup=(etc/pacman.conf
etc/makepkg.conf)
options=('strip')
source=(https://gitlab.archlinux.org/pacman/pacman/-/releases/v${pkgver}/downloads/${pkgname}-${pkgver}.tar.xz
revertme-makepkg-remove-libdepends-and-libprovides.patch
${pkgname}-fix-msg-unknown-key.patch
${pkgname}-man-gitlab.patch
${pkgname}-make-aligned-titles.patch
${pkgname}-repo-add-parseopts.patch
${pkgname}-drop-result-warn.patch
${pkgname}-fix-debugedit.patch
makepkg.conf
pacman.conf)
sha256sums=(5a60ac6e6bf995ba6140c7d038c34448df1f3daa4ae7141d2cad88eeb5f1f9d9
b3bce9d662e189e8e49013b818f255d08494a57e13fc264625f852f087d3def2
94c987046c2ff232fa0d395cddc11644840d767806711e04ef34f876a9baf217
0774d7035e34661f74b673d4b0a94be877bdc0158a555b873ec6bd4e2c936377
7bb64910265ce2590f593cdfd302076e49f67a68f8cc792a9aaac572d36fc842
2bbfe40539513ff5775aaf900644c8985ef618f5df9af856b9d571e2501365b0
160515b741aadc876a67f213029f5f62a51ff072ea4aaeb687bbe614035bf72f
1f4e4cc54332e60c9da2bdabf9a80dc11db466535f1a0be298cbf654f0723721
d1b0455e9a028c851e81451b48ddeaea4d5778e44eb52f023a70411ff28725c0
8e0d68a8926afd1de30b18ffdf6abcf9138fd1cb60da775a71f81cdb8fdca817)
prepare() {
cd ${pkgname}-${pkgver}
patch -RNp1 < ${srcdir}/revertme-makepkg-remove-libdepends-and-libprovides.patch
patch -Np1 -i ${srcdir}/${pkgname}-fix-msg-unknown-key.patch
patch -Np1 -i ${srcdir}/${pkgname}-man-gitlab.patch
patch -Np1 -i ${srcdir}/${pkgname}-make-aligned-titles.patch
patch -Np1 -i ${srcdir}/${pkgname}-repo-add-parseopts.patch
patch -Np1 -i ${srcdir}/${pkgname}-drop-result-warn.patch
patch -Np1 -i ${srcdir}/${pkgname}-fix-debugedit.patch
}
build() {
cd ${pkgname}-${pkgver}
meson setup build \
--prefix=/usr \
-Dbuildtype=release \
-Dlibdir=/usr/lib64 \
-Dpkg-ext=".pkg.tar.zst" \
-Dsrc-ext=".src.tar.zst" \
-Dcrypto=openssl \
-Ddoc=enabled \
-Dscriptlet-shell=/usr/bin/bash \
-Dldconfig=/usr/sbin/ldconfig
meson compile -C build
}
package() {
cd ${pkgname}-${pkgver}
meson install -C build --destdir ${pkgdir}
install -m644 ${srcdir}/makepkg.conf ${pkgdir}/etc
install -m644 ${srcdir}/pacman.conf ${pkgdir}/etc
local wantsdir="${pkgdir}/usr/lib/systemd/system/sockets.target.wants"
install -dm755 ${wantsdir}
local unit
for unit in dirmngr gpg-agent gpg-agent-{browser,extra,ssh} keyboxd; do
ln -s "../${unit}@.socket" ${wantsdir}/${unit}@etc-pacman.d-gnupg.socket
done
}