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:
parent
35135c0a0c
commit
dae3f9deef
|
@ -151,7 +151,7 @@ hi def link pbValidSha1sums Number
|
||||||
|
|
||||||
" options
|
" options
|
||||||
syn keyword pb_k_options options contained
|
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 pbOptionsNeg /\!/ contained
|
||||||
syn match pbOptionsDeprec /no/ contained
|
syn match pbOptionsDeprec /no/ contained
|
||||||
syn region pbOptionsGroup start=/^options=(/ end=/)/ contains=pb_k_options,pbOptions,pbOptionsNeg,pbOptionsDeprec,pbIllegalOption,shDoubleQuote,shSingleQuote
|
syn region pbOptionsGroup start=/^options=(/ end=/)/ contains=pb_k_options,pbOptions,pbOptionsNeg,pbOptionsDeprec,pbIllegalOption,shDoubleQuote,shSingleQuote
|
||||||
|
|
|
@ -182,6 +182,9 @@ Options and Directives
|
||||||
*emptydirs*;;
|
*emptydirs*;;
|
||||||
Leave empty directories in packages.
|
Leave empty directories in packages.
|
||||||
|
|
||||||
|
*zipman*;;
|
||||||
|
Compress man pages with gzip.
|
||||||
|
|
||||||
*ccache*;;
|
*ccache*;;
|
||||||
Allow the use of ccache during build. More useful in its negative
|
Allow the use of ccache during build. More useful in its negative
|
||||||
form `!ccache` with select packages that have problems building
|
form `!ccache` with select packages that have problems building
|
||||||
|
|
|
@ -97,8 +97,8 @@ Options
|
||||||
running in the DistCC cluster. In addition, you will want to modify your
|
running in the DistCC cluster. In addition, you will want to modify your
|
||||||
`MAKEFLAGS`.
|
`MAKEFLAGS`.
|
||||||
|
|
||||||
**OPTIONS=(**strip !docs libtool emptydirs**)**::
|
**OPTIONS=(**strip !docs libtool emptydirs zipman**)**::
|
||||||
This array contains options that affect the default packaging. All four are
|
This array contains options that affect the default packaging. They are
|
||||||
equivalent to options that can be placed in the PKGBUILD; the defaults 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
|
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
|
disable an option simply remove or place an ``!'' at the front of the
|
||||||
|
@ -120,6 +120,9 @@ Options
|
||||||
*emptydirs*;;
|
*emptydirs*;;
|
||||||
Leave empty directories in packages.
|
Leave empty directories in packages.
|
||||||
|
|
||||||
|
*zipman*;;
|
||||||
|
Compress man pages with gzip.
|
||||||
|
|
||||||
**INTEGRITY_CHECK=(**check1 ...**)**::
|
**INTEGRITY_CHECK=(**check1 ...**)**::
|
||||||
File integrity checks to use. Multiple checks may be specified; this
|
File integrity checks to use. Multiple checks may be specified; this
|
||||||
affects both generation and checking. The current valid options are:
|
affects both generation and checking. The current valid options are:
|
||||||
|
|
|
@ -58,15 +58,16 @@ BUILDENV=(fakeroot !distcc color !ccache !xdelta)
|
||||||
# These are default values for the options=() settings
|
# 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.
|
# A negated option will do the opposite of the comments below.
|
||||||
#
|
#
|
||||||
#-- strip: Strip symbols from binaries/libraries
|
#-- strip: Strip symbols from binaries/libraries
|
||||||
#-- docs: Save doc and info directories
|
#-- docs: Save doc and info directories
|
||||||
#-- libtool: Leave libtool (.la) files in packages
|
#-- libtool: Leave libtool (.la) files in packages
|
||||||
#-- emptydirs: Leave empty directories 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
|
#-- File integrity checks to use. Valid: md5, sha1, sha256, sha384, sha512
|
||||||
INTEGRITY_CHECK=(md5)
|
INTEGRITY_CHECK=(md5)
|
||||||
|
|
|
@ -733,37 +733,41 @@ tidy_install() {
|
||||||
rm -rf ${DOC_DIRS[@]}
|
rm -rf ${DOC_DIRS[@]}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
msg2 "$(gettext "Compressing man pages...")"
|
if [ "$(check_option zipman)" = "y" ]; then
|
||||||
local manpage mandirs ext file link hardlinks hl
|
msg2 "$(gettext "Compressing man pages...")"
|
||||||
mandirs="usr/man usr/share/man usr/local/man usr/local/share/man opt/*/man"
|
local manpage mandirs ext file link hardlinks hl
|
||||||
find ${mandirs} -type f 2>/dev/null | while read manpage ; do
|
mandirs="usr/man usr/share/man usr/local/man usr/local/share/man opt/*/man"
|
||||||
# check file still exists (potentially compressed with hard link)
|
find ${mandirs} -type f 2>/dev/null |
|
||||||
if [ -f ${manpage} ]; then
|
while read manpage ; do
|
||||||
ext="${manpage##*.}"
|
# check file still exists (potentially compressed with hard link)
|
||||||
file="${manpage##*/}"
|
if [ -f ${manpage} ]; then
|
||||||
if [ "$ext" != "gz" -a "$ext" != "bz2" ]; then
|
ext="${manpage##*.}"
|
||||||
# update symlinks to this manpage
|
file="${manpage##*/}"
|
||||||
find ${mandirs} -lname "$file" 2>/dev/null | while read link ; do
|
if [ "$ext" != "gz" -a "$ext" != "bz2" ]; then
|
||||||
rm -f "$link"
|
# update symlinks to this manpage
|
||||||
ln -sf "${file}.gz" "${link}.gz"
|
find ${mandirs} -lname "$file" 2>/dev/null |
|
||||||
done
|
while read link ; do
|
||||||
# find hard links and remove them
|
rm -f "$link"
|
||||||
# the '|| true' part keeps the script from bailing if find returned an
|
ln -sf "${file}.gz" "${link}.gz"
|
||||||
# error, such as when one of the man directories doesn't exist
|
done
|
||||||
hardlinks="$(find ${mandirs} \! -name "$file" -samefile "$manpage" 2>/dev/null)" || true
|
# find hard links and remove them
|
||||||
for hl in ${hardlinks}; do
|
# the '|| true' part keeps the script from bailing if find returned an
|
||||||
rm -f "${hl}";
|
# error, such as when one of the man directories doesn't exist
|
||||||
done
|
hardlinks="$(find ${mandirs} \! -name "$file" -samefile "$manpage" 2>/dev/null)" || true
|
||||||
# compress the original
|
for hl in ${hardlinks}; do
|
||||||
gzip -9 "$manpage"
|
rm -f "${hl}";
|
||||||
# recreate hard links removed earlier
|
done
|
||||||
for hl in ${hardlinks}; do
|
# compress the original
|
||||||
ln "${manpage}.gz" "${hl}.gz"
|
gzip -9 "$manpage"
|
||||||
chmod 644 ${hl}.gz
|
# recreate hard links removed earlier
|
||||||
done
|
for hl in ${hardlinks}; do
|
||||||
|
ln "${manpage}.gz" "${hl}.gz"
|
||||||
|
chmod 644 ${hl}.gz
|
||||||
|
done
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
done
|
||||||
done
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ "$(check_option strip)" = "y" ]; then
|
if [ "$(check_option strip)" = "y" ]; then
|
||||||
|
|
Loading…
Reference in New Issue