Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 801034 | Differences between
and this patch

Collapse All | Expand All

(-)a/app-text/mandoc/mandoc-1.14.5-r2.ebuild (+154 lines)
Line 0 Link Here
1
https://cvsweb.bsd.lv/mandoc/tbl_term.c.diff?r1=1.68&r2=1.73
2
3
https://bugs.gentoo.org/801034
4
--- mandoc/tbl_term.c	2019/02/09 21:02:47	1.68
Line 0 Link Here
1
# Copyright 1999-2021 Gentoo Authors
2
# Distributed under the terms of the GNU General Public License v2
3
4
EAPI=7
5
6
inherit toolchain-funcs savedconfig
7
8
DESCRIPTION="Suite of tools compiling mdoc and man"
9
HOMEPAGE="https://mandoc.bsd.lv/"
10
SRC_URI="https://mandoc.bsd.lv/snapshots/${P}.tar.gz"
11
12
LICENSE="ISC"
13
SLOT="0"
14
KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86"
15
IUSE="cgi system-man test tools"
16
REQUIRED_USE="savedconfig? ( cgi )"
17
RESTRICT="!test? ( test )"
18
19
RDEPEND="sys-libs/zlib
20
	system-man? ( !sys-apps/man-db )
21
"
22
DEPEND="${RDEPEND}
23
	cgi? ( sys-libs/zlib[static-libs] )
24
"
25
BDEPEND="
26
	cgi? ( app-text/highlight )
27
	test? ( dev-lang/perl )
28
"
29
30
PATCHES=(
31
	"${FILESDIR}"/${PN}-1.14.5-r1-www-install.patch
32
	"${FILESDIR}"/${PN}-1.14.5-gcc10.patch
33
	"${FILESDIR}"/${PN}-1.14.5-fix-tbl-crashes.patch
34
)
35
36
pkg_pretend() {
37
	use system-man || return
38
39
	# only support uncompressed and gzip
40
	case "${PORTAGE_COMPRESS-bzip2}" in
41
		gzip|"") ;;
42
		*) ewarn "only PORTAGE_COMPRESS=gzip or '' is supported, man pages will not be indexed"
43
	esac
44
}
45
46
src_prepare() {
47
	default
48
49
	# The db-install change is to support parallel installs.
50
	sed -i \
51
		-e '/ar rs/s:ar:$(AR):' \
52
		-e '/^db-install:/s:$: base-install:' \
53
		Makefile || die
54
55
	# make-4.3 doesn't like the CC line (bug #706024)
56
	# and "echo -n" is not portable
57
	sed \
58
		-e "s@^\(CC=\).*\$@\1\"$(tc-getCC)\"@" \
59
		-e 's@echo -n@printf@g' \
60
		-i configure || die
61
62
	cat <<-EOF > "configure.local"
63
		PREFIX="${EPREFIX}/usr"
64
		BINDIR="${EPREFIX}/usr/bin"
65
		SBINDIR="${EPREFIX}/usr/sbin"
66
		LIBDIR="${EPREFIX}/usr/$(get_libdir)"
67
		MANDIR="${EPREFIX}/usr/share/man"
68
		INCLUDEDIR="${EPREFIX}/usr/include/mandoc"
69
		EXAMPLEDIR="${EPREFIX}/usr/share/examples/mandoc"
70
		MANPATH_DEFAULT="${EPREFIX}/usr/man:${EPREFIX}/usr/share/man:${EPREFIX}/usr/local/man:${EPREFIX}/usr/local/share/man"
71
72
		CFLAGS="${CFLAGS} ${CPPFLAGS}"
73
		LDFLAGS="${LDFLAGS}"
74
		AR="$(tc-getAR)"
75
		CC="$(tc-getCC)"
76
		# The STATIC variable is only used by man.cgi.
77
		STATIC=
78
79
		# conflicts with sys-apps/groff
80
		BINM_SOELIM=msoelim
81
		MANM_ROFF=mandoc_roff
82
		# conflicts with sys-apps/man-pages
83
		MANM_MAN=mandoc_man
84
85
		# fix utf-8 locale on musl
86
		$(usex elibc_musl UTF8_LOCALE=C.UTF-8 '')
87
	EOF
88
	use system-man || cat <<-EOF >> "configure.local"
89
		BINM_MAN=mman
90
		BINM_APROPOS=mapropos
91
		BINM_WHATIS=mwhatis
92
		BINM_MAKEWHATIS=mmakewhatis
93
		MANM_MDOC=mandoc_mdoc
94
		MANM_EQN=mandoc_eqn
95
		MANM_TBL=mandoc_tbl
96
		MANM_MANCONF=mman.conf
97
	EOF
98
	if use cgi; then
99
		cp cgi.h{.example,} || die
100
		restore_config cgi.h
101
	fi
102
103
	# ./configure does not propagate all configure.local
104
	# settings to Makefile.local settings.
105
	tc-export AR
106
}
107
108
src_compile() {
109
	default
110
	use cgi && emake man.cgi
111
	use tools && emake catman
112
}
113
114
src_test() {
115
	cd regress || die
116
	./regress.pl . all verbose || die "tests failed"
117
}
118
119
src_install() {
120
	local extra_manpages=( man.options.1 )
121
122
	emake DESTDIR="${D}" install
123
124
	# install library manpages and header files but
125
	# not the static library itself (PG0302)
126
	emake DESTDIR="${D}" lib-install
127
	find "${ED}" -name libmandoc.a -delete || die
128
129
	use tools && emake DESTDIR="${D}" catman-install
130
131
	if use cgi ; then
132
		emake DESTDIR="${D}" cgi-install www-install
133
		extra_manpages+=( man.cgi.{3,8} )
134
		save_config cgi.h
135
	fi
136
137
	if use system-man ; then
138
		exeinto /etc/cron.daily
139
		newexe "${FILESDIR}"/mandoc.cron-r0 mandoc
140
	fi
141
142
	doman "${extra_manpages[@]}"
143
}
144
145
pkg_postinst() {
146
	if use system-man ; then
147
		elog "Generating mandoc database"
148
		makewhatis || die
149
	fi
150
}
(-)a/app-text/mandoc/metadata.xml (-3 / +3 lines)
Lines 5-11 Link Here
5
	<email>base-system@gentoo.org</email>
5
	<email>base-system@gentoo.org</email>
6
</maintainer>
6
</maintainer>
7
	<use>
7
	<use>
8
		<flag name="cgi">build man.cgi web plugin for viewing man pages</flag>  
8
		<flag name="cgi">Build man.cgi web plugin for viewing man pages</flag>  
9
		<flag name="system-man">set as the default man provider</flag>
9
		<flag name="system-man">Set as the default man provider</flag>
10
		<flag name="tools">Build catman and mandocd system administration tools</flag>
10
	</use>
11
	</use>
11
</pkgmetadata>
12
</pkgmetadata>
12
- 

Return to bug 801034