Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 499174 | Differences between
and this patch

Collapse All | Expand All

(-)original/net-firewall/shorewall/files/4.5.21.6/shorewall.confd (+15 lines)
Line 0 Link Here
1
# Global start/restart/stop options
2
# 
3
OPTIONS=""
4
5
# Start options
6
# 
7
STARTOPTIONS=""
8
9
# Stop options
10
# 
11
STOPOPTIONS=""
12
13
# Restart options
14
# 
15
RESTARTOPTIONS=""
(-)original/net-firewall/shorewall/files/4.5.21.6/shorewall.initd (+107 lines)
Line 0 Link Here
1
#!/sbin/runscript
2
# Copyright 1999-2013 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
4
# $Header: $
5
6
description='The Shoreline Firewall, more commonly known as "Shorewall", is'
7
description="${description} a high-level tool for configuring Netfilter."
8
9
extra_commands="check clear"
10
extra_started_commands="refresh reset"
11
12
description_check="Checks if the configuration will compile or not."
13
14
description_clear="Clear will remove all rules and chains installed by"
15
description_clear="${description_clear} Shorewall. The firewall is then"
16
description_clear="${description_clear} wide open and unprotected."
17
18
description_refresh="The mangle table will be refreshed along with the"
19
description_refresh="${description_refresh} blacklist chain (if any)."
20
21
description_reset="All the packet and byte counters in the firewall are reset."
22
23
depend() {
24
	need net
25
	provide firewall
26
	after ulogd
27
}
28
29
status() {
30
	local _retval
31
	/sbin/shorewall status 1>/dev/null
32
	_retval=$?
33
	if [ ${_retval} = '0' ]; then
34
		einfo 'status: started'
35
		mark_service_started "${SVCNAME}"
36
		return 0
37
	else
38
		einfo 'status: stopped'	
39
		mark_service_stopped "${SVCNAME}"
40
		return 3
41
	fi
42
}
43
44
start() {
45
	ebegin "Starting shorewall"
46
	/sbin/shorewall ${OPTIONS} start ${STARTOPTIONS} 1>/dev/null
47
	eend $? 
48
}
49
50
stop() {
51
	ebegin "Stopping shorewall"
52
	/sbin/shorewall ${OPTIONS} stop ${STOPOPTIONS} 1>/dev/null
53
	eend $?
54
}
55
56
restart() {
57
	# shorewall comes with its own control script that includes a
58
	# restart function, so refrain from calling svc_stop/svc_start
59
	# here.  Note that this comment is required to fix bug 55576;
60
	# runscript.sh greps this script...  (09 Jul 2004 agriffis)
61
62
	ebegin "Restarting shorewall"
63
	/sbin/shorewall status 1>/dev/null
64
	if [ $? != 0 ] ; then
65
		svc_start
66
	else
67
		/sbin/shorewall ${OPTIONS} restart ${RESTARTOPTIONS} 1>/dev/null
68
	fi
69
	eend $?
70
}
71
72
clear() {
73
	# clear will remove all the rules and bring the system to an unfirewalled
74
	# state. (21 Nov 2004 eldad)
75
76
	ebegin "Clearing all shorewall rules and setting policy to ACCEPT"
77
	/sbin/shorewall ${OPTIONS} clear 1>/dev/null
78
	eend $?
79
}
80
81
reset() {
82
	# reset the packet and byte counters in the firewall
83
84
	ebegin "Resetting the packet and byte counters in shorewall"
85
	/sbin/shorewall ${OPTIONS} reset 1>/dev/null
86
	eend $?
87
}
88
89
refresh() {
90
	# refresh the rules involving the broadcast addresses of firewall 
91
	# interfaces, the black list, traffic control rules and 
92
	# ECN control rules
93
94
	ebegin "Refreshing shorewall rules"
95
	/sbin/shorewall ${OPTIONS} refresh 1>/dev/null
96
	eend $?
97
}
98
99
check() {
100
	# perform cursory validation of the zones, interfaces, hosts, rules
101
	# and policy files. CAUTION: does not parse and validate the generated 
102
	# iptables commands.
103
104
	ebegin "Checking shorewall configuration"
105
	/sbin/shorewall ${OPTIONS} check 1>/dev/null
106
	eend $?
107
}
(-)original/net-firewall/shorewall/files/4.5.21.6/shorewallrc (+23 lines)
Line 0 Link Here
1
#
2
# Gentoo Shorewall 4.5 rc file
3
#
4
BUILD=                                  #Default is to detect the build system
5
HOST=gentoo                             #Gentoo GNU Linux
6
PREFIX=@GENTOO_PORTAGE_EPREFIX@/usr                             #Top-level directory for shared files, libraries, etc.
7
SHAREDIR=${PREFIX}/share                #Directory for arch-neutral files.
8
LIBEXECDIR=${PREFIX}/share              #Directory for executable scripts.
9
PERLLIBDIR=${PREFIX}/share/shorewall    #Directory to install Shorewall Perl module directory
10
CONFDIR=@GENTOO_PORTAGE_EPREFIX@/etc                            #Directory where subsystem configurations are installed
11
SBINDIR=@GENTOO_PORTAGE_EPREFIX@/sbin                           #Directory where system administration programs are installed
12
MANDIR=${PREFIX}/share/man              #Directory where manpages are installed.
13
INITDIR=${CONFDIR}/init.d               #Directory where SysV init scripts are installed.
14
INITFILE=${PRODUCT}                     #Name of the product's installed SysV init script
15
INITSOURCE=init.gentoo.sh               #Name of the distributed file to be installed as the SysV init script
16
ANNOTATED=                              #If non-zero, annotated configuration files are installed
17
SYSTEMD=@GENTOO_PORTAGE_EPREFIX@/usr/lib/systemd/system         #Directory where .service files are installed (systems running systemd only)
18
SERVICEFILE=gentoo.service              #Name of the distributed file to be installed as systemd service file
19
SYSCONFFILE=default.gentoo              #Name of the distributed file to be installed in $SYSCONFDIR
20
SYSCONFDIR=${CONFDIR}/conf.d            #Directory where SysV init parameter files are installed
21
SPARSE=                                 #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR
22
VARLIB=@GENTOO_PORTAGE_EPREFIX@/var/lib                         #Directory where product variable data is stored.
23
VARDIR=${VARLIB}/${PRODUCT}             #Directory where product variable data is stored.
(-)original/net-firewall/shorewall/files/4.5.21.6/shorewall.systemd (+17 lines)
Line 0 Link Here
1
#
2
#	The Shoreline Firewall (Shorewall) Packet Filtering Firewall - V4.5
3
#
4
[Unit]
5
Description=Shorewall IPv4 firewall
6
Documentation=man:shorewall(8) http://www.shorewall.net/Documentation_Index.html
7
After=network.target
8
9
[Service]
10
Type=oneshot
11
RemainAfterExit=yes
12
EnvironmentFile=/etc/conf.d/shorewall
13
ExecStart=/sbin/shorewall $OPTIONS start $STARTOPTIONS
14
ExecStop=/sbin/shorewall $OPTIONS stop $STOPOPTIONS
15
16
[Install]
17
WantedBy=multi-user.target
(-)original/net-firewall/shorewall/shorewall-4.5.21.6.ebuild (+116 lines)
Line 0 Link Here
1
# Copyright 1999-2013 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
3
# $Header: $
4
5
EAPI="5"
6
7
inherit eutils linux-info prefix systemd versionator
8
9
MY_URL_PREFIX=
10
case ${P} in
11
	*_beta* | \
12
	*_rc*)
13
		MY_URL_PREFIX='development/'
14
		;;
15
esac
16
17
MY_PV=${PV/_rc/-RC}
18
MY_PV=${MY_PV/_beta/-Beta}
19
MY_P=${PN}-${MY_PV}
20
MY_P_DOCS=shorewall-docs-html-${MY_PV}
21
22
MY_MAJOR_RELEASE_NUMBER=$(get_version_component_range 1-2)
23
MY_MAJORMINOR_RELEASE_NUMBER=$(get_version_component_range 1-3)
24
25
DESCRIPTION='The Shoreline Firewall, commonly known as Shorewall, is'
26
DESCRIPTION+=' a high-level tool for configuring Netfilter.'
27
HOMEPAGE="http://www.shorewall.net/"
28
SRC_URI="
29
	http://www1.shorewall.net/pub/shorewall/${MY_URL_PREFIX}${MY_MAJOR_RELEASE_NUMBER}/shorewall-${MY_MAJORMINOR_RELEASE_NUMBER}/${MY_P}.tar.bz2
30
	doc? ( http://www1.shorewall.net/pub/shorewall/${MY_URL_PREFIX}${MY_MAJOR_RELEASE_NUMBER}/shorewall-${MY_MAJORMINOR_RELEASE_NUMBER}/${MY_P_DOCS}.tar.bz2 )
31
"
32
33
LICENSE="GPL-2"
34
SLOT="0"
35
KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
36
IUSE="doc"
37
38
DEPEND="
39
	>=dev-lang/perl-5.10
40
	virtual/perl-Digest-SHA
41
	=net-firewall/shorewall-core-${PVR}
42
"
43
RDEPEND="
44
	${DEPEND}
45
	>=net-firewall/iptables-1.4.20
46
	>=sys-apps/iproute2-3.8.0[-minimal]
47
	>=sys-devel/bc-1.06.95
48
"
49
50
S=${WORKDIR}/${MY_P}
51
52
pkg_pretend() {
53
	local CONFIG_CHECK="~NF_CONNTRACK ~NF_CONNTRACK_IPV4"
54
55
	local WARNING_CONNTRACK="Without NF_CONNTRACK support, you will be unable"
56
	local WARNING_CONNTRACK+=" to run ${PN} on the local system."
57
58
	local WARNING_CONNTRACK_IPV4="Without NF_CONNTRACK_IPV4 support, you will"
59
	local WARNING_CONNTRACK_IPV4+=" be unable to run ${PN} on the local system."
60
61
	check_extra_config
62
}
63
64
src_prepare() {
65
	cp "${FILESDIR}"/${PVR}/shorewallrc "${S}"/shorewallrc.gentoo || die "Copying shorewallrc failed"
66
	eprefixify "${S}"/shorewallrc.gentoo
67
68
	cp "${FILESDIR}"/${PVR}/${PN}.confd "${S}"/default.gentoo || die "Copying ${PN}.confd failed"
69
	cp "${FILESDIR}"/${PVR}/${PN}.initd "${S}"/init.gentoo.sh || die "Copying ${PN}.initd failed"
70
	cp "${FILESDIR}"/${PVR}/${PN}.systemd "${S}"/gentoo.service || die "Copying ${PN}.systemd failed"
71
72
	epatch_user
73
}
74
75
src_configure() {
76
	:;
77
}
78
79
src_compile() {
80
	:;
81
}
82
83
src_install() {
84
	keepdir /var/lib/${PN}
85
86
	DESTDIR="${D}" ./install.sh shorewallrc.gentoo || die "install.sh failed"
87
88
	dodoc changelog.txt releasenotes.txt
89
	if use doc; then
90
		dodoc -r Samples
91
		cd "${WORKDIR}"/${MY_P_DOCS}
92
		dohtml -r *
93
	fi
94
}
95
96
pkg_postinst() {
97
	if [[ -z "${REPLACING_VERSIONS}" ]]; then
98
		# This is a new installation
99
		elog "Before you can use ${PN}, you need to edit its configuration in:"
100
		elog ""
101
		elog "  ${EPREFIX}/etc/${PN}/${PN}.conf"
102
		elog ""
103
		elog "To activate ${PN} on system start, please add ${PN} to your default runlevel:"
104
		elog ""
105
		elog "  # rc-update add ${PN} default"
106
	fi
107
108
	if ! has_version ${CATEGORY}/shorewall-init; then
109
		elog ""
110
		elog "Starting with shorewall-4.5.21.2, Gentoo also offers ${CATEGORY}/shorewall-init,"
111
		elog "which we recommend to install, to protect your firewall at system boot."
112
		elog ""
113
		elog "To read more about shorewall-init, please visit"
114
		elog "  http://www.shorewall.net/Shorewall-init.html"
115
	fi
116
}
(-)original/net-firewall/shorewall6/files/4.5.21.6/shorewall6.confd (+15 lines)
Line 0 Link Here
1
# Global start/restart/stop options
2
# 
3
OPTIONS=""
4
5
# Start options
6
# 
7
STARTOPTIONS=""
8
9
# Stop options
10
# 
11
STOPOPTIONS=""
12
13
# Restart options
14
# 
15
RESTARTOPTIONS=""
(-)original/net-firewall/shorewall6/files/4.5.21.6/shorewall6.initd (+107 lines)
Line 0 Link Here
1
#!/sbin/runscript
2
# Copyright 1999-2013 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
4
# $Header: $
5
6
description='The Shoreline Firewall 6, more commonly known as "Shorewall6", is'
7
description="${description} a high-level tool for configuring Netfilter."
8
9
extra_commands="check clear"
10
extra_started_commands="refresh reset"
11
12
description_check="Checks if the configuration will compile or not."
13
14
description_clear="Clear will remove all rules and chains installed by"
15
description_clear="${description_clear} Shorewall6. The firewall is then"
16
description_clear="${description_clear} wide open and unprotected."
17
18
description_refresh="The mangle table will be refreshed along with the"
19
description_refresh="${description_refresh} blacklist chain (if any)."
20
21
description_reset="All the packet and byte counters in the firewall are reset."
22
23
depend() {
24
	need net
25
	provide firewall
26
	after ulogd
27
}
28
29
status() {
30
	local _retval
31
	/sbin/shorewall6 status 1>/dev/null
32
	_retval=$?
33
	if [ ${_retval} = '0' ]; then
34
		einfo 'status: started'
35
		mark_service_started "${SVCNAME}"
36
		return 0
37
	else
38
		einfo 'status: stopped'	
39
		mark_service_stopped "${SVCNAME}"
40
		return 3
41
	fi
42
}
43
44
start() {
45
	ebegin "Starting shorewall6"
46
	/sbin/shorewall6 ${OPTIONS} start ${STARTOPTIONS} 1>/dev/null
47
	eend $? 
48
}
49
50
stop() {
51
	ebegin "Stopping shorewall6"
52
	/sbin/shorewall6 ${OPTIONS} stop ${STOPOPTIONS} 1>/dev/null
53
	eend $?
54
}
55
56
restart() {
57
	# shorewall comes with its own control script that includes a
58
	# restart function, so refrain from calling svc_stop/svc_start
59
	# here.  Note that this comment is required to fix bug 55576;
60
	# runscript.sh greps this script...  (09 Jul 2004 agriffis)
61
62
	ebegin "Restarting shorewall6"
63
	/sbin/shorewall6 status 1>/dev/null
64
	if [ $? != 0 ] ; then
65
		svc_start
66
	else
67
		/sbin/shorewall6 ${OPTIONS} restart ${RESTARTOPTIONS} 1>/dev/null
68
	fi
69
	eend $?
70
}
71
72
clear() {
73
	# clear will remove all the rules and bring the system to an unfirewalled
74
	# state. (21 Nov 2004 eldad)
75
76
	ebegin "Clearing all shorewall rules and setting policy to ACCEPT"
77
	/sbin/shorewall6 ${OPTIONS} clear 1>/dev/null
78
	eend $?
79
}
80
81
reset() {
82
	# reset the packet and byte counters in the firewall
83
84
	ebegin "Resetting the packet and byte counters in shorewall6"
85
	/sbin/shorewall6 ${OPTIONS} reset 1>/dev/null
86
	eend $?
87
}
88
89
refresh() {
90
	# refresh the rules involving the broadcast addresses of firewall 
91
	# interfaces, the black list, traffic control rules and 
92
	# ECN control rules
93
94
	ebegin "Refreshing shorewall6 rules"
95
	/sbin/shorewall6 ${OPTIONS} refresh 1>/dev/null
96
	eend $?
97
}
98
99
check() {
100
	# perform cursory validation of the zones, interfaces, hosts, rules
101
	# and policy files. CAUTION: does not parse and validate the generated 
102
	# iptables commands.
103
104
	ebegin "Checking shorewall6 configuration"
105
	/sbin/shorewall6 ${OPTIONS} check 1>/dev/null
106
	eend $?
107
}
(-)original/net-firewall/shorewall6/files/4.5.21.6/shorewall6.systemd (+17 lines)
Line 0 Link Here
1
#
2
#	The Shoreline Firewall 6 (Shorewall6) Packet Filtering Firewall - V4.5
3
#
4
[Unit]
5
Description=Shorewall IPv6 firewall
6
Documentation=man:shorewall6(8) http://www.shorewall.net/Documentation_Index.html
7
After=network.target
8
9
[Service]
10
Type=oneshot
11
RemainAfterExit=yes
12
EnvironmentFile=/etc/conf.d/shorewall6
13
ExecStart=/sbin/shorewall6 $OPTIONS start $STARTOPTIONS
14
ExecStop=/sbin/shorewall6 $OPTIONS stop $STOPOPTIONS
15
16
[Install]
17
WantedBy=multi-user.target
(-)original/net-firewall/shorewall6/files/4.5.21.6/shorewallrc (+23 lines)
Line 0 Link Here
1
#
2
# Gentoo Shorewall 4.5 rc file
3
#
4
BUILD=                                  #Default is to detect the build system
5
HOST=gentoo                             #Gentoo GNU Linux
6
PREFIX=@GENTOO_PORTAGE_EPREFIX@/usr                             #Top-level directory for shared files, libraries, etc.
7
SHAREDIR=${PREFIX}/share                #Directory for arch-neutral files.
8
LIBEXECDIR=${PREFIX}/share              #Directory for executable scripts.
9
PERLLIBDIR=${PREFIX}/share/shorewall    #Directory to install Shorewall Perl module directory
10
CONFDIR=@GENTOO_PORTAGE_EPREFIX@/etc                            #Directory where subsystem configurations are installed
11
SBINDIR=@GENTOO_PORTAGE_EPREFIX@/sbin                           #Directory where system administration programs are installed
12
MANDIR=${PREFIX}/share/man              #Directory where manpages are installed.
13
INITDIR=${CONFDIR}/init.d               #Directory where SysV init scripts are installed.
14
INITFILE=${PRODUCT}                     #Name of the product's installed SysV init script
15
INITSOURCE=init.gentoo.sh               #Name of the distributed file to be installed as the SysV init script
16
ANNOTATED=                              #If non-zero, annotated configuration files are installed
17
SYSTEMD=@GENTOO_PORTAGE_EPREFIX@/usr/lib/systemd/system         #Directory where .service files are installed (systems running systemd only)
18
SERVICEFILE=gentoo.service              #Name of the distributed file to be installed as systemd service file
19
SYSCONFFILE=default.gentoo              #Name of the distributed file to be installed in $SYSCONFDIR
20
SYSCONFDIR=${CONFDIR}/conf.d            #Directory where SysV init parameter files are installed
21
SPARSE=                                 #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR
22
VARLIB=@GENTOO_PORTAGE_EPREFIX@/var/lib                         #Directory where product variable data is stored.
23
VARDIR=${VARLIB}/${PRODUCT}             #Directory where product variable data is stored.
(-)original/net-firewall/shorewall6/shorewall6-4.5.21.6.ebuild (+112 lines)
Line 0 Link Here
1
# Copyright 1999-2013 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
3
# $Header: $
4
5
EAPI="5"
6
7
inherit eutils linux-info prefix systemd versionator
8
9
MY_URL_PREFIX=
10
case ${P} in
11
	*_beta* | \
12
	*_rc*)
13
		MY_URL_PREFIX='development/'
14
		;;
15
esac
16
17
MY_PV=${PV/_rc/-RC}
18
MY_PV=${MY_PV/_beta/-Beta}
19
MY_P=${PN}-${MY_PV}
20
MY_P_DOCS=shorewall-docs-html-${MY_PV}
21
22
MY_MAJOR_RELEASE_NUMBER=$(get_version_component_range 1-2)
23
MY_MAJORMINOR_RELEASE_NUMBER=$(get_version_component_range 1-3)
24
25
DESCRIPTION='The Shoreline Firewall, commonly known as Shorewall,'
26
DESCRIPTION+=' IPv6 component.'
27
HOMEPAGE="http://www.shorewall.net/"
28
SRC_URI="
29
	http://www1.shorewall.net/pub/shorewall/${MY_URL_PREFIX}${MY_MAJOR_RELEASE_NUMBER}/shorewall-${MY_MAJORMINOR_RELEASE_NUMBER}/${MY_P}.tar.bz2
30
	doc? ( http://www1.shorewall.net/pub/shorewall/${MY_URL_PREFIX}${MY_MAJOR_RELEASE_NUMBER}/shorewall-${MY_MAJORMINOR_RELEASE_NUMBER}/${MY_P_DOCS}.tar.bz2 )
31
"
32
33
LICENSE="GPL-2"
34
SLOT="0"
35
KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
36
IUSE="doc"
37
38
DEPEND="=net-firewall/shorewall-${PVR}"
39
RDEPEND="
40
	${DEPEND}
41
	>=net-firewall/iptables-1.4.20[ipv6]
42
	>=sys-apps/iproute2-3.8.0[-minimal]
43
	>=dev-perl/Socket6-0.230.0
44
"
45
46
S=${WORKDIR}/${MY_P}
47
48
pkg_pretend() {
49
	local CONFIG_CHECK="~NF_CONNTRACK ~NF_CONNTRACK_IPV6"
50
51
	local WARNING_CONNTRACK="Without NF_CONNTRACK support, you will be unable"
52
	local WARNING_CONNTRACK+=" to run ${PN} on the local system."
53
54
	local WARNING_CONNTRACK_IPV6="Without NF_CONNTRACK_IPV6 support, you will"
55
	local WARNING_CONNTRACK_IPV6+=" be unable to run ${PN} on the local system."
56
57
	check_extra_config
58
}
59
60
src_prepare() {
61
	cp "${FILESDIR}"/${PVR}/shorewallrc "${S}"/shorewallrc.gentoo || die "Copying shorewallrc failed"
62
	eprefixify "${S}"/shorewallrc.gentoo
63
64
	cp "${FILESDIR}"/${PVR}/${PN}.confd "${S}"/default.gentoo || die "Copying ${PN}.confd failed"
65
	cp "${FILESDIR}"/${PVR}/${PN}.initd "${S}"/init.gentoo.sh || die "Copying ${PN}.initd failed"
66
	cp "${FILESDIR}"/${PVR}/${PN}.systemd "${S}"/gentoo.service || die "Copying ${PN}.systemd failed"
67
68
	epatch_user
69
}
70
71
src_configure() {
72
	:;
73
}
74
75
src_compile() {
76
	:;
77
}
78
79
src_install() {
80
	keepdir /var/lib/${PN}
81
82
	DESTDIR="${D}" ./install.sh shorewallrc.gentoo || die "install.sh failed"
83
84
	dodoc changelog.txt releasenotes.txt
85
	if use doc; then
86
		dodoc -r Samples6
87
		cd "${WORKDIR}"/${MY_P_DOCS}
88
		dohtml -r *
89
	fi
90
}
91
92
pkg_postinst() {
93
	if [[ -z "${REPLACING_VERSIONS}" ]]; then
94
		# This is a new installation
95
		elog "Before you can use ${PN}, you need to edit its configuration in:"
96
		elog ""
97
		elog "  ${EPREFIX}/etc/${PN}/${PN}.conf"
98
		elog ""
99
		elog "To activate ${PN} on system start, please add ${PN} to your default runlevel:"
100
		elog ""
101
		elog "  # rc-update add ${PN} default"
102
	fi
103
104
	if ! has_version ${CATEGORY}/shorewall-init; then
105
		elog ""
106
		elog "Starting with shorewall6-4.5.21.2, Gentoo also offers ${CATEGORY}/shorewall-init,"
107
		elog "which we recommend to install, to protect your firewall at system boot."
108
		elog ""
109
		elog "To read more about shorewall-init, please visit"
110
		elog "  http://www.shorewall.net/Shorewall-init.html"
111
	fi
112
}
(-)original/net-firewall/shorewall6-lite/files/4.5.21.6/shorewall6-lite.confd (+15 lines)
Line 0 Link Here
1
# Global start/restart/stop options
2
# 
3
OPTIONS=""
4
5
# Start options
6
# 
7
STARTOPTIONS=""
8
9
# Stop options
10
# 
11
STOPOPTIONS=""
12
13
# Restart options
14
# 
15
RESTARTOPTIONS=""
(-)original/net-firewall/shorewall6-lite/files/4.5.21.6/shorewall6-lite.initd (+82 lines)
Line 0 Link Here
1
#!/sbin/runscript
2
# Copyright 1999-2013 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
4
# $Header: $
5
6
description='The Shoreline Firewall 6 Lite, more commonly known as "Shorewall6 Lite", is'
7
description="${description} a high-level tool for configuring Netfilter."
8
9
extra_commands="clear"
10
extra_started_commands="reset"
11
12
description_clear="Clear will remove all rules and chains installed by"
13
description_clear="${description_clear} Shorewall6 Lite. The firewall is"
14
description_clear="${description_clear} then wide open and unprotected."
15
16
description_reset="All the packet and byte counters in the firewall are reset."
17
18
depend() {
19
	need net
20
	provide firewall
21
	after ulogd
22
}
23
24
status() {
25
	local _retval
26
	/sbin/shorewall6-lite status 1>/dev/null
27
	_retval=$?
28
	if [ ${_retval} = '0' ]; then
29
		einfo 'status: started'
30
		mark_service_started "${SVCNAME}"
31
		return 0
32
	else
33
		einfo 'status: stopped'	
34
		mark_service_stopped "${SVCNAME}"
35
		return 3
36
	fi
37
}
38
39
start() {
40
	ebegin "Starting shorewall6-lite"
41
	/sbin/shorewall6-lite ${OPTIONS} start ${STARTOPTIONS} 1>/dev/null
42
	eend $? 
43
}
44
45
stop() {
46
	ebegin "Stopping shorewall6-lite"
47
	/sbin/shorewall6-lite ${OPTIONS} stop ${STOPOPTIONS} 1>/dev/null
48
	eend $?
49
}
50
51
restart() {
52
	# shorewall comes with its own control script that includes a
53
	# restart function, so refrain from calling svc_stop/svc_start
54
	# here.  Note that this comment is required to fix bug 55576;
55
	# runscript.sh greps this script...  (09 Jul 2004 agriffis)
56
57
	ebegin "Restarting shorewall6-lite"
58
	/sbin/shorewall6-lite status 1>/dev/null
59
	if [ $? != 0 ] ; then
60
		svc_start
61
	else
62
		/sbin/shorewall6-lite ${OPTIONS} restart ${RESTARTOPTIONS} 1>/dev/null
63
	fi
64
	eend $?
65
}
66
67
clear() {
68
	# clear will remove all the rules and bring the system to an unfirewalled
69
	# state. (21 Nov 2004 eldad)
70
71
	ebegin "Clearing all shorewall6-lite rules and setting policy to ACCEPT"
72
	/sbin/shorewall6-lite ${OPTIONS} clear 1>/dev/null
73
	eend $?
74
}
75
76
reset() {
77
	# reset the packet and byte counters in the firewall
78
79
	ebegin "Resetting the packet and byte counters in shorewall6-lite"
80
	/sbin/shorewall6-lite ${OPTIONS} reset 1>/dev/null
81
	eend $?
82
}
(-)original/net-firewall/shorewall6-lite/files/4.5.21.6/shorewall6-lite.systemd (+17 lines)
Line 0 Link Here
1
#
2
#	The Shoreline Firewall 6 Lite (Shorewall6-Lite) Packet Filtering Firewall - V4.5
3
#
4
[Unit]
5
Description=Shorewall IPv6 firewall lite
6
Documentation=man:shorewall6-lite(8) http://www.shorewall.net/Documentation_Index.html
7
After=network.target
8
9
[Service]
10
Type=oneshot
11
RemainAfterExit=yes
12
EnvironmentFile=/etc/conf.d/shorewall6-lite
13
ExecStart=/sbin/shorewall6-lite $OPTIONS start $STARTOPTIONS
14
ExecStop=/sbin/shorewall6-lite $OPTIONS stop $STOPOPTIONS
15
16
[Install]
17
WantedBy=multi-user.target
(-)original/net-firewall/shorewall6-lite/files/4.5.21.6/shorewallrc (+23 lines)
Line 0 Link Here
1
#
2
# Gentoo Shorewall 4.5 rc file
3
#
4
BUILD=                                  #Default is to detect the build system
5
HOST=gentoo                             #Gentoo GNU Linux
6
PREFIX=@GENTOO_PORTAGE_EPREFIX@/usr                             #Top-level directory for shared files, libraries, etc.
7
SHAREDIR=${PREFIX}/share                #Directory for arch-neutral files.
8
LIBEXECDIR=${PREFIX}/share              #Directory for executable scripts.
9
PERLLIBDIR=${PREFIX}/share/shorewall    #Directory to install Shorewall Perl module directory
10
CONFDIR=@GENTOO_PORTAGE_EPREFIX@/etc                            #Directory where subsystem configurations are installed
11
SBINDIR=@GENTOO_PORTAGE_EPREFIX@/sbin                           #Directory where system administration programs are installed
12
MANDIR=${PREFIX}/share/man              #Directory where manpages are installed.
13
INITDIR=${CONFDIR}/init.d               #Directory where SysV init scripts are installed.
14
INITFILE=${PRODUCT}                     #Name of the product's installed SysV init script
15
INITSOURCE=init.gentoo.sh               #Name of the distributed file to be installed as the SysV init script
16
ANNOTATED=                              #If non-zero, annotated configuration files are installed
17
SYSTEMD=@GENTOO_PORTAGE_EPREFIX@/usr/lib/systemd/system         #Directory where .service files are installed (systems running systemd only)
18
SERVICEFILE=gentoo.service              #Name of the distributed file to be installed as systemd service file
19
SYSCONFFILE=default.gentoo              #Name of the distributed file to be installed in $SYSCONFDIR
20
SYSCONFDIR=${CONFDIR}/conf.d            #Directory where SysV init parameter files are installed
21
SPARSE=                                 #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR
22
VARLIB=@GENTOO_PORTAGE_EPREFIX@/var/lib                         #Directory where product variable data is stored.
23
VARDIR=${VARLIB}/${PRODUCT}             #Directory where product variable data is stored.
(-)original/net-firewall/shorewall6-lite/shorewall6-lite-4.5.21.6.ebuild (+107 lines)
Line 0 Link Here
1
# Copyright 1999-2013 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
3
# $Header: $
4
5
EAPI="5"
6
7
inherit eutils linux-info prefix systemd versionator
8
9
MY_URL_PREFIX=
10
case ${P} in
11
	*_beta* | \
12
	*_rc*)
13
		MY_URL_PREFIX='development/'
14
		;;
15
esac
16
17
MY_PV=${PV/_rc/-RC}
18
MY_PV=${MY_PV/_beta/-Beta}
19
MY_P=${PN}-${MY_PV}
20
MY_P_DOCS=shorewall-docs-html-${MY_PV}
21
22
MY_MAJOR_RELEASE_NUMBER=$(get_version_component_range 1-2)
23
MY_MAJORMINOR_RELEASE_NUMBER=$(get_version_component_range 1-3)
24
25
DESCRIPTION="An iptables-based firewall whose config is handled by a normal Shorewall6."
26
HOMEPAGE="http://www.shorewall.net/"
27
SRC_URI="
28
	http://www1.shorewall.net/pub/shorewall/${MY_URL_PREFIX}${MY_MAJOR_RELEASE_NUMBER}/shorewall-${MY_MAJORMINOR_RELEASE_NUMBER}/${MY_P}.tar.bz2
29
	doc? ( http://www1.shorewall.net/pub/shorewall/${MY_URL_PREFIX}${MY_MAJOR_RELEASE_NUMBER}/shorewall-${MY_MAJORMINOR_RELEASE_NUMBER}/${MY_P_DOCS}.tar.bz2 )
30
"
31
32
LICENSE="GPL-2"
33
SLOT="0"
34
KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
35
IUSE="doc"
36
37
DEPEND="=net-firewall/shorewall-core-${PVR}"
38
RDEPEND="
39
	${DEPEND}
40
	>=net-firewall/iptables-1.4.20[ipv6]
41
	>=sys-apps/iproute2-3.8.0[-minimal]
42
	>=dev-perl/Socket6-0.230.0
43
"
44
45
S=${WORKDIR}/${MY_P}
46
47
pkg_pretend() {
48
	local CONFIG_CHECK="~NF_CONNTRACK ~NF_CONNTRACK_IPV6"
49
50
	local ERROR_CONNTRACK="${PN} requires NF_CONNTRACK support."
51
52
	local ERROR_CONNTRACK_IPV6="${PN} requires NF_CONNTRACK_IPV6 support."
53
54
	check_extra_config
55
}
56
57
src_prepare() {
58
	cp "${FILESDIR}"/${PVR}/shorewallrc "${S}"/shorewallrc.gentoo || die "Copying shorewallrc failed"
59
	eprefixify "${S}"/shorewallrc.gentoo
60
61
	cp "${FILESDIR}"/${PVR}/${PN}.confd "${S}"/default.gentoo || die "Copying ${PN}.confd failed"
62
	cp "${FILESDIR}"/${PVR}/${PN}.initd "${S}"/init.gentoo.sh || die "Copying ${PN}.initd failed"
63
	cp "${FILESDIR}"/${PVR}/${PN}.systemd "${S}"/gentoo.service || die "Copying ${PN}.systemd failed"
64
65
	epatch_user
66
}
67
68
src_configure() {
69
	:;
70
}
71
72
src_compile() {
73
	:;
74
}
75
76
src_install() {
77
	keepdir /var/lib/${PN}
78
79
	DESTDIR="${D}" ./install.sh shorewallrc.gentoo || die "install.sh failed"
80
81
	dodoc changelog.txt releasenotes.txt
82
	if use doc; then
83
		cd "${WORKDIR}/${MY_P_DOCS}"
84
		dohtml -r *
85
	fi
86
}
87
88
pkg_postinst() {
89
	if [[ -z "${REPLACING_VERSIONS}" ]]; then
90
		# This is a new installation
91
		elog "Before you can use ${PN}, you need to provide a configuration, which you can"
92
		elog "create using ${CATEGORY}/shorewall6 (the full version, including the compiler)."
93
		elog ""
94
		elog "To activate ${PN} on system start, please add ${PN} to your default runlevel:"
95
		elog ""
96
		elog "  # rc-update add ${PN} default"
97
	fi
98
99
	if ! has_version ${CATEGORY}/shorewall-init; then
100
		elog ""
101
		elog "Starting with shorewall6-lite-4.5.21.2, Gentoo also offers ${CATEGORY}/shorewall-init,"
102
		elog "which we recommend to install, to protect your firewall at system boot."
103
		elog ""
104
		elog "To read more about shorewall-init, please visit"
105
		elog "  http://www.shorewall.net/Shorewall-init.html"
106
	fi
107
}
(-)original/net-firewall/shorewall-core/files/4.5.21.6/shorewallrc (+23 lines)
Line 0 Link Here
1
#
2
# Gentoo Shorewall 4.5 rc file
3
#
4
BUILD=                                  #Default is to detect the build system
5
HOST=gentoo                             #Gentoo GNU Linux
6
PREFIX=@GENTOO_PORTAGE_EPREFIX@/usr                             #Top-level directory for shared files, libraries, etc.
7
SHAREDIR=${PREFIX}/share                #Directory for arch-neutral files.
8
LIBEXECDIR=${PREFIX}/share              #Directory for executable scripts.
9
PERLLIBDIR=${PREFIX}/share/shorewall    #Directory to install Shorewall Perl module directory
10
CONFDIR=@GENTOO_PORTAGE_EPREFIX@/etc                            #Directory where subsystem configurations are installed
11
SBINDIR=@GENTOO_PORTAGE_EPREFIX@/sbin                           #Directory where system administration programs are installed
12
MANDIR=${PREFIX}/share/man              #Directory where manpages are installed.
13
INITDIR=${CONFDIR}/init.d               #Directory where SysV init scripts are installed.
14
INITFILE=${PRODUCT}                     #Name of the product's installed SysV init script
15
INITSOURCE=init.gentoo.sh               #Name of the distributed file to be installed as the SysV init script
16
ANNOTATED=                              #If non-zero, annotated configuration files are installed
17
SYSTEMD=@GENTOO_PORTAGE_EPREFIX@/usr/lib/systemd/system         #Directory where .service files are installed (systems running systemd only)
18
SERVICEFILE=gentoo.service              #Name of the distributed file to be installed as systemd service file
19
SYSCONFFILE=default.gentoo              #Name of the distributed file to be installed in $SYSCONFDIR
20
SYSCONFDIR=${CONFDIR}/conf.d            #Directory where SysV init parameter files are installed
21
SPARSE=                                 #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR
22
VARLIB=@GENTOO_PORTAGE_EPREFIX@/var/lib                         #Directory where product variable data is stored.
23
VARDIR=${VARLIB}/${PRODUCT}             #Directory where product variable data is stored.
(-)original/net-firewall/shorewall-core/shorewall-core-4.5.21.6.ebuild (+74 lines)
Line 0 Link Here
1
# Copyright 1999-2013 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
3
# $Header: $
4
5
EAPI="5"
6
7
inherit eutils prefix versionator
8
9
MY_URL_PREFIX=
10
case ${P} in
11
	*_beta* | \
12
	*_rc*)
13
		MY_URL_PREFIX='development/'
14
		;;
15
esac
16
17
MY_PV=${PV/_rc/-RC}
18
MY_PV=${MY_PV/_beta/-Beta}
19
MY_P=${PN}-${MY_PV}
20
21
MY_MAJOR_RELEASE_NUMBER=$(get_version_component_range 1-2)
22
MY_MAJORMINOR_RELEASE_NUMBER=$(get_version_component_range 1-3)
23
24
DESCRIPTION="Core libraries of shorewall / shorewall(6)-lite"
25
HOMEPAGE="http://www.shorewall.net/"
26
SRC_URI="http://www1.shorewall.net/pub/shorewall/${MY_URL_PREFIX}${MY_MAJOR_RELEASE_NUMBER}/shorewall-${MY_MAJORMINOR_RELEASE_NUMBER}/${MY_P}.tar.bz2"
27
28
LICENSE="GPL-2"
29
SLOT="0"
30
KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
31
IUSE="selinux"
32
33
DEPEND="
34
	>=dev-lang/perl-5.10
35
	virtual/perl-Digest-SHA
36
	!<net-firewall/shorewall-4.5.0.1
37
	selinux? ( >=sec-policy/selinux-shorewall-2.20130424-r2 )
38
"
39
RDEPEND="
40
	${DEPEND}
41
	>=net-firewall/iptables-1.4.20
42
	>=sys-apps/iproute2-3.8.0[-minimal]
43
	>=sys-devel/bc-1.06.95
44
	>=sys-apps/coreutils-8.20
45
"
46
47
DOCS=( changelog.txt releasenotes.txt )
48
49
S=${WORKDIR}/${PN}-${MY_PV}
50
51
src_prepare() {
52
	cp "${FILESDIR}"/${PVR}/shorewallrc "${S}"/shorewallrc.gentoo || die "Copying shorewallrc failed"
53
	eprefixify "${S}"/shorewallrc.gentoo
54
55
	epatch_user
56
}
57
58
src_configure() {
59
	:;
60
}
61
62
src_install() {
63
	DESTDIR="${D}" ./install.sh shorewallrc.gentoo || die "install.sh failed"
64
	default
65
}
66
67
pkg_postinst() {
68
	if ! has_version sys-apps/net-tools; then
69
		elog "It is recommended to install sys-apps/net-tools which will provide the"
70
		elog "the 'arp' utility which will give you a better 'shorewall-lite dump' output:"
71
		elog ""
72
		elog "  # emerge sys-apps/net-tools"
73
	fi
74
}
(-)original/net-firewall/shorewall-init/files/4.5.21.6/README.Gentoo.txt (+31 lines)
Line 0 Link Here
1
--- shorewall-init.old	2013-09-08 23:25:36.364924304 +0200
Line 0 Link Here
1
shorewall-init from upstream offers two features (taken from [1]):
2
3
	1. It can 'close' the firewall before the network interfaces are
4
	   brought up during boot.
5
	
6
	2. It can change the firewall state as the result of interfaces
7
	   being brought up or taken down.
8
9
On Gentoo we only support the first feature -- the firewall lockdown during
10
boot.
11
12
We do not support the second feature, because Gentoo doesn't support a
13
if-{up,down}.d folder like other distributions do. If you would want to use
14
such a feature, you would have to add a custom action to /etc/conf.d/net
15
(please refer to the Gentoo Linux Handbook [2] for more information).
16
If you are able to add your custom {pre,post}{up,down} action, your are
17
also able to specify what shorewall{6,-lite,6-lite} should do, so there is
18
no need for upstream's scripts in Gentoo.
19
20
If you disagree with us, feel free to open a bug [3] and contribute your
21
solution for Gentoo.
22
23
Upstream's original init script also supports saving and restoring of
24
ipsets. Please use the init script from net-firewall/ipset if you need
25
such a feature.
26
27
28
[1] http://www.shorewall.net/Shorewall-init.html
29
[2] http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4&chap=5
30
[3] https://bugs.gentoo.org
(-)original/net-firewall/shorewall-init/files/4.5.21.6/shorewall-init.confd (+9 lines)
Line 0 Link Here
1
# List the Shorewall products that Shorewall-init is to
2
# initialize (space-separated list).
3
#
4
# Sample: PRODUCTS="shorewall shorewall6-lite"
5
#
6
PRODUCTS=""
7
8
# Startup options - set verbosity to 0 (minimal reporting)
9
OPTIONS="-V0"
(-)original/net-firewall/shorewall-init/files/4.5.21.6/shorewall-init.initd (+196 lines)
Line 0 Link Here
1
#!/sbin/runscript
2
# Copyright 1999-2013 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
4
# $Header: $
5
6
SHOREWALLRC_FILE="@GENTOO_PORTAGE_EPREFIX@/usr/share/shorewall/shorewallrc"
7
CONFIG_FILE="@GENTOO_PORTAGE_EPREFIX@/etc/conf.d/${SVCNAME}"
8
9
description="Puts Shorewall in a safe state at boot time"
10
description="${description} prior to bringing up the network."
11
12
required_files="$SHOREWALLRC_FILE"
13
14
depend() {
15
	need localmount
16
	before net
17
	after bootmisc ipset tmpfiles.setup ulogd
18
}
19
20
21
. $SHOREWALLRC_FILE
22
23
checkconfig() {
24
	local PRODUCT=
25
	
26
	if [ -z "${VARLIB}" ]; then
27
		eerror "\"VARLIB\" isn't defined or empty! Please check" \
28
			"\"${SHOREWALLRC_FILE}\"."
29
		
30
		
31
		return 1
32
	fi
33
	
34
	if [ -z "${PRODUCTS}" ]; then
35
		eerror "${SVCNAME} isn't configured! Please check" \
36
			"\"${CONFIG_FILE}\"."
37
		
38
		
39
		return 1
40
	fi
41
	
42
	for PRODUCT in ${PRODUCTS}; do
43
		if [ ! -x ${SBINDIR}/${PRODUCT} ]; then
44
			eerror "Invalid product \"${PRODUCT}\" specified" \
45
				"in \"${CONFIG_FILE}\"!"
46
			eerror "Maybe \"${PRODUCT}\" isn't installed?"
47
			
48
			
49
			return 1
50
		fi
51
	done
52
	
53
	
54
	return 0
55
}
56
57
check_firewall_script() {
58
	if [ ! -x ${STATEDIR}/firewall ]; then
59
		if [ ${PRODUCT} = shorewall -o ${PRODUCT} = shorewall6 ]; then
60
			ebegin "Creating \"${STATEDIR}/firewall\""
61
			${SBINDIR}/${PRODUCT} compile 1>/dev/null
62
			eend $?
63
		else
64
			eerror "\"${PRODUCT}\" isn't configured!"
65
			eerror "Please go to your 'administrative system'" \
66
				"and deploy the compiled firewall" \
67
				"configuration for this system."
68
			
69
			
70
			return 1
71
		fi
72
	fi
73
	
74
	
75
	return 0
76
}
77
78
is_allowed_to_be_executed() {
79
	# This is not a real service. shorewall-init is an intermediate
80
	# script to put your Shorewall-based firewall into a safe state
81
	# at boot time prior to bringing up the network.
82
	# Please read /usr/share/doc/shorewall-init-*/README.gentoo.gz
83
	# for more information.
84
	# When your system is up, there is no need to call shorewall-init.
85
	# Please call shorewall{,6,-lite,6-lite} directly. That's the
86
	# reason why we are preventing start, stop or restart here.
87
	
88
	local PRODUCT=
89
	
90
	if [ "${RC_RUNLEVEL}" != "boot" -a "${RC_CMD}" = "start" ]; then
91
		# Starting shorewall-init is only allowed at boot time
92
		eerror "This is a boot service, which can only be started" \
93
			"at boot."
94
		eerror "If you want to get your shorewall-based firewall" \
95
			"into the same safe boot state again, run"
96
		eerror ""
97
		eindent
98
		for PRODUCT in ${PRODUCTS}; do
99
			eerror "/etc/init.d/${PRODUCT} stop"
100
		done
101
		eoutdent
102
		eerror ""
103
		eerror "Yes, \"stop\" and not start."
104
		eerror ""
105
		return 1
106
	fi
107
	
108
	if [ "${RC_RUNLEVEL}" != "shutdown" -a "${RC_CMD}" = "stop" ]; then
109
		# Stopping shorewall-init is only allowed at shutdown
110
		eerror "This is a boot service, which cannot be stopped."
111
		eerror "If you really want to stop your Shorewall-based" \
112
			"firewall the same way this service would stop" \
113
			"Shorewall at shutdown, please run"
114
		eerror ""
115
		eindent
116
		for PRODUCT in ${PRODUCTS}; do
117
			eerror "/etc/init.d/${PRODUCT} clear"
118
		done
119
		eoutdent
120
		eerror ""
121
		eerror "Keep in mind that this will clear (=bring down)" \
122
			"your firewall!"
123
		eerror ""
124
		return 1
125
	fi
126
	
127
	if [ "${RC_CMD}" = "restart" ]; then
128
		eerror "This is a boot service, which cannot be restarted."
129
		eerror "If you want to restart any of your Shorewall-based" \
130
			"firewalls, run"
131
		eerror ""
132
		eindent
133
		for PRODUCT in ${PRODUCTS}; do
134
			eerror "/etc/init.d/${PRODUCT} restart"
135
		done
136
		eoutdent
137
		eerror ""
138
		return 1
139
	fi
140
	
141
	
142
	return 0
143
}
144
145
set_statedir() {
146
	STATEDIR=
147
	local VARDIR=
148
	
149
	if [ -f ${CONFDIR}/${PRODUCT}/vardir ]; then
150
		STATEDIR=$( . ${CONFDIR}/${PRODUCT}/vardir && echo ${VARDIR} )
151
	fi
152
	
153
	[ ! -n "${STATEDIR}" ] && STATEDIR=${VARLIB}/${PRODUCT}
154
}
155
156
start_pre() {
157
	checkconfig || return 1
158
	
159
	is_allowed_to_be_executed || return 1
160
}
161
162
start() {
163
	local PRODUCT=
164
	local STATEDIR=
165
	
166
	for PRODUCT in ${PRODUCTS}; do
167
		set_statedir
168
		
169
		check_firewall_script || return 1
170
		
171
		ebegin "Initializing \"${PRODUCT}\""
172
		${STATEDIR}/firewall stop 1>/dev/null
173
		eend $?
174
	done
175
}
176
177
stop_pre() {
178
	checkconfig || return 1
179
	
180
	is_allowed_to_be_executed || return 1
181
}
182
183
stop() {
184
	local PRODUCT=
185
	local STATEDIR=
186
	
187
	for PRODUCT in ${PRODUCTS}; do
188
		set_statedir
189
		
190
		check_firewall_script || return 1
191
		
192
		ebegin "Clearing \"${PRODUCT}\""
193
		${STATEDIR}/firewall clear 1>/dev/null
194
		eend $?
195
	done
196
}
(-)original/net-firewall/shorewall-init/files/4.5.21.6/shorewall-init.systemd (+16 lines)
Line 0 Link Here
1
#
2
#	The Shoreline Firewall (Shorewall) Packet Filtering Firewall - V4.5
3
#
4
[Unit]
5
Description=shorewall-init
6
Documentation=http://www.shorewall.net/Shorewall-init.html
7
Before=network.target
8
9
[Service]
10
Type=oneshot
11
RemainAfterExit=yes
12
ExecStart=/sbin/shorewall-init start
13
ExecStop=/sbin/shorewall-init stop
14
15
[Install]
16
WantedBy=multi-user.target
(-)original/net-firewall/shorewall-init/files/4.5.21.6/shorewallrc (+23 lines)
Line 0 Link Here
1
#
2
# Gentoo Shorewall 4.5 rc file
3
#
4
BUILD=                                  #Default is to detect the build system
5
HOST=gentoo                             #Gentoo GNU Linux
6
PREFIX=@GENTOO_PORTAGE_EPREFIX@/usr                             #Top-level directory for shared files, libraries, etc.
7
SHAREDIR=${PREFIX}/share                #Directory for arch-neutral files.
8
LIBEXECDIR=${PREFIX}/share              #Directory for executable scripts.
9
PERLLIBDIR=${PREFIX}/share/shorewall    #Directory to install Shorewall Perl module directory
10
CONFDIR=@GENTOO_PORTAGE_EPREFIX@/etc                            #Directory where subsystem configurations are installed
11
SBINDIR=@GENTOO_PORTAGE_EPREFIX@/sbin                           #Directory where system administration programs are installed
12
MANDIR=${PREFIX}/share/man              #Directory where manpages are installed.
13
INITDIR=${CONFDIR}/init.d               #Directory where SysV init scripts are installed.
14
INITFILE=${PRODUCT}                     #Name of the product's installed SysV init script
15
INITSOURCE=init.gentoo.sh               #Name of the distributed file to be installed as the SysV init script
16
ANNOTATED=                              #If non-zero, annotated configuration files are installed
17
SYSTEMD=@GENTOO_PORTAGE_EPREFIX@/usr/lib/systemd/system         #Directory where .service files are installed (systems running systemd only)
18
SERVICEFILE=gentoo.service              #Name of the distributed file to be installed as systemd service file
19
SYSCONFFILE=default.gentoo              #Name of the distributed file to be installed in $SYSCONFDIR
20
SYSCONFDIR=${CONFDIR}/conf.d            #Directory where SysV init parameter files are installed
21
SPARSE=                                 #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR
22
VARLIB=@GENTOO_PORTAGE_EPREFIX@/var/lib                         #Directory where product variable data is stored.
23
VARDIR=${VARLIB}/${PRODUCT}             #Directory where product variable data is stored.
(-)original/net-firewall/shorewall-init/shorewall-init-4.5.21.6.ebuild (+104 lines)
Line 0 Link Here
1
# Copyright 1999-2013 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
3
# $Header: $
4
5
EAPI="5"
6
7
inherit eutils versionator prefix
8
9
MY_URL_PREFIX=
10
case ${P} in
11
	*_beta* | \
12
	*_rc*)
13
		MY_URL_PREFIX='development/'
14
		;;
15
esac
16
17
MY_PV=${PV/_rc/-RC}
18
MY_PV=${MY_PV/_beta/-Beta}
19
MY_P=${PN}-${MY_PV}
20
21
MY_MAJOR_RELEASE_NUMBER=$(get_version_component_range 1-2)
22
MY_MAJORMINOR_RELEASE_NUMBER=$(get_version_component_range 1-3)
23
24
DESCRIPTION="Component to secure a Shorewall-protected system at boot time prior to bringing up the network."
25
HOMEPAGE="http://www.shorewall.net/"
26
SRC_URI="http://www1.shorewall.net/pub/shorewall/${MY_URL_PREFIX}${MY_MAJOR_RELEASE_NUMBER}/shorewall-${MY_MAJORMINOR_RELEASE_NUMBER}/${MY_P}.tar.bz2"
27
28
LICENSE="GPL-2"
29
SLOT="0"
30
KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
31
IUSE=""
32
33
DEPEND=">=sys-apps/coreutils-8.20"
34
RDEPEND="
35
	${DEPEND}
36
	|| ( =net-firewall/shorewall-${PVR} =net-firewall/shorewall6-${PVR} =net-firewall/shorewall-lite-${PVR} =net-firewall/shorewall6-lite-${PVR} )
37
"
38
39
S=${WORKDIR}/${MY_P}
40
41
src_prepare() {
42
	cp "${FILESDIR}"/${PVR}/shorewallrc "${S}"/shorewallrc.gentoo || die "Copying shorewallrc failed"
43
	eprefixify "${S}"/shorewallrc.gentoo
44
45
	cp "${FILESDIR}"/${PVR}/${PN}.confd "${S}"/default.gentoo || die "Copying ${PN}.confd failed"
46
47
	cp "${FILESDIR}"/${PVR}/${PN}.initd "${S}"/init.gentoo.sh || die "Copying ${PN}.initd failed"
48
	eprefixify "${S}"/init.gentoo.sh
49
50
	cp "${FILESDIR}"/${PVR}/${PN}.systemd "${S}"/gentoo.service || die "Copying ${PN}.systemd failed"
51
52
	epatch "${FILESDIR}"/${PVR}/01_Remove-ipset-functionality.patch
53
	epatch_user
54
}
55
56
src_configure() {
57
	:;
58
}
59
60
src_compile() {
61
	:;
62
}
63
64
src_install() {
65
	DESTDIR="${D}" ./install.sh shorewallrc.gentoo || die "install.sh failed"
66
67
	if [ -d "${D}/etc/logrotate.d" ]; then
68
		# On Gentoo, shorewall-init will not create shorewall-ifupdown.log,
69
		# so we don't need a logrotate folder at all
70
		rm -rf "${D}"/etc/logrotate.d
71
	fi
72
73
	if [ -d "${D}/etc/NetworkManager" ]; then
74
		# On Gentoo, we don't support NetworkManager
75
		# so we don't need these folder at all
76
		rm -rf "${D}"/etc/NetworkManager
77
	fi
78
79
	if [ -f "${D}/usr/share/shorewall-init/ifupdown" ]; then
80
		# This script won't work on Gentoo
81
		rm -rf "${D}"/usr/share/shorewall-init/ifupdown
82
	fi
83
84
	dodoc "${FILESDIR}"/${PVR}/README.Gentoo.txt
85
}
86
87
pkg_postinst() {
88
	if [[ -z "${REPLACING_VERSIONS}" ]]; then
89
		# This is a new installation
90
		elog "Before you can use ${PN}, you need to edit its configuration in:"
91
		elog ""
92
		elog "  ${EPREFIX}/etc/conf.d/${PN}"
93
		elog ""
94
		elog "To use ${PN}, please add ${PN} to your boot runlevel:"
95
		elog ""
96
		elog "  # rc-update add ${PN} boot"
97
		elog ""
98
		ewarn "Notice:"
99
		ewarn "${PN} is more like a start script than a service."
100
		ewarn "Therefore you cannot start or stop ${PN} at default runlevel."
101
		ewarn ""
102
		ewarn "For more information read ${EPREFIX}/usr/share/doc/${PF}/README.Gentoo.txt.bz2"
103
	fi
104
}
(-)original/net-firewall/shorewall-lite/files/4.5.21.6/shorewall-lite.confd (+15 lines)
Line 0 Link Here
1
# Global start/restart/stop options
2
# 
3
OPTIONS=""
4
5
# Start options
6
# 
7
STARTOPTIONS=""
8
9
# Stop options
10
# 
11
STOPOPTIONS=""
12
13
# Restart options
14
# 
15
RESTARTOPTIONS=""
(-)original/net-firewall/shorewall-lite/files/4.5.21.6/shorewall-lite.initd (+82 lines)
Line 0 Link Here
1
#!/sbin/runscript
2
# Copyright 1999-2013 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
4
# $Header: $
5
6
description='The Shoreline Firewall Lite, more commonly known as "Shorewall Lite", is'
7
description="${description} a high-level tool for configuring Netfilter."
8
9
extra_commands="clear"
10
extra_started_commands="reset"
11
12
description_clear="Clear will remove all rules and chains installed by"
13
description_clear="${description_clear} Shorewall Lite. The firewall is"
14
description_clear="${description_clear} then wide open and unprotected."
15
16
description_reset="All the packet and byte counters in the firewall are reset."
17
18
depend() {
19
	need net
20
	provide firewall
21
	after ulogd
22
}
23
24
status() {
25
	local _retval
26
	/sbin/shorewall-lite status 1>/dev/null
27
	_retval=$?
28
	if [ ${_retval} = '0' ]; then
29
		einfo 'status: started'
30
		mark_service_started "${SVCNAME}"
31
		return 0
32
	else
33
		einfo 'status: stopped'	
34
		mark_service_stopped "${SVCNAME}"
35
		return 3
36
	fi
37
}
38
39
start() {
40
	ebegin "Starting shorewall-lite"
41
	/sbin/shorewall-lite ${OPTIONS} start ${STARTOPTIONS} 1>/dev/null
42
	eend $? 
43
}
44
45
stop() {
46
	ebegin "Stopping shorewall-lite"
47
	/sbin/shorewall-lite ${OPTIONS} stop ${STOPOPTIONS} 1>/dev/null
48
	eend $?
49
}
50
51
restart() {
52
	# shorewall comes with its own control script that includes a
53
	# restart function, so refrain from calling svc_stop/svc_start
54
	# here.  Note that this comment is required to fix bug 55576;
55
	# runscript.sh greps this script...  (09 Jul 2004 agriffis)
56
57
	ebegin "Restarting shorewall-lite"
58
	/sbin/shorewall-lite status 1>/dev/null
59
	if [ $? != 0 ] ; then
60
		svc_start
61
	else
62
		/sbin/shorewall-lite ${OPTIONS} restart ${RESTARTOPTIONS} 1>/dev/null
63
	fi
64
	eend $?
65
}
66
67
clear() {
68
	# clear will remove all the rules and bring the system to an unfirewalled
69
	# state. (21 Nov 2004 eldad)
70
71
	ebegin "Clearing all shorewall-lite rules and setting policy to ACCEPT"
72
	/sbin/shorewall-lite ${OPTIONS} clear 1>/dev/null
73
	eend $?
74
}
75
76
reset() {
77
	# reset the packet and byte counters in the firewall
78
79
	ebegin "Resetting the packet and byte counters in shorewall-lite"
80
	/sbin/shorewall-lite ${OPTIONS} reset 1>/dev/null
81
	eend $?
82
}
(-)original/net-firewall/shorewall-lite/files/4.5.21.6/shorewall-lite.systemd (+17 lines)
Line 0 Link Here
1
#
2
#	The Shoreline Firewall Lite (Shorewall-Lite) Packet Filtering Firewall - V4.5
3
#
4
[Unit]
5
Description=Shorewall IPv4 firewall lite
6
Documentation=man:shorewall-lite(8) http://www.shorewall.net/Documentation_Index.html
7
After=network.target
8
9
[Service]
10
Type=oneshot
11
RemainAfterExit=yes
12
EnvironmentFile=/etc/conf.d/shorewall-lite
13
ExecStart=/sbin/shorewall-lite $OPTIONS start $STARTOPTIONS
14
ExecStop=/sbin/shorewall-lite $OPTIONS stop $STOPOPTIONS
15
16
[Install]
17
WantedBy=multi-user.target
(-)original/net-firewall/shorewall-lite/files/4.5.21.6/shorewallrc (+23 lines)
Line 0 Link Here
1
#
2
# Gentoo Shorewall 4.5 rc file
3
#
4
BUILD=                                  #Default is to detect the build system
5
HOST=gentoo                             #Gentoo GNU Linux
6
PREFIX=@GENTOO_PORTAGE_EPREFIX@/usr                             #Top-level directory for shared files, libraries, etc.
7
SHAREDIR=${PREFIX}/share                #Directory for arch-neutral files.
8
LIBEXECDIR=${PREFIX}/share              #Directory for executable scripts.
9
PERLLIBDIR=${PREFIX}/share/shorewall    #Directory to install Shorewall Perl module directory
10
CONFDIR=@GENTOO_PORTAGE_EPREFIX@/etc                            #Directory where subsystem configurations are installed
11
SBINDIR=@GENTOO_PORTAGE_EPREFIX@/sbin                           #Directory where system administration programs are installed
12
MANDIR=${PREFIX}/share/man              #Directory where manpages are installed.
13
INITDIR=${CONFDIR}/init.d               #Directory where SysV init scripts are installed.
14
INITFILE=${PRODUCT}                     #Name of the product's installed SysV init script
15
INITSOURCE=init.gentoo.sh               #Name of the distributed file to be installed as the SysV init script
16
ANNOTATED=                              #If non-zero, annotated configuration files are installed
17
SYSTEMD=@GENTOO_PORTAGE_EPREFIX@/usr/lib/systemd/system         #Directory where .service files are installed (systems running systemd only)
18
SERVICEFILE=gentoo.service              #Name of the distributed file to be installed as systemd service file
19
SYSCONFFILE=default.gentoo              #Name of the distributed file to be installed in $SYSCONFDIR
20
SYSCONFDIR=${CONFDIR}/conf.d            #Directory where SysV init parameter files are installed
21
SPARSE=                                 #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR
22
VARLIB=@GENTOO_PORTAGE_EPREFIX@/var/lib                         #Directory where product variable data is stored.
23
VARDIR=${VARLIB}/${PRODUCT}             #Directory where product variable data is stored.
(-)original/net-firewall/shorewall-lite/shorewall-lite-4.5.21.6.ebuild (+106 lines)
Line 0 Link Here
1
# Copyright 1999-2013 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
3
# $Header: $
4
5
EAPI="5"
6
7
inherit eutils linux-info prefix systemd versionator
8
9
MY_URL_PREFIX=
10
case ${P} in
11
	*_beta* | \
12
	*_rc*)
13
		MY_URL_PREFIX='development/'
14
		;;
15
esac
16
17
MY_PV=${PV/_rc/-RC}
18
MY_PV=${MY_PV/_beta/-Beta}
19
MY_P=${PN}-${MY_PV}
20
MY_P_DOCS=shorewall-docs-html-${MY_PV}
21
22
MY_MAJOR_RELEASE_NUMBER=$(get_version_component_range 1-2)
23
MY_MAJORMINOR_RELEASE_NUMBER=$(get_version_component_range 1-3)
24
25
DESCRIPTION="An iptables-based firewall whose config is handled by a normal Shorewall."
26
HOMEPAGE="http://www.shorewall.net/"
27
SRC_URI="
28
	http://www1.shorewall.net/pub/shorewall/${MY_URL_PREFIX}${MY_MAJOR_RELEASE_NUMBER}/shorewall-${MY_MAJORMINOR_RELEASE_NUMBER}/${MY_P}.tar.bz2
29
	doc? ( http://www1.shorewall.net/pub/shorewall/${MY_URL_PREFIX}${MY_MAJOR_RELEASE_NUMBER}/shorewall-${MY_MAJORMINOR_RELEASE_NUMBER}/${MY_P_DOCS}.tar.bz2 )
30
"
31
32
LICENSE="GPL-2"
33
SLOT="0"
34
KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
35
IUSE="doc"
36
37
DEPEND="=net-firewall/shorewall-core-${PVR}"
38
RDEPEND="
39
	${DEPEND}
40
	>=net-firewall/iptables-1.4.20
41
	>=sys-apps/iproute2-3.8.0[-minimal]
42
"
43
44
S=${WORKDIR}/${MY_P}
45
46
pkg_pretend() {
47
	local CONFIG_CHECK="~NF_CONNTRACK ~NF_CONNTRACK_IPV4"
48
49
	local ERROR_CONNTRACK="${PN} requires NF_CONNTRACK support."
50
51
	local ERROR_CONNTRACK_IPV4="${PN} requires NF_CONNTRACK_IPV4 support."
52
53
	check_extra_config
54
}
55
56
src_prepare() {
57
	cp "${FILESDIR}"/${PVR}/shorewallrc "${S}"/shorewallrc.gentoo || die "Copying shorewallrc failed"
58
	eprefixify "${S}"/shorewallrc.gentoo
59
60
	cp "${FILESDIR}"/${PVR}/${PN}.confd "${S}"/default.gentoo || die "Copying ${PN}.confd failed"
61
	cp "${FILESDIR}"/${PVR}/${PN}.initd "${S}"/init.gentoo.sh || die "Copying ${PN}.initd failed"
62
	cp "${FILESDIR}"/${PVR}/${PN}.systemd "${S}"/gentoo.service || die "Copying ${PN}.systemd failed"
63
64
	epatch_user
65
}
66
67
src_configure() {
68
	:;
69
}
70
71
src_compile() {
72
	:;
73
}
74
75
src_install() {
76
	keepdir /var/lib/${PN}
77
78
	DESTDIR="${D}" ./install.sh shorewallrc.gentoo || die "install.sh failed"
79
80
	dodoc changelog.txt releasenotes.txt
81
	if use doc; then
82
		cd "${WORKDIR}/${MY_P_DOCS}"
83
		dohtml -r *
84
	fi
85
}
86
87
pkg_postinst() {
88
	if [[ -z "${REPLACING_VERSIONS}" ]]; then
89
		# This is a new installation
90
		elog "Before you can use ${PN}, you need to provide a configuration, which you can"
91
		elog "create using ${CATEGORY}/shorewall (the full version, including the compiler)."
92
		elog ""
93
		elog "To activate ${PN} on system start, please add ${PN} to your default runlevel:"
94
		elog ""
95
		elog "  # rc-update add ${PN} default"
96
	fi
97
98
	if ! has_version ${CATEGORY}/shorewall-init; then
99
		elog ""
100
		elog "Starting with shorewall-lite-4.5.21.2, Gentoo also offers ${CATEGORY}/shorewall-init,"
101
		elog "which we recommend to install, to protect your firewall at system boot."
102
		elog ""
103
		elog "To read more about shorewall-init, please visit"
104
		elog "  http://www.shorewall.net/Shorewall-init.html"
105
	fi
106
}

Return to bug 499174