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

EAPI=8

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 ~riscv x86"

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

DOCS=( CHANGELOG README TODO )

# < 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="${ED}" PREFIX=/usr DOCDIR=/usr/share/doc/${PF} install
	einstalldocs

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

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

	keepdir /etc/${PN}.d
	keepdir /var/spool/${PN}
}