summaryrefslogtreecommitdiff
blob: 36930da5891e38577b6e17cf72824f0ffbbef5ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit toolchain-funcs

DESCRIPTION="A daemon to serve the gopher protocol"
HOMEPAGE="http://r-36.net/scm/geomyidae/"
SRC_URI="ftp://bitreich.org/releases/geomyidae/${PN}-v${PV}.tgz"
S="${WORKDIR}/${PN}-v${PV}"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~arm ~x86"

RDEPEND="
	acct-group/gopherd
	acct-user/gopherd
"
DEPEND="${RDEPEND}"

src_prepare() {
	# enable verbose build
	# respect CFLAGS
	# remove /usr/lib from LDFLAGS, bug #731672
	sed -i \
		-e 's/@${CC}/${CC}/g' \
		-e '/CFLAGS/s/=/?=/' \
		-e '/GEOM_LDFLAGS/s:-L/usr/lib ::' \
		Makefile || die 'sed on Makefile failed'
	# fix path for pid file
	sed -i \
		-e 's:/var/run:/run:g' \
		rc.d/Gentoo.init.d || die

	eapply_user
}

src_compile() {
	emake CC="$(tc-getCC)"
}

src_install() {
	dosbin ${PN}

	newinitd rc.d/Gentoo.init.d ${PN}
	newconfd rc.d/Gentoo.conf.d ${PN}

	insinto /var/gopher
	doins index.gph
	fowners -R root.gopherd /var/gopher
	fperms -R g=rX,o=rX /var/gopher

	doman ${PN}.8
	dodoc CGI README
}