Subject: [alpine-devel] Updated ebtables and icecast package patches

From: Andrew Manison <[email-masked]>
Date: Thu, 29 Oct 2009 01:30:30 -0400

>From d66a2d28518aeeb30d944529ddc7c1e2343989e4 Mon Sep 17 00:00:00 2001
From: Andrew Manison <[email-masked]>
Date: Wed, 28 Oct 2009 17:39:39 +0000
Subject: [PATCH] Added ebtables package with makefile revisions to support ssp: link with gcc, make install directories

---
 testing/ebtables/0001-link-with-gcc.patch |   25 +++++++++++++++++++
 testing/ebtables/APKBUILD                 |   38 +++++++++++++++++++++++++++++
 2 files changed, 63 insertions(+), 0 deletions(-)
 create mode 100644 testing/ebtables/0001-link-with-gcc.patch
 create mode 100644 testing/ebtables/APKBUILD

diff --git a/testing/ebtables/0001-link-with-gcc.patch b/testing/ebtables/0001-link-with-gcc.patch
new file mode 100644
index 0000000..88aba09
--- /dev/null
+++ b/testing/ebtables/0001-link-with-gcc.patch
@@ -0,0 +1,25 @@
+--- a/Makefile	Sun Jun 21 13:13:25 2009
++++ b/Makefile	Wed Oct 28 02:42:43 2009
+@@ -85,7 +85,7 @@
+ 
+ .PHONY: libebtc
+ libebtc: $(OBJECTS2)
+-	$(LD) -shared -soname libebtc.so -o libebtc.so -lc $(OBJECTS2)
++	$(CC) -shared -Wl,-soname,libebtc.so -o libebtc.so -lc $(OBJECTS2)
+ 
+ ebtables: $(OBJECTS) ebtables-standalone.o libebtc
+ 	$(CC) $(CFLAGS) $(CFLAGS_SH_LIB) -o $@ ebtables-standalone.o -I$(KERNEL_INCLUDES) -L. -Lextensions -lebtc $(EXT_LIBSI) \
+@@ -153,10 +153,13 @@
+ tmp3:=$(shell printf $(PIPE) | sed 's/\//\\\//g')
+ .PHONY: scripts
+ scripts: ebtables-save ebtables.sysv ebtables-config
++	mkdir -p $(DESTDIR)$(BINDIR)
+ 	cat ebtables-save | sed 's/__EXEC_PATH__/$(tmp1)/g' > ebtables-save_
+ 	install -m 0755 -o root -g root ebtables-save_ $(DESTDIR)$(BINDIR)/ebtables-save
++	mkdir -p $(DESTDIR)$(INITDIR)
+ 	cat ebtables.sysv | sed 's/__EXEC_PATH__/$(tmp1)/g' | sed 's/__SYSCONFIG__/$(tmp2)/g' > ebtables.sysv_
+ 	install -m 0755 -o root -g root ebtables.sysv_ $(DESTDIR)$(INITDIR)/ebtables
++	mkdir -p $(DESTDIR)$(SYSCONFIGDIR)
+ 	cat ebtables-config | sed 's/__SYSCONFIG__/$(tmp2)/g' > ebtables-config_
+ 	install -m 0600 -o root -g root ebtables-config_ $(DESTDIR)$(SYSCONFIGDIR)/ebtables-config
+ 	rm -f ebtables-save_ ebtables.sysv_ ebtables-config_
diff --git a/testing/ebtables/APKBUILD b/testing/ebtables/APKBUILD
new file mode 100644
index 0000000..c538f76
--- /dev/null
+++ b/testing/ebtables/APKBUILD
@@ -0,0 +1,38 @@
+# Contributor: 
+# Maintainer: 
+pkgname=ebtables
+pkgver=2.0.9.1
+_realver=v2.0.9-1
+pkgrel=0
+pkgdesc="Ethernet bridge tables - Linux Ethernet filter for the Linux bridge."
+url="http://ebtables.sourceforge.net/"
+license="GPL"
+depends=""
+makedepends="uclibc-dev"
+install=
+#subpackages="$pkgname-dev $pkgname-doc"
+source="http://downloads.sourceforge.net/$pkgname/$pkgname-$_realver.tar.gz"
+
+#    0001-add-gcc-no-stack-protector-flag-to-makefile.patch"
+
+# append extra dependencies to -dev subpackage
+# remove if not used.
+# depends_dev="somepackage-dev"
+
+build() {
+	cd "$srcdir"/$pkgname-$_realver
+
+	patches
+	for i in ../../*.patch; do
+		msg "Applying $i"
+		if ! patch --verbose -p1 -i $i; then
+			error "$i failed"
+			return 1
+		fi
+	done
+
+	make || return 1
+	make DESTDIR="$pkgdir" install
+}
+
+md5sums="0e0c20adf2bba6d91dbd0b74a1a38c33  ebtables-v2.0.9-1.tar.gz"
-- 
1.6.5

>From 39b52280825fe98466ae44f3e418ecb2741d3e15 Mon Sep 17 00:00:00 2001
From: Andrew Manison <[email-masked]>
Date: Wed, 28 Oct 2009 22:53:15 +0000
Subject: [PATCH] Added icecast package

---
 testing/icecast/APKBUILD |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)
 create mode 100644 testing/icecast/APKBUILD

diff --git a/testing/icecast/APKBUILD b/testing/icecast/APKBUILD
new file mode 100644
index 0000000..b9d34f4
--- /dev/null
+++ b/testing/icecast/APKBUILD
@@ -0,0 +1,25 @@
+# Contributor: 
+# Maintainer: 
+pkgname=icecast
+pkgver=2.3.2
+pkgrel=0
+pkgdesc="Open source media server"
+url="http://www.icecast.org"
+license="GPL"
+depends="busybox"
+makedepends="libxslt-dev libxml2-dev libogg-dev libvorbis-dev libtheora-dev"
+subpackages="$pkgname-doc"
+source="http://downloads.xiph.org/releases/$pkgname/$pkgname-$pkgver.tar.gz"
+
+build() {
+	cd "$srcdir"/$pkgname-$pkgver
+
+	./configure --prefix=/usr \
+		--sysconfdir=/etc \
+		--mandir=/usr/share/man \
+		--infodir=/usr/share/info
+	make || return 1
+	make DESTDIR="$pkgdir" install
+}
+
+md5sums="ff516b3ccd2bcc31e68f460cd316093f  icecast-2.3.2.tar.gz"
-- 
1.6.5

---

From: Natanael Copa <[email-masked]>
Date: Thu, 29 Oct 2009 15:09:01 +0100

Sorry for the late reply. 

First impression is: Very well done!

Good catch on that stack-protector linking issue. A tip: have a look at
what gentoo does. We use their patches to enforce ssp so they very often
have had same issues as we bump into.

Looks like gentoo have a patch for it too.
http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-firewall/ebtables/files/ebtables-v2.0.9-1-LDFLAGS.diff?rev=1.1&view=markup

On Thu, 2009-10-29 at 01:30 -0400, Andrew Manison wrote:
> plain text document attachment
> (0001-Added-ebtables-package-with-makefile-revisions.patch)
The init.d script uses #!/bin/bash and /etc/sysconfig is redhatish. I
think we don't install those at all. We can rip the gentoo init.d
scripts.

abuild will automatically add build-base as make dependnecy. This
includes gnu make, gcc, uclibc-dev etc. so you dont relaly need to add
uclibc-dev as makedepends.

> +#subpackages="$pkgname-dev $pkgname-doc"

There was a manpage that got installed in /usr/local. We want a -doc
subpackage with the man page in /usr/share/man

> +# depends_dev="somepackage-dev"
^^^
Those comments can be removed
> +	cd "$srcdir"/$pkgname-$_realver
        ^^^
missing #

> +	for i in ../../*.patch; do

the unpack() function will symlink everthing listed in $sources to
$srcdir. The srcdir otoh, might not alway be in startdir. We were
talking about move it to some place outside the poarts git tree. (some
compeil scripts check git describe, gets the aports git description and
compiles in that version info into the binary. see the lighttpd version
in footer on http://dev.alpinelinux.org/~ncopa/alpine/)

so, ../*.patch works, and "$srcdir"/*.patch works. The ../../*.patch
works at the moment but might not work in future.

> +	make DESTDIR="$pkgdir" install

The make install seems to install the binaries in /usr/local. We want
our packages install stuff in /usr

> +md5sums="0e0c20adf2bba6d91dbd0b74a1a38c33  ebtables-v2.0.9-1.tar.gz"

I committed your stuff and added the gentoo initd scripts and cleaned up
the apkbuild a bit. Since its a new apkbuild i also did the patching in
prepare() and make install in package(). I think thats how we want
things in future.

> plain text document attachment (0001-Added-icecast-package.patch)

Why you need busybox in depends?

> +md5sums="ff516b3ccd2bcc31e68f460cd316093f  icecast-2.3.2.tar.gz"

I committed and pushed your packages. Added init.d scripts from gentoo
seems like icecast needs some more fixing as it does not start
out-of-the box.

-nc

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