summaryrefslogtreecommitdiff
blob: e79ad35d10da9ec4fe4a47e08aded3c665e68190 (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
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI="7"

inherit flag-o-matic linux-info systemd toolchain-funcs

COMMIT="1eedfbc9b318372efd119fd17f4abdbde561a53d"
S="${WORKDIR}/${PN}-${COMMIT}"

DESCRIPTION="inotify based cron daemon"
HOMEPAGE="https://incron.aiken.cz/"
SRC_URI="https://github.com/ar-/incron/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"

LICENSE="GPL-2 LGPL-2.1"
SLOT="0"
KEYWORDS="amd64 ~arm64 ppc x86"
IUSE=""

DEPEND=""
RDEPEND=""

PATCHES=(
	"${FILESDIR}"/${PN}-0.5.12-use-execl-instead-system.patch
	"${FILESDIR}"/${PN}-0.5.12-issue25.patch
)

# < 2.6.18 => INOTIFY, >= 2.6.18 => INOTIFY_USER
# It should be ok to expect at least 2.6.18
CONFIG_CHECK="~INOTIFY_USER"

src_prepare() {
	default

	sed -i \
		-e '/$(INSTALL) -m 0644 incron.conf $(DESTDIR)$(INITDIR)/d' \
		Makefile \
		|| die
}

src_compile() {
	# code is not C++17 ready
	append-cxxflags -std=c++14

	emake CXX=$(tc-getCXX)
}

src_install() {
	emake DESTDIR="${D}" PREFIX=/usr DOCDIR=/usr/share/doc/${PF} install

	newinitd "${FILESDIR}/incrond-r1.init" incrond
	newconfd "${FILESDIR}/incrond.conf" incrond
	systemd_dounit "${FILESDIR}/incrond.service"

	dodoc CHANGELOG README TODO

	insinto /etc
	doins "${FILESDIR}"/incron.conf
	touch \
		"${D}/etc/incron.allow" \
		"${D}/etc/incron.deny" \
		|| die

	keepdir /var/spool/${PN}
}