1.1 --- a/honeyd/honeyd.spec Tue Aug 28 18:35:30 2012 +0200 1.2 +++ b/honeyd/honeyd.spec Tue Aug 28 18:35:40 2012 +0200 1.3 @@ -22,7 +22,7 @@ 1.4 ## 1.5 1.6 # package version 1.7 -%define V_honeyd 1.5b 1.8 +%define V_honeyd 1.5c 1.9 %define V_libdnsres 0.1a 1.10 1.11 # package information 1.12 @@ -36,7 +36,7 @@ 1.13 Group: Security 1.14 License: BSD 1.15 Version: %{V_honeyd} 1.16 -Release: 20080101 1.17 +Release: 20120800 1.18 1.19 # package options 1.20 %option with_fsl yes 1.21 @@ -60,14 +60,13 @@ 1.22 Source14: setenv.c 1.23 Source15: vasprintf.c 1.24 Source16: vasprintf.h 1.25 -Source17: http://www.monkey.org/~provos/libdnsres-%{V_libdnsres}.tar.gz 1.26 +Source17: evbuffer.h 1.27 +Source18: http://www.monkey.org/~provos/libdnsres-%{V_libdnsres}.tar.gz 1.28 Patch0: honeyd.patch 1.29 1.30 # build information 1.31 -Prefix: %{l_prefix} 1.32 -BuildRoot: %{l_buildroot} 1.33 -BuildPreReq: OpenPKG, openpkg >= 20060823, make 1.34 -PreReq: OpenPKG, openpkg >= 20060823 1.35 +BuildPreReq: OpenPKG, openpkg >= 20100808, make 1.36 +PreReq: OpenPKG, openpkg >= 20100808 1.37 BuildPreReq: libdnet, libpcap, libevent, libedit, zlib, pcre 1.38 PreReq: libdnet, libpcap, libevent, libedit, zlib, pcre 1.39 %if "%{with_fsl}" == "yes" 1.40 @@ -77,8 +76,6 @@ 1.41 %if "%{with_gui}" == "yes" 1.42 PreReq: java, JAVA-JDK 1.43 %endif 1.44 -AutoReq: no 1.45 -AutoReqProv: no 1.46 1.47 %description 1.48 Honeyd is a small daemon that creates virtual hosts on a network. 1.49 @@ -107,24 +104,42 @@ 1.50 1.51 %prep 1.52 %setup -q 1.53 - %setup -q -D -T -a 17 1.54 + %setup -q -D -T -a 18 1.55 %patch -p0 1.56 + cp -f %{SOURCE setenv.c} . 1.57 + cp -f %{SOURCE setenv.h} . 1.58 + cp -f %{SOURCE vasprintf.c} . 1.59 + cp -f %{SOURCE vasprintf.h} . 1.60 + cp -f %{SOURCE evbuffer.h} . 1.61 + cp -f %{SOURCE cdefs.h} . 1.62 + %{l_shtool} mkdir -f -p -m 755 libdnsres-%{V_libdnsres}/sys 1.63 + cp -f %{SOURCE cdefs.h} libdnsres-%{V_libdnsres}/sys/ 1.64 %{l_shtool} subst \ 1.65 -e 's;AF_LOCAL;AF_UNIX;' \ 1.66 *.c 1.67 %{l_shtool} subst \ 1.68 + -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;' \ 1.69 + -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;' \ 1.70 + configure 1.71 + %{l_shtool} subst \ 1.72 -e 's;^\(honeyd_SOURCES *=[^\\]*\);\1 setenv.c vasprintf.c;' \ 1.73 -e 's;^\(honeyd_OBJECTS *=[^\\]*\);\1 setenv.o vasprintf.o ;' \ 1.74 Makefile.in 1.75 - cp -f %{SOURCE setenv.c} . 1.76 - cp -f %{SOURCE setenv.h} . 1.77 - cp -f %{SOURCE vasprintf.c} . 1.78 - cp -f %{SOURCE vasprintf.h} . 1.79 - cp -f %{SOURCE cdefs.h} . 1.80 %{l_shtool} subst \ 1.81 -e 's;/var/run/honeyd.pid;%{l_prefix}/var/honeyd/honeyd.pid;' \ 1.82 honeyd.h 1.83 %{l_shtool} subst \ 1.84 + -e 's;\(encode_int\);loc_\1;g' \ 1.85 + tagging.[ch] 1.86 + %{l_shtool} subst \ 1.87 + -e '/#include <event.h>/a#include "evbuffer.h"' \ 1.88 + honeydstats.c \ 1.89 + untagging.c \ 1.90 + ui.c 1.91 + %{l_shtool} subst \ 1.92 + -e 's;flock(fd, [^)][^)]*);lockf(fd, F_LOCK, 0);g' \ 1.93 + subsystems/smtp.c 1.94 + %{l_shtool} subst \ 1.95 -e 's/\(user_target=no\)/\1; pic_mode=no;/' \ 1.96 -e 's;test "*$\(hardcode_into_libs\)"* *\([!=]*\) *"*\([a-zA-Z_][a-zA-Z_]*\)"*;test ".$\1" \2 ".$\3";g' \ 1.97 -e 's;test "*$\(build_libtool_need_lc\)"* *\([!=]*\) *"*\([a-zA-Z_][a-zA-Z_]*\)"*;test ".$\1" \2 ".$\3";g' \ 1.98 @@ -137,19 +152,47 @@ 1.99 %{l_shtool} subst \ 1.100 -e 's;\(\$(honeydctl_LDADD)\);\1 -lsocket -lnsl;g' \ 1.101 Makefile.in 1.102 + %{l_shtool} subst \ 1.103 + -e 's;-lsocket;-lsocket -lnsl -lresolv;g' \ 1.104 + libdnsres-%{V_libdnsres}/configure 1.105 ;; 1.106 esac 1.107 + %{l_shtool} subst \ 1.108 + -e 's;#if \((!defined(BSD))\) || \((BSD < [0-9][0-9]*)\);#if (!defined(__sun)) \&\& (!defined(__SVR4)) \&\& \1 \&\& \2;' \ 1.109 + libdnsres-%{V_libdnsres}/dnsres.h \ 1.110 + libdnsres-%{V_libdnsres}/resolv.h 1.111 + %{l_shtool} subst \ 1.112 + -e 's;u_int\([0-9]*\)_t;uint\1_t;g' \ 1.113 + libdnsres-%{V_libdnsres}/dnsres.h \ 1.114 + libdnsres-%{V_libdnsres}/resolv.h \ 1.115 + libdnsres-%{V_libdnsres}/res_random.c 1.116 + %{l_shtool} subst \ 1.117 + -e 's;top_buildir;top_builddir;' \ 1.118 + -e 's;\(am_simple_test_OBJECTS = simple_test\.\$(OBJEXT)\);\1 arc4random.$(OBJEXT);' \ 1.119 + libdnsres-%{V_libdnsres}/Makefile.in 1.120 + %{l_shtool} subst \ 1.121 + -e '/#include "config.h"/a#ifndef HAVE_ARC4RANDOM' \ 1.122 + libdnsres-%{V_libdnsres}/arc4random.c 1.123 + echo '#endif' >>libdnsres-%{V_libdnsres}/arc4random.c 1.124 + echo '#ifndef MIN' >>keycount.h 1.125 + echo '#define MIN(a,b) (((a) < (b)) ? (a) : (b))' >>keycount.h 1.126 + echo '#endif' >>keycount.h 1.127 1.128 %build 1.129 ( cd libdnsres-%{V_libdnsres} 1.130 + loc_cppflags= 1.131 + case "%{l_platform -t}" in 1.132 + *-sunos* ) 1.133 + loc_cppflags="-D_KERNEL" 1.134 + ;; 1.135 + esac 1.136 CC="%{l_cc}" \ 1.137 CFLAGS="%{l_cflags -O}" \ 1.138 - CPPFLAGS="%{l_cppflags}" \ 1.139 + CPPFLAGS="%{l_cppflags} $loc_cppflags" \ 1.140 ./configure \ 1.141 --with-libevent=%{l_prefix} \ 1.142 --disable-shared 1.143 %{l_make} %{l_mflags} 1.144 - ln .libs/libdnsres.a . 1.145 ) || exit $? 1.146 CC="%{l_cc}" \ 1.147 CFLAGS="%{l_cflags -O}" \ 1.148 @@ -163,11 +206,9 @@ 1.149 --with-libdnsres=`pwd`/libdnsres-%{V_libdnsres} \ 1.150 --with-libpcre=%{l_prefix} \ 1.151 --without-python 1.152 - %{l_make} %{l_mflags} 1.153 + %{l_make} %{l_mflags -O} 1.154 1.155 %install 1.156 - rm -rf $RPM_BUILD_ROOT 1.157 - 1.158 # create directories 1.159 %{l_shtool} mkdir -f -p -m 755 \ 1.160 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \ 1.161 @@ -232,7 +273,6 @@ 1.162 %files -f files 1.163 1.164 %clean 1.165 - rm -rf $RPM_BUILD_ROOT 1.166 1.167 %pre 1.168 # before upgrade, save status and stop service