summaryrefslogtreecommitdiff
path: root/net-misc/fax/fax-0.2.2.ebuild
blob: afbc6d4ba15bbaa99f41169ddcd220c9e14da211 (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
EAPI=8

inherit cmake

DESCRIPTION="faxd: the fax API, sender and web portal for fax.trunkmasters.com"
HOMEPAGE="https://trunkmasters.com/fax"
SRC_URI="https://www.hedronfire.com/distfiles/${P}.tar.gz"

# The application carries no grant of an open-source license.
LICENSE="all-rights-reserved"
SLOT="0"
KEYWORDS="~amd64"
RESTRICT="mirror bindist"

DEPEND="
	=dev-libs/boost-1.91.0*
	=dev-libs/openssl-3.6.5*
	=dev-db/postgresql-18.6*
	=dev-cpp/nlohmann_json-3.12.0*
	sys-libs/libxcrypt
"
# It runs as the existing `fax` account (on Alpha it predates any acct package), and calls
# Ghostscript, tiff2pdf/tiffinfo, ImageMagick, unzip and sendmail.
RDEPEND="${DEPEND}
	app-text/ghostscript-gpl
	media-libs/tiff
	media-gfx/imagemagick
	app-arch/unzip
	virtual/mta
"
BDEPEND="
	=dev-cpp/catch-3.15.3*
"

src_configure() {
	# The project refuses in-source builds and requires an absolute build root.
	export FAX_BUILD_ROOT="${WORKDIR}/build"
	local mycmakeargs=( -DFAX_SANITIZER=none )
	cmake_src_configure
}

src_test() {
	# The parity suite needs root, PostgreSQL and the Rust reference binary; it runs outside the
	# Portage sandbox (README, "Build and test").
	cmake_src_test -R '^unit$'
}

src_install() {
	cmake_src_install
	newinitd "${ED}"/usr/share/fax/openrc/fax.initd fax
	newconfd "${ED}"/usr/share/fax/openrc/fax.confd fax
	# It holds AMI_SECRET and FAX_SESSION_SECRET once filled in.
	fperms 0600 /etc/conf.d/fax
	# Its own directory: /var/lib/fax is the Python service's old one, left as it is.
	keepdir /var/lib/faxd/bus-outbox
	fowners -R fax:fax /var/lib/faxd
	fperms 0750 /var/lib/faxd /var/lib/faxd/bus-outbox
}

pkg_postinst() {
	elog "faxd runs as fax with the settings in /etc/conf.d/fax, on /run/fax/fax.sock and"
	elog "/run/fax/web.sock, against the fax database and /var/spool/fax, as the Rust daemon did."
	elog "An existing /etc/init.d/fax and /etc/conf.d/fax are kept (CONFIG_PROTECT): merge the"
	elog "new init script at the switch."
}