[pacman-dev] [PATCH] Provides a MAN_DIRS variable much like DOC/STRIP_DIRS. I need that for a package that install manpages in a non-standard place (/opt/devkitpro/devkitPPC/man/...).
Tiago Pierezan Camargo
tcamargo at gmail.com
Fri Oct 10 07:21:52 EDT 2008
Signed-off-by: Tiago Pierezan Camargo <tcamargo at gmail.com>
---
doc/makepkg.conf.5.txt | 7 +++++++
etc/makepkg.conf.in | 2 ++
scripts/makepkg.sh.in | 9 ++++-----
3 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/doc/makepkg.conf.5.txt b/doc/makepkg.conf.5.txt
index ca9df02..d6dd7dd 100644
--- a/doc/makepkg.conf.5.txt
+++ b/doc/makepkg.conf.5.txt
@@ -136,6 +136,13 @@ Options
that are located in opt/, you may need to add the directory to this
array. *NOTE:* Do not add the leading slash to the directory name.
+**MAN_DIRS=(**{usr{,/local}{,/share},opt/*}/{man,info} ...**)**::
+ If "zipman" is specified in the OPTIONS array, this variable will
+ instruct makepkg where to look to compress manpages and docs. If you
+ build packages that are located in opt/, you may need to add the
+ directory to this array. *NOTE:* Do not add the leading slash to
+ the directory name.
+
**STRIP_DIRS=(**bin lib sbin usr/{bin,lib} ...**)**::
If "strip" is specified in the OPTIONS array, this variable will
instruct makepkg where to look to for files to strip. If you build
diff --git a/etc/makepkg.conf.in b/etc/makepkg.conf.in
index 7eb647b..43f03b4 100644
--- a/etc/makepkg.conf.in
+++ b/etc/makepkg.conf.in
@@ -73,6 +73,8 @@ OPTIONS=(strip !docs libtool emptydirs zipman)
INTEGRITY_CHECK=(md5)
#-- Doc directories to remove (if option set correctly above)
DOC_DIRS=(usr/{,share/}{doc,gtk-doc} opt/*/{doc,gtk-doc})
+#-- Manpage directories to compress (if option set correctly above)
+MAN_DIRS=({usr{,/local}{,/share},opt/*}/{man,info})
#-- 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})
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index c15d91f..2fa64ea 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -714,9 +714,8 @@ tidy_install() {
if [ "$(check_option zipman)" = "y" ]; then
msg2 "$(gettext "Compressing man and info pages...")"
- local manpage mandirs ext file link hardlinks hl
- mandirs=({usr{,/local}{,/share},opt/*}/{man,info})
- find ${mandirs[@]} -type f 2>/dev/null |
+ local manpage ext file link hardlinks hl
+ find ${MAN_DIRS[@]} -type f 2>/dev/null |
while read manpage ; do
# check file still exists (potentially compressed with hard link)
if [ -f ${manpage} ]; then
@@ -724,7 +723,7 @@ tidy_install() {
file="${manpage##*/}"
if [ "$ext" != "gz" -a "$ext" != "bz2" ]; then
# update symlinks to this manpage
- find ${mandirs[@]} -lname "$file" 2>/dev/null |
+ find ${MAN_DIRS[@]} -lname "$file" 2>/dev/null |
while read link ; do
rm -f "$link"
ln -sf "${file}.gz" "${link}.gz"
@@ -732,7 +731,7 @@ tidy_install() {
# find hard links and remove them
# the '|| true' part keeps the script from bailing if find returned an
# error, such as when one of the man directories doesn't exist
- hardlinks="$(find ${mandirs[@]} \! -name "$file" -samefile "$manpage" 2>/dev/null)" || true
+ hardlinks="$(find ${MAN_DIRS[@]} \! -name "$file" -samefile "$manpage" 2>/dev/null)" || true
for hl in ${hardlinks}; do
rm -f "${hl}";
done
--
1.6.0.2
More information about the pacman-dev
mailing list