summaryrefslogtreecommitdiff
path: root/sys-apps/multiconfig/multiconfig-0.1.1-r2.ebuild
blob: d10c35b678ccf9456a3d7e910192ef282c7e9c4e (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
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=6

VER="${PV%-r*}"

DESCRIPTION="Multiple configuration system"
HOMEPAGE="http://git.cynerd.cz/multiconfig/"
SRC_URI="http://git.cynerd.cz/multiconfig/snapshot/multiconfig-${VER}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/multiconfig-${VER}"

LICENSE="GPL-3.0+"
SLOT="0"
KEYWORDS="amd64 x86"
IUSE="bridge firewall openvpn"

DEPEND="bridge? ( net-misc/dhcp )
        firewall? ( net-firewall/iptables )
        openvpn? ( net-vpn/openvpn )
"
RDEPEND="${DEPEND}"

src_install() {
	dodir /usr/sbin
	exeinto /usr/sbin
	doexe "${S}/multiconfig.sh"
	dodir /usr/lib/multiconfig
	touch "${D}"/usr/lib/multiconfig/.keep
	# TODO cron

	if use bridge; then
		doinitd "${S}/bridge/init/bridge"
		doinitd "${S}/bridge/init/bridge-dhcp"

		dodir /etc/dhcp
		insinto /etc/dhcp
		newins "${S}/bridge/dhcpd.conf" "bridge_dhcpd.conf"

		dodir /etc/sysctl.d
		insinto /etc/sysctl.d
		newins "${S}/bridge/sysctl.conf" "bridge.conf"
	fi

	if use firewall; then
		cp "${S}/firewall/multiconfig.sh" "${D}/usr/lib/multiconfig/firewall.sh"
	fi

	if use openvpn; then
		cp "${S}/openvpn/multiconfig.sh" "${D}/usr/lib/multiconfig/openvpn.sh"
		# TODO
	fi
}