1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-22 15:58:50 -05:00

Add zipman makepkg option.

All other steps in tidy_install function were already controlled by an
option in makepkg.conf, so this patch adds an option for the man page
compression step too.
This will allow to keep man pages uncompressed, which is required for some
special meta man page, like the zshall one (see FS#4580).

Ref: http://www.archlinux.org/pipermail/pacman-dev/2008-March/011472.html

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
This commit is contained in:
Chantry Xavier 2008-03-13 00:25:38 +01:00
parent 35135c0a0c
commit dae3f9deef
5 changed files with 46 additions and 35 deletions

View File

@ -151,7 +151,7 @@ hi def link pbValidSha1sums Number
" options
syn keyword pb_k_options options contained
syn match pbOptions /\(no\)\?\(strip\|docs\|libtool\|emptydirs\|ccache\|distcc\|makeflags\|force\)/ contained
syn match pbOptions /\(no\)\?\(strip\|docs\|libtool\|emptydirs\|zipman\|ccache\|distcc\|makeflags\|force\)/ contained
syn match pbOptionsNeg /\!/ contained
syn match pbOptionsDeprec /no/ contained
syn region pbOptionsGroup start=/^options=(/ end=/)/ contains=pb_k_options,pbOptions,pbOptionsNeg,pbOptionsDeprec,pbIllegalOption,shDoubleQuote,shSingleQuote

View File

@ -182,6 +182,9 @@ Options and Directives
*emptydirs*;;
Leave empty directories in packages.
*zipman*;;
Compress man pages with gzip.
*ccache*;;
Allow the use of ccache during build. More useful in its negative
form `!ccache` with select packages that have problems building

View File

@ -97,8 +97,8 @@ Options
running in the DistCC cluster. In addition, you will want to modify your
`MAKEFLAGS`.
**OPTIONS=(**strip !docs libtool emptydirs**)**::
This array contains options that affect the default packaging. All four are
**OPTIONS=(**strip !docs libtool emptydirs zipman**)**::
This array contains options that affect the default packaging. They are
equivalent to options that can be placed in the PKGBUILD; the defaults are
shown here. All options should always be left in the array; to enable or
disable an option simply remove or place an ``!'' at the front of the
@ -120,6 +120,9 @@ Options
*emptydirs*;;
Leave empty directories in packages.
*zipman*;;
Compress man 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:

View File

@ -58,15 +58,16 @@ BUILDENV=(fakeroot !distcc color !ccache !xdelta)
# These are default values for the options=() settings
#########################################################################
#
# Default: OPTIONS=(strip !docs libtool emptydirs)
# Default: OPTIONS=(strip !docs libtool emptydirs zipman)
# A negated option will do the opposite of the comments below.
#
#-- strip: Strip symbols from binaries/libraries
#-- docs: Save doc and info directories
#-- libtool: Leave libtool (.la) files in packages
#-- emptydirs: Leave empty directories in packages
#-- zipman: Compress manpages with gzip
#
OPTIONS=(strip !docs libtool emptydirs)
OPTIONS=(strip !docs libtool emptydirs zipman)
#-- File integrity checks to use. Valid: md5, sha1, sha256, sha384, sha512
INTEGRITY_CHECK=(md5)

View File

@ -733,37 +733,41 @@ tidy_install() {
rm -rf ${DOC_DIRS[@]}
fi
msg2 "$(gettext "Compressing man pages...")"
local manpage mandirs ext file link hardlinks hl
mandirs="usr/man usr/share/man usr/local/man usr/local/share/man opt/*/man"
find ${mandirs} -type f 2>/dev/null | while read manpage ; do
# check file still exists (potentially compressed with hard link)
if [ -f ${manpage} ]; then
ext="${manpage##*.}"
file="${manpage##*/}"
if [ "$ext" != "gz" -a "$ext" != "bz2" ]; then
# update symlinks to this manpage
find ${mandirs} -lname "$file" 2>/dev/null | while read link ; do
rm -f "$link"
ln -sf "${file}.gz" "${link}.gz"
done
# 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
for hl in ${hardlinks}; do
rm -f "${hl}";
done
# compress the original
gzip -9 "$manpage"
# recreate hard links removed earlier
for hl in ${hardlinks}; do
ln "${manpage}.gz" "${hl}.gz"
chmod 644 ${hl}.gz
done
if [ "$(check_option zipman)" = "y" ]; then
msg2 "$(gettext "Compressing man pages...")"
local manpage mandirs ext file link hardlinks hl
mandirs="usr/man usr/share/man usr/local/man usr/local/share/man opt/*/man"
find ${mandirs} -type f 2>/dev/null |
while read manpage ; do
# check file still exists (potentially compressed with hard link)
if [ -f ${manpage} ]; then
ext="${manpage##*.}"
file="${manpage##*/}"
if [ "$ext" != "gz" -a "$ext" != "bz2" ]; then
# update symlinks to this manpage
find ${mandirs} -lname "$file" 2>/dev/null |
while read link ; do
rm -f "$link"
ln -sf "${file}.gz" "${link}.gz"
done
# 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
for hl in ${hardlinks}; do
rm -f "${hl}";
done
# compress the original
gzip -9 "$manpage"
# recreate hard links removed earlier
for hl in ${hardlinks}; do
ln "${manpage}.gz" "${hl}.gz"
chmod 644 ${hl}.gz
done
fi
fi
fi
done
done
fi
if [ "$(check_option strip)" = "y" ]; then