man-db: re-release -2, workaround for spurious %SystemDrive% directory creation
[git/cygwin-packages/man-db.git] / man-db.cygport
1 # -*- mode: sh; sh-shell: bash -*-
2 BUILD_REQUIRES=" flex groff libgdbm-devel libiconv-devel libpipeline-devel lzip po4a zstd"
3 NAME="man-db"
4 VERSION="2.9.4"
5 RELEASE="2"
6 CATEGORY="Base"
7 SUMMARY="Man page viewer"
8 DESCRIPTION="man-db is an implementation of the standard Unix documentation
9 system accessed using the man command. It uses a Berkeley DB database in place
10 of the traditional flat-text whatis databases."
11 HOMEPAGE="https://www.nongnu.org/man-db/"
12 SRC_URI="
13 mirror://savannah/man-db/${P}.tar.xz
14 mirror://savannah/man-db/${P}.tar.xz.asc
15 "
16 PATCH_URI="
17 ${P}-avoid-multiply-defined-symbols.patch
18 "
19
20 PKG_NAMES="${PN} ${PN}-create-index ${PN}-index-synchronously"
21 man_db_OBSOLETES="man"
22 man_db_REQUIRES="groff gzip less util-linux" # lynx
23 man_db_CONTENTS="
24 etc/defaults/
25 etc/postinstall/zp_${PN}-update-index.dash etc/postinstall/${PN}.dash etc/preremove/${PN}.sh
26 usr/bin/ usr/libexec/ usr/sbin/
27 usr/share/doc/ usr/share/locale/ usr/share/man/
28 var/cache/man/"
29 PKG_IGNORE="usr/lib/man-db/libman*"
30 man_db_create_index_SUMMARY="Create and maintain index of man pages"
31 man_db_create_index_CATEGORY="System"
32 man_db_create_index_REQUIRES="${PN}"
33 man_db_create_index_CONTENTS="
34 etc/postinstall/${PN}-create-index.dash
35 "
36 man_db_index_synchronously_SUMMARY="Maintain index of man pages synchronously"
37 man_db_index_synchronously_CATEGORY="System"
38 man_db_index_synchronously_REQUIRES="${PN}-create-index"
39 man_db_index_synchronously_CONTENTS="
40 etc/postinstall/${PN}-index-synchronously.dash etc/preremove/${PN}-index-synchronously.dash
41 "
42
43 src_compile() {
44 cd ${S}
45 cygautoreconf
46 cd ${B}
47 cygconf \
48 "--with-sections=1 1p 8 2 3 3p 4 5 6 7 9 0p n" \
49 --disable-cache-owner \
50 --disable-setuid \
51 --with-browser=lynx \
52 --with-pager=less \
53 --with-db=gdbm
54 cygmake
55 }
56
57 src_test() {
58 cd ${B}
59 unset MANPATH
60 cygtest
61 }
62
63 src_install() {
64 cd ${B}
65 cyginstall
66 make_etc_defaults /etc/man_db.conf
67 keepdir /var/cache/man
68
69 dodir /etc/postinstall
70 cat > ${D}/etc/postinstall/zp_${PN}-update-index.dash <<"_EOF"
71 if [ -f /var/cache/man/index.db ] ; then
72 if [ -f /var/cache/man/.index-synchronously ] || [ "$1" = "background" ] ; then
73 printf " ManDB index update starting...\n"
74 tf=$(/usr/bin/mktemp -p /var/log mandb-index-XXXXXXXX.log)
75 exec 3> $tf
76 /usr/bin/mv --backup=simple $tf /var/log/mandb-index.log
77 printf "ManDB update started: $(/usr/bin/date -Iseconds)\n" >&3
78 /usr/bin/mandb <&- >&3 2>&1
79 printf "ManDB update finished: $(/usr/bin/date -Iseconds)\n" >&3
80 exec 3>&-
81 printf " ... ManDB index update complete.\n"
82 else
83 printf " ManDB index update commencing in background...\n"
84 env -i ProgramData=$(hexdump -n 32 -e '/8 "%02X" 3/8 "/%02X"' /dev/urandom) \
85 /usr/bin/cygstart --hide /usr/bin/dash $0 background
86 fi
87 else
88 printf " ManDB index not available.\n"
89 fi
90 _EOF
91 cat > ${D}/etc/postinstall/${PN}-create-index.dash <<_EOF
92 [ -e /var/cache/man/index.db ] || exec /usr/bin/touch /var/cache/man/index.db
93 _EOF
94 cat > ${D}/etc/postinstall/${PN}-index-synchronously.dash <<_EOF
95 exec /usr/bin/touch /var/cache/man/.index-synchronously
96 _EOF
97 cat > ${D}/etc/preremove/${PN}-index-synchronously.dash <<_EOF
98 exec /usr/bin/rm -f /var/cache/man/.index-synchronously
99 _EOF
100 }
This page took 0.038006 seconds and 6 git commands to generate.