Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-freebsd/freebsd-ubin/files/, sys-freebsd/freebsd-ubin/
Date: Tue, 22 Jan 2019 19:05:08
Message-Id: 1548183895.e5f0fdfe2fc4c70091efb4806078158ad7d9ca55.mgorny@gentoo
1 commit: e5f0fdfe2fc4c70091efb4806078158ad7d9ca55
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jan 22 16:34:23 2019 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Tue Jan 22 19:04:55 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e5f0fdfe
7
8 sys-freebsd/freebsd-ubin: Install 'man' as part of the package
9
10 Since sys-apps/man is being treecleaned, and sys-apps/man-db is bloated
11 with dependencies that are plain broken on FreeBSD, build & install
12 the original FreeBSD man implementation.
13
14 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
15
16 .../files/freebsd-ubin-11.1-man-paths.patch | 40 ++++
17 .../freebsd-ubin/freebsd-ubin-11.1-r1.ebuild | 214 +++++++++++++++++++++
18 2 files changed, 254 insertions(+)
19
20 diff --git a/sys-freebsd/freebsd-ubin/files/freebsd-ubin-11.1-man-paths.patch b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-11.1-man-paths.patch
21 new file mode 100644
22 index 00000000000..c26a672f372
23 --- /dev/null
24 +++ b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-11.1-man-paths.patch
25 @@ -0,0 +1,40 @@
26 +diff -dupr a/usr.bin/man/man.sh b/usr.bin/man/man.sh
27 +--- a/usr.bin/man/man.sh 2017-07-21 01:43:23.000000000 +0200
28 ++++ b/usr.bin/man/man.sh 2019-01-22 19:32:52.136578832 +0100
29 +@@ -883,12 +883,12 @@ search_whatis() {
30 + # Finds an appropriate decompressor based on extension
31 + setup_cattool() {
32 + case "$1" in
33 +- *.bz) cattool='/usr/bin/bzcat' ;;
34 +- *.bz2) cattool='/usr/bin/bzcat' ;;
35 +- *.gz) cattool='/usr/bin/zcat' ;;
36 +- *.lzma) cattool='/usr/bin/lzcat' ;;
37 +- *.xz) cattool='/usr/bin/xzcat' ;;
38 +- *) cattool='/usr/bin/zcat -f' ;;
39 ++ *.bz) cattool='bzcat' ;;
40 ++ *.bz2) cattool='bzcat' ;;
41 ++ *.gz) cattool='zcat' ;;
42 ++ *.lzma) cattool='lzcat' ;;
43 ++ *.xz) cattool='xzcat' ;;
44 ++ *) cattool='zcat -f' ;;
45 + esac
46 + }
47 +
48 +@@ -903,7 +903,7 @@ setup_pager() {
49 + if [ -n "$PAGER" ]; then
50 + MANPAGER="$PAGER"
51 + else
52 +- MANPAGER="more -s"
53 ++ MANPAGER="less -sR"
54 + fi
55 + fi
56 + fi
57 +@@ -1008,7 +1008,7 @@ SYSCTL=/sbin/sysctl
58 + debug=0
59 + man_default_sections='1:8:2:3:n:4:5:6:7:9:l'
60 + man_default_path='/usr/share/man:/usr/share/openssl/man:/usr/local/man'
61 +-cattool='/usr/bin/zcat -f'
62 ++cattool='zcat -f'
63 +
64 + config_global='/etc/man.conf'
65 +
66
67 diff --git a/sys-freebsd/freebsd-ubin/freebsd-ubin-11.1-r1.ebuild b/sys-freebsd/freebsd-ubin/freebsd-ubin-11.1-r1.ebuild
68 new file mode 100644
69 index 00000000000..1ed9907fc97
70 --- /dev/null
71 +++ b/sys-freebsd/freebsd-ubin/freebsd-ubin-11.1-r1.ebuild
72 @@ -0,0 +1,214 @@
73 +# Copyright 1999-2019 Gentoo Authors
74 +# Distributed under the terms of the GNU General Public License v2
75 +
76 +EAPI=5
77 +
78 +inherit bsdmk freebsd flag-o-matic pam multilib multibuild multilib-build
79 +
80 +DESCRIPTION="FreeBSD's base system source for /usr/bin"
81 +SLOT="0"
82 +IUSE="ar atm audit bluetooth ipv6 kerberos netware nis ssl usb build zfs"
83 +LICENSE="BSD zfs? ( CDDL )"
84 +
85 +# Security Advisory and Errata patches.
86 +# UPSTREAM_PATCHES=()
87 +
88 +if [[ ${PV} != *9999* ]]; then
89 + KEYWORDS="~amd64-fbsd ~x86-fbsd"
90 + SRC_URI="${SRC_URI}
91 + $(freebsd_upstream_patches)"
92 +fi
93 +
94 +EXTRACTONLY="
95 + usr.bin/
96 + contrib/
97 + lib/
98 + etc/
99 + bin/
100 + include/
101 +"
102 +
103 +RDEPEND="=sys-freebsd/freebsd-lib-${RV}*[usb?,bluetooth?,${MULTILIB_USEDEP}]
104 + ssl? ( dev-libs/openssl:0= )
105 + kerberos? ( virtual/krb5 )
106 + ar? ( >=app-arch/libarchive-3 )
107 + virtual/pam
108 + sys-libs/zlib
109 + >=sys-libs/ncurses-5.9:0=
110 + !sys-process/fuser-bsd
111 + !dev-util/csup
112 + !dev-libs/libiconv
113 + !sys-apps/man
114 + !sys-apps/man-db
115 + !sys-freebsd/freebsd-contrib"
116 +
117 +DEPEND="${RDEPEND}
118 + sys-devel/flex
119 + !build? ( =sys-freebsd/freebsd-sources-${RV}* )
120 + =sys-freebsd/freebsd-sbin-${RV}*
121 + =sys-freebsd/freebsd-mk-defs-${RV}*"
122 +
123 +RDEPEND="${RDEPEND}
124 + >=sys-auth/pambase-20080219.1
125 + sys-process/cronbase"
126 +
127 +S="${WORKDIR}/usr.bin"
128 +
129 +PATCHES=( "${FILESDIR}/${PN}-6.0-bsdcmp.patch"
130 + "${FILESDIR}/${PN}-11.1-fixmakefiles.patch"
131 + "${FILESDIR}/${PN}-11.0-setXid.patch"
132 + "${FILESDIR}/${PN}-lint-stdarg.patch"
133 + "${FILESDIR}/${PN}-9.1-bsdar.patch"
134 + "${FILESDIR}/${PN}-10.2-talk-workaround.patch"
135 + "${FILESDIR}/${PN}-10.2-bsdxml.patch"
136 + "${FILESDIR}/${PN}-11.1-man-paths.patch" )
137 +
138 +# Here we remove some sources we don't need because they are already
139 +# provided by portage's packages or similar. In order:
140 +# - Archiving tools, provided by their own ebuilds
141 +# - ncurses stuff
142 +# - less stuff
143 +# - bind utils
144 +# - rsh stuff
145 +# - binutils gprof
146 +# - dc stuff
147 +# and the rest are misc utils we already provide somewhere else.
148 +REMOVE_SUBDIRS="bzip2 bzip2recover tar cpio
149 + gzip gprof minigzip
150 + lzmainfo xz xzdec
151 + unzip
152 + tput tset tabs
153 + less lessecho lesskey
154 + hesinfo host
155 + rsh rlogin rusers rwho ruptime
156 + compile_et lex vi smbutil file vacation nc ftp telnet
157 + c99 c89
158 + bc dc
159 + whois tftp
160 + addr2line bsdcat cxxfilt cxxfilt elfcopy nm readelf sdiff size soelim strings"
161 +
162 +pkg_setup() {
163 + # Add the required source files.
164 + use zfs && EXTRACTONLY+="cddl/ "
165 + use build && EXTRACTONLY+="sys/ "
166 + use nis && EXTRACTONLY+="usr.sbin/ypserv/ "
167 +
168 + use atm || mymakeopts="${mymakeopts} WITHOUT_ATM= "
169 + use audit || mymakeopts="${mymakeopts} WITHOUT_AUDIT= "
170 + use bluetooth || mymakeopts="${mymakeopts} WITHOUT_BLUETOOTH= "
171 + use ipv6 || mymakeopts="${mymakeopts} WITHOUT_INET6= WITHOUT_INET6_SUPPORT= "
172 + use kerberos || mymakeopts="${mymakeopts} WITHOUT_KERBEROS_SUPPORT= "
173 + use netware || mymakeopts="${mymakeopts} WITHOUT_IPX= WITHOUT_IPX_SUPPORT= WITHOUT_NCP= "
174 + use nis || mymakeopts="${mymakeopts} WITHOUT_NIS= "
175 + use ssl || mymakeopts="${mymakeopts} WITHOUT_OPENSSL= "
176 + use usb || mymakeopts="${mymakeopts} WITHOUT_USB= "
177 + use zfs || mymakeopts="${mymakeopts} WITHOUT_CDDL= "
178 + mymakeopts="${mymakeopts} WITHOUT_CLANG= WITHOUT_LZMA_SUPPORT= WITHOUT_SVN= WITHOUT_SVNLITE= WITHOUT_OPENSSH= WITHOUT_LDNS_UTILS= WITHOUT_MANDOCDB= "
179 +}
180 +
181 +pkg_preinst() {
182 + # bison installs a /usr/bin/yacc symlink ...
183 + # we need to remove it to avoid triggering
184 + # collision-protect errors
185 + if [[ -L ${ROOT}/usr/bin/yacc ]]; then
186 + rm -f "${ROOT}"/usr/bin/yacc || die
187 + fi
188 +}
189 +
190 +src_prepare() {
191 + if [[ ! -e "${WORKDIR}/sys" ]]; then
192 + use build || ln -s "/usr/src/sys" "${WORKDIR}/sys"
193 + fi
194 +
195 + # Rename manpage for renamed cmp
196 + mv "${S}"/cmp/cmp.1 "${S}"/cmp/bsdcmp.1 || die
197 + # Rename manpage for renamed ar
198 + mv "${S}"/ar/ar.1 "${S}"/ar/freebsd-ar.1 || die
199 + # Fix whereis(1) manpath search.
200 + sed -i -e 's:"manpath -q":"manpath":' "${S}/whereis/pathnames.h" || die
201 +
202 + # Build a dynamic make
203 + sed -i -e '/^NO_SHARED/ s/^/#/' "${S}"/bmake/Makefile.inc || die
204 +
205 + # Disable it here otherwise our patch wont apply
206 + use ar || dummy_mk ar
207 +
208 + # Preparing to build xlint
209 + export LINT=xlint
210 +}
211 +
212 +setup_multilib_vars() {
213 + if ! multilib_is_native_abi ; then
214 + cd "${WORKDIR}/usr.bin/ldd" || die
215 + export mymakeopts="${mymakeopts} PROG=ldd32 WITHOUT_MAN="
216 + else
217 + cd "${S}" || die
218 + fi
219 + "$@"
220 +}
221 +
222 +src_compile() {
223 + local MULTIBUILD_VARIANTS="${DEFAULT_ABI}"
224 + # Preparing to build addr2line, elfcopy, m4, getaddrinfo
225 + for dir in libelftc libpe libopenbsd libnetbsd; do
226 + cd "${WORKDIR}/lib/${dir}" || die
227 + multibuild_foreach_variant freebsd_multilib_multibuild_wrapper freebsd_src_compile -j1
228 + done
229 +
230 + MULTIBUILD_VARIANTS=( $(multilib_get_enabled_abis) )
231 + multibuild_foreach_variant freebsd_multilib_multibuild_wrapper setup_multilib_vars freebsd_src_compile -j1
232 +}
233 +
234 +src_install() {
235 + cd "${S}"/calendar/calendars || die
236 + for dir in $(find . -type d ! -name "." ); do
237 + dodir /usr/share/calendar/"$(basename ${dir})"
238 + done
239 +
240 + local MULTIBUILD_VARIANTS=( $(multilib_get_enabled_abis) )
241 + multibuild_foreach_variant freebsd_multilib_multibuild_wrapper setup_multilib_vars freebsd_src_install
242 +
243 + # baselayout requires these in /bin
244 + dodir /bin
245 + for bin in sed printf ; do
246 + mv "${D}/usr/bin/${bin}" "${D}/bin/" || die "mv ${bin} failed"
247 + dosym /bin/${bin} /usr/bin/${bin} || die "dosym ${bin} failed"
248 + done
249 +
250 + for pamdfile in login passwd su; do
251 + newpamd "${FILESDIR}/${pamdfile}.1.pamd" ${pamdfile} || die
252 + done
253 +
254 + cd "${WORKDIR}/etc" || die
255 + insinto /etc
256 + doins remote phones opieaccess fbtab
257 +
258 + exeinto /etc/cron.daily
259 + newexe "${FILESDIR}/locate-updatedb-cron" locate.updatedb || die
260 +
261 + # tip requires /var/spool/lock/, bug #200700
262 + keepdir /var/spool/lock
263 +
264 + # create locate database #472468
265 + local f=/var/db/locate.database
266 + mkdir "${ED}${f%/*}" || die
267 + touch "${ED}${f}" || die
268 + fowners nobody:nobody ${f}
269 +}
270 +
271 +pkg_postinst() {
272 + # We need to ensure that login.conf.db is up-to-date.
273 + if [[ -e "${ROOT}"etc/login.conf ]] ; then
274 + einfo "Updating ${ROOT}etc/login.conf.db"
275 + "${ROOT}"usr/bin/cap_mkdb -f "${ROOT}"etc/login.conf "${ROOT}"etc/login.conf || die
276 + elog "Remember to run cap_mkdb /etc/login.conf after making changes to it"
277 + fi
278 +}
279 +
280 +pkg_postrm() {
281 + # and if we uninstall yacc but keep bison,
282 + # lets restore the /usr/bin/yacc symlink
283 + if [[ ! -e ${ROOT}/usr/bin/yacc ]] && [[ -e ${ROOT}/usr/bin/yacc.bison ]] ; then
284 + ln -s yacc.bison "${ROOT}"/usr/bin/yacc || die
285 + fi
286 +}