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.7/shorewall.confd (+20 lines)
Line 0 Link Here
1
This patch will update the version number in the release notes.
2
3
See http://thread.gmane.org/gmane.comp.security.shorewall/30808
4
5
--- shorewall-4.5.21.7.old/releasenotes.txt	2014-03-08 16:35:39.000000000 +0100
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.7/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.7/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.7/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/metadata.xml (+10 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
3
<pkgmetadata>
4
	<herd>netmon</herd>
5
	<herd>proxy-maintainers</herd>
6
	<maintainer>
7
		<email>whissi@whissi.de</email>
8
		<name>Thomas D. (Whissi)</name>
9
	</maintainer>
10
</pkgmetadata>
(-)original/net-firewall/shorewall/shorewall-4.5.21.7.ebuild (+118 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
	epatch "${FILESDIR}"/${PVR}/10-releasenotes.patch
66
67
	cp "${FILESDIR}"/${PVR}/shorewallrc "${S}"/shorewallrc.gentoo || die "Copying shorewallrc failed"
68
	eprefixify "${S}"/shorewallrc.gentoo
69
70
	cp "${FILESDIR}"/${PVR}/${PN}.confd "${S}"/default.gentoo || die "Copying ${PN}.confd failed"
71
	cp "${FILESDIR}"/${PVR}/${PN}.initd "${S}"/init.gentoo.sh || die "Copying ${PN}.initd failed"
72
	cp "${FILESDIR}"/${PVR}/${PN}.systemd "${S}"/gentoo.service || die "Copying ${PN}.systemd failed"
73
74
	epatch_user
75
}
76
77
src_configure() {
78
	:;
79
}
80
81
src_compile() {
82
	:;
83
}
84
85
src_install() {
86
	keepdir /var/lib/${PN}
87
88
	DESTDIR="${D}" ./install.sh shorewallrc.gentoo || die "install.sh failed"
89
90
	dodoc changelog.txt releasenotes.txt
91
	if use doc; then
92
		dodoc -r Samples
93
		cd "${WORKDIR}"/${MY_P_DOCS}
94
		dohtml -r *
95
	fi
96
}
97
98
pkg_postinst() {
99
	if [[ -z "${REPLACING_VERSIONS}" ]]; then
100
		# This is a new installation
101
		elog "Before you can use ${PN}, you need to edit its configuration in:"
102
		elog ""
103
		elog "  ${EPREFIX}/etc/${PN}/${PN}.conf"
104
		elog ""
105
		elog "To activate ${PN} on system start, please add ${PN} to your default runlevel:"
106
		elog ""
107
		elog "  # rc-update add ${PN} default"
108
	fi
109
110
	if ! has_version ${CATEGORY}/shorewall-init; then
111
		elog ""
112
		elog "Starting with shorewall-4.5.21.2, Gentoo also offers ${CATEGORY}/shorewall-init,"
113
		elog "which we recommend to install, to protect your firewall at system boot."
114
		elog ""
115
		elog "To read more about shorewall-init, please visit"
116
		elog "  http://www.shorewall.net/Shorewall-init.html"
117
	fi
118
}
(-)original/net-firewall/shorewall6/files/4.5.21.7/shorewall6.confd (+20 lines)
Line 0 Link Here
1
This patch will update the version number in the release notes.
2
3
See http://thread.gmane.org/gmane.comp.security.shorewall/30808
4
5
--- shorewall6-4.5.21.7.old/releasenotes.txt	2014-03-08 16:35:39.000000000 +0100
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.7/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.7/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.7/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/metadata.xml (+10 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
3
<pkgmetadata>
4
	<herd>netmon</herd>
5
	<herd>proxy-maintainers</herd>
6
	<maintainer>
7
		<email>whissi@whissi.de</email>
8
		<name>Thomas D. (Whissi)</name>
9
	</maintainer>
10
</pkgmetadata>
(-)original/net-firewall/shorewall6/shorewall6-4.5.21.7.ebuild (+114 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
	epatch "${FILESDIR}"/${PVR}/10-releasenotes.patch
62
63
	cp "${FILESDIR}"/${PVR}/shorewallrc "${S}"/shorewallrc.gentoo || die "Copying shorewallrc failed"
64
	eprefixify "${S}"/shorewallrc.gentoo
65
66
	cp "${FILESDIR}"/${PVR}/${PN}.confd "${S}"/default.gentoo || die "Copying ${PN}.confd failed"
67
	cp "${FILESDIR}"/${PVR}/${PN}.initd "${S}"/init.gentoo.sh || die "Copying ${PN}.initd failed"
68
	cp "${FILESDIR}"/${PVR}/${PN}.systemd "${S}"/gentoo.service || die "Copying ${PN}.systemd failed"
69
70
	epatch_user
71
}
72
73
src_configure() {
74
	:;
75
}
76
77
src_compile() {
78
	:;
79
}
80
81
src_install() {
82
	keepdir /var/lib/${PN}
83
84
	DESTDIR="${D}" ./install.sh shorewallrc.gentoo || die "install.sh failed"
85
86
	dodoc changelog.txt releasenotes.txt
87
	if use doc; then
88
		dodoc -r Samples6
89
		cd "${WORKDIR}"/${MY_P_DOCS}
90
		dohtml -r *
91
	fi
92
}
93
94
pkg_postinst() {
95
	if [[ -z "${REPLACING_VERSIONS}" ]]; then
96
		# This is a new installation
97
		elog "Before you can use ${PN}, you need to edit its configuration in:"
98
		elog ""
99
		elog "  ${EPREFIX}/etc/${PN}/${PN}.conf"
100
		elog ""
101
		elog "To activate ${PN} on system start, please add ${PN} to your default runlevel:"
102
		elog ""
103
		elog "  # rc-update add ${PN} default"
104
	fi
105
106
	if ! has_version ${CATEGORY}/shorewall-init; then
107
		elog ""
108
		elog "Starting with shorewall6-4.5.21.2, Gentoo also offers ${CATEGORY}/shorewall-init,"
109
		elog "which we recommend to install, to protect your firewall at system boot."
110
		elog ""
111
		elog "To read more about shorewall-init, please visit"
112
		elog "  http://www.shorewall.net/Shorewall-init.html"
113
	fi
114
}
(-)original/net-firewall/shorewall6-lite/files/4.5.21.7/shorewall6-lite.confd (+20 lines)
Line 0 Link Here
1
This patch will update the version number in the release notes.
2
3
See http://thread.gmane.org/gmane.comp.security.shorewall/30808
4
5
--- shorewall6-lite-4.5.21.7.old/releasenotes.txt	2014-03-08 16:35:39.000000000 +0100
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.7/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.7/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.7/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/metadata.xml (+10 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
3
<pkgmetadata>
4
	<herd>netmon</herd>
5
	<herd>proxy-maintainers</herd>
6
	<maintainer>
7
		<email>whissi@whissi.de</email>
8
		<name>Thomas D. (Whissi)</name>
9
	</maintainer>
10
</pkgmetadata>
(-)original/net-firewall/shorewall6-lite/shorewall6-lite-4.5.21.7.ebuild (+109 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
	epatch "${FILESDIR}"/${PVR}/10-releasenotes.patch
59
60
	cp "${FILESDIR}"/${PVR}/shorewallrc "${S}"/shorewallrc.gentoo || die "Copying shorewallrc failed"
61
	eprefixify "${S}"/shorewallrc.gentoo
62
63
	cp "${FILESDIR}"/${PVR}/${PN}.confd "${S}"/default.gentoo || die "Copying ${PN}.confd failed"
64
	cp "${FILESDIR}"/${PVR}/${PN}.initd "${S}"/init.gentoo.sh || die "Copying ${PN}.initd failed"
65
	cp "${FILESDIR}"/${PVR}/${PN}.systemd "${S}"/gentoo.service || die "Copying ${PN}.systemd failed"
66
67
	epatch_user
68
}
69
70
src_configure() {
71
	:;
72
}
73
74
src_compile() {
75
	:;
76
}
77
78
src_install() {
79
	keepdir /var/lib/${PN}
80
81
	DESTDIR="${D}" ./install.sh shorewallrc.gentoo || die "install.sh failed"
82
83
	dodoc changelog.txt releasenotes.txt
84
	if use doc; then
85
		cd "${WORKDIR}/${MY_P_DOCS}"
86
		dohtml -r *
87
	fi
88
}
89
90
pkg_postinst() {
91
	if [[ -z "${REPLACING_VERSIONS}" ]]; then
92
		# This is a new installation
93
		elog "Before you can use ${PN}, you need to provide a configuration, which you can"
94
		elog "create using ${CATEGORY}/shorewall6 (the full version, including the compiler)."
95
		elog ""
96
		elog "To activate ${PN} on system start, please add ${PN} to your default runlevel:"
97
		elog ""
98
		elog "  # rc-update add ${PN} default"
99
	fi
100
101
	if ! has_version ${CATEGORY}/shorewall-init; then
102
		elog ""
103
		elog "Starting with shorewall6-lite-4.5.21.2, Gentoo also offers ${CATEGORY}/shorewall-init,"
104
		elog "which we recommend to install, to protect your firewall at system boot."
105
		elog ""
106
		elog "To read more about shorewall-init, please visit"
107
		elog "  http://www.shorewall.net/Shorewall-init.html"
108
	fi
109
}
(-)original/net-firewall/shorewall-core/files/4.5.21.7/shorewallrc (+28 lines)
Line 0 Link Here
1
This patch will update the version number in the release notes.
2
3
See http://thread.gmane.org/gmane.comp.security.shorewall/30808
4
5
--- shorewall-core-4.5.21.7.old/releasenotes.txt	2014-03-08 16:35:39.000000000 +0100
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/metadata.xml (+10 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
3
<pkgmetadata>
4
	<herd>netmon</herd>
5
	<herd>proxy-maintainers</herd>
6
	<maintainer>
7
		<email>whissi@whissi.de</email>
8
		<name>Thomas D. (Whissi)</name>
9
	</maintainer>
10
</pkgmetadata>
(-)original/net-firewall/shorewall-core/shorewall-core-4.5.21.7.ebuild (+76 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
	epatch "${FILESDIR}"/${PVR}/10-releasenotes.patch
53
54
	cp "${FILESDIR}"/${PVR}/shorewallrc "${S}"/shorewallrc.gentoo || die "Copying shorewallrc failed"
55
	eprefixify "${S}"/shorewallrc.gentoo
56
57
	epatch_user
58
}
59
60
src_configure() {
61
	:;
62
}
63
64
src_install() {
65
	DESTDIR="${D}" ./install.sh shorewallrc.gentoo || die "install.sh failed"
66
	default
67
}
68
69
pkg_postinst() {
70
	if ! has_version sys-apps/net-tools; then
71
		elog "It is recommended to install sys-apps/net-tools which will provide the"
72
		elog "the 'arp' utility which will give you a better 'shorewall-lite dump' output:"
73
		elog ""
74
		elog "  # emerge sys-apps/net-tools"
75
	fi
76
}
(-)original/net-firewall/shorewall-init/files/4.5.21.7/README.Gentoo.txt (+36 lines)
Line 0 Link Here
1
--- shorewall-init.old	2013-09-08 23:25:36.364924304 +0200
Line 0 Link Here
1
This patch will update the version number in the release notes.
2
3
See http://thread.gmane.org/gmane.comp.security.shorewall/30808
4
5
--- shorewall-init-4.5.21.7.old/releasenotes.txt	2014-03-08 16:35:39.000000000 +0100
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.7/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.7/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.7/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.7/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/metadata.xml (+10 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
3
<pkgmetadata>
4
	<herd>netmon</herd>
5
	<herd>proxy-maintainers</herd>
6
	<maintainer>
7
		<email>whissi@whissi.de</email>
8
		<name>Thomas D. (Whissi)</name>
9
	</maintainer>
10
</pkgmetadata>
(-)original/net-firewall/shorewall-init/shorewall-init-4.5.21.7.ebuild (+105 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 "${FILESDIR}"/${PVR}/10-releasenotes.patch
54
	epatch_user
55
}
56
57
src_configure() {
58
	:;
59
}
60
61
src_compile() {
62
	:;
63
}
64
65
src_install() {
66
	DESTDIR="${D}" ./install.sh shorewallrc.gentoo || die "install.sh failed"
67
68
	if [ -d "${D}/etc/logrotate.d" ]; then
69
		# On Gentoo, shorewall-init will not create shorewall-ifupdown.log,
70
		# so we don't need a logrotate folder at all
71
		rm -rf "${D}"/etc/logrotate.d
72
	fi
73
74
	if [ -d "${D}/etc/NetworkManager" ]; then
75
		# On Gentoo, we don't support NetworkManager
76
		# so we don't need these folder at all
77
		rm -rf "${D}"/etc/NetworkManager
78
	fi
79
80
	if [ -f "${D}/usr/share/shorewall-init/ifupdown" ]; then
81
		# This script won't work on Gentoo
82
		rm -rf "${D}"/usr/share/shorewall-init/ifupdown
83
	fi
84
85
	dodoc changelog.txt releasenotes.txt "${FILESDIR}"/${PVR}/README.Gentoo.txt
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 edit its configuration in:"
92
		elog ""
93
		elog "  ${EPREFIX}/etc/conf.d/${PN}"
94
		elog ""
95
		elog "To use ${PN}, please add ${PN} to your boot runlevel:"
96
		elog ""
97
		elog "  # rc-update add ${PN} boot"
98
		elog ""
99
		ewarn "Notice:"
100
		ewarn "${PN} is more like a start script than a service."
101
		ewarn "Therefore you cannot start or stop ${PN} at default runlevel."
102
		ewarn ""
103
		ewarn "For more information read ${EPREFIX}/usr/share/doc/${PF}/README.Gentoo.txt.bz2"
104
	fi
105
}
(-)original/net-firewall/shorewall-lite/files/4.5.21.7/shorewall-lite.confd (+20 lines)
Line 0 Link Here
1
This patch will update the version number in the release notes.
2
3
See http://thread.gmane.org/gmane.comp.security.shorewall/30808
4
5
--- shorewall-lite-4.5.21.7.old/releasenotes.txt	2014-03-08 16:35:39.000000000 +0100
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.7/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.7/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.7/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/metadata.xml (+10 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
3
<pkgmetadata>
4
	<herd>netmon</herd>
5
	<herd>proxy-maintainers</herd>
6
	<maintainer>
7
		<email>whissi@whissi.de</email>
8
		<name>Thomas D. (Whissi)</name>
9
	</maintainer>
10
</pkgmetadata>
(-)original/net-firewall/shorewall-lite/shorewall-lite-4.5.21.7.ebuild (+108 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
	epatch "${FILESDIR}"/${PVR}/10-releasenotes.patch
58
59
	cp "${FILESDIR}"/${PVR}/shorewallrc "${S}"/shorewallrc.gentoo || die "Copying shorewallrc failed"
60
	eprefixify "${S}"/shorewallrc.gentoo
61
62
	cp "${FILESDIR}"/${PVR}/${PN}.confd "${S}"/default.gentoo || die "Copying ${PN}.confd failed"
63
	cp "${FILESDIR}"/${PVR}/${PN}.initd "${S}"/init.gentoo.sh || die "Copying ${PN}.initd failed"
64
	cp "${FILESDIR}"/${PVR}/${PN}.systemd "${S}"/gentoo.service || die "Copying ${PN}.systemd failed"
65
66
	epatch_user
67
}
68
69
src_configure() {
70
	:;
71
}
72
73
src_compile() {
74
	:;
75
}
76
77
src_install() {
78
	keepdir /var/lib/${PN}
79
80
	DESTDIR="${D}" ./install.sh shorewallrc.gentoo || die "install.sh failed"
81
82
	dodoc changelog.txt releasenotes.txt
83
	if use doc; then
84
		cd "${WORKDIR}/${MY_P_DOCS}"
85
		dohtml -r *
86
	fi
87
}
88
89
pkg_postinst() {
90
	if [[ -z "${REPLACING_VERSIONS}" ]]; then
91
		# This is a new installation
92
		elog "Before you can use ${PN}, you need to provide a configuration, which you can"
93
		elog "create using ${CATEGORY}/shorewall (the full version, including the compiler)."
94
		elog ""
95
		elog "To activate ${PN} on system start, please add ${PN} to your default runlevel:"
96
		elog ""
97
		elog "  # rc-update add ${PN} default"
98
	fi
99
100
	if ! has_version ${CATEGORY}/shorewall-init; then
101
		elog ""
102
		elog "Starting with shorewall-lite-4.5.21.2, Gentoo also offers ${CATEGORY}/shorewall-init,"
103
		elog "which we recommend to install, to protect your firewall at system boot."
104
		elog ""
105
		elog "To read more about shorewall-init, please visit"
106
		elog "  http://www.shorewall.net/Shorewall-init.html"
107
	fi
108
}

Return to bug 499174