summaryrefslogtreecommitdiffstats
path: root/main/knock
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2013-01-04 22:49:25 +0100
committerCarlo Landmeter <clandmeter@gmail.com>2013-01-04 22:49:25 +0100
commitf4487ef759ff869103ba36ba82d2366a373e600d (patch)
treeda62a2a65b9a446192c11ad926e268a4369be3c0 /main/knock
parentaa04d0ad4e9f31c6bdfb2116609253d38bd9b383 (diff)
downloadaports-f4487ef759ff869103ba36ba82d2366a373e600d.tar.bz2
aports-f4487ef759ff869103ba36ba82d2366a373e600d.tar.xz
main/knock: fix build on eglibc
Diffstat (limited to 'main/knock')
-rw-r--r--main/knock/APKBUILD33
-rw-r--r--main/knock/path-max.patch75
2 files changed, 99 insertions, 9 deletions
diff --git a/main/knock/APKBUILD b/main/knock/APKBUILD
index 5ae1bd581..58a63654d 100644
--- a/main/knock/APKBUILD
+++ b/main/knock/APKBUILD
@@ -13,26 +13,41 @@ install=
subpackages="$pkgname-doc"
source="http://www.zeroflux.org/proj/knock/files/$pkgname-$pkgver.tar.gz
knock.initd
- knock.confd"
+ knock.confd
+ path-max.patch"
-build() {
- cd "$srcdir/$pkgname-$pkgver"
+_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"
./configure --prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--infodir=/usr/share/info
- make -j1 || return 1
+ make || return 1
}
package() {
- cd "$srcdir/$pkgname-$pkgver"
- make -j1 DESTDIR="$pkgdir" install
+ cd "$_builddir"
+ make DESTDIR="$pkgdir" install || return 1
- install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/knockd
- install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/knockd
+ install -m755 -D "$srcdir"/$pkgname.initd \
+ "$pkgdir"/etc/init.d/knockd || return 1
+ install -m644 -D "$srcdir"/$pkgname.confd \
+ "$pkgdir"/etc/conf.d/knockd || return 1
}
md5sums="ca09d61458974cff90a700aba6120891 knock-0.5.tar.gz
5f05196d700c04287523d184226e2dc2 knock.initd
-8067d3b8401a0b5d513c44d3ff436032 knock.confd"
+8067d3b8401a0b5d513c44d3ff436032 knock.confd
+1b7efd25668793c9248e530fd804cb54 path-max.patch"
diff --git a/main/knock/path-max.patch b/main/knock/path-max.patch
new file mode 100644
index 000000000..d4c398dae
--- /dev/null
+++ b/main/knock/path-max.patch
@@ -0,0 +1,75 @@
+--- knock-0.5.orig/src/knockd.c
++++ knock-0.5/src/knockd.c
+@@ -131,9 +131,9 @@
+ int o_daemon = 0;
+ int o_lookup = 0;
+ char o_int[32] = ""; /* default (eth0) is set after parseconfig() */
+-char o_cfg[PATH_MAX] = "/etc/knockd.conf";
+-char o_pidfile[PATH_MAX] = "/var/run/knockd.pid";
+-char o_logfile[PATH_MAX] = "";
++char o_cfg[4096] = "/etc/knockd.conf";
++char o_pidfile[4096] = "/var/run/knockd.pid";
++char o_logfile[4096] = "";
+
+ int main(int argc, char **argv)
+ {
+@@ -435,7 +435,7 @@
+ int parseconfig(char *configfile)
+ {
+ FILE *fp = NULL;
+- char line[PATH_MAX+1];
++ char line[4096+1];
+ char *ptr = NULL;
+ char *key = NULL;
+ int linenum = 0;
+@@ -448,7 +448,7 @@
+ return(1);
+ }
+
+- while(fgets(line, PATH_MAX, fp)) {
++ while(fgets(line, 4096, fp)) {
+ linenum++;
+ trim(line);
+ if(strlen(line) == 0 || line[0] == '#') {
+@@ -509,12 +509,12 @@
+ trim(ptr);
+ if(!strcmp(section, "options")) {
+ if(!strcmp(key, "LOGFILE")) {
+- strncpy(o_logfile, ptr, PATH_MAX-1);
+- o_logfile[PATH_MAX-1] = '\0';
++ strncpy(o_logfile, ptr, 4096-1);
++ o_logfile[4096-1] = '\0';
+ dprint("config: log file: %s\n", o_logfile);
+ } else if(!strcmp(key, "PIDFILE")) {
+- strncpy(o_pidfile, ptr, PATH_MAX-1);
+- o_pidfile[PATH_MAX-1] = '\0';
++ strncpy(o_pidfile, ptr, 4096-1);
++ o_pidfile[4096-1] = '\0';
+ dprint("config: pid file: %s\n", o_pidfile);
+ } else if(!strcmp(key, "INTERFACE")) {
+ /* set interface only if it has not already been set by the -i switch */
+@@ -692,11 +692,11 @@
+ */
+ long get_next_one_time_sequence(opendoor_t *door)
+ {
+- char line[PATH_MAX+1];
++ char line[4096+1];
+ int pos;
+
+ pos = ftell(door->one_time_sequences_fd);
+- while(fgets(line, PATH_MAX, door->one_time_sequences_fd)) {
++ while(fgets(line, 4096, door->one_time_sequences_fd)) {
+ trim(line);
+ if(strlen(line) == 0 || line[0] == '#') {
+ pos = ftell(door->one_time_sequences_fd);
+@@ -1382,8 +1382,8 @@
+ /* run the associated command */
+ if(fork() == 0) {
+ /* child */
+- char parsed_start_cmd[PATH_MAX];
+- char parsed_stop_cmd[PATH_MAX];
++ char parsed_start_cmd[4096];
++ char parsed_stop_cmd[4096];
+ size_t cmd_len = 0;
+
+ setsid();