diff options
author | Ian Delaney <idella4@gentoo.org> | 2015-10-18 10:43:46 +0800 |
---|---|---|
committer | Ian Delaney <idella4@gentoo.org> | 2015-10-18 10:45:33 +0800 |
commit | fe00c3bc1b28a3d98881d8fe82e4206129fc8e3b (patch) | |
tree | 23c90ad3a738d24a3008c3b74a1030f8fdba03a5 /net-firewall | |
parent | dev-qt/qt-creator: apply patches (diff) | |
download | gentoo-fe00c3bc1b28a3d98881d8fe82e4206129fc8e3b.tar.gz gentoo-fe00c3bc1b28a3d98881d8fe82e4206129fc8e3b.tar.bz2 gentoo-fe00c3bc1b28a3d98881d8fe82e4206129fc8e3b.zip |
net-firewall/shorewall: bump to -5.0.1
patches submitted by proxy maintainer via gentoo bug & pull request;
dropped 'rc_need="net"', files moved from
$FILESDIR/$MAJOR_VERSION to $FILESDIR
Gentoo bug: #563088
Pull request: https://github.com/gentoo/gentoo/pull/241
Package-Manager: portage-2.2.20.1
Diffstat (limited to 'net-firewall')
20 files changed, 1253 insertions, 0 deletions
diff --git a/net-firewall/shorewall/Manifest b/net-firewall/shorewall/Manifest index 7d2576f3dfde..461f8bb4bbf1 100644 --- a/net-firewall/shorewall/Manifest +++ b/net-firewall/shorewall/Manifest @@ -3,23 +3,30 @@ DIST shorewall-4.5.21.9.tar.bz2 489618 SHA256 a1fc41abcba3181235e217a5da53bb25d1 DIST shorewall-4.6.10.1.tar.bz2 496061 SHA256 de527474f5bac6bf59678321c604748c48efe28a897d339a2187a45e3efed8ef SHA512 a5ef4783ff04b6faaa2e25d1da57ca3c46860960859dad5cd3b8d3cb252626b1db39c35767b226333f10db7b08b0fb18c0c09cd4eaf14586cb02b1a4259b571d WHIRLPOOL 26ebb72e769d5ca7489f718cabdb1f9cfb78e2acd514329c7036edcafe27f159ffa4cdadeeb1cee43619f748474fcc7a614011147976abb14cf627503a542e3f DIST shorewall-4.6.13.1.tar.bz2 498949 SHA256 fc2c390fecbc0c78d5cd648596abc1edb1d338d748b4a0605695c3141e24d35e SHA512 1b8e0a008660a8b66bcc77bb92f110fbdc04a0925d6f19bb01a6e798baa907f5ca4f6f60851c861963ab49b1a0b2ae652d4d1234fcf18ab56325ebcc66fbefb1 WHIRLPOOL 6c2a63a5c547d429c3d9c5d05683d8c4a2bdc662f58b7b8e7ae197053a13c06ad1c0ae9fcd0face2601d05a7becfaf0948e0765ff22e5dbeace0176e77e4bad6 DIST shorewall-4.6.13.tar.bz2 500076 SHA256 fc4530d891da22d9efaa4339f10ebde27133bef9fe8c6e93abc701991f8b30ba SHA512 5018d34a15784870c521614a725baa05ea8df5e11e11d0177d01fc3012ed006f25b6a2afaf20cbae7b1c189ea841cc5ad2764067af0513f8378b316645524b48 WHIRLPOOL a6fef96deed7f7ad7bdc0273de88c15f77b901ec27905af474399b3b86fd8b6cdfe92556ae2314feaa73cd525960b56d986ce426225f7779e9235ccdc9f7248c +DIST shorewall-5.0.1.tar.bz2 477174 SHA256 1b5147d5ecb1ccf950785c239a6b6db47fa694cde229ad7d4eaea2e3fcc2a4ee SHA512 1eb1d1d4fb5f750a93af61462b789e5c725ab960a3512e5363aab8a3d4ca9823ed3dd3e189222ed782321edbb9f28230446b7cae3156ab0e86d6fe584c2ba253 WHIRLPOOL f24be9f60e10937f760c316c74d7d854541df2c1f0d019dcefa128c27bdfbe71b5fc72201dc750671adc61667923c3138350d00210cfe5d2112308b4bf1df7fc DIST shorewall-core-4.6.10.1.tar.bz2 58247 SHA256 5af804f39f4480685e995080dc8913d4af61af70d5a478dd00bbf0593851b44d SHA512 1028e0bf950aecbc77c6c263ab8351fb8ff90b6077a0d6bf7c0d882559f5d8644ce0f2c6aec6dd3614d90a319277763460909e345e1e004cf8ea1f548e369284 WHIRLPOOL 0a0834eb355e05679b5809a18dd0749c6c06ac3130a9ab375587c7e6134042c01762775ac136f0396c051f4ac4b2f379141d111760929a42da6f00656a96e120 DIST shorewall-core-4.6.13.1.tar.bz2 61749 SHA256 d06a4c1050578013c6e37468f0a803fd129f1ac95b6ea5ab8af80f3eb0739539 SHA512 8db64a150101368ad50075f7ed97e2ceecf0d974ae1d0d61f6bc8dd967ff8f222265c543dfbe8f1217d90b21d93398669cc3d6e06a2b2c706c25347b27f13868 WHIRLPOOL 493f9a739388d3ecfe5fc9d04414c272d09a6eade8f236e21ec773b7df423844d2b9b427a297c9fa842ef22e7c491427d74e83dbc0aa267b16c20c1aff8525ed DIST shorewall-core-4.6.13.tar.bz2 61679 SHA256 e31dd55c8df37ee2168c5aa9843f9c2727f6a31a98634445e0c10990360665a4 SHA512 2c769f2f77ee51357f92daa1fe3f794fd3e3b537f0686a004809767340ad7bdd922be2580760cdbb834e8c80f53e9d5329ef86ee741520870c242452b1e44f30 WHIRLPOOL 90668efd2db2f09bf40934206b3124666b96157f085dfabc17ff2c2d65ebb8f348db6727516fced866d16eb4d44aa0ea9d6d91ed907593785788c6cdb50f10dc +DIST shorewall-core-5.0.1.tar.bz2 45988 SHA256 fd2c764f34f02b923ad4a2c5b4017b9b96df2c6886710254f2e2771e3b007a0b SHA512 a65965d272190ff4e32022a5ba21eaabfedfde50ffa1c2d100892f1b3796a5908641f5fe40e3c66f9d0bd7666217ba046e61a89368a41d8dc9eaee7db2efa4cf WHIRLPOOL 8366b0d423dc38349e795e65dace67e7c851a00335b49da1c8308796e9ff5c9544c76375d00c8c521ade30b21ccc91e874382c89691cf11927624fc42fd1a434 DIST shorewall-docs-html-4.5.21.10.tar.bz2 4146174 SHA256 cdbc5f3654f7cfb6f0c3b3750a7174df8fa0590dfe34df055300140b3eb13192 SHA512 94852cc094d6a485cacc4023a2819431f1bfd80b8cbcab29981c422fdff9dfee90697ae8a9bda7ded3a8be03db516bdd5f4bcc4b83e7d01bc433a8c88d23731a WHIRLPOOL 6f02d0e3255dd1e31a43193f67f9b957546a6ae574631e61364f81244bee887e7f21c38f412fa21cde77b3d89aaf0e14e43909683db0c9c32edeb455c20b998e DIST shorewall-docs-html-4.5.21.9.tar.bz2 4146065 SHA256 9056c22b8232d8276cc53a6eb74940bab42a250c670cb5baa42c75cfb89efdef SHA512 48b2c692ba59b7ec74307909e43a95104e212c9b8e21af7f0dd9f3438ac4f24a6fd2bcc6517966681517aef03beaa8faf03efd74406966d97b68cb416be8551b WHIRLPOOL f68cba7ecaf8c541e58d26c157914bff2d90cd9deae30af7323ca69c68d028217133f53e597bf383191aee83fab29203d233b3cd1e75e4cf08d9e17308dc25e4 DIST shorewall-docs-html-4.6.10.1.tar.bz2 4185752 SHA256 eeaec18b7f8663f0b836b76d140d3fad7871075de90f18ccc7b9fbda1538a787 SHA512 1bf1b3f5745d54af3af5f9bb6417c661e2bde8028d699aed4c4fcbe7cf301b8eadfed7be5e9bfdd677659c362d1e757eee13cd1b497a0c6837c179883c33e3a8 WHIRLPOOL 937fc4f76174f615de86eaa08690ebbe42f658154320d3e9972cbb0bcaa461e11fdaf5390f517f5d2f905aa5996ecb7399ca07d1767f647a49d33b1220e8d547 DIST shorewall-docs-html-4.6.13.1.tar.bz2 4280904 SHA256 ded94cd41022855bbb20e3a5a579f82515fea8eb3d6b7ea110e491a5cc654804 SHA512 0f6090a428ead0c5ccfca020776a93c6c69de7043b947c129ca9fba8289919448af4b5c6a2a65dc9317df2979688f86873dc0ff6a04ba6e9a14b26f183872f33 WHIRLPOOL 4cf65fd2e4afcf40d7e7fdaab43002551f7af4bba6a12466d7dab87d5df5cbcf5ed80d3238ec6cf77e59f7587056adc4450db4765a2ef47e9bcf2641cf38407a DIST shorewall-docs-html-4.6.13.tar.bz2 4280790 SHA256 2fdc3d5aa2d998831b66ed2ebf257a581924ef9b5ef1a5a2d18511aeb6f46d3d SHA512 40b3db8e8ca022ee47f928fac512f28dff7da597d19dbf9d19f5d706764d01aa09ff348df37be40a8551a7e6fae9a8b1be7e1321de7f581af4e7217ad6e3bc64 WHIRLPOOL e639126f0b16ad332bf115ccd773e7b32b1b9a0c7bda78cf072096a466d4e78d2a404f2ec923cd1acc152481a01cd90affa9af25496ee136555cc55ed1156a31 +DIST shorewall-docs-html-5.0.1.tar.bz2 4274054 SHA256 c43f847ae2b106c7966b3aeb6a4221c0b9b3d5219e35b485b84d70f2e84ff8d9 SHA512 1bb264ba0166204c77588a7741388af2ac3091c305331f962b333c3adf725a055bf2b15974d0f6007ff93f4112a387937668b815acff3ca19ee2cc36d36a827f WHIRLPOOL e200846eff4e467b9cbec7097e9d69c4f039bfe0e5a8e8ff193f077ab7e92c4d9c41458b8041a6be27e4afe9e06b1809a54b0d1797c38bc7d62d933173812edf DIST shorewall-init-4.6.10.1.tar.bz2 37674 SHA256 c3948dbe48230358eb4d5a370a44b247f4a6e6f28b1c4853be23d9abda79f6ba SHA512 71507a9c27f9a8286f82567f731714fe5a6f5b21f1f3f27f3a3ba9171301361948bef9824a9a45445d65f74039c4dca3ffc83e74a6ffd33783d1528ad581578e WHIRLPOOL 23c886b1015c6430d819d3010b8cdc587d88054f55b8092238438310562affdaead265a40a74dd888d1c939367afafa0ebecfe8946ceb202bab126ca2232cd97 DIST shorewall-init-4.6.13.1.tar.bz2 40718 SHA256 35684f1955eed65d897f5c51a74b9bf431a839cdeabc9ca7b37109d7b47a9d95 SHA512 f6b5d6e59eb3e4f4408b68bee69dacd3e5b00b3d0628b4b0f6408342bd05b279efc3962c0b294e37b8e6c719442232e73e348f048534916f97e3f40fb3a598d5 WHIRLPOOL 05c774194b33e1ffecec42e756851d3a9bd6764a13b280f63737dca53efe4223cea081b42e4f1a205062baaa3fac62a92b490b1402a6cd0ada637f98bea1b690 DIST shorewall-init-4.6.13.tar.bz2 40574 SHA256 a1ebf757ccf5b455220daf80af71d23dd6290d9bcd9440da2058bdf6fcfcd768 SHA512 63092ad30f4528e96ca8a12e0e76ef702446a9b61c880455f13ab9ce86c953a3cc3c3f05a04fff9df1a93cad8d01ffd2b846281a7f46a3d9000e5cd3c908051e WHIRLPOOL cf78de19cdcf6c0de23a3259509a95382aaac554a827cca4a031ce4c1ef3b57e7ccaa65c40daadea53dc4433ad819416cafb215aff7088b8eecfeecb1ab7983b +DIST shorewall-init-5.0.1.tar.bz2 25161 SHA256 ab2e2cfbe87fb4503d7b587ca3072e70b649f4a3a2a1e16651d801181390acfe SHA512 fb4d1764311bd3d244315c3f33d2881c9d78501102a619b389bc439c306e12871e65e7cc8fef25ce45e44b88bafd57798feb5c6cc3f988ad1ff1125d8c002db3 WHIRLPOOL ec6277fe1c881bc8ad55fa92e70676972228a13ca95a6c36ef2b5cf5e87d280d87ee5a743b98002e26be8b90a51a79d786abe3fdb72bfe5ab4ee08f3aa25d43f DIST shorewall-lite-4.6.10.1.tar.bz2 53535 SHA256 9944da74b9496fe29afe6ebab8f4a37cfb24a6a701282231dd6916831e064c38 SHA512 79347ae6c62e8f039efb2a21b10fd33d08831b6595b64fb4806cc5fd812216d295b73c859db775c0c19cd7c8bdfe67f21042db0d0b47ba47ab6b430d1d522659 WHIRLPOOL 593b8872ea0ff95c5847c51c9c3c312329017cbd7e96efcd39bf1a41a32ef3e99a29deb797a4260422d1bfd86ef4ca72b25024b7d2f5e4e17464df1f3f25571a DIST shorewall-lite-4.6.13.1.tar.bz2 56534 SHA256 639213a42c424def670a8b54ce13f0fe007aa9ff97e2beb8cb1cd98deb3fba2f SHA512 0fd3ac13e09dc4975d8a186a536b02420e00374376e3d8b903d6a69cb542de88a303bbe5d3e44831ef8d3ef3fd9ba0a34f19c89803d3ff4b622a366338cf7453 WHIRLPOOL 640541b5bb1c92d3fcb23ec970094200257af5b55a4a71be47a854be781d3e29d8354ea03d79b28fc654f3cab49c1e6de16ee01b3a02a61f0299a0a9bb4b5255 DIST shorewall-lite-4.6.13.tar.bz2 56490 SHA256 b73707abeb7d9911cae12c8280c014ed4189bd181e8e45f341d9b786b2f22b82 SHA512 c19aaaec6f31efd1afc2cc8e00d341b6135bb5a3b019a3f4a050ec43e4c1f5e4f8d68b00ec29a41201bd8e37a39c4b37348ddef575a1771cc6e6f80024db027c WHIRLPOOL eef127d2c8b76e2846490c916ddfd95692f13f362fd8a522f4b14fe47aec3c91a18a96935db46f5f6bdeb148ce9b1287c99bb4cb4e8292d74812c3ac677a9b41 +DIST shorewall-lite-5.0.1.tar.bz2 41893 SHA256 591fc40ca5af74f4a0d50a9aa7413e3c6311b4eeb46f36b72e2bf90ee392ed53 SHA512 9debace6a1202ff5b438078e8a0e47033fe13a563ea26fa6b163b55a3355eec31d1b89a1bdae071a6da8f3c4130b669eadd3b91073a366cfe8b9b31f3eb6fcc7 WHIRLPOOL 921cc0643b62ab5a068f8b0c276a971f7361d3cb59851ba96328afc95558cf3a85cd4bf3589c098b070474df18d9f5704e592ae0e51e6485c67804512e5bc009 DIST shorewall6-4.6.10.1.tar.bz2 231553 SHA256 1a2e303e9361fccf393ebfe512cf8d770b522f6b65a0a125a5e4aa0b28dd6e0c SHA512 acb678bd84e68d72f5dafd00d03feedefc8b954f7df9a4e6d57c70647ad2b046f7145c7b5de729d8bf1258a036587a687ee41170add2a50a411675be61de7d3d WHIRLPOOL a3451ff58bc32f4d720f5b8c6db226ac924cf0179084f351b7b35773f011c1b0b5feff2e9544a7b198995d297637e210b80adfb483db198e186b24a1954d2cc1 DIST shorewall6-4.6.13.1.tar.bz2 235114 SHA256 561887394a04532e06ebdf153aa60c6eaf176349f59a7a30e2c1d31aa48ba4eb SHA512 0700255da06c48577227439b3b358f4693a4e1e4c311f39079686c16b573e5bc4efd251160f69c1e6fc3daa8a503b2ede8fe44d51c93a9abd89431fd85081d72 WHIRLPOOL 9bcdf5b7a0c0a79143b3d451f7b362d41290ad641ab92b92abcfdda0fe15903ff2a225fc3571abe7c9c12e4b6ac34d054adf46372d94acfe997579a931a2979b DIST shorewall6-4.6.13.tar.bz2 235132 SHA256 dceb2de20460cd2015297925529fc95feb7bfc156465ef907dead663213a5994 SHA512 91184afc3b42b2b9d9ae679f9061964d79fd8320ff95eb8ab040dd2e2b144a2b546ba458c19a432992924b51c560cd04bff5750634b41f367f40314f8e3399a4 WHIRLPOOL d9a87edccc3d59146d3bcb97264b2a8c1c540b79885e76309ec8cfb9c73f0ce0332f9abc92574c5eb4812a000bede85ca28f5b144ceeb39af52f28cb9571a2a6 +DIST shorewall6-5.0.1.tar.bz2 220973 SHA256 466b6486cb992385443e46158afab60d669e6e5f774f68b0754d2b394feaf740 SHA512 0af72641961eb9b86e679a7456968a807e72ff296bcee28a8fcc60c1c8254a8b1b4d9c8ca22949f02705cb022622d9435a66a65ac35948ca49b419e410665823 WHIRLPOOL c72368da11227f2a1cc2b061e329314f06517617a322fbe2394a3a94fd11c7dab00ed86e657f74c344732cfc4217cfa5cf7af424f5c751632523bbcf7c45bef1 DIST shorewall6-lite-4.6.10.1.tar.bz2 52669 SHA256 ce19583541f5eb39acad33099af087d030374d467eb64aa4415ac9b18e65c5a8 SHA512 a33ab4b2397864329f35e6352606b13d04fb8ada17777c98d75bc685411bcf9453bf452d3a0b6699c537081483347c542bdfa547d71ca4c0c41967ccd755fd2e WHIRLPOOL ff3ef6e3ad68f69f47e71553061e845ed125735c1c6986180835397c8148386349a0317debf592917ec5ed0734c3af461c5161d9a061c6b8a6ff5c81d52743f0 DIST shorewall6-lite-4.6.13.1.tar.bz2 55723 SHA256 33a95315f4b976a4fe003f084c3f4363761a076c758c05c6a211a884fe6a63c5 SHA512 6c240fc31bf07e8c52aae3285cf22e7b2fefe846898bea02514157cffbedb930a7cf6a12a4ef473b1713ef8c524b7a48b916f0ffff37477c4ac94afb72397e11 WHIRLPOOL c9b99295ee498e9be3ae7d2a947153828653c931fba90527ecb05254c1fccb1981f800894b31786bcfab50cffdc2dd7e91964e70e43ab67a2d3d0954303b35a3 DIST shorewall6-lite-4.6.13.tar.bz2 55646 SHA256 9da8d4e29d867ba96aaaa9c0854e385e26b107aa0e5babbc5b1ffd36327cb413 SHA512 e826778478532f32155514e47aad35e2bace38933f5c4ccded67d058acba0766ef6687cc8bcdef6ba4ee1e629af7b5e8d11a77c5a8bb67d4fdc0b0167dadb731 WHIRLPOOL 9a6bba924e24f400d46afb0e13760ee4ed2e690c35e4364f652e4c252f9930d5710eed30e51ff5f312bff6bd56130321c49d0a8ea893c789122bd412c6c79993 +DIST shorewall6-lite-5.0.1.tar.bz2 41039 SHA256 fec8bc38fff94f0f5375992038eee83fb395a232b7cad83e1cf215a5d3388061 SHA512 1dc6f0681e429998880b90ca6e877bdeb4bfdf2c68036026db88aa55efdeaff27c59e4829597da938b0ee0e395278e744e98f7a41eabe536f7e6a1bea38850d3 WHIRLPOOL c5dcb398c353500f76ab6f555e387639d09f122ad792d40021958971c0dcf8e44cf16a4e443697574eecbc63eee2dc1d465aec1b86f6b9784b1a832c018ef3a0 diff --git a/net-firewall/shorewall/files/shorewall-init-01_remove-ipset-functionality.patch b/net-firewall/shorewall/files/shorewall-init-01_remove-ipset-functionality.patch new file mode 100644 index 000000000000..8b60eb245fc0 --- /dev/null +++ b/net-firewall/shorewall/files/shorewall-init-01_remove-ipset-functionality.patch @@ -0,0 +1,28 @@ +diff -rupN old/shorewall-init-4.6.10.1/shorewall-init new/shorewall-init-4.6.10.1/shorewall-init +--- old/shorewall-init-4.6.10.1/shorewall-init 2015-06-09 20:02:00.000000000 +0200 ++++ new/shorewall-init-4.6.10.1/shorewall-init 2015-06-14 17:16:17.396424059 +0200 +@@ -78,10 +78,6 @@ shorewall_start () { + fi + done + +- if [ -n "$SAVE_IPSETS" -a -f "$SAVE_IPSETS" ]; then +- ipset -R < "$SAVE_IPSETS" +- fi +- + return 0 + } + +@@ -99,13 +95,6 @@ shorewall_stop () { + fi + done + +- if [ -n "$SAVE_IPSETS" ]; then +- mkdir -p $(dirname "$SAVE_IPSETS") +- if ipset -S > "${SAVE_IPSETS}.tmp"; then +- grep -qE -- '^(-N|create )' "${SAVE_IPSETS}.tmp" && mv -f "${SAVE_IPSETS}.tmp" "$SAVE_IPSETS" +- fi +- fi +- + return 0 + } + diff --git a/net-firewall/shorewall/files/shorewall-init.confd b/net-firewall/shorewall/files/shorewall-init.confd new file mode 100644 index 000000000000..1b126be4e8bf --- /dev/null +++ b/net-firewall/shorewall/files/shorewall-init.confd @@ -0,0 +1,6 @@ +# List the Shorewall products Shorewall-init should +# initialize (space-separated list). +# +# Sample: PRODUCTS="shorewall shorewall6-lite" +# +PRODUCTS="" diff --git a/net-firewall/shorewall/files/shorewall-init.initd b/net-firewall/shorewall/files/shorewall-init.initd new file mode 100644 index 000000000000..837d609bb9fd --- /dev/null +++ b/net-firewall/shorewall/files/shorewall-init.initd @@ -0,0 +1,192 @@ +#!/sbin/runscript +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +SHOREWALLRC_FILE="@GENTOO_PORTAGE_EPREFIX@/usr/share/shorewall/shorewallrc" +CONFIG_FILE="@GENTOO_PORTAGE_EPREFIX@/etc/conf.d/${SVCNAME}" + +description="Puts Shorewall in a safe state at boot time" +description="${description} prior to bringing up the network." + +required_files="$SHOREWALLRC_FILE" + +depend() { + need localmount + before net + after bootmisc ipset tmpfiles.setup ulogd +} + + +. $SHOREWALLRC_FILE + +checkconfig() { + local PRODUCT= + + if [ -z "${VARLIB}" ]; then + eerror "\"VARLIB\" isn't defined or empty! Please check" \ + "\"${SHOREWALLRC_FILE}\"." + + return 1 + fi + + if [ -z "${PRODUCTS}" ]; then + eerror "${SVCNAME} isn't configured! Please check" \ + "\"${CONFIG_FILE}\"." + + return 1 + fi + + for PRODUCT in ${PRODUCTS}; do + if [ ! -x ${SBINDIR}/${PRODUCT} ]; then + eerror "Invalid product \"${PRODUCT}\" specified" \ + "in \"${CONFIG_FILE}\"!" + eerror "Maybe \"${PRODUCT}\" isn't installed?" + + return 1 + fi + done + + return 0 +} + +check_firewall_script() { + if [ ${PRODUCT} = shorewall -o ${PRODUCT} = shorewall6 ]; then + ebegin "Checking \"${STATEDIR}/firewall\"" + ${SBINDIR}/${PRODUCT} compile -c 1>/dev/null + eend $? + fi + + if [ ! -x ${STATEDIR}/firewall ]; then + eerror "\"${PRODUCT}\" isn't configured!" + + if [ ${PRODUCT} = shorewall-lite -o ${PRODUCT} = shorewall6-lite ]; then + eerror "Please go to your 'administrative system'" \ + "and deploy the compiled firewall" \ + "configuration for this system." + fi + + return 1 + fi + + return 0 +} + +is_allowed_to_be_executed() { + # This is not a real service. shorewall-init is an intermediate + # script to put your Shorewall-based firewall into a safe state + # at boot time prior to bringing up the network. + # Please read /usr/share/doc/shorewall-init-*/README.gentoo.gz + # for more information. + # When your system is up, there is no need to call shorewall-init. + # Please call shorewall{,6,-lite,6-lite} directly. That's the + # reason why we are preventing start, stop or restart here. + + local PRODUCT= + + if [ "${RC_RUNLEVEL}" != "boot" -a "${RC_CMD}" = "start" ]; then + # Starting shorewall-init is only allowed at boot time + eerror "This is a boot service, which can only be started" \ + "at boot." + eerror "If you want to get your shorewall-based firewall" \ + "into the same safe boot state again, run" + eerror "" + eindent + for PRODUCT in ${PRODUCTS}; do + eerror "/etc/init.d/${PRODUCT} stop" + done + eoutdent + eerror "" + eerror "Yes, \"stop\" and not start." + eerror "" + return 1 + fi + + if [ "${RC_RUNLEVEL}" != "shutdown" -a "${RC_CMD}" = "stop" ]; then + # Stopping shorewall-init is only allowed at shutdown + eerror "This is a boot service, which cannot be stopped." + eerror "If you really want to stop your Shorewall-based" \ + "firewall the same way this service would stop" \ + "Shorewall at shutdown, please run" + eerror "" + eindent + for PRODUCT in ${PRODUCTS}; do + eerror "/etc/init.d/${PRODUCT} clear" + done + eoutdent + eerror "" + eerror "Keep in mind that this will clear (=bring down)" \ + "your firewall!" + eerror "" + return 1 + fi + + if [ "${RC_CMD}" = "restart" ]; then + eerror "This is a boot service, which cannot be restarted." + eerror "If you want to restart any of your Shorewall-based" \ + "firewalls, run" + eerror "" + eindent + for PRODUCT in ${PRODUCTS}; do + eerror "/etc/init.d/${PRODUCT} restart" + done + eoutdent + eerror "" + return 1 + fi + + return 0 +} + +set_statedir() { + STATEDIR= + local VARDIR= + + if [ -f ${CONFDIR}/${PRODUCT}/vardir ]; then + STATEDIR=$( . ${CONFDIR}/${PRODUCT}/vardir && echo ${VARDIR} ) + fi + + [ ! -n "${STATEDIR}" ] && STATEDIR=${VARLIB}/${PRODUCT} +} + +start_pre() { + checkconfig || return 1 + + is_allowed_to_be_executed || return 1 +} + +start() { + local PRODUCT= + local STATEDIR= + + for PRODUCT in ${PRODUCTS}; do + set_statedir + + check_firewall_script || return 1 + + ebegin "Initializing \"${PRODUCT}\"" + ${STATEDIR}/firewall stop 1>/dev/null + eend $? + done +} + +stop_pre() { + checkconfig || return 1 + + is_allowed_to_be_executed || return 1 +} + +stop() { + local PRODUCT= + local STATEDIR= + + for PRODUCT in ${PRODUCTS}; do + set_statedir + + check_firewall_script || return 1 + + ebegin "Clearing \"${PRODUCT}\"" + ${STATEDIR}/firewall clear 1>/dev/null + eend $? + done +} diff --git a/net-firewall/shorewall/files/shorewall-init.readme b/net-firewall/shorewall/files/shorewall-init.readme new file mode 100644 index 000000000000..f7b13fed3de6 --- /dev/null +++ b/net-firewall/shorewall/files/shorewall-init.readme @@ -0,0 +1,30 @@ +shorewall-init from upstream offers two features (taken from [1]): + + 1. It can 'close' the firewall before the network interfaces are + brought up during boot. + + 2. It can change the firewall state as the result of interfaces + being brought up or taken down. + +On Gentoo we only support the first feature -- the firewall lockdown during +boot. + +We do not support the second feature, because Gentoo doesn't support a +if-{up,down}.d folder like other distributions do. If you would want to use +such a feature, you would have to add a custom action to /etc/conf.d/net +(please refer to the Gentoo Linux Handbook [2] for more information). +If you are able to add your custom {pre,post}{up,down} action, your are +also able to specify what shorewall{6,-lite,6-lite} should do, so there is +no need for upstream's scripts in Gentoo. + +If you disagree with us, feel free to open a bug [3] and contribute your +solution for Gentoo. + +Upstream's original init script also supports saving and restoring of +ipsets. Please use the init script from net-firewall/ipset if you need +such a feature. + + +[1] http://www.shorewall.net/Shorewall-init.html +[2] http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4&chap=5 +[3] https://bugs.gentoo.org diff --git a/net-firewall/shorewall/files/shorewall-init.systemd b/net-firewall/shorewall/files/shorewall-init.systemd new file mode 100644 index 000000000000..2b4695855f3a --- /dev/null +++ b/net-firewall/shorewall/files/shorewall-init.systemd @@ -0,0 +1,18 @@ +# +# The Shoreline Firewall (Shorewall) Packet Filtering Firewall - V5.0 +# +[Unit] +Description=shorewall-init +Documentation=http://www.shorewall.net/Shorewall-init.html +Before=network-pre.target +Wants=network-pre.target + +[Service] +Type=oneshot +RemainAfterExit=yes +StandardOutput=syslog +ExecStart=/sbin/shorewall-init start +ExecStop=/sbin/shorewall-init stop + +[Install] +WantedBy=basic.target diff --git a/net-firewall/shorewall/files/shorewall-lite.confd b/net-firewall/shorewall/files/shorewall-lite.confd new file mode 100644 index 000000000000..0e419b87a3c0 --- /dev/null +++ b/net-firewall/shorewall/files/shorewall-lite.confd @@ -0,0 +1,15 @@ +# Global start/restart/stop options +# +OPTIONS="-tvv" + +# Start options +# +STARTOPTIONS="" + +# Stop options +# +STOPOPTIONS="" + +# Restart options +# +RESTARTOPTIONS="" diff --git a/net-firewall/shorewall/files/shorewall-lite.initd b/net-firewall/shorewall/files/shorewall-lite.initd new file mode 100644 index 000000000000..c981a19e783c --- /dev/null +++ b/net-firewall/shorewall/files/shorewall-lite.initd @@ -0,0 +1,73 @@ +#!/sbin/runscript +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +description='The Shoreline Firewall Lite, more commonly known as "Shorewall Lite", is' +description="${description} a high-level tool for configuring Netfilter." + +extra_commands="clear" +extra_started_commands="reset" + +description_clear="Clear will remove all rules and chains installed by" +description_clear="${description_clear} Shorewall Lite. The firewall is" +description_clear="${description_clear} then wide open and unprotected." + +description_reset="All the packet and byte counters in the firewall are reset." + +command="/usr/sbin/shorewall-lite" + +depend() { + provide firewall + after ulogd +} + +status() { + local _retval + ${command} status 1>/dev/null + _retval=$? + if [ ${_retval} = '0' ]; then + einfo 'status: started' + mark_service_started "${SVCNAME}" + return 0 + else + einfo 'status: stopped' + mark_service_stopped "${SVCNAME}" + return 3 + fi +} + +start() { + ebegin "Starting shorewall-lite" + ${command} ${OPTIONS} start ${STARTOPTIONS} 1>/dev/null + eend $? +} + +stop() { + ebegin "Stopping shorewall-lite" + ${command} ${OPTIONS} stop ${STOPOPTIONS} 1>/dev/null + eend $? +} + +restart() { + ebegin "Restarting shorewall-lite" + ${command} status 1>/dev/null + if [ $? != 0 ] ; then + svc_start + else + ${command} ${OPTIONS} restart ${RESTARTOPTIONS} 1>/dev/null + fi + eend $? +} + +clear() { + ebegin "Clearing all shorewall-lite rules and setting policy to ACCEPT" + ${command} ${OPTIONS} clear 1>/dev/null + eend $? +} + +reset() { + ebegin "Resetting the packet and byte counters in shorewall-lite" + ${command} ${OPTIONS} reset 1>/dev/null + eend $? +} diff --git a/net-firewall/shorewall/files/shorewall-lite.systemd b/net-firewall/shorewall/files/shorewall-lite.systemd new file mode 100644 index 000000000000..a9d66e732bb1 --- /dev/null +++ b/net-firewall/shorewall/files/shorewall-lite.systemd @@ -0,0 +1,20 @@ +# +# The Shoreline Firewall Lite (Shorewall-Lite) Packet Filtering Firewall - V5.0 +# +[Unit] +Description=Shorewall IPv4 firewall lite +Documentation=man:shorewall-lite(8) http://www.shorewall.net/Documentation_Index.html +Wants=network-online.target +After=network-online.target +Conflicts=iptables.service firewalld.service iptables-restore.service + +[Service] +Type=oneshot +RemainAfterExit=yes +EnvironmentFile=/etc/conf.d/shorewall-lite +StandardOutput=syslog +ExecStart=/sbin/shorewall-lite $OPTIONS start $STARTOPTIONS +ExecStop=/sbin/shorewall-lite $OPTIONS stop $STOPOPTIONS + +[Install] +WantedBy=basic.target diff --git a/net-firewall/shorewall/files/shorewall.confd b/net-firewall/shorewall/files/shorewall.confd new file mode 100644 index 000000000000..0e419b87a3c0 --- /dev/null +++ b/net-firewall/shorewall/files/shorewall.confd @@ -0,0 +1,15 @@ +# Global start/restart/stop options +# +OPTIONS="-tvv" + +# Start options +# +STARTOPTIONS="" + +# Stop options +# +STOPOPTIONS="" + +# Restart options +# +RESTARTOPTIONS="" diff --git a/net-firewall/shorewall/files/shorewall.initd b/net-firewall/shorewall/files/shorewall.initd new file mode 100644 index 000000000000..95c1d0f1f5cc --- /dev/null +++ b/net-firewall/shorewall/files/shorewall.initd @@ -0,0 +1,98 @@ +#!/sbin/runscript +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +description='The Shoreline Firewall, more commonly known as "Shorewall", is' +description="${description} a high-level tool for configuring Netfilter." + +extra_commands="check clear" +extra_started_commands="refresh reset" + +description_check="Checks if the configuration will compile or not." + +description_clear="Clear will remove all rules and chains installed by" +description_clear="${description_clear} Shorewall. The firewall is then" +description_clear="${description_clear} wide open and unprotected." + +description_refresh="The mangle table will be refreshed along with the" +description_refresh="${description_refresh} blacklist chain (if any)." + +description_reset="All the packet and byte counters in the firewall are reset." + +command="/usr/sbin/shorewall" + +depend() { + provide firewall + after ulogd +} + +status() { + local _retval + ${command} status 1>/dev/null + _retval=$? + if [ ${_retval} = '0' ]; then + einfo 'status: started' + mark_service_started "${SVCNAME}" + return 0 + else + einfo 'status: stopped' + mark_service_stopped "${SVCNAME}" + return 3 + fi +} + +start() { + ebegin "Starting shorewall" + ${command} ${OPTIONS} start ${STARTOPTIONS} 1>/dev/null + eend $? +} + +stop() { + ebegin "Stopping shorewall" + ${command} ${OPTIONS} stop ${STOPOPTIONS} 1>/dev/null + eend $? +} + +restart() { + ebegin "Restarting shorewall" + ${command} status 1>/dev/null + if [ $? != 0 ] ; then + svc_start + else + ${command} ${OPTIONS} restart ${RESTARTOPTIONS} 1>/dev/null + fi + eend $? +} + +clear() { + ebegin "Clearing all shorewall rules and setting policy to ACCEPT" + ${command} ${OPTIONS} clear 1>/dev/null + eend $? +} + +reset() { + ebegin "Resetting the packet and byte counters in shorewall" + ${command} ${OPTIONS} reset 1>/dev/null + eend $? +} + +refresh() { + # refresh the rules involving the broadcast addresses of firewall + # interfaces, the black list, traffic control rules and + # ECN control rules + + ebegin "Refreshing shorewall rules" + ${command} ${OPTIONS} refresh 1>/dev/null + eend $? +} + +check() { + # perform cursory validation of the zones, interfaces, hosts, rules + # and policy files. CAUTION: does not parse and validate the generated + # iptables commands. + + ebegin "Checking shorewall configuration" + ${command} ${OPTIONS} check 1>/dev/null + eend $? +} diff --git a/net-firewall/shorewall/files/shorewall.systemd b/net-firewall/shorewall/files/shorewall.systemd new file mode 100644 index 000000000000..0844178b0d1f --- /dev/null +++ b/net-firewall/shorewall/files/shorewall.systemd @@ -0,0 +1,20 @@ +# +# The Shoreline Firewall (Shorewall) Packet Filtering Firewall - V5.0 +# +[Unit] +Description=Shorewall IPv4 firewall +Documentation=man:shorewall(8) http://www.shorewall.net/Documentation_Index.html +Wants=network-online.target +After=network-online.target +Conflicts=iptables.service firewalld.service iptables-restore.service + +[Service] +Type=oneshot +RemainAfterExit=yes +EnvironmentFile=/etc/conf.d/shorewall +StandardOutput=syslog +ExecStart=/sbin/shorewall $OPTIONS start $STARTOPTIONS +ExecStop=/sbin/shorewall $OPTIONS stop $STOPOPTIONS + +[Install] +WantedBy=basic.target diff --git a/net-firewall/shorewall/files/shorewall6-lite.confd b/net-firewall/shorewall/files/shorewall6-lite.confd new file mode 100644 index 000000000000..0e419b87a3c0 --- /dev/null +++ b/net-firewall/shorewall/files/shorewall6-lite.confd @@ -0,0 +1,15 @@ +# Global start/restart/stop options +# +OPTIONS="-tvv" + +# Start options +# +STARTOPTIONS="" + +# Stop options +# +STOPOPTIONS="" + +# Restart options +# +RESTARTOPTIONS="" diff --git a/net-firewall/shorewall/files/shorewall6-lite.initd b/net-firewall/shorewall/files/shorewall6-lite.initd new file mode 100644 index 000000000000..8eb0acebb6f2 --- /dev/null +++ b/net-firewall/shorewall/files/shorewall6-lite.initd @@ -0,0 +1,83 @@ +#!/sbin/runscript +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +description='The Shoreline Firewall 6 Lite, more commonly known as "Shorewall6 Lite", is' +description="${description} a high-level tool for configuring Netfilter." + +extra_commands="clear" +extra_started_commands="reset" + +description_clear="Clear will remove all rules and chains installed by" +description_clear="${description_clear} Shorewall6 Lite. The firewall is" +description_clear="${description_clear} then wide open and unprotected." + +description_reset="All the packet and byte counters in the firewall are reset." + +command="/usr/sbin/shorewall6-lite" + +depend() { + provide firewall + after ulogd +} + +status() { + local _retval + ${command} status 1>/dev/null + _retval=$? + if [ ${_retval} = '0' ]; then + einfo 'status: started' + mark_service_started "${SVCNAME}" + return 0 + else + einfo 'status: stopped' + mark_service_stopped "${SVCNAME}" + return 3 + fi +} + +start() { + ebegin "Starting shorewall6-lite" + ${command} ${OPTIONS} start ${STARTOPTIONS} 1>/dev/null + eend $? +} + +stop() { + ebegin "Stopping shorewall6-lite" + ${command} ${OPTIONS} stop ${STOPOPTIONS} 1>/dev/null + eend $? +} + +restart() { + # shorewall comes with its own control script that includes a + # restart function, so refrain from calling svc_stop/svc_start + # here. Note that this comment is required to fix bug 55576; + # runscript.sh greps this script... (09 Jul 2004 agriffis) + + ebegin "Restarting shorewall6-lite" + ${command} status 1>/dev/null + if [ $? != 0 ] ; then + svc_start + else + ${command} ${OPTIONS} restart ${RESTARTOPTIONS} 1>/dev/null + fi + eend $? +} + +clear() { + # clear will remove all the rules and bring the system to an unfirewalled + # state. (21 Nov 2004 eldad) + + ebegin "Clearing all shorewall6-lite rules and setting policy to ACCEPT" + ${command} ${OPTIONS} clear 1>/dev/null + eend $? +} + +reset() { + # reset the packet and byte counters in the firewall + + ebegin "Resetting the packet and byte counters in shorewall6-lite" + ${command} ${OPTIONS} reset 1>/dev/null + eend $? +} diff --git a/net-firewall/shorewall/files/shorewall6-lite.systemd b/net-firewall/shorewall/files/shorewall6-lite.systemd new file mode 100644 index 000000000000..5ca1a0d2d1a8 --- /dev/null +++ b/net-firewall/shorewall/files/shorewall6-lite.systemd @@ -0,0 +1,20 @@ +# +# The Shoreline Firewall 6 Lite (Shorewall6-Lite) Packet Filtering Firewall - V5.0 +# +[Unit] +Description=Shorewall IPv6 firewall lite +Documentation=man:shorewall6-lite(8) http://www.shorewall.net/Documentation_Index.html +Wants=network-online.target +After=network-online.target +Conflicts=ip6tables.service firewalld.service ip6tables-restore.service + +[Service] +Type=oneshot +RemainAfterExit=yes +EnvironmentFile=/etc/conf.d/shorewall6-lite +StandardOutput=syslog +ExecStart=/sbin/shorewall6-lite $OPTIONS start $STARTOPTIONS +ExecStop=/sbin/shorewall6-lite $OPTIONS stop $STOPOPTIONS + +[Install] +WantedBy=basic.target diff --git a/net-firewall/shorewall/files/shorewall6.confd b/net-firewall/shorewall/files/shorewall6.confd new file mode 100644 index 000000000000..210eec1b5730 --- /dev/null +++ b/net-firewall/shorewall/files/shorewall6.confd @@ -0,0 +1,15 @@ +# Global start/restart/stop options +# +OPTIONS="-tvv" + +# Start options +# +STARTOPTIONS="" + +# Stop options +# +STOPOPTIONS="" + +# Restart options +# +RESTARTOPTIONS="" diff --git a/net-firewall/shorewall/files/shorewall6.initd b/net-firewall/shorewall/files/shorewall6.initd new file mode 100644 index 000000000000..3826ae034196 --- /dev/null +++ b/net-firewall/shorewall/files/shorewall6.initd @@ -0,0 +1,108 @@ +#!/sbin/runscript +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +description='The Shoreline Firewall 6, more commonly known as "Shorewall6", is' +description="${description} a high-level tool for configuring Netfilter." + +extra_commands="check clear" +extra_started_commands="refresh reset" + +description_check="Checks if the configuration will compile or not." + +description_clear="Clear will remove all rules and chains installed by" +description_clear="${description_clear} Shorewall6. The firewall is then" +description_clear="${description_clear} wide open and unprotected." + +description_refresh="The mangle table will be refreshed along with the" +description_refresh="${description_refresh} blacklist chain (if any)." + +description_reset="All the packet and byte counters in the firewall are reset." + +command="/usr/sbin/shorewall6" + +depend() { + provide firewall + after ulogd +} + +status() { + local _retval + ${command} status 1>/dev/null + _retval=$? + if [ ${_retval} = '0' ]; then + einfo 'status: started' + mark_service_started "${SVCNAME}" + return 0 + else + einfo 'status: stopped' + mark_service_stopped "${SVCNAME}" + return 3 + fi +} + +start() { + ebegin "Starting shorewall6" + ${command} ${OPTIONS} start ${STARTOPTIONS} 1>/dev/null + eend $? +} + +stop() { + ebegin "Stopping shorewall6" + ${command} ${OPTIONS} stop ${STOPOPTIONS} 1>/dev/null + eend $? +} + +restart() { + # shorewall comes with its own control script that includes a + # restart function, so refrain from calling svc_stop/svc_start + # here. Note that this comment is required to fix bug 55576; + # runscript.sh greps this script... (09 Jul 2004 agriffis) + + ebegin "Restarting shorewall6" + ${command} status 1>/dev/null + if [ $? != 0 ] ; then + svc_start + else + ${command} ${OPTIONS} restart ${RESTARTOPTIONS} 1>/dev/null + fi + eend $? +} + +clear() { + # clear will remove all the rules and bring the system to an unfirewalled + # state. (21 Nov 2004 eldad) + + ebegin "Clearing all shorewall rules and setting policy to ACCEPT" + ${command} ${OPTIONS} clear 1>/dev/null + eend $? +} + +reset() { + # reset the packet and byte counters in the firewall + + ebegin "Resetting the packet and byte counters in shorewall6" + ${command} ${OPTIONS} reset 1>/dev/null + eend $? +} + +refresh() { + # refresh the rules involving the broadcast addresses of firewall + # interfaces, the black list, traffic control rules and + # ECN control rules + + ebegin "Refreshing shorewall6 rules" + ${command} ${OPTIONS} refresh 1>/dev/null + eend $? +} + +check() { + # perform cursory validation of the zones, interfaces, hosts, rules + # and policy files. CAUTION: does not parse and validate the generated + # iptables commands. + + ebegin "Checking shorewall6 configuration" + ${command} ${OPTIONS} check 1>/dev/null + eend $? +} diff --git a/net-firewall/shorewall/files/shorewall6.systemd b/net-firewall/shorewall/files/shorewall6.systemd new file mode 100644 index 000000000000..182c71bd0803 --- /dev/null +++ b/net-firewall/shorewall/files/shorewall6.systemd @@ -0,0 +1,20 @@ +# +# The Shoreline Firewall 6 (Shorewall6) Packet Filtering Firewall - V5.0 +# +[Unit] +Description=Shorewall IPv6 firewall +Documentation=man:shorewall6(8) http://www.shorewall.net/Documentation_Index.html +Wants=network-online.target +After=network-online.target +Conflicts=ip6tables.service firewalld.service ip6tables-restore.service + +[Service] +Type=oneshot +RemainAfterExit=yes +EnvironmentFile=/etc/conf.d/shorewall6 +StandardOutput=syslog +ExecStart=/sbin/shorewall6 $OPTIONS start $STARTOPTIONS +ExecStop=/sbin/shorewall6 $OPTIONS stop $STOPOPTIONS + +[Install] +WantedBy=basic.target diff --git a/net-firewall/shorewall/files/shorewallrc b/net-firewall/shorewall/files/shorewallrc new file mode 100644 index 000000000000..53e7200be3dc --- /dev/null +++ b/net-firewall/shorewall/files/shorewallrc @@ -0,0 +1,23 @@ +# +# Gentoo Shorewall 5.0 rc file +# +BUILD=gentoo #Default is to detect the build system +HOST=gentoo #Gentoo GNU Linux +PREFIX=@GENTOO_PORTAGE_EPREFIX@/usr #Top-level directory for shared files, libraries, etc. +SHAREDIR=${PREFIX}/share #Directory for arch-neutral files. +LIBEXECDIR=${PREFIX}/share #Directory for executable scripts. +PERLLIBDIR=${PREFIX}/share/shorewall #Directory to install Shorewall Perl module directory +CONFDIR=@GENTOO_PORTAGE_EPREFIX@/etc #Directory where subsystem configurations are installed +SBINDIR=${PREFIX}/sbin #Directory where system administration programs are installed +MANDIR=${PREFIX}/share/man #Directory where manpages are installed. +INITDIR=${CONFDIR}/init.d #Directory where SysV init scripts are installed. +INITFILE=${PRODUCT} #Name of the product's installed SysV init script +INITSOURCE=init.gentoo.sh #Name of the distributed file to be installed as the SysV init script +ANNOTATED= #If non-zero, annotated configuration files are installed +SERVICEDIR=@GENTOO_PORTAGE_EPREFIX@/usr/lib/systemd/system #Directory where .service files are installed (systems running systemd only) +SERVICEFILE=gentoo.service #Name of the distributed file to be installed as systemd service file +SYSCONFFILE=default.gentoo #Name of the distributed file to be installed in $SYSCONFDIR +SYSCONFDIR=${CONFDIR}/conf.d #Directory where SysV init parameter files are installed +SPARSE= #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR +VARLIB=@GENTOO_PORTAGE_EPREFIX@/var/lib #Directory where product variable data is stored. +VARDIR=${VARLIB}/${PRODUCT} #Directory where product variable data is stored. diff --git a/net-firewall/shorewall/shorewall-5.0.1.ebuild b/net-firewall/shorewall/shorewall-5.0.1.ebuild new file mode 100644 index 000000000000..66ba2b7f52ef --- /dev/null +++ b/net-firewall/shorewall/shorewall-5.0.1.ebuild @@ -0,0 +1,447 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI="5" + +inherit eutils linux-info prefix systemd versionator + +DESCRIPTION='The Shoreline Firewall, commonly known as Shorewall, is' +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 "${S}"/${MY_PN_IPV4}/default.gentoo || die "Copying shorewall.confd failed" + cp "${FILESDIR}"/shorewall.initd "${S}"/${MY_PN_IPV4}/init.gentoo.sh || die "Copying shorewall.initd 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}"/shorewall6.confd "${S}"/${MY_PN_IPV6}/default.gentoo || die "Copying shorewall6.confd failed" + cp "${FILESDIR}"/shorewall6.initd "${S}"/${MY_PN_IPV6}/init.gentoo.sh || die "Copying shorewall6.initd 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 "${S}"/${MY_PN_LITE4}/default.gentoo || die "Copying shorewall-lite.confd failed" + cp "${FILESDIR}"/shorewall-lite.initd "${S}"/${MY_PN_LITE4}/init.gentoo.sh || die "Copying shorewall-lite.initd 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}"/shorewall6-lite.confd "${S}"/${MY_PN_LITE6}/default.gentoo || die "Copying shorewall6-lite.confd failed" + cp "${FILESDIR}"/shorewall6-lite.initd "${S}"/${MY_PN_LITE6}/init.gentoo.sh || die "Copying shorewall6-lite.initd 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} + epatch "${FILESDIR}"/shorewall-init-01_remove-ipset-functionality.patch + cd "${S}" + 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 + + epatch_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} ..." + dohtml -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 + + if [[ -n "${REPLACING_VERSIONS}" && ${REPLACING_VERSIONS} < ${MY_MAJOR_RELEASE_NUMBER} ]]; 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/upgrade_issues.htm#idp8704902640" + + 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 + fi + + 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 +} |