git: 9e436cd0e537 - main - sysutils/pacman: update to 6.0.2

From: Charlie Li <vishwin_at_FreeBSD.org>
Date: Sat, 10 Jun 2023 07:12:27 UTC
The branch main has been updated by vishwin:

URL: https://cgit.FreeBSD.org/ports/commit/?id=9e436cd0e5370197f40938bb9b19c2a39e441087

commit 9e436cd0e5370197f40938bb9b19c2a39e441087
Author:     Charlie Li <vishwin@FreeBSD.org>
AuthorDate: 2023-06-10 07:00:34 +0000
Commit:     Charlie Li <vishwin@FreeBSD.org>
CommitDate: 2023-06-10 07:00:34 +0000

    sysutils/pacman: update to 6.0.2
    
    New to this version is the archlinux FLAVOR to manage an Arch Linux
    userland for the Linuxulator. It installs into/manages /compat/archlinux
    to not conflict with the linux-c7 ports, similar to sysutils/debootstrap.
    
    Reviewed by: fluffy, trasz
    Event: BSDCan 2022
    Event: SouthEast LinuxFest 2022
    Event: SouthEast LinuxFest 2023
    Differential Revision: https://reviews.freebsd.org/D33652
---
 sysutils/pacman/Makefile                           | 81 ++++++++++++----------
 sysutils/pacman/distinfo                           |  6 +-
 sysutils/pacman/files/patch-doc_meson.build        | 11 +++
 sysutils/pacman/files/patch-etc_makepkg.conf.in    | 28 ++++++++
 sysutils/pacman/files/patch-etc_pacman.conf.in     | 13 ++++
 .../pacman/files/patch-lib_libalpm_diskspace.c     | 11 +++
 sysutils/pacman/files/patch-lib_libalpm_util.c     | 19 -----
 sysutils/pacman/files/patch-meson.build            | 27 ++++++++
 sysutils/pacman/files/patch-scripts_meson.build    | 11 +++
 sysutils/pacman/files/patch-src_pacman_conf.c      | 10 +++
 sysutils/pacman/files/pkg-deinstall.in             |  8 +--
 sysutils/pacman/files/pkg-message.in               | 20 ++++--
 sysutils/pacman/pkg-plist                          | 77 +++++++++++++-------
 13 files changed, 231 insertions(+), 91 deletions(-)

diff --git a/sysutils/pacman/Makefile b/sysutils/pacman/Makefile
index 98b8fd5fdb19..d32c243fcb64 100644
--- a/sysutils/pacman/Makefile
+++ b/sysutils/pacman/Makefile
@@ -1,66 +1,77 @@
 PORTNAME=	pacman
-PORTVERSION=	5.1.3
-PORTREVISION=	1
+DISTVERSION=	6.0.2
 CATEGORIES=	sysutils
 MASTER_SITES=	https://sources.archlinux.org/other/${PORTNAME}/
 
-MAINTAINER=	ports@FreeBSD.org
-COMMENT=	Package manager from ArchLinux
-WWW=		https://www.archlinux.org/pacman/
+MAINTAINER=	vishwin@vishwin.info
+COMMENT=	Package manager from Arch Linux
 
 LICENSE=	GPLv2+
 LICENSE_FILE=	${WRKSRC}/COPYING
 
-BROKEN_FreeBSD_14=	gpgme >= 1.3.0 is needed for GPG signature support
-
-BUILD_DEPENDS=	asciidoc:textproc/asciidoc \
-		bash:shells/bash
+BUILD_DEPENDS=	bash:shells/bash
 RUN_DEPENDS=	bash:shells/bash
-LIB_DEPENDS=	libarchive.so:archivers/libarchive
 
-USES=		cpe gmake libtool localbase:ldflags pathfix perl5 pkgconfig shebangfix ssl
+FLAVORS=	default archlinux
+FLAVORS_SUB=	yes
+
+default_CONFLICTS_INSTALL=	archlinux-pacman
+
+archlinux_PKGNAMEPREFIX=	archlinux-
+archlinux_CONFLICTS_INSTALL=	pacman
+
+USES=		cpe libarchive localbase meson perl5 pkgconfig python:build shebangfix ssl \
+		tar:xz
 CPE_VENDOR=	${PORTNAME}_project
 SHEBANG_FILES=	${WRKSRC}/scripts/makepkg-template.pl.in \
 		${WRKSRC}/scripts/libmakepkg/lint_config.sh.in
-GNU_CONFIGURE=	yes
-CONFIGURE_ARGS=	--with-root-dir="${PACMAN_ROOT}" \
-		--localstatedir=/var
-CONFIGURE_ENV=	LIBSSL_CFLAGS="-I${OPENSSLINC}" \
-		LIBSSL_LIBS="-L${OPENSSLLIB} -lcrypto"
+BINARY_ALIAS=	python3=${PYTHON_CMD}
+MESON_ARGS=	-Droot-dir=${PACMAN_ROOT} \
+		-Dlocalstatedir=${PACMAN_ROOT}/var \
+		-Dsysconfdir=${PREFIX}/etc \
+		-Dcrypto=openssl
 USE_LDCONFIG=	yes
-BINARY_WRAPPERS=	gm4
 
 SUB_FILES=	pkg-message pkg-deinstall
 SUB_LIST=	PACMAN_ROOT="${PACMAN_ROOT}" PREFIX="${PREFIX}"
 PLIST_SUB=	PACMAN_ROOT="${PACMAN_ROOT:C/^${PREFIX}//}"
 
-PACMAN_ROOT?=	${PREFIX}/pacman
-
 PORTEXAMPLES=	*
+PKGMESSAGE=	${PKGDIR}/pkg-message-${FLAVOR:U}
 
-OPTIONS_DEFINE=	CURL GPGME EXAMPLES NLS
-OPTIONS_DEFAULT=CURL GPGME
+OPTIONS_DEFINE=	CURL DOCS GPGME EXAMPLES NLS
+OPTIONS_DEFAULT=CURL DOCS GPGME
+OPTIONS_EXCLUDE=NLS # XXX: meson cannot find ngettext(3) despite gettext-runtime
 OPTIONS_SUB=	yes
 
 CURL_DESC=	Use libcurl fetcher instead of external curl/wget
-CURL_CONFIGURE_WITH=	libcurl=${LOCALBASE}
+CURL_MESON_ENABLED=	curl
 CURL_LIB_DEPENDS=	libcurl.so:ftp/curl
+
+DOCS_MESON_ENABLED=	doc
+DOCS_BUILD_DEPENDS=	a2x:textproc/asciidoc
+
 GPGME_DESC=	Use GPGME for PGP signature verification
-GPGME_CONFIGURE_WITH=	gpgme
+GPGME_MESON_ENABLED=	gpgme
 GPGME_LIB_DEPENDS=	libgpgme.so:security/gpgme
-NLS_USES=		gettext
-NLS_CONFIGURE_ENABLE=	nls
+
+NLS_USES=		gettext-runtime gettext-tools
+NLS_MESON_TRUE=	i18n
+
+.if ${FLAVOR:U} == default
+PACMAN_ROOT=	${PREFIX}/pacman
+.elif ${FLAVOR:U} == archlinux
+ONLY_FOR_ARCHS=	amd64
+ONLY_FOR_ARCHS_REASON=	Arch Linux itself only supports amd64
+PACMAN_ROOT=	/compat/archlinux
+PLIST_DIRS+=	%%PACMAN_ROOT%%/var/cache \
+		%%PACMAN_ROOT%%/var \
+		/compat
+.endif
 
 .include <bsd.port.options.mk>
 
 post-patch:
-	@${REINPLACE_CMD} -e 's|m4|gm4|' ${WRKSRC}/scripts/Makefile.in
-	@${REINPLACE_CMD} -e '2 s/.*/exit 0/' ${WRKSRC}/build-aux/missing
-	@${REINPLACE_CMD} -e '/INSTALL_DATA.*sysconfdir/ d' ${WRKSRC}/etc/Makefile.in
-.for tool in curl wget rsync lftpget
-	@${REINPLACE_CMD} -e 's|/usr/bin/${tool}|${LOCALBASE}/bin/${tool}|' \
-		${WRKSRC}/etc/pacman.conf.in ${WRKSRC}/etc/makepkg.conf.in
-.endfor
 .if ${ARCH} == "i386"
 	@${REINPLACE_CMD} -e '/^Architecture/ s|auto|i686|' ${WRKSRC}/etc/pacman.conf.in
 .endif
@@ -69,11 +80,7 @@ post-patch:
 .endif
 
 post-install:
-.for f in makepkg.conf pacman.conf
-	${INSTALL_DATA} ${WRKSRC}/etc/${f} ${STAGEDIR}${PREFIX}/etc/${f}.sample
-.endfor
-	@${MKDIR} ${STAGEDIR}${PACMAN_ROOT}
-	${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libalpm.so
+	@${MKDIR} ${STAGEDIR}${PREFIX}/etc/pacman.d
 
 post-install-EXAMPLES-on:
 	@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
diff --git a/sysutils/pacman/distinfo b/sysutils/pacman/distinfo
index 4dd42534ac1c..5f2836076271 100644
--- a/sysutils/pacman/distinfo
+++ b/sysutils/pacman/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1552322023
-SHA256 (pacman-5.1.3.tar.gz) = 10db61a0928d619871340c3f93a677d1541d6c52353c516aec4f8d96e830d4eb
-SIZE (pacman-5.1.3.tar.gz) = 3358848
+TIMESTAMP = 1686368450
+SHA256 (pacman-6.0.2.tar.xz) = 7d8e3e8c5121aec0965df71f59bedf46052c6cf14f96365c4411ec3de0a4c1a5
+SIZE (pacman-6.0.2.tar.xz) = 880868
diff --git a/sysutils/pacman/files/patch-doc_meson.build b/sysutils/pacman/files/patch-doc_meson.build
new file mode 100644
index 000000000000..1d8a040e6e59
--- /dev/null
+++ b/sysutils/pacman/files/patch-doc_meson.build
@@ -0,0 +1,11 @@
+--- doc/meson.build.orig	2021-05-20 03:38:45 UTC
++++ doc/meson.build
+@@ -101,7 +101,7 @@ foreach page: manpages + sitepages
+ endforeach
+ 
+ run_target('html',
+-           command : ['/bin/true'],
++           command : ['/usr/bin/true'],
+            depends : html_targets)
+ 
+ custom_target(
diff --git a/sysutils/pacman/files/patch-etc_makepkg.conf.in b/sysutils/pacman/files/patch-etc_makepkg.conf.in
new file mode 100644
index 000000000000..8ead8b12ac53
--- /dev/null
+++ b/sysutils/pacman/files/patch-etc_makepkg.conf.in
@@ -0,0 +1,28 @@
+--- etc/makepkg.conf.in.orig	2020-12-03 11:37:30 UTC
++++ etc/makepkg.conf.in
+@@ -9,17 +9,17 @@
+ #
+ #-- The download utilities that makepkg should use to acquire sources
+ #  Format: 'protocol::agent'
+-DLAGENTS=('file::/usr/bin/curl -gqC - -o %o %u'
+-          'ftp::/usr/bin/curl -gqfC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
+-          'http::/usr/bin/curl -gqb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
+-          'https::/usr/bin/curl -gqb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
+-          'rsync::/usr/bin/rsync --no-motd -z %u %o'
++DLAGENTS=('file::@prefix@/bin/curl -gqC - -o %o %u'
++          'ftp::@prefix@/bin/curl -gqfC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
++          'http::@prefix@/bin/curl -gqb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
++          'https::@prefix@/bin/curl -gqb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
++          'rsync::@prefix@/bin/rsync --no-motd -z %u %o'
+           'scp::/usr/bin/scp -C %u %o')
+ 
+ # Other common tools:
+-# /usr/bin/snarf
+-# /usr/bin/lftpget -c
+-# /usr/bin/wget
++# @prefix@/bin/snarf
++# @prefix@/bin/lftpget -c
++# @prefix@/bin/wget
+ 
+ #-- The package required by makepkg to download VCS sources
+ #  Format: 'protocol::package'
diff --git a/sysutils/pacman/files/patch-etc_pacman.conf.in b/sysutils/pacman/files/patch-etc_pacman.conf.in
new file mode 100644
index 000000000000..7cca8e444cb3
--- /dev/null
+++ b/sysutils/pacman/files/patch-etc_pacman.conf.in
@@ -0,0 +1,13 @@
+--- etc/pacman.conf.in.orig	2020-12-03 11:37:30 UTC
++++ etc/pacman.conf.in
+@@ -16,8 +16,8 @@
+ #GPGDir      = @sysconfdir@/pacman.d/gnupg/
+ #HookDir     = @sysconfdir@/pacman.d/hooks/
+ HoldPkg     = pacman glibc
+-#XferCommand = /usr/bin/curl -L -C - -f -o %o %u
+-#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
++#XferCommand = @prefix@/bin/curl -L -C - -f -o %o %u
++#XferCommand = @prefix@/bin/wget --passive-ftp -c -O %o %u
+ #CleanMethod = KeepInstalled
+ Architecture = auto
+ 
diff --git a/sysutils/pacman/files/patch-lib_libalpm_diskspace.c b/sysutils/pacman/files/patch-lib_libalpm_diskspace.c
new file mode 100644
index 000000000000..a1dceb9cc61e
--- /dev/null
+++ b/sysutils/pacman/files/patch-lib_libalpm_diskspace.c
@@ -0,0 +1,11 @@
+--- lib/libalpm/diskspace.c.orig	2020-12-03 11:37:30 UTC
++++ lib/libalpm/diskspace.c
+@@ -71,7 +71,7 @@ static void mount_point_list_free(alpm_list_t *mount_p
+ 
+ static int mount_point_load_fsinfo(alpm_handle_t *handle, alpm_mountpoint_t *mountpoint)
+ {
+-#if defined(HAVE_GETMNTENT)
++#if HAVE_GETMNTENT
+ 	/* grab the filesystem usage */
+ 	if(statvfs(mountpoint->mount_dir, &(mountpoint->fsp)) != 0) {
+ 		_alpm_log(handle, ALPM_LOG_WARNING,
diff --git a/sysutils/pacman/files/patch-lib_libalpm_util.c b/sysutils/pacman/files/patch-lib_libalpm_util.c
deleted file mode 100644
index 615da764b81b..000000000000
--- a/sysutils/pacman/files/patch-lib_libalpm_util.c
+++ /dev/null
@@ -1,19 +0,0 @@
---- lib/libalpm/util.c.orig	2018-11-19 01:25:18 UTC
-+++ lib/libalpm/util.c
-@@ -33,6 +33,7 @@
- #include <sys/socket.h>
- #include <fnmatch.h>
- #include <poll.h>
-+#include <signal.h>
- 
- /* libarchive */
- #include <archive.h>
-@@ -556,7 +557,7 @@ static void _alpm_reset_signals(void)
- 	int *i, signals[] = {
- 		SIGABRT, SIGALRM, SIGBUS, SIGCHLD, SIGCONT, SIGFPE, SIGHUP, SIGILL,
- 		SIGINT, SIGKILL, SIGPIPE, SIGQUIT, SIGSEGV, SIGSTOP, SIGTERM, SIGTSTP,
--		SIGTTIN, SIGTTOU, SIGUSR1, SIGUSR2, SIGPOLL, SIGPROF, SIGSYS, SIGTRAP,
-+		SIGTTIN, SIGTTOU, SIGUSR1, SIGUSR2, SIGIO, SIGPROF, SIGSYS, SIGTRAP,
- 		SIGURG, SIGVTALRM, SIGXCPU, SIGXFSZ,
- 		0
- 	};
diff --git a/sysutils/pacman/files/patch-meson.build b/sysutils/pacman/files/patch-meson.build
new file mode 100644
index 000000000000..a68f82b00345
--- /dev/null
+++ b/sysutils/pacman/files/patch-meson.build
@@ -0,0 +1,27 @@
+--- meson.build.orig	2020-12-03 11:37:30 UTC
++++ meson.build
+@@ -175,7 +175,7 @@ foreach type : [
+   endif
+ endforeach
+ 
+-if conf.has('HAVE_STRUCT_STATVFS_F_FLAG')
++if conf.has('HAVE_STRUCT_STATVFS_F_FLAG') and not host_machine.system().contains('freebsd')
+   conf.set('FSSTATSTYPE', 'struct statvfs')
+ elif conf.has('HAVE_STRUCT_STATFS_F_FLAGS')
+   conf.set('FSSTATSTYPE', 'struct statfs')
+@@ -386,13 +386,13 @@ endforeach
+ 
+ configure_file(
+   input : 'etc/makepkg.conf.in',
+-  output : 'makepkg.conf',
++  output : 'makepkg.conf.sample',
+   configuration : substs,
+   install_dir : SYSCONFDIR)
+ 
+ configure_file(
+   input : 'etc/pacman.conf.in',
+-  output : 'pacman.conf',
++  output : 'pacman.conf.sample',
+   configuration : substs,
+   install_dir : SYSCONFDIR)
+ 
diff --git a/sysutils/pacman/files/patch-scripts_meson.build b/sysutils/pacman/files/patch-scripts_meson.build
new file mode 100644
index 000000000000..7ceb0f8ccb6c
--- /dev/null
+++ b/sysutils/pacman/files/patch-scripts_meson.build
@@ -0,0 +1,11 @@
+--- scripts/meson.build.orig	2020-12-03 11:37:30 UTC
++++ scripts/meson.build
+@@ -66,7 +66,7 @@ configure_file(
+ 	configuration : { 'libmakepkgdir': LIBMAKEPKGDIR, 'PACKAGE_VERSION': PACKAGE_VERSION },
+ 	input : 'libmakepkg.pc.in',
+ 	output : '@BASENAME@',
+-	install_dir : join_paths(DATAROOTDIR, 'pkgconfig'))
++	install_dir : join_paths(get_option('prefix'), 'libdata', 'pkgconfig'))
+ 
+ custom_target(
+   'bash_completion',
diff --git a/sysutils/pacman/files/patch-src_pacman_conf.c b/sysutils/pacman/files/patch-src_pacman_conf.c
new file mode 100644
index 000000000000..89d05db6de12
--- /dev/null
+++ b/sysutils/pacman/files/patch-src_pacman_conf.c
@@ -0,0 +1,10 @@
+--- src/pacman/conf.c.orig	2020-12-03 11:37:30 UTC
++++ src/pacman/conf.c
+@@ -23,6 +23,7 @@
+ #include <locale.h> /* setlocale */
+ #include <fcntl.h> /* open */
+ #include <glob.h>
++#include <signal.h>
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <string.h> /* strdup */
diff --git a/sysutils/pacman/files/pkg-deinstall.in b/sysutils/pacman/files/pkg-deinstall.in
index 4f05ea6b40cf..0c6269364ac1 100644
--- a/sysutils/pacman/files/pkg-deinstall.in
+++ b/sysutils/pacman/files/pkg-deinstall.in
@@ -2,14 +2,14 @@
 
 case $2 in
 POST-DEINSTALL)
-	if find /var/lib/pacman /var/cache/pacman %%PACMAN_ROOT%% -type f 2>/dev/null | head -1 | grep -q ''; then
+	if find %%PACMAN_ROOT%% -type f 2>/dev/null | head -1 | grep -q ''; then
 		echo ""
 		echo "To completely remove the port, please remove the following"
-		echo "directories and the content manualy if its no longer needed:"
+		echo "directories and the content manually if it's no longer needed:"
 		echo ""
 		echo "    %%PACMAN_ROOT%%"
-		echo "    /var/cache/pacman"
-		echo "    /var/lib/pacman"
+		echo "    %%PACMAN_ROOT%%/var/cache/pacman"
+		echo "    %%PACMAN_ROOT%%/var/lib/pacman"
 		echo ""
 	fi
 	;;
diff --git a/sysutils/pacman/files/pkg-message.in b/sysutils/pacman/files/pkg-message.in
index 73494fa72d84..0dc8b136c2c2 100644
--- a/sysutils/pacman/files/pkg-message.in
+++ b/sysutils/pacman/files/pkg-message.in
@@ -1,13 +1,25 @@
 [
 { type: install
   message: <<EOM
-Default pacman root directory (the one it will install packages into) is
+%%DEFAULT%%Default pacman root directory (the one it will install packages into) is
+%%ARCHLINUX%%Default Arch Linux userland directory (the one it will install
+%%ARCHLINUX%%packages to) for Linuxulator usage is
 
   %%PACMAN_ROOT%%
 
-To change it (and to define package repositories to use), see
-
-  %%PREFIX%%/etc/pacman.conf
+%%DEFAULT%%To change it (and to define package repositories to use), see
+%%DEFAULT%%
+%%DEFAULT%%  %%PREFIX%%/etc/pacman.conf
+%%ARCHLINUX%%To use the Arch Linux repositories, generate one from
+%%ARCHLINUX%%https://archlinux.org/mirrorlist/ and place the result in
+%%ARCHLINUX%%
+%%ARCHLINUX%%  %%PREFIX%%/etc/pacman.d/mirrorlist
+%%ARCHLINUX%%
+%%ARCHLINUX%%Then make sure to install security/archlinux-keyring so that Arch
+%%ARCHLINUX%%Linux official repository packages verify PGP signatures properly.
+%%ARCHLINUX%%
+%%ARCHLINUX%%You may want to sync pacman configuration from here to the Arch
+%%ARCHLINUX%%Linux copy in the Linuxulator should you invoke pacman there.
 EOM
 }
 ]
diff --git a/sysutils/pacman/pkg-plist b/sysutils/pacman/pkg-plist
index 178865ee6522..5d3f56a7f1e2 100644
--- a/sysutils/pacman/pkg-plist
+++ b/sysutils/pacman/pkg-plist
@@ -1,40 +1,41 @@
-bin/cleanupdelta
 bin/makepkg
 bin/makepkg-template
 bin/pacman
 bin/pacman-conf
 bin/pacman-db-upgrade
 bin/pacman-key
-bin/pkgdelta
 bin/repo-add
 bin/repo-elephant
 bin/repo-remove
 bin/testpkg
 bin/vercmp
-etc/bash_completion.d/pacman
 @sample etc/makepkg.conf.sample
 @sample etc/pacman.conf.sample
+@dir %%ETCDIR%%.d
 include/alpm.h
 include/alpm_list.h
-lib/libalpm.a
 lib/libalpm.so
-lib/libalpm.so.11
-lib/libalpm.so.11.0.3
+lib/libalpm.so.13
+lib/libalpm.so.13.0.2
 libdata/pkgconfig/libalpm.pc
-man/man1/makepkg-template.1.gz
-man/man3/libalpm.3.gz
-man/man5/BUILDINFO.5.gz
-man/man5/PKGBUILD.5.gz
-man/man5/alpm-hooks.5.gz
-man/man5/makepkg.conf.5.gz
-man/man5/pacman.conf.5.gz
-man/man8/makepkg.8.gz
-man/man8/pacman-key.8.gz
-man/man8/pacman.8.gz
-man/man8/pkgdelta.8.gz
-man/man8/repo-add.8.gz
-man/man8/repo-remove.8.gz
-man/man8/vercmp.8.gz
+libdata/pkgconfig/libmakepkg.pc
+%%PORTDOCS%%man/man1/makepkg-template.1.gz
+%%PORTDOCS%%man/man5/BUILDINFO.5.gz
+%%PORTDOCS%%man/man5/PKGBUILD.5.gz
+%%PORTDOCS%%man/man5/alpm-hooks.5.gz
+%%PORTDOCS%%man/man5/makepkg.conf.5.gz
+%%PORTDOCS%%man/man5/pacman-hooks.5.gz
+%%PORTDOCS%%man/man5/pacman.conf.5.gz
+%%PORTDOCS%%man/man8/makepkg.8.gz
+%%PORTDOCS%%man/man8/pacman-conf.8.gz
+%%PORTDOCS%%man/man8/pacman-key.8.gz
+%%PORTDOCS%%man/man8/pacman.8.gz
+%%PORTDOCS%%man/man8/repo-add.8.gz
+%%PORTDOCS%%man/man8/repo-remove.8.gz
+%%PORTDOCS%%man/man8/vercmp.8.gz
+share/bash-completion/completions/makepkg
+share/bash-completion/completions/pacman
+share/bash-completion/completions/pacman-key
 %%NLS%%share/locale/ar/LC_MESSAGES/libalpm.mo
 %%NLS%%share/locale/ar/LC_MESSAGES/pacman.mo
 %%NLS%%share/locale/ast/LC_MESSAGES/libalpm.mo
@@ -156,13 +157,32 @@ man/man8/vercmp.8.gz
 %%NLS%%share/locale/zh_TW/LC_MESSAGES/libalpm.mo
 %%NLS%%share/locale/zh_TW/LC_MESSAGES/pacman-scripts.mo
 %%NLS%%share/locale/zh_TW/LC_MESSAGES/pacman.mo
+share/makepkg/buildenv.sh
+share/makepkg/buildenv/buildflags.sh
+share/makepkg/buildenv/compiler.sh
+share/makepkg/buildenv/debugflags.sh
+share/makepkg/buildenv/lto.sh
+share/makepkg/buildenv/makeflags.sh
+share/makepkg/executable.sh
+share/makepkg/executable/ccache.sh
+share/makepkg/executable/checksum.sh
+share/makepkg/executable/distcc.sh
+share/makepkg/executable/fakeroot.sh
+share/makepkg/executable/gpg.sh
+share/makepkg/executable/gzip.sh
+share/makepkg/executable/pacman.sh
+share/makepkg/executable/strip.sh
+share/makepkg/executable/sudo.sh
+share/makepkg/executable/vcs.sh
 share/makepkg/integrity.sh
 share/makepkg/integrity/generate_checksum.sh
 share/makepkg/integrity/generate_signature.sh
 share/makepkg/integrity/verify_checksum.sh
 share/makepkg/integrity/verify_signature.sh
 share/makepkg/lint_config.sh
+share/makepkg/lint_config/ext.sh
 share/makepkg/lint_config/paths.sh
+share/makepkg/lint_config/source_date_epoch.sh
 share/makepkg/lint_config/variable.sh
 share/makepkg/lint_package.sh
 share/makepkg/lint_package/build_references.sh
@@ -171,17 +191,20 @@ share/makepkg/lint_package/file_names.sh
 share/makepkg/lint_package/missing_backup.sh
 share/makepkg/lint_pkgbuild.sh
 share/makepkg/lint_pkgbuild/arch.sh
+share/makepkg/lint_pkgbuild/arch_specific.sh
 share/makepkg/lint_pkgbuild/backup.sh
 share/makepkg/lint_pkgbuild/changelog.sh
 share/makepkg/lint_pkgbuild/checkdepends.sh
 share/makepkg/lint_pkgbuild/conflicts.sh
 share/makepkg/lint_pkgbuild/depends.sh
 share/makepkg/lint_pkgbuild/epoch.sh
+share/makepkg/lint_pkgbuild/fullpkgver.sh
 share/makepkg/lint_pkgbuild/install.sh
 share/makepkg/lint_pkgbuild/makedepends.sh
 share/makepkg/lint_pkgbuild/optdepends.sh
 share/makepkg/lint_pkgbuild/options.sh
 share/makepkg/lint_pkgbuild/package_function.sh
+share/makepkg/lint_pkgbuild/package_function_variable.sh
 share/makepkg/lint_pkgbuild/pkgbase.sh
 share/makepkg/lint_pkgbuild/pkglist.sh
 share/makepkg/lint_pkgbuild/pkgname.sh
@@ -191,9 +214,12 @@ share/makepkg/lint_pkgbuild/provides.sh
 share/makepkg/lint_pkgbuild/source.sh
 share/makepkg/lint_pkgbuild/util.sh
 share/makepkg/lint_pkgbuild/variable.sh
+share/makepkg/reproducible.sh
+share/makepkg/reproducible/python.sh
 share/makepkg/source.sh
 share/makepkg/source/bzr.sh
 share/makepkg/source/file.sh
+share/makepkg/source/fossil.sh
 share/makepkg/source/git.sh
 share/makepkg/source/hg.sh
 share/makepkg/source/local.sh
@@ -209,11 +235,14 @@ share/makepkg/tidy/strip.sh
 share/makepkg/tidy/zipman.sh
 share/makepkg/util.sh
 share/makepkg/util/compress.sh
+share/makepkg/util/config.sh
+share/makepkg/util/dirsize.sh
 share/makepkg/util/error.sh
 share/makepkg/util/message.sh
 share/makepkg/util/option.sh
 share/makepkg/util/parseopts.sh
 share/makepkg/util/pkgbuild.sh
+share/makepkg/util/schema.sh
 share/makepkg/util/source.sh
 share/makepkg/util/util.sh
 %%DATADIR%%/PKGBUILD-split.proto
@@ -224,7 +253,7 @@ share/zsh/site-functions/_pacman
 @dir share/libalpm/hooks
 @dir share/makepkg-template
 @dir %%PACMAN_ROOT%%
-@dir /var/cache/pacman/pkg
-@dir /var/cache/pacman
-@dir /var/lib/pacman
-@dir /var/lib
+@dir %%PACMAN_ROOT%%/var/cache/pacman/pkg
+@dir %%PACMAN_ROOT%%/var/cache/pacman
+@dir %%PACMAN_ROOT%%/var/lib/pacman
+@dir %%PACMAN_ROOT%%/var/lib