diff -Naur pacman-3.2.1.orig/etc/makepkg.conf pacman-3.2.1/etc/makepkg.conf --- pacman-3.2.1.orig/etc/makepkg.conf 2008-12-10 06:05:43.000000000 -0600 +++ pacman-3.2.1/etc/makepkg.conf 2008-12-10 07:13:29.000000000 -0600 @@ -66,8 +66,9 @@ #-- libtool: Leave libtool (.la) files in packages #-- emptydirs: Leave empty directories in packages #-- zipman: Compress manpages with gzip +#-- purge: Remove files and regex patterns specified in PURGE_TARGETS # -OPTIONS=(strip docs libtool emptydirs zipman) +OPTIONS=(strip docs libtool emptydirs zipman purge) #-- File integrity checks to use. Valid: md5, sha1, sha256, sha384, sha512 INTEGRITY_CHECK=(md5) @@ -75,6 +76,8 @@ DOC_DIRS=(usr/{,share/}{info,doc,gtk-doc} opt/*/{info,doc,gtk-doc}) #-- Directories to be searched for the strip option (if option set correctly above) STRIP_DIRS=(bin lib sbin usr/{bin,lib,sbin,local/{bin,lib,sbin}} opt/*/{bin,lib,sbin}) +#-- Files (labeled 'file:') and regex patterns to be removed from all packages +PURGE_TARGETS=(file:usr/share/info/dir .packlist *.pod) ######################################################################### # PACKAGE OUTPUT diff -Naur pacman-3.2.1.orig/etc/makepkg.conf.in pacman-3.2.1/etc/makepkg.conf.in --- pacman-3.2.1.orig/etc/makepkg.conf.in 2008-12-10 06:05:43.000000000 -0600 +++ pacman-3.2.1/etc/makepkg.conf.in 2008-12-10 07:13:52.000000000 -0600 @@ -66,8 +66,9 @@ #-- libtool: Leave libtool (.la) files in packages #-- emptydirs: Leave empty directories in packages #-- zipman: Compress manpages with gzip +#-- purge: Remove files and regex patterns specified in PURGE_TARGETS # -OPTIONS=(strip docs libtool emptydirs zipman) +OPTIONS=(strip docs libtool emptydirs zipman purge) #-- File integrity checks to use. Valid: md5, sha1, sha256, sha384, sha512 INTEGRITY_CHECK=(md5) @@ -75,6 +76,8 @@ DOC_DIRS=(usr/{,share/}{info,doc,gtk-doc} opt/*/{info,doc,gtk-doc}) #-- Directories to be searched for the strip option (if option set correctly above) STRIP_DIRS=(bin lib sbin usr/{bin,lib,sbin,local/{bin,lib,sbin}} opt/*/{bin,lib,sbin}) +#-- Files (labeled 'file:') and regex patterns to be removed from all packages +PURGE_TARGETS=(file:usr/share/info/dir .packlist *.pod) ######################################################################### # PACKAGE OUTPUT diff -Naur pacman-3.2.1.orig/scripts/makepkg.sh.in pacman-3.2.1/scripts/makepkg.sh.in --- pacman-3.2.1.orig/scripts/makepkg.sh.in 2008-12-10 06:05:43.000000000 -0600 +++ pacman-3.2.1/scripts/makepkg.sh.in 2008-12-10 07:15:12.000000000 -0600 @@ -41,7 +41,7 @@ startdir="$PWD" srcdir="$startdir/src" pkgdir="$startdir/pkg" -known_options=('strip' 'docs' 'libtool' 'emptydirs' 'zipman' 'ccache' 'distcc' 'makeflags' 'force') +known_options=('strip' 'docs' 'libtool' 'emptydirs' 'zipman' 'ccache' 'distcc' 'makeflags' 'force' 'purge') readonly -a known_options # Options @@ -776,6 +776,18 @@ find . ! -type d -name "*.la" -exec rm -f -- '{}' \; fi + if [ "$(check_option purge)" = "y" -a -n "PURGE_TARGETS" ]; then + msg2 "$(gettext "Removing specified purge targets...")" + local pt + for pt in "${PURGE_TARGETS[@]}"; do + if [[ "$pt" =~ "file:" ]]; then + rm -f "${pt#file:}" + else + find . -type f -name "$pt" -exec rm -f -- '{}' \; + fi + done + fi + if [ "$(check_option emptydirs)" = "n" ]; then msg2 "$(gettext "Removing empty directories...")" find . -depth -type d -empty -delete