summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMika Havela <mika.havela@gmail.com>2010-11-26 12:02:33 +0100
committerMika Havela <mika.havela@gmail.com>2010-11-26 12:02:33 +0100
commit04d7ed52caaa08d16814b904daced2014bf15ff6 (patch)
treeda1d3a2ec238e1dcb42b300a5f5abf764d0bd168
parent4a5c67baf55bbe6eea951668095e2a9e27bb2336 (diff)
parentc315da486a9ecf4b696be7bb982aeb0a9c0ecb0b (diff)
downloadaports-04d7ed52caaa08d16814b904daced2014bf15ff6.tar.bz2
aports-04d7ed52caaa08d16814b904daced2014bf15ff6.tar.xz
Merge branch 'master' of git://git.alpinelinux.org/aports
-rw-r--r--main/fprobe/APKBUILD23
-rw-r--r--main/fprobe/fprobe-1.1-pidfile-sanity.patch48
-rw-r--r--main/fprobe/fprobe-1.1-setgroups.patch19
-rw-r--r--main/pcre/APKBUILD23
-rw-r--r--main/pcre/uclibc-strtoq.patch18
5 files changed, 122 insertions, 9 deletions
diff --git a/main/fprobe/APKBUILD b/main/fprobe/APKBUILD
index f7311e98e..f5db4ea82 100644
--- a/main/fprobe/APKBUILD
+++ b/main/fprobe/APKBUILD
@@ -1,19 +1,32 @@
-# Contributor: Carlo Landmeter <clandmeter@gmail.com>
+# Contributor: Leonardo Arena <rnalrd@gmail.com>
# Maintainer: Carlo Landmeter <clandmeter@gmail.com>
pkgname=fprobe
pkgver=1.1
-pkgrel=3
+pkgrel=4
pkgdesc="libpcap-based tool that collect network traffic"
url="http://fprobe.sourceforge.net/"
license="GPL"
depends=
makedepends="libpcap-dev"
+install=""
subpackages="$pkgname-doc"
source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.bz2
-$pkgname.initd
-$pkgname.confd"
+ fprobe-1.1-pidfile-sanity.patch
+ fprobe-1.1-setgroups.patch
+ $pkgname.initd
+ $pkgname.confd"
_builddir="$srcdir"/$pkgname-$pkgver
+
+prepare() {
+ cd $_builddir
+ for i in ../*.patch
+ do
+ msg "Applying $i"
+ patch -p1 < ../$i || exit 1
+ done
+}
+
build() {
cd "$_builddir"
./configure --prefix=/usr \
@@ -32,5 +45,7 @@ package() {
}
md5sums="65850d0470078269b33eee58cba77ac2 fprobe-1.1.tar.bz2
+265c9d9c434df46fc224a1ce7051e27a fprobe-1.1-pidfile-sanity.patch
+ba8632d883fb49e83ea16db67c50a69b fprobe-1.1-setgroups.patch
41810a73503624de2c27809e34ed80b4 fprobe.initd
ba9c9327456e4db897b60481705df282 fprobe.confd"
diff --git a/main/fprobe/fprobe-1.1-pidfile-sanity.patch b/main/fprobe/fprobe-1.1-pidfile-sanity.patch
new file mode 100644
index 000000000..e7c10bd98
--- /dev/null
+++ b/main/fprobe/fprobe-1.1-pidfile-sanity.patch
@@ -0,0 +1,48 @@
+If we are using the chroot() option or the setuid options, we must create the
+pidfile before doing the chroot OR the setreuid. It's actually best for
+start-stop-daemon if we create the pidfile from the master side of the fork()
+before it exits, since most of the startup checks happen after the chroot()
+unfortunetly.
+
+Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
+
+diff -Nuar fprobe-1.1.orig/src/fprobe.c fprobe-1.1/src/fprobe.c
+--- fprobe-1.1.orig/src/fprobe.c 2005-01-30 08:43:35.000000000 +0000
++++ fprobe-1.1/src/fprobe.c 2008-03-16 20:51:24.000000000 +0000
+@@ -1379,7 +1379,8 @@
+
+ my_log_open(ident, verbosity, log_dest);
+ if (!(log_dest & 2)) {
+- switch (fork()) {
++ pid_t childpid = fork();
++ switch (childpid) {
+ case -1:
+ fprintf(stderr, "fork(): %s", strerror(errno));
+ exit(1);
+@@ -1392,6 +1393,12 @@
+ break;
+
+ default:
++ if (!(pidfile = fopen(pidfilepath, "w")))
++ my_log(LOG_ERR, "Can't create pid file. fopen(): %s", strerror(errno));
++ else {
++ fprintf(pidfile, "%ld\n", (long) childpid);
++ fclose(pidfile);
++ }
+ exit(0);
+ }
+ } else {
+@@ -1548,13 +1555,6 @@
+ }
+ }
+
+- if (!(pidfile = fopen(pidfilepath, "w")))
+- my_log(LOG_ERR, "Can't create pid file. fopen(): %s", strerror(errno));
+- else {
+- fprintf(pidfile, "%ld\n", (long) pid);
+- fclose(pidfile);
+- }
+-
+ my_log(LOG_INFO, "pid: %d", pid);
+ my_log(LOG_INFO, "interface: %s, datalink: %s (%d)",
+ dev, dlt[link_type_idx].descr, link_type);
diff --git a/main/fprobe/fprobe-1.1-setgroups.patch b/main/fprobe/fprobe-1.1-setgroups.patch
new file mode 100644
index 000000000..969681243
--- /dev/null
+++ b/main/fprobe/fprobe-1.1-setgroups.patch
@@ -0,0 +1,19 @@
+This seems to fail after the chroot(), so just squelch the exit for now.
+
+Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
+
+diff -Nuar fprobe-1.1/src/fprobe.c fprobe-1.1.new/src/fprobe.c
+--- fprobe-1.1/src/fprobe.c 2008-03-17 00:06:43.000000000 +0000
++++ fprobe-1.1.new/src/fprobe.c 2008-03-17 00:07:30.000000000 +0000
+@@ -1541,10 +1541,10 @@
+ }
+
+ if (pw) {
+ if (setgroups(0, NULL) < 0) {
+ my_log(LOG_CRIT, "setgroups: %s", strerror(errno));
+- exit(1);
++ //exit(1);
+ }
+ if (setregid(pw->pw_gid, pw->pw_gid)) {
+ my_log(LOG_CRIT, "setregid(%u): %s", pw->pw_gid, strerror(errno));
+ exit(1);
diff --git a/main/pcre/APKBUILD b/main/pcre/APKBUILD
index 160311093..cc7c74fcf 100644
--- a/main/pcre/APKBUILD
+++ b/main/pcre/APKBUILD
@@ -6,12 +6,24 @@ pkgdesc="Perl-compatible regular expression library"
url="http://pcre.sourceforge.net"
license="BSD"
depends=
-makedepends=
-source="ftp://ftp.csx.cam.ac.uk/pub/software/programming/$pkgname/$pkgname-$pkgver.tar.bz2"
+makedepends="autoconf automake libtool"
+source="ftp://ftp.csx.cam.ac.uk/pub/software/programming/$pkgname/$pkgname-$pkgver.tar.bz2
+ uclibc-strtoq.patch"
subpackages="$pkgname-dev $pkgname-doc libpcrecpp"
+_builddir="$srcdir/$pkgname-$pkgver"
+prepare() {
+ cd "$_builddir"
+ for i in $source; do
+ case $i in
+ *.patch) patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+ aclocal && autoconf && automake && libtoolize
+}
+
build() {
- cd "$srcdir/$pkgname-$pkgver"
+ cd "$_builddir"
./configure --prefix=/usr \
--enable-utf8 \
--with-match-limit-recursion=8192 \
@@ -22,7 +34,7 @@ build() {
}
package() {
- cd "$srcdir/$pkgname-$pkgver"
+ cd "$_builddir"
make DESTDIR="$pkgdir" install || return 1
}
@@ -32,4 +44,5 @@ libpcrecpp() {
mv "$pkgdir"/usr/lib/libpcrecpp.so* "$subpkgdir"/usr/lib/
}
-md5sums="780867a700e9d4e4b9cb47aa5453e4b2 pcre-8.10.tar.bz2"
+md5sums="780867a700e9d4e4b9cb47aa5453e4b2 pcre-8.10.tar.bz2
+6276c5cdbecaa14256b50ce9a9333500 uclibc-strtoq.patch"
diff --git a/main/pcre/uclibc-strtoq.patch b/main/pcre/uclibc-strtoq.patch
new file mode 100644
index 000000000..b1de742e3
--- /dev/null
+++ b/main/pcre/uclibc-strtoq.patch
@@ -0,0 +1,18 @@
+--- ./configure.ac.orig
++++ ./configure.ac
+@@ -361,13 +361,13 @@
+ else
+ include=stdlib.h
+ fi
+- AC_COMPILE_IFELSE(AC_LANG_PROGRAM([#include <$include>],
++ AC_LINK_IFELSE(AC_LANG_PROGRAM([#include <$include>],
+ [char* e; return $fn("100", &e, 10)]),
+ [AC_MSG_RESULT(yes)
+ AC_DEFINE_UNQUOTED(HAVE_`echo $fn | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`, 1,
+ [Define to 1 if you have `$fn'.])
+ have_strto_fn=1
+- break],
++ ],
+ [AC_MSG_RESULT(no)])
+ done
+