Subject: [alpine-aports] testing/firehol: new aport

From: Jonathan Tyers <[email-masked]>
Date: Mon, 22 Aug 2016 17:17:56 +0100

The attached includes two new packages, firehol (excluding fireqos,
vnetbuild) and iprange, which is a firehol dependency.

testing/firehol: new aport

    http://www.firehol.org/
    simple yet powerful firewall

testing/iprange: new aport

    http://www.firehol.org/
    supporting tools for firehol package

--
Jonny Tyers
From 36b35a05c01d20d2b20a85fe4a610ee9b1f04744 Mon Sep 17 00:00:00 2001
From: Jonny Tyers <[email-masked]>
Date: Sun, 21 Aug 2016 22:44:06 +0100
Subject: [PATCH] firehol: new aport

http://www.firehol.org/
simple yet powerful firewall
---
 testing/firehol/APKBUILD             | 90 ++++++++++++++++++++++++++++++++++++
 testing/firehol/firehol.initd        | 33 +++++++++++++
 testing/firehol/firehol.post-install |  3 ++
 3 files changed, 126 insertions(+)
 create mode 100644 testing/firehol/APKBUILD
 create mode 100644 testing/firehol/firehol.initd
 create mode 100644 testing/firehol/firehol.post-install

diff --git a/testing/firehol/APKBUILD b/testing/firehol/APKBUILD
new file mode 100644
index 0000000..a64fe95
--- /dev/null
+++ b/testing/firehol/APKBUILD
@@ -0,0 +1,90 @@
+# Contributor: Jonny Tyers <[email-masked]>
+# Maintainer: Jonny Tyers <[email-masked]>
+pkgname=firehol
+pkgver=3.0.1
+pkgrel=0
+pkgdesc="easy to use but powerful iptables stateful firewall"
+url="http://www.firehol.org/"
+arch="noarch"
+license="GPL2"
+depends="bash iprange ipset iptables"
+depends_dev=""
+makedepends="$depends_dev"
+install="$pkgname.post-install"
+subpackages="$pkgname-doc"
+source="
+	https://firehol.org/download/firehol/releases/v3.0.1/firehol-3.0.1.tar.bz2
+	firehol.initd
+	"
+
+_builddir="$srcdir"/$pkgname-$pkgver
+prepare() {
+	local i
+	cd "$_builddir"
+	for i in $source; do
+		case $i in
+		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+		esac
+	done
+}
+
+build() {
+	cd "$_builddir"
+
+	export LD="$CC"
+
+	./configure \
+		--build=$CBUILD \
+		--host=$CHOST \
+		--prefix=/usr \
+		--sysconfdir=/etc/firehol \
+		--datadir=/usr/share/firehol \
+		--libexecdir=/usr/lib/firehol \
+		--mandir=/usr/share/man \
+		--with-ldflags="$LDFLAGS" \
+		--disable-doc \
+		--disable-fireqos \
+		--disable-vnetbuild \
+		--disable-man \
+		--disable-link-balancer \
+		|| return 1
+	make || return 1
+}
+
+package() {
+	cd "$_builddir"
+
+	#make DESTDIR="$pkgdir" install || return 1
+	
+	install -m755 -D sbin/firehol \
+		"$pkgdir"/sbin/$pkgname || return 1
+	install -m755 -D sbin/update-ipsets \
+		"$pkgdir"/sbin/update-ipsets || return 1
+
+	install -d "$pkgdir"/usr/lib/$pkgname
+	install -m755 -D sbin/functions.common.sh \
+		"$pkgdir"/usr/lib/$pkgname/ || return 1
+
+	install -m644 -D etc/firehol.conf.example \
+		"$pkgdir"/etc/firehol.conf.example || return 1
+
+	#install -m755 -D "$srcdir"/$pkgname.initd \
+		#"$pkgdir"/etc/init.d/$pkgname || return 1
+}
+
+doc() {
+	cd "$_builddir"
+	pkgdesc="$pkgname documentation and contrib files (including dnsbl and systemd unit files)"
+	install -d "$subpkgdir"/usr/share/doc/$subpkgname
+	mv examples "$subpkgdir"/usr/share/doc/$subpkgname/
+	mv html "$subpkgdir"/usr/share/doc/$subpkgname/
+	mv COPYING "$subpkgdir"/usr/share/doc/$subpkgname/
+	mv contrib "$subpkgdir"/usr/share/doc/$subpkgname/
+}
+
+md5sums="c66069dfec4b14af5ec2f85fe6f71936  firehol-3.0.1.tar.bz2
+b65142a9090cc3b6ad9793f9fc09c73c  firehol.initd"
+sha256sums="4c385a41705023d60d64f76a7cf4c9d7e193097c90a621beaedb91727ce6afea  firehol-3.0.1.tar.bz2
+86a8a960fd009eaef9a7b5ac56407eb18cac53bf2c26a6bbb9183f5edfbfd2b1  firehol.initd"
+sha512sums="36624ce27f03d5fdd42031d30e8ab00b80674d73131204f90ea9d9dec732fcd1359e6e213b59922cc67435a859961065009c18269dd21bf6eb556dca11c06a80  firehol-3.0.1.tar.bz2
+e005ad8a663c735dfb88a751ac3772a5c043fb38f3d35fffc569d8bececf02df48db45a5416b799f13bec9b02ad2dc094e2034f56be5a3386684d0e3f47ecf24  firehol.initd"
diff --git a/testing/firehol/firehol.initd b/testing/firehol/firehol.initd
new file mode 100644
index 0000000..88f3826
--- /dev/null
+++ b/testing/firehol/firehol.initd
@@ -0,0 +1,33 @@
+#!/sbin/openrc-run
+
+name=firehol
+daemon=/usr/sbin/$name
+
+depend() {
+	need net
+}
+
+start() {
+	ebegin "Starting ${name}"
+	firehol start
+	eend $?
+}
+
+stop() {
+	ebegin "Stopping ${name}"
+	firehol stop
+	eend $?
+}
+
+try() {
+	ebegin "Testing ${name} configuration"
+	firehol try
+	eend $?
+}
+
+panic() {
+	ebegin "Putting ${name} in PANIC mode"
+	firehol panic "$@"
+	eend $?
+}
+
diff --git a/testing/firehol/firehol.post-install b/testing/firehol/firehol.post-install
new file mode 100644
index 0000000..c57fbaf
--- /dev/null
+++ b/testing/firehol/firehol.post-install
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+ln -s /sbin/firehol /etc/init.d/firehol
-- 
2.6.6

---

From: Jonathan Tyers <[email-masked]>
Date: Sun, 4 Sep 2016 16:16:03 +0100

Hi there,

I see these havent yet been merged into testing... just wanted to check you
recieved this patch alright?

--
Jonny Tyers

On 22 Aug 2016 17:17, "Jonathan Tyers" <[email-masked]> wrote:

> The attached includes two new packages, firehol (excluding fireqos, vnetbuild) and iprange, which is a firehol dependency.
>

---

From: Stuart Cardall <[email-masked]>
Date: Sun, 4 Sep 2016 17:45:57 +0100

Patches will probably be accepted more quickly sent via github (as they
are built automatically)

I've made some notes for moving patchwork => github:

https://it-offshore.co.uk/code/81-alpine-linux-pull-requests-on-github

Stuart.

On 09/04/2016 04:16 PM, Jonathan Tyers wrote:
>
>
> Hi there,
>
> I see these havent yet been merged into testing... just wanted to
> check you recieved this patch alright?
>
> --
> Jonny Tyers
>
>
> On 22 Aug 2016 17:17, "Jonathan Tyers" <[email-masked]
> <mailto:[email-masked]>> wrote:
>

---

From: Natanael Copa <[email-masked]>
Date: Thu, 22 Sep 2016 12:54:17 +0200

On Mon, 22 Aug 2016 17:17:56 +0100

> +++ b/testing/firehol/APKBUILD

it fails to build for me due to missing dependendy iprange.

>>> firehol: Checking sanity of /home/ncopa/aports/testing/firehol/APKBUILD...
>>> firehol: Analyzing dependencies...
ERROR: unsatisfiable constraints:
  iprange (missing):
    required by: world[iprange]
>>> ERROR: firehol: all failed

-nc

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Leonardo Arena <[email-masked]>
Date: Thu, 29 Dec 2016 11:33:57 +0100

Hi,

>     supporting tools for firehol package

iprange patch is missing, hence firehol can't be built.

Thanks

|_eo

---

From: Jonny Tyers <[email-masked]>
Date: Thu, 29 Dec 2016 11:48:23 +0000

Hi Leo, since I didn't get a response on this submission I assumed that I
was following old build instructions and that I'd need to resubmit [this is
my first package].

I've therefore put together another patch containing *only* iprange, not
firehol, and submitted a pull request via github according to the
instructions I've since found on there. I excluded firehol as this is my
first package and it looked like it would be a complex one to put together
and get right, so going through the process with just iprange, which is
much simpler, seemed the best option.

Once the iprange pull request is accepted and makes it into testing I
intend to put togeher another patch for firehol and submit that seperately.

I think we can therefore ignore the patch in this email entirely as the
pull requests effectively supercede it.

Jonny

-- 
--
Jonny Tyers