# HG changeset patch # User Michael Schloh von Bennewitz # Date 1346171740 -7200 # Node ID 6e491d7671a47143f44a5201cd0bc14edae91dc8 # Parent 1074e5934dd9bfd5c667f9b326844f40f368ff1c Update version, modernize packaging, accommodate libevent version 2 opaque evbuffer datatype, port Linux style flock(2) to SVR4, include correct non BSD and non SVR4 headers in DNS and resolving logic, correctly include a arc4random(3) implementation for platforms lacking it, conditionally implement the nonstandard MIN(a,b) macro, and use parallel make for faster SMP and multicore builds. diff -r 1074e5934dd9 -r 6e491d7671a4 honeyd/honeyd.patch --- a/honeyd/honeyd.patch Tue Aug 28 18:35:30 2012 +0200 +++ b/honeyd/honeyd.patch Tue Aug 28 18:35:40 2012 +0200 @@ -64,27 +64,6 @@ /* Define to 1 if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H -Index: configure ---- configure.orig 2006-08-19 09:11:11 +0200 -+++ configure 2006-08-24 12:14:21 +0200 -@@ -22317,7 +22317,7 @@ - - - --for ac_header in stdarg.h errno.h fcntl.h paths.h stdlib.h string.h time.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h sys/ioccom.h sys/file.h syslog.h unistd.h assert.h -+for ac_header in stdarg.h errno.h fcntl.h paths.h stdlib.h string.h time.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h sys/ioccom.h sys/file.h syslog.h unistd.h assert.h sys/cdefs.h - do - as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` - if eval "test \"\${$as_ac_Header+set}\" = set"; then -@@ -23483,7 +23483,7 @@ - - - --for ac_func in asprintf dup2 fgetln gettimeofday memmove memset strcasecmp strchr strdup strncasecmp strtoul strspn getaddrinfo getnameinfo freeaddrinfo setgroups sendmsg recvmsg setregid setruid kqueue -+for ac_func in asprintf dup2 fgetln gettimeofday memmove memset strcasecmp strchr strdup strncasecmp strtoul strspn getaddrinfo getnameinfo freeaddrinfo setgroups sendmsg recvmsg setregid setruid setenv kqueue - do - as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` - echo "$as_me:$LINENO: checking for $ac_func" >&5 Index: dhcpclient.c --- dhcpclient.c.orig 2006-08-19 09:10:41 +0200 +++ dhcpclient.c 2006-08-24 12:14:21 +0200 diff -r 1074e5934dd9 -r 6e491d7671a4 honeyd/honeyd.spec --- a/honeyd/honeyd.spec Tue Aug 28 18:35:30 2012 +0200 +++ b/honeyd/honeyd.spec Tue Aug 28 18:35:40 2012 +0200 @@ -22,7 +22,7 @@ ## # package version -%define V_honeyd 1.5b +%define V_honeyd 1.5c %define V_libdnsres 0.1a # package information @@ -36,7 +36,7 @@ Group: Security License: BSD Version: %{V_honeyd} -Release: 20080101 +Release: 20120800 # package options %option with_fsl yes @@ -60,14 +60,13 @@ Source14: setenv.c Source15: vasprintf.c Source16: vasprintf.h -Source17: http://www.monkey.org/~provos/libdnsres-%{V_libdnsres}.tar.gz +Source17: evbuffer.h +Source18: http://www.monkey.org/~provos/libdnsres-%{V_libdnsres}.tar.gz Patch0: honeyd.patch # build information -Prefix: %{l_prefix} -BuildRoot: %{l_buildroot} -BuildPreReq: OpenPKG, openpkg >= 20060823, make -PreReq: OpenPKG, openpkg >= 20060823 +BuildPreReq: OpenPKG, openpkg >= 20100808, make +PreReq: OpenPKG, openpkg >= 20100808 BuildPreReq: libdnet, libpcap, libevent, libedit, zlib, pcre PreReq: libdnet, libpcap, libevent, libedit, zlib, pcre %if "%{with_fsl}" == "yes" @@ -77,8 +76,6 @@ %if "%{with_gui}" == "yes" PreReq: java, JAVA-JDK %endif -AutoReq: no -AutoReqProv: no %description Honeyd is a small daemon that creates virtual hosts on a network. @@ -107,24 +104,42 @@ %prep %setup -q - %setup -q -D -T -a 17 + %setup -q -D -T -a 18 %patch -p0 + cp -f %{SOURCE setenv.c} . + cp -f %{SOURCE setenv.h} . + cp -f %{SOURCE vasprintf.c} . + cp -f %{SOURCE vasprintf.h} . + cp -f %{SOURCE evbuffer.h} . + cp -f %{SOURCE cdefs.h} . + %{l_shtool} mkdir -f -p -m 755 libdnsres-%{V_libdnsres}/sys + cp -f %{SOURCE cdefs.h} libdnsres-%{V_libdnsres}/sys/ %{l_shtool} subst \ -e 's;AF_LOCAL;AF_UNIX;' \ *.c %{l_shtool} subst \ + -e 's;\(for ac_header in stdarg.h errno.h fcntl.h paths.h stdlib.h string.h time.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h sys/ioccom.h sys/file.h net/bpf.h syslog.h unistd.h assert.h\);\1 sys/cdefs.h;' \ + -e 's;\(for ac_func in asprintf dup2 fgetln gettimeofday memmove memset strcasecmp strchr strdup strncasecmp strtoul strspn getaddrinfo getnameinfo freeaddrinfo setgroups sendmsg recvmsg setregid setruid\) \(kqueue\);\1 setenv \2;' \ + configure + %{l_shtool} subst \ -e 's;^\(honeyd_SOURCES *=[^\\]*\);\1 setenv.c vasprintf.c;' \ -e 's;^\(honeyd_OBJECTS *=[^\\]*\);\1 setenv.o vasprintf.o ;' \ Makefile.in - cp -f %{SOURCE setenv.c} . - cp -f %{SOURCE setenv.h} . - cp -f %{SOURCE vasprintf.c} . - cp -f %{SOURCE vasprintf.h} . - cp -f %{SOURCE cdefs.h} . %{l_shtool} subst \ -e 's;/var/run/honeyd.pid;%{l_prefix}/var/honeyd/honeyd.pid;' \ honeyd.h %{l_shtool} subst \ + -e 's;\(encode_int\);loc_\1;g' \ + tagging.[ch] + %{l_shtool} subst \ + -e '/#include /a#include "evbuffer.h"' \ + honeydstats.c \ + untagging.c \ + ui.c + %{l_shtool} subst \ + -e 's;flock(fd, [^)][^)]*);lockf(fd, F_LOCK, 0);g' \ + subsystems/smtp.c + %{l_shtool} subst \ -e 's/\(user_target=no\)/\1; pic_mode=no;/' \ -e 's;test "*$\(hardcode_into_libs\)"* *\([!=]*\) *"*\([a-zA-Z_][a-zA-Z_]*\)"*;test ".$\1" \2 ".$\3";g' \ -e 's;test "*$\(build_libtool_need_lc\)"* *\([!=]*\) *"*\([a-zA-Z_][a-zA-Z_]*\)"*;test ".$\1" \2 ".$\3";g' \ @@ -137,19 +152,47 @@ %{l_shtool} subst \ -e 's;\(\$(honeydctl_LDADD)\);\1 -lsocket -lnsl;g' \ Makefile.in + %{l_shtool} subst \ + -e 's;-lsocket;-lsocket -lnsl -lresolv;g' \ + libdnsres-%{V_libdnsres}/configure ;; esac + %{l_shtool} subst \ + -e 's;#if \((!defined(BSD))\) || \((BSD < [0-9][0-9]*)\);#if (!defined(__sun)) \&\& (!defined(__SVR4)) \&\& \1 \&\& \2;' \ + libdnsres-%{V_libdnsres}/dnsres.h \ + libdnsres-%{V_libdnsres}/resolv.h + %{l_shtool} subst \ + -e 's;u_int\([0-9]*\)_t;uint\1_t;g' \ + libdnsres-%{V_libdnsres}/dnsres.h \ + libdnsres-%{V_libdnsres}/resolv.h \ + libdnsres-%{V_libdnsres}/res_random.c + %{l_shtool} subst \ + -e 's;top_buildir;top_builddir;' \ + -e 's;\(am_simple_test_OBJECTS = simple_test\.\$(OBJEXT)\);\1 arc4random.$(OBJEXT);' \ + libdnsres-%{V_libdnsres}/Makefile.in + %{l_shtool} subst \ + -e '/#include "config.h"/a#ifndef HAVE_ARC4RANDOM' \ + libdnsres-%{V_libdnsres}/arc4random.c + echo '#endif' >>libdnsres-%{V_libdnsres}/arc4random.c + echo '#ifndef MIN' >>keycount.h + echo '#define MIN(a,b) (((a) < (b)) ? (a) : (b))' >>keycount.h + echo '#endif' >>keycount.h %build ( cd libdnsres-%{V_libdnsres} + loc_cppflags= + case "%{l_platform -t}" in + *-sunos* ) + loc_cppflags="-D_KERNEL" + ;; + esac CC="%{l_cc}" \ CFLAGS="%{l_cflags -O}" \ - CPPFLAGS="%{l_cppflags}" \ + CPPFLAGS="%{l_cppflags} $loc_cppflags" \ ./configure \ --with-libevent=%{l_prefix} \ --disable-shared %{l_make} %{l_mflags} - ln .libs/libdnsres.a . ) || exit $? CC="%{l_cc}" \ CFLAGS="%{l_cflags -O}" \ @@ -163,11 +206,9 @@ --with-libdnsres=`pwd`/libdnsres-%{V_libdnsres} \ --with-libpcre=%{l_prefix} \ --without-python - %{l_make} %{l_mflags} + %{l_make} %{l_mflags -O} %install - rm -rf $RPM_BUILD_ROOT - # create directories %{l_shtool} mkdir -f -p -m 755 \ $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \ @@ -232,7 +273,6 @@ %files -f files %clean - rm -rf $RPM_BUILD_ROOT %pre # before upgrade, save status and stop service