summaryrefslogtreecommitdiff
path: root/www-apps/sms/sms-0.3.0.ebuild
blob: 9a5c22d29fc0505fc1b2b599336d79d73caabb17 (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
EAPI=8

inherit cmake

DESCRIPTION="SMS web service for txt.trunkmasters.com, and smsd, the send daemon"
HOMEPAGE="https://trunkmasters.com/sms"
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 `sms` and `smsd` accounts (on Alpha they predate any acct package).
RDEPEND="${DEPEND}"
BDEPEND="
	=dev-cpp/catch-3.15.3*
	>=dev-lang/python-3.11
"

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

src_test() {
	# The parity and cross-implementation suites (sms and smsd) need root, PostgreSQL and the
	# archived Rust binaries; they run outside the Portage sandbox (README, "Build and test").
	cmake_src_test -R '^unit$'
}

src_install() {
	cmake_src_install
	newinitd "${ED}"/usr/share/sms/openrc/sms.initd sms
	newconfd "${ED}"/usr/share/sms/openrc/sms.confd sms
	newinitd "${ED}"/usr/share/sms/openrc/smsd.initd smsd
	newconfd "${ED}"/usr/share/sms/openrc/smsd.confd smsd
}

pkg_postinst() {
	elog "Before the first start, as the sms account: sms --migrate sms adds the table"
	elog "sms_provider_sends, or renames sms-cpp 0.1's sms_cpp_provider_sends, keeping its rows."
	elog "The service runs in /srv/sms (for .env) and listens on /run/sms/sms.sock; Apache serves"
	elog "/usr/share/sms/public."
	elog "smsd runs as smsd in /var/spool/smsd, reads /etc/smsd/smsd.conf and listens on"
	elog "/run/smsd/smsd.sock. It takes over the Rust daemon's spool and dedup.json as they are."
}