diff options
author | Thomas Deutschmann <whissi@gentoo.org> | 2017-03-30 08:43:35 +0200 |
---|---|---|
committer | Thomas Deutschmann <whissi@gentoo.org> | 2017-03-30 08:43:35 +0200 |
commit | 30f2181a526344cc26f3fb59c40756a6efdaef75 (patch) | |
tree | b4abec8fee8b17985a68959fad5bde7859e5523b /net-firewall | |
parent | net-firewall/shorewall: Cleanup old version (diff) | |
download | gentoo-30f2181a526344cc26f3fb59c40756a6efdaef75.tar.gz gentoo-30f2181a526344cc26f3fb59c40756a6efdaef75.tar.bz2 gentoo-30f2181a526344cc26f3fb59c40756a6efdaef75.zip |
net-firewall/shorewall: Bump to v5.0.15.6
Package-Manager: Portage-2.3.5, Repoman-2.3.2
Diffstat (limited to 'net-firewall')
-rw-r--r-- | net-firewall/shorewall/Manifest | 7 | ||||
-rw-r--r-- | net-firewall/shorewall/shorewall-5.0.15.6.ebuild | 451 |
2 files changed, 458 insertions, 0 deletions
diff --git a/net-firewall/shorewall/Manifest b/net-firewall/shorewall/Manifest index 9e8959bcdf26..56704e09bc20 100644 --- a/net-firewall/shorewall/Manifest +++ b/net-firewall/shorewall/Manifest @@ -1,7 +1,14 @@ DIST shorewall-5.0.15.3.tar.bz2 525470 SHA256 c71c42e9697057b39ae27593725d2fcc5829cc8eab78ef2109a1f16ed89534db SHA512 a0990a23870740e96d86dc5f02aa55d0f762e030a0a08ba9ce8801065712a1908889d9d82052cdeefcd14d851462217fd0096101a4535de96d5ff141a8ec7faa WHIRLPOOL f95ce4cbf856a8d4d635cf926408e782c44317ea4866c476b5ba8372f62fac1b16651a4b3ce8266e2bd8ff211254e2c6fa32dfef5e381c540e12651c7c695a2b +DIST shorewall-5.0.15.6.tar.bz2 525827 SHA256 17ae4613eac68a62d4cd520af8c63b54b36ae79aac4e22fc57c74929a968ef46 SHA512 d1665a30a9b1273e3cfdb7e8001a679beb3d09e75e8fd21caadcd528d3912cceca5525c6ef7c8191865e8e62d1abaa894480a403cc2e8ef6545301ca36f83b32 WHIRLPOOL 1e2e613de27e6caf449b8f3127526dc68971d08693b7235a7f504abc8cf2afcdda244f910b726e37e2554080830f13eb197424995a0a5155b73d5c538042ce5d DIST shorewall-core-5.0.15.3.tar.bz2 65108 SHA256 0d174d9aabd3608e000a4536470b35d15a856d7394f5e8bd22ef410d8501b989 SHA512 4a5cca151bc5e8e538e7cb0f4d36461e32232bc7d94e72f82ddefc8c4d5622f14d8c625892295275b41b5ca99dc5217e3fafbf9c1d25d872117f78eed621575c WHIRLPOOL 71f0011684a1bfadaa5439eaa4e0852189262381a1a39b6c17e6f3ee0d4e397faf6ec5516b0288ac9a80896d56f275ae1c85b385adf69d98b4a780a60491e7bf +DIST shorewall-core-5.0.15.6.tar.bz2 65272 SHA256 6b1c461494922f207397ce2d9ed12b0a105d82ee3528a02a4448bc6c028623b8 SHA512 5e33ef55c4ca43a5c49747d5b3f40c9f43b0696e7084a6db56df73810551d216bd313860eb5354f50b1f9849c4d332f665e3f4832ff1cf3a9542bb6a43a73119 WHIRLPOOL 1b66e763e0d37b78b0343c8ad4964d46459347114bbebfeb965af075d73bbf71a8c695310f051f4160e5dd1cc7033e32545a5404538acce7d0452aa1618af4cd DIST shorewall-docs-html-5.0.15.3.tar.bz2 4290905 SHA256 5e519eb6956fb51058e7c977f7130ab4c91b519097c624c83de980808e555849 SHA512 bca31dcb50246aa081512ee61c6e46545361777c9b033912023624872d7fb8fb4fc0b0b821fd0422698fab9000b4f087b8f4ef6799ee2d55b5f3cfbf81276a87 WHIRLPOOL 84c6c3777cfd228ef98880c84832fd5e23ae46fb38397783ad3dacd93eb57e5e0dc662014d3c9e98a1cd4647e3b84a84ecd3564be098a3ca20820215ae4b13db +DIST shorewall-docs-html-5.0.15.6.tar.bz2 4290931 SHA256 e6b253591fd9df7d00bf0bbcfd9c563f4248013119e13b22b34d947b244ce4e4 SHA512 e1304ea2b0e05645654b04ea825d255de70e02edc5f183dcf9eba88641aaeda8cd9781bf46a84b98628a7ed148bf1450e37e7871ef2a577e54ffd3707d7d85c3 WHIRLPOOL f1c038886f1428480c1f6b6be688717cee11717a8ae2b31ea35aef915245d2e46f7934e5bc0e54aaca7a9c83b0328cb3e96c949ed96730bada25896d85fbbf4a DIST shorewall-init-5.0.15.3.tar.bz2 42608 SHA256 00fc0f1bd04010626debf8b076b5b4e9a7451eff9d813ee6bf9cd507679a6443 SHA512 fae316724fe64cc93e20f08e221959156f59abc0b9349f830f6f4f8ba6be9f0a4ffedf68db5ee18b1a765c4ab51a3c9cb8153b70f1319b2b3bde38086208c628 WHIRLPOOL 35a5b06fe158ff4d173dec2246cdd329bcd573021b7e49db70065f9ea4ac3e5ca0321ed7ada9347eb0753fb68dfbd37ed6d65c599b005b25f024ffafe6a5882e +DIST shorewall-init-5.0.15.6.tar.bz2 42934 SHA256 c7afa1aff586186c4ce0cbe0f4e0fc06a84e936349f3dc69c84ef97c815fc6c1 SHA512 11c639b20992005e74ccd4aaa855a519fe6f96b030f171e91d68ec4ba1ca5ff5f73c6a1c823c5ffc88e3ad8e3cc2809dd24a91e0c892ab1f71d6c957113367e9 WHIRLPOOL c1190c31f5c2556fa7e73385856c8bbeb3b0cadb5ebed834e9b2138eee90059a864d85301095d3accdf537b6b4347cffe213d26c6a2201e040887647c65f4291 DIST shorewall-lite-5.0.15.3.tar.bz2 59024 SHA256 5e32b0346edea2ceef4930b80e1a5797048c4e419c96a870499ea0d6336e9eef SHA512 c71957f243e5e93810f04bfb4154a6bc0ae96ea7040753d15a4856d3b7d153871e29394b07ff1fba92a7f832a3880a6e58ac55303ae7c81e5df8ace7fadd8129 WHIRLPOOL b864fb2f776540d26e578ba038368ae9d014979fff9008ce9241d1acd893ac41df46696a2513866c280cd86d363257e8b9b1f2f47237c13f54d489a034adc5a6 +DIST shorewall-lite-5.0.15.6.tar.bz2 59347 SHA256 393a2aea8fe8c9d43babaad969e00c80508900123d78a0433d3a3ac6470fd6a8 SHA512 e49f74bfa39d65fffca00657487bc4d8600d6330af0413d3b146ff9192769def1e3f66e181c02bf541d50b73e327ff4035f86fd4ded5a133fc02b84c958a4bbc WHIRLPOOL 85e25de97e5594ae41e2277f6a48500d14add389710c0727483a270b8d071dec2ef66c8d2633b96a34109b432c4025832cdb7c05c9eb4de4d8ac9aba755651e8 DIST shorewall6-5.0.15.3.tar.bz2 241045 SHA256 79b91e33b24ac620a682e91c48ca18590dbac33e36c0fea37bdb2b1f3db47d7e SHA512 141fe6e23883d71f3d1fb8cb3d305a5eb439170430d71c9a066feb2acd734d4db54f386c91345c91c14f017ca5b4da7b08ad521e580545632411ae4c43d99e5b WHIRLPOOL 03c2f0731f988d094c96dd74271437c8bddc494b780980edab914c77944ded0343d6df0b94b871e33508d293f9ccfde89e4023a56b0ca2866433aa1c87ac2595 +DIST shorewall6-5.0.15.6.tar.bz2 240682 SHA256 1434b973e76ed75080aa1853986406a2346e57f0f21b094a2e1793a8b6bd7ee4 SHA512 26ea371bf40548ceda7bff786b790dd74e9a1a74a3745dcc683e7101ea5303eef87006116704d15aa688b0c40c0777c7732a7727fe714c71c8566b85ae4c560a WHIRLPOOL 92097d48bcd77ff814ab2ce9a0edb9514f2ec2e27725fd01492982ae9e4731e4366b6a5a10d903122ec7e0c43a4107d370b8f2ee11dc213a9ae78a19df6dd172 DIST shorewall6-lite-5.0.15.3.tar.bz2 58442 SHA256 822e6fbf3f2f7bef8db2424f6c40ad03b492ce7305d95b123ad2b1d1329e396a SHA512 f8bf47f2d39857df9579b8bacc32ef87159b5502cd4fed1761fca21d14a902122c30d87ce2a8af9a309c32d826238c5f966416cccc6bb1fe93271f45902d867d WHIRLPOOL 40d37102e415c3b13560159cd994a9baeeefa96f641e5bf6133212a084ff5bc2a54abcbe34901f35b5d0faef671b908fa19a873f0a98d8e074f6731bfae46ec1 +DIST shorewall6-lite-5.0.15.6.tar.bz2 58776 SHA256 1d693d3815bd0c2e4a9e7acad7be38ff2b354681da847a5ec4b8d87ca860378f SHA512 83cab85eda851e071eb004688b10a70811bd6f896c831e97713c48b322ee419ed9fc8ac7570b4faf567be317ca1d6f5c89c1e0da0e025a94abe39aa0f000e9ad WHIRLPOOL 842e02fe907854682b54343750df60b0e4c60613eca675d69c071c4d726a05d5d940c8283e9b718413520b3ccc11a01913dabba49189c41a61aa756645a401ae diff --git a/net-firewall/shorewall/shorewall-5.0.15.6.ebuild b/net-firewall/shorewall/shorewall-5.0.15.6.ebuild new file mode 100644 index 000000000000..654e667040f2 --- /dev/null +++ b/net-firewall/shorewall/shorewall-5.0.15.6.ebuild @@ -0,0 +1,451 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" + +inherit linux-info prefix systemd versionator + +DESCRIPTION='A high-level tool for configuring Netfilter' +HOMEPAGE="http://www.shorewall.net/" +LICENSE="GPL-2" +SLOT="0" +IUSE="doc +init +ipv4 ipv6 lite4 lite6" + +MY_PV=${PV/_rc/-RC} +MY_PV=${MY_PV/_beta/-Beta} +MY_P=${PN}-${MY_PV} + +MY_MAJOR_RELEASE_NUMBER=$(get_version_component_range 1-2) +MY_MAJORMINOR_RELEASE_NUMBER=$(get_version_component_range 1-3) + +# shorewall +MY_PN_IPV4=Shorewall +MY_P_IPV4=${MY_PN_IPV4/#S/s}-${MY_PV} + +# shorewall6 +MY_PN_IPV6=Shorewall6 +MY_P_IPV6=${MY_PN_IPV6/#S/s}-${MY_PV} + +# shorewall-lite +MY_PN_LITE4=Shorewall-lite +MY_P_LITE4=${MY_PN_LITE4/#S/s}-${MY_PV} + +# shorewall6-lite +MY_PN_LITE6=Shorewall6-lite +MY_P_LITE6=${MY_PN_LITE6/#S/s}-${MY_PV} + +# shorewall-init +MY_PN_INIT=Shorewall-init +MY_P_INIT=${MY_PN_INIT/#S/s}-${MY_PV} + +# shorewall-core +MY_PN_CORE=Shorewall-core +MY_P_CORE=${MY_PN_CORE/#S/s}-${MY_PV} + +# shorewall-docs-html +MY_PN_DOCS=Shorewall-docs-html +MY_P_DOCS=${MY_PN_DOCS/#S/s}-${MY_PV} + +# Upstream URL schema: +# Beta: $MIRROR/pub/shorewall/development/4.6/shorewall-4.6.4-Beta2/shorewall-4.6.4-Beta2.tar.bz2 +# RC: $MIRROR/pub/shorewall/development/4.6/shorewall-4.6.4-RC1/shorewall-4.6.4-RC1.tar.bz2 +# Release: $MIRROR/pub/shorewall/4.6/shorewall-4.6.3/shorewall-4.6.3.3.tar.bz2 + +MY_URL_PREFIX= +MY_URL_SUFFIX= +if [[ ${MY_PV} = *-Beta* ]] || [[ ${MY_PV} = *-RC* ]]; then + MY_URL_PREFIX='development/' + + _tmp_last_index=$(($(get_last_version_component_index ${MY_PV})+1)) + _tmp_suffix=$(get_version_component_range ${_tmp_last_index} ${MY_PV}) + if [[ ${_tmp_suffix} = *Beta* ]] || [[ ${_tmp_suffix} = *RC* ]]; then + MY_URL_SUFFIX="-${_tmp_suffix}" + fi + + # Cleaning up temporary variables + unset _tmp_last_index + unset _tmp_suffix +else + KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86" +fi + +SRC_URI=" + http://www.shorewall.net/pub/shorewall/${MY_URL_PREFIX}${MY_MAJOR_RELEASE_NUMBER}/shorewall-${MY_MAJORMINOR_RELEASE_NUMBER}${MY_URL_SUFFIX}/shorewall-core-${MY_PV}.tar.bz2 + ipv4? ( http://www.shorewall.net/pub/shorewall/${MY_URL_PREFIX}${MY_MAJOR_RELEASE_NUMBER}/shorewall-${MY_MAJORMINOR_RELEASE_NUMBER}${MY_URL_SUFFIX}/shorewall-${MY_PV}.tar.bz2 ) + ipv6? ( http://www.shorewall.net/pub/shorewall/${MY_URL_PREFIX}${MY_MAJOR_RELEASE_NUMBER}/shorewall-${MY_MAJORMINOR_RELEASE_NUMBER}${MY_URL_SUFFIX}/shorewall6-${MY_PV}.tar.bz2 ) + lite4? ( http://www.shorewall.net/pub/shorewall/${MY_URL_PREFIX}${MY_MAJOR_RELEASE_NUMBER}/shorewall-${MY_MAJORMINOR_RELEASE_NUMBER}${MY_URL_SUFFIX}/shorewall-lite-${MY_PV}.tar.bz2 ) + lite6? ( http://www.shorewall.net/pub/shorewall/${MY_URL_PREFIX}${MY_MAJOR_RELEASE_NUMBER}/shorewall-${MY_MAJORMINOR_RELEASE_NUMBER}${MY_URL_SUFFIX}/shorewall6-lite-${MY_PV}.tar.bz2 ) + init? ( http://www.shorewall.net/pub/shorewall/${MY_URL_PREFIX}${MY_MAJOR_RELEASE_NUMBER}/shorewall-${MY_MAJORMINOR_RELEASE_NUMBER}${MY_URL_SUFFIX}/shorewall-init-${MY_PV}.tar.bz2 ) + doc? ( http://www.shorewall.net/pub/shorewall/${MY_URL_PREFIX}${MY_MAJOR_RELEASE_NUMBER}/shorewall-${MY_MAJORMINOR_RELEASE_NUMBER}${MY_URL_SUFFIX}/${MY_P_DOCS}.tar.bz2 ) +" + +# - Shorewall6 requires Shorewall +# - Installing Shorewall-init or just the documentation doesn't make any sense, +# that's why we force the user to select at least one "real" Shorewall product +# +# See http://shorewall.net/download.htm#Which +REQUIRED_USE=" + ipv6? ( ipv4 ) + || ( ipv4 lite4 lite6 ) +" + +# No build dependencies! Just plain shell scripts... +DEPEND="" + +RDEPEND=" + >=net-firewall/iptables-1.4.20 + >=sys-apps/iproute2-3.8.0[-minimal] + >=sys-devel/bc-1.06.95 + ipv4? ( + >=dev-lang/perl-5.16 + virtual/perl-Digest-SHA + ) + ipv6? ( + >=dev-perl/Socket6-0.230.0 + >=net-firewall/iptables-1.4.20[ipv6] + >=sys-apps/iproute2-3.8.0[ipv6] + ) + lite6? ( + >=net-firewall/iptables-1.4.20[ipv6] + >=sys-apps/iproute2-3.8.0[ipv6] + ) + init? ( >=sys-apps/coreutils-8.20 ) + !net-firewall/shorewall-core + !net-firewall/shorewall6 + !net-firewall/shorewall-lite + !net-firewall/shorewall6-lite + !net-firewall/shorewall-init + !<sys-apps/systemd-214 +" + +S=${WORKDIR} + +pkg_pretend() { + local CONFIG_CHECK="~NF_CONNTRACK" + + local WARNING_CONNTRACK="Without NF_CONNTRACK support, you will be unable" + local WARNING_CONNTRACK+=" to run any shorewall-based firewall on the local system." + + if use ipv4 || use lite4; then + CONFIG_CHECK="${CONFIG_CHECK} ~NF_CONNTRACK_IPV4" + + local WARNING_CONNTRACK_IPV4="Without NF_CONNTRACK_IPV4 support, you will" + local WARNING_CONNTRACK_IPV4+=" be unable to run any shorewall-based IPv4 firewall on the local system." + fi + + if use ipv6 || use lite6; then + CONFIG_CHECK="${CONFIG_CHECK} ~NF_CONNTRACK_IPV6" + + local WARNING_CONNTRACK_IPV6="Without NF_CONNTRACK_IPV6 support, you will" + local WARNING_CONNTRACK_IPV6+=" be unable to run any shorewall-based IPv6 firewall on the local system." + fi + + check_extra_config +} + +pkg_setup() { + if [[ -n "${DIGEST}" ]]; then + einfo "Unsetting environment variable \"DIGEST\" to prevent conflicts with package's \"install.sh\" script ..." + unset DIGEST + fi +} + +src_prepare() { + # We are moving each unpacked source from MY_P_* to MY_PN_*. + # This allows us to use patches from upstream and keeps epatch_user working + + einfo "Preparing shorewallrc ..." + cp "${FILESDIR}"/shorewallrc "${S}"/shorewallrc.gentoo || die "Copying shorewallrc failed" + eprefixify "${S}"/shorewallrc.gentoo + + # shorewall-core + mv "${S}"/${MY_P_CORE} "${S}"/${MY_PN_CORE} || die "Failed to move '${S}/${MY_P_CORE}' to '${S}/${MY_PN_CORE}'" + ebegin "Applying Gentoo-specific changes to ${MY_P_CORE} ..." + ln -s ../shorewallrc.gentoo ${MY_PN_CORE}/shorewallrc.gentoo || die "Failed to symlink shorewallrc.gentoo" + eend 0 + + # shorewall + if use ipv4; then + mv "${S}"/${MY_P_IPV4} "${S}"/${MY_PN_IPV4} || die "Failed to move '${S}/${MY_P_IPV4}' to '${S}/${MY_PN_IPV4}'" + ebegin "Applying Gentoo-specific changes to ${MY_P_IPV4}" + ln -s ../shorewallrc.gentoo ${MY_PN_IPV4}/shorewallrc.gentoo || die "Failed to symlink shorewallrc.gentoo" + cp "${FILESDIR}"/shorewall.confd-r1 "${S}"/${MY_PN_IPV4}/default.gentoo || die "Copying shorewall.confd-r1 failed" + cp "${FILESDIR}"/shorewall.initd-r2 "${S}"/${MY_PN_IPV4}/init.gentoo.sh || die "Copying shorewall.initd-r2 failed" + cp "${FILESDIR}"/shorewall.systemd "${S}"/${MY_PN_IPV4}/gentoo.service || die "Copying shorewall.systemd failed" + eend 0 + fi + + # shorewall6 + if use ipv6; then + mv "${S}"/${MY_P_IPV6} "${S}"/${MY_PN_IPV6} || die "Failed to move '${S}/${MY_P_IPV6}' to '${S}/${MY_PN_IPV6}'" + ebegin "Applying Gentoo-specific changes to ${MY_P_IPV6}" + ln -s ../shorewallrc.gentoo ${MY_PN_IPV6}/shorewallrc.gentoo || die "Failed to symlink shorewallrc.gentoo" + cp "${FILESDIR}"/shorewall.confd-r1 "${S}"/${MY_PN_IPV6}/default.gentoo || die "Copying shorewall.confd-r1 failed" + cp "${FILESDIR}"/shorewall.initd-r2 "${S}"/${MY_PN_IPV6}/init.gentoo.sh || die "Copying shorewall.initd-r2 failed" + cp "${FILESDIR}"/shorewall6.systemd "${S}"/${MY_PN_IPV6}/gentoo.service || die "Copying shorewall6.systemd failed" + eend 0 + fi + + # shorewall-lite + if use lite4; then + mv "${S}"/${MY_P_LITE4} "${S}"/${MY_PN_LITE4} || die "Failed to move '${S}/${MY_P_LITE4}' to '${S}/${MY_PN_LITE4}'" + ebegin "Applying Gentoo-specific changes to ${MY_P_LITE4}" + ln -s ../shorewallrc.gentoo ${MY_PN_LITE4}/shorewallrc.gentoo || die "Failed to symlink shorewallrc.gentoo" + cp "${FILESDIR}"/shorewall-lite.confd-r1 "${S}"/${MY_PN_LITE4}/default.gentoo || die "Copying shorewall-lite.confd-r1 failed" + cp "${FILESDIR}"/shorewall-lite.initd-r2 "${S}"/${MY_PN_LITE4}/init.gentoo.sh || die "Copying shorewall-lite.initd-r2 failed" + cp "${FILESDIR}"/shorewall-lite.systemd "${S}"/${MY_PN_LITE4}/gentoo.service || die "Copying shorewall-lite.systemd failed" + eend 0 + fi + + # shorewall6-lite + if use lite6; then + mv "${S}"/${MY_P_LITE6} "${S}"/${MY_PN_LITE6} || die "Failed to move '${S}/${MY_P_LITE6}' to '${S}/${MY_PN_LITE6}'" + ebegin "Applying Gentoo-specific changes to ${MY_P_LITE6}" + ln -s ../shorewallrc.gentoo ${MY_PN_LITE6}/shorewallrc.gentoo || die "Failed to symlink shorewallrc.gentoo" + cp "${FILESDIR}"/shorewall-lite.confd-r1 "${S}"/${MY_PN_LITE6}/default.gentoo || die "Copying shorewall-lite.confd-r1 failed" + cp "${FILESDIR}"/shorewall-lite.initd-r2 "${S}"/${MY_PN_LITE6}/init.gentoo.sh || die "Copying shorewall-lite.initd-r2 failed" + cp "${FILESDIR}"/shorewall6-lite.systemd "${S}"/${MY_PN_LITE6}/gentoo.service || die "Copying shorewall6-lite.systemd failed" + eend 0 + fi + + # shorewall-init + if use init; then + mv "${S}"/${MY_P_INIT} "${S}"/${MY_PN_INIT} || die "Failed to move '${S}/${MY_P_INIT}' to '${S}/${MY_PN_INIT}'" + ebegin "Applying Gentoo-specific changes to ${MY_P_INIT}" + ln -s ../shorewallrc.gentoo ${MY_PN_INIT}/shorewallrc.gentoo || die "Failed to symlink shorewallrc.gentoo" + cp "${FILESDIR}"/shorewall-init.confd "${S}"/${MY_PN_INIT}/default.gentoo || die "Copying shorewall-init.confd failed" + cp "${FILESDIR}"/shorewall-init.initd "${S}"/${MY_PN_INIT}/init.gentoo.sh || die "Copying shorewall-init.initd failed" + cp "${FILESDIR}"/shorewall-init.systemd "${S}"/${MY_PN_INIT}/gentoo.service || die "Copying shorewall-init.systemd failed" + cp "${FILESDIR}"/shorewall-init.readme "${S}"/${MY_PN_INIT}/shorewall-init.README.Gentoo.txt || die "Copying shorewall-init.systemd failed" + eend 0 + + eprefixify "${S}"/${MY_PN_INIT}/init.gentoo.sh + + cd "${S}"/${MY_PN_INIT} || die + eapply -p2 "${FILESDIR}"/shorewall-init-01_remove-ipset-functionality.patch + cd "${S}" || die + fi + + # shorewall-docs-html + if use doc; then + mv "${S}"/${MY_P_DOCS} "${S}"/${MY_PN_DOCS} || die "Failed to move '${S}/${MY_P_DOCS}' to '${S}/${MY_PN_DOCS}'" + fi + + eapply_user +} + +src_configure() { + :; +} + +src_compile() { + :; +} + +src_install() { + # shorewall-core + einfo "Installing ${MY_P_CORE} ..." + DESTDIR="${D%/}" ${MY_PN_CORE}/install.sh shorewallrc.gentoo || die "${MY_PN_CORE}/install.sh failed" + dodoc "${S}"/${MY_PN_CORE}/changelog.txt "${S}"/${MY_PN_CORE}/releasenotes.txt + + # shorewall + if use ipv4; then + einfo "Installing ${MY_P_IPV4} ..." + keepdir /var/lib/shorewall + DESTDIR="${D%/}" ${MY_PN_IPV4}/install.sh shorewallrc.gentoo || die "${MY_PN_IPV4}/install.sh failed" + + if use doc; then + dodoc -r "${S}"/${MY_PN_IPV4}/Samples + fi + fi + + # shorewall6 + if use ipv6; then + einfo "Installing ${MY_P_IPV6} ..." + keepdir /var/lib/shorewall6 + DESTDIR="${D%/}" ${MY_PN_IPV6}/install.sh shorewallrc.gentoo || die "${MY_PN_IPV6}/install.sh failed" + + if use doc; then + dodoc -r "${S}"/${MY_PN_IPV6}/Samples6 + fi + fi + + # shorewall-lite + if use lite4; then + einfo "Installing ${MY_P_LITE4} ..." + keepdir /var/lib/shorewall-lite + DESTDIR="${D%/}" ${MY_PN_LITE4}/install.sh shorewallrc.gentoo || die "${MY_PN_LITE4}/install.sh failed" + fi + + # shorewall6-lite + if use lite6; then + einfo "Installing ${MY_P_LITE6} ..." + keepdir /var/lib/shorewall6-lite + DESTDIR="${D%/}" ${MY_PN_LITE6}/install.sh shorewallrc.gentoo || die "${MY_PN_LITE6}/install.sh failed" + fi + + # shorewall-init + if use init; then + einfo "Installing ${MY_P_INIT} ..." + DESTDIR="${D%/}" ${MY_PN_INIT}/install.sh shorewallrc.gentoo || die "${MY_PN_INIT}/install.sh failed" + dodoc "${S}"/${MY_PN_INIT}/shorewall-init.README.Gentoo.txt + + if [[ -f "${D}etc/logrotate.d/shorewall-init" ]]; then + # On Gentoo, shorewall-init will not create shorewall-ifupdown.log, + # so we don't need a logrotate configuration file for shorewall-init + einfo "Removing unused \"${D}etc/logrotate.d/shorewall-init\" ..." + rm -rf "${D}"etc/logrotate.d/shorewall-init || die "Removing \"${D}etc/logrotate.d/shorewall-init\" failed" + fi + + if [[ -d "${D}etc/NetworkManager" ]]; then + # On Gentoo, we don't support NetworkManager + # so we don't need this folder at all + einfo "Removing unused \"${D}etc/NetworkManager\" ..." + rm -rf "${D}"etc/NetworkManager || die "Removing \"${D}etc/NetworkManager\" failed" + fi + + if [[ -f "${D}usr/share/shorewall-init/ifupdown" ]]; then + # This script isn't supported on Gentoo + rm -rf "${D}"usr/share/shorewall-init/ifupdown || die "Removing \"${D}usr/share/shorewall-init/ifupdown\" failed" + fi + fi + + if use doc; then + einfo "Installing ${MY_P_DOCS} ..." + docinto html && dodoc -r "${S}"/${MY_PN_DOCS}/* + fi +} + +pkg_postinst() { + if [[ -z "${REPLACING_VERSIONS}" ]]; then + # This is a new installation + + # Show first steps for shorewall/shorewall6 + local _PRODUCTS="" + if use ipv4; then + _PRODUCTS="shorewall" + + if use ipv6; then + _PRODUCTS="${_PRODUCTS}/shorewall6" + fi + fi + + if [[ -n "${_PRODUCTS}" ]]; then + elog "Before you can use ${_PRODUCTS}, you need to edit its configuration in:" + elog "" + elog " /etc/shorewall/shorewall.conf" + + if use ipv6; then + elog " /etc/shorewall6/shorewall6.conf" + fi + + elog "" + elog "To activate your shorewall-based firewall on system start, please add ${_PRODUCTS} to your default runlevel:" + elog "" + elog " # rc-update add shorewall default" + + if use ipv6; then + elog " # rc-update add shorewall6 default" + fi + fi + + # Show first steps for shorewall-lite/shorewall6-lite + _PRODUCTS="" + if use lite4; then + _PRODUCTS="shorewall-lite" + fi + + if use lite6; then + if [[ -z "${_PRODUCTS}" ]]; then + _PRODUCTS="shorewall6-lite" + else + _PRODUCTS="${_PRODUCTS}/shorewall6-lite" + fi + fi + + if [[ -n "${_PRODUCTS}" ]]; then + if use ipv4; then + elog "" + fi + + elog "Before you can use ${_PRODUCTS}, you need to provide a configuration, which you can" + elog "create using ${CATEGORY}/shorewall (with \"ipv4\" and or \"ipv6\" USE flag)." + elog "" + elog "To read more about ${_PRODUCTS}, please visit" + elog " http://shorewall.net/CompiledPrograms.html" + elog "" + elog "To activate your shorewall-lite-based firewall on system start, please add ${PRODUCTS} to your default runlevel:" + elog "" + + if use lite4; then + elog " # rc-update add shorewall-lite default" + fi + + if use lite6; then + elog " # rc-update add shorewall6-lite default" + fi + fi + + if use init; then + elog "" + elog "To secure your system on boot, please add shorewall-init to your boot runlevel:" + elog "" + elog " # rc-update add shorewall-init boot" + elog "" + elog "and review \$PRODUCTS in" + elog "" + elog " /etc/conf.d/shorewall-init" + fi + + fi + + local v + for v in ${REPLACING_VERSIONS}; do + if ! version_is_at_least ${MY_MAJOR_RELEASE_NUMBER} ${v}; then + # This is an upgrade + + elog "You are upgrading from a previous major version. It is highly recommended that you read" + elog "" + elog " - /usr/share/doc/shorewall*/releasenotes.tx*" + elog " - http://shorewall.net/Shorewall-5.html#idp51151872" + + if use ipv4; then + elog "" + elog "You can auto-migrate your configuration using" + elog "" + elog " # shorewall update -A" + + if use ipv6; then + elog " # shorewall6 update -A" + fi + + elog "" + elog "But if you are not familiar with the \"shorewall[6] update\" command," + elog "please read the shorewall[6] man page first." + fi + + # Show this elog only once + break + fi + done + + if ! use init; then + elog "" + elog "Consider emerging ${CATEGORY}/${PN} with USE flag \"init\" to secure your system on boot" + elog "before your shorewall-based firewall is ready to start." + elog "" + elog "To read more about shorewall-init, please visit" + elog " http://www.shorewall.net/Shorewall-init.html" + fi + + if ! has_version "net-firewall/conntrack-tools"; then + elog "" + elog "Your Shorewall firewall can utilize \"conntrack\" from the \"net-firewall/conntrack-tools\"" + elog "package. if you want to use this feature, you need to install \"net-firewall/conntrack-tools\"!" + fi + + if ! has_version "dev-perl/Devel-NYTProf"; then + elog "" + elog "If you want to profile your Shorewall firewall you need to install \"dev-perl/Devel-NYTProf\"!" + fi +} |