mirror of
https://github.com/moparisthebest/pacman
synced 2025-02-28 17:31:52 -05:00
makepkg: provide MAN_DIRS configuration variable
Provides a MAN_DIRS variable in makepkg.conf which can be used to specify folders to look for manual (man and info) pages to be compressed. Useful for packages that install to /opt. Also clarifies that "zipman" means "zip manuals" and covers both man and info pages. Original work by: Tiago Pierezan Camargo <tcamargo at gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
b55f478042
commit
bb9b19a6c4
@ -123,13 +123,20 @@ Options
|
||||
Leave empty directories in packages.
|
||||
|
||||
*zipman*;;
|
||||
Compress man and info pages with gzip.
|
||||
Compress manual (man and info) pages with gzip.
|
||||
|
||||
**INTEGRITY_CHECK=(**check1 ...**)**::
|
||||
File integrity checks to use. Multiple checks may be specified; this
|
||||
affects both generation and checking. The current valid options are:
|
||||
`md5`, `sha1`, `sha256`, `sha384`, and `sha512`.
|
||||
|
||||
**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 manual (man and info)
|
||||
pages. 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.
|
||||
|
||||
**DOC_DIRS=(**usr/{,share/}{doc,gtk-doc} ...**)**::
|
||||
If "!docs" is specified in the OPTIONS array, this variable will
|
||||
instruct makepkg where to look to remove docs. If you build packages
|
||||
|
@ -65,12 +65,14 @@ BUILDENV=(fakeroot !distcc color !ccache !xdelta)
|
||||
#-- docs: Save doc and info directories
|
||||
#-- libtool: Leave libtool (.la) files in packages
|
||||
#-- emptydirs: Leave empty directories in packages
|
||||
#-- zipman: Compress manpages with gzip
|
||||
#-- zipman: Compress manual (man and info) pages with gzip
|
||||
#
|
||||
OPTIONS=(strip !docs libtool emptydirs zipman)
|
||||
|
||||
#-- File integrity checks to use. Valid: md5, sha1, sha256, sha384, sha512
|
||||
INTEGRITY_CHECK=(md5)
|
||||
#-- Manual (man and info) directories to compress (if option set correctly above)
|
||||
MAN_DIRS=({usr{,/local}{,/share},opt/*}/{man,info})
|
||||
#-- Doc directories to remove (if option set correctly above)
|
||||
DOC_DIRS=(usr/{,share/}{doc,gtk-doc} opt/*/{doc,gtk-doc})
|
||||
#-- Directories to be searched for the strip option (if option set correctly above)
|
||||
|
@ -718,9 +718,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
|
||||
@ -728,7 +727,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"
|
||||
@ -736,7 +735,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
|
||||
|
Loading…
x
Reference in New Issue
Block a user