summaryrefslogtreecommitdiff
blob: 574d26fb3ac505b1ed03ecd84310476fccf7350c (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI="6"

inherit eutils cmake-utils user

DESCRIPTION="A spam-resistant message board application for Freenet"
#FMS oly has a homepage within freenet, so the closest is a wiki linking to it
HOMEPAGE="https://github.com/freenet/wiki/wiki/FMS"
SRC_URI="https://dev.gentoo.org/~tommy/distfiles/${PN}-src-${PV}.zip"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="frost ssl"

RDEPEND="virtual/libiconv
	frost? ( net-libs/mbedtls )
	ssl? ( net-libs/mbedtls )
	>=dev-libs/poco-1.4.3_p1
	>=dev-db/sqlite-3.6.15"
DEPEND="${RDEPEND}
	app-arch/unzip"

S=${WORKDIR}
PATCHES=( "${FILESDIR}"/${PN}-use-system-libs4.patch )

pkg_setup() {
	enewgroup freenet
	enewuser freenet -1 -1 /var/freenet freenet
}

src_prepare() {
	rm -rv  libs
	edos2unix src/http/pages/showfilepage.cpp
	edos2unix CMakeLists.txt

	cmake-utils_src_prepare
}

src_configure() {
	local mycmakeargs=( -DI_HAVE_READ_THE_README=ON \
		-DUSE_BUNDLED_SQLITE=OFF \
		-DDO_CHARSET_CONVERSION=ON \
		-DFROST_SUPPORT=$(use frost && echo ON || echo OFF) \
		-DFCP_SSL_SUPPORT=$(use ssl && echo ON || echo OFF) )
	cmake-utils_src_configure
}

src_install() {
	insinto /var/freenet/fms
	dobin "${CMAKE_BUILD_DIR}"/fms || die
	doins *.htm || die "doinstall failed"
	doins -r fonts images styles translations || die
	fperms -R o-rwx /var/freenet/fms/ /usr/bin/fms
	fowners -R freenet:freenet /var/freenet/fms/ /usr/bin/fms
	doinitd "${FILESDIR}/fms" || die "installing init.d file failed"
	dodoc readme.txt || die "installing doc failed"
}

pkg_postinst() {
	if ! has_version 'net-p2p/freenet' ; then
		ewarn "FMS needs a freenet node to up-/download messages."
		ewarn "Please make sure to have a node you can connect to"
		ewarn "or install net-p2p/freenet to get FMS working."
	fi
	elog "By default, the FMS NNTP server will listen on port 1119,"
	elog "and the web configuration interface will be running at"
	elog "http://localhost:8080. For more information, read"
	elog "${ROOT}usr/share/doc/${PF}/readme.txt.bz2"
	if use frost; then
		elog " "
		elog "You need to enable frost on the config page"
		elog "and restart fms for frost support."
	fi
}