## ## honeyd.spec -- OpenPKG RPM Specification ## Copyright (c) 2000-2004 The OpenPKG Project ## Copyright (c) 2000-2004 Ralf S. Engelschall ## Copyright (c) 2000-2004 Cable & Wireless ## ## Permission to use, copy, modify, and distribute this software for ## any purpose with or without fee is hereby granted, provided that ## the above copyright notice and this permission notice appear in all ## copies. ## ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ## SUCH DAMAGE. ## # package information Name: honeyd Summary: Creates a Virtual Host on Network URL: http://www.citi.umich.edu/u/provos/honeyd/ Vendor: Niels Provos Packager: The OpenPKG Project Distribution: OpenPKG [EVAL] Group: Security License: BSD Version: 0.8 Release: 20040124 # package options %option with_fsl yes %option with_gui no # list of sources Source0: http://niels.xtdnet.nl/honeyd/honeyd-%{version}.tar.gz Source1: http://www.citi.umich.edu/u/provos/honeyd/contrib/mael/ftp.sh Source2: http://www.citi.umich.edu/u/provos/honeyd/contrib/mael/pop3.sh Source3: http://www.citi.umich.edu/u/provos/honeyd/contrib/mael/smtp.sh Source4: http://www.citi.umich.edu/u/provos/papers/honeyd-eabstract.pdf Source5: http://www.citi.umich.edu/u/provos/papers/honeyd-eabstract.ps Source6: http://www.citi.umich.edu/u/provos/honeyd/ch01-results/1/honeydGUI.tar.gz Source7: honey Source8: svcs.sh Source9: rc.honeyd Source10: fsl.honeyd Source11: honeyd.conf Source12: cdefs.h Source13: setenv.h Source14: setenv.c Patch0: honeyd.patch # build information Prefix: %{l_prefix} BuildRoot: %{l_buildroot} BuildPreReq: OpenPKG, openpkg >= 20030718, libdnet, libpcap, libevent, make PreReq: OpenPKG, openpkg >= 20030718, libdnet, libpcap, libevent %if "%{with_fsl}" == "yes" BuildPreReq: fsl >= 1.2.0 PreReq: fsl >= 1.2.0 %endif %if "%{with_gui}" == "yes" PreReq: JRE %endif AutoReq: no AutoReqProv: no %description Honeyd is a small daemon that creates virtual hosts on a network. The hosts can be configured to run arbitrary services, and their TCP personality can be adapted so that they appear to be running certain versions of operating systems. Honeyd enables a single host to claim multiple addresses on a LAN for network simulation. It is possible to ping the virtual machines, or to traceroute them. Any type of service on the virtual machine can be simulated according to a simple configuration file. Instead of simulating a service, it is also possible to proxy it to another machine. The package arpd will most certainly be useful as well, although it is not a technical requirement for this package. %prep %setup -q %patch -p0 %{l_shtool} subst \ -e 's;AF_LOCAL;AF_UNIX;' \ *.c %{l_shtool} subst \ -e 's;^\(honeyd_SOURCES *=[^\\]*\);\1 setenv.c ;' \ -e 's;^\(honeyd_OBJECTS *=[^\\]*\);\1 setenv.o ;' \ Makefile.in cp -f %{SOURCE setenv.c} . cp -f %{SOURCE setenv.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/\(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' \ ltmain.sh %build CC="%{l_cc}" \ CFLAGS="%{l_cflags -O}" \ CPPFLAGS="%{l_cppflags} -DREPLACE_GETOPT" \ LDFLAGS="%{l_fsl_ldflags}" \ LIBS="%{l_fsl_libs}" \ ./configure \ --without-python \ --prefix=%{l_prefix} %{l_make} %{l_mflags} %install rm -rf $RPM_BUILD_ROOT # create directories %{l_shtool} mkdir -f -p -m 755 \ $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \ $RPM_BUILD_ROOT%{l_prefix}/etc/honeyd \ $RPM_BUILD_ROOT%{l_prefix}/lib/honeyd \ $RPM_BUILD_ROOT%{l_prefix}/var/honeyd \ $RPM_BUILD_ROOT%{l_prefix}/share/honeyd \ $RPM_BUILD_ROOT%{l_prefix}/libexec/honeyd # install files %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT %{l_shtool} install -c -m 750 %{l_value -s -a} \ -e 's;^log=/\(.*/\)*\(.*\)-.*\.log;log=%{l_prefix}/var/honeyd/\2.log;g' \ -e 's;^\(host=\).*;\1`%{l_shtool} echo -e %h`;g' \ -e 's;^\(domain=\).*;\1`%{l_shtool} echo -e %d | cut -c2-`;g' \ -e 's; gawk ; awk ;g' \ %{SOURCE ftp.sh} \ %{SOURCE pop3.sh} \ %{SOURCE smtp.sh} \ %{SOURCE svcs.sh} \ $RPM_BUILD_ROOT%{l_prefix}/libexec/honeyd/ %{l_shtool} install -c -m 644 %{l_value -s -a} \ %{SOURCE honeyd.conf} \ $RPM_BUILD_ROOT%{l_prefix}/etc/honeyd/ %{l_shtool} install -c -m 755 %{l_value -s -a} \ %{SOURCE rc.honeyd} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ %{l_shtool} install -c -m 644 \ %{SOURCE honeyd-eabstract.ps} \ $RPM_BUILD_ROOT%{l_prefix}/share/honeyd/honeyd.ps %{l_shtool} install -c -m 644 \ %{SOURCE honeyd-eabstract.pdf} \ $RPM_BUILD_ROOT%{l_prefix}/share/honeyd/honeyd.pdf # optionally install the Java GUI %if "%{with_gui}" == "yes" %{l_tar} zxf %{SOURCE honeydGUI.tar.gz} mv -f honeydGUI/exec $RPM_BUILD_ROOT%{l_prefix}/lib/honeyd/javagui %{l_shtool} install -c -m 755 %{l_value -s -a} \ %{SOURCE honey} \ $RPM_BUILD_ROOT%{l_prefix}/bin/ %endif # install OSSP fsl configuration %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl %{l_shtool} install -c -m 644 %{l_value -s -a} \ %{SOURCE fsl.honeyd} \ $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/ # remove unwanted files rm -rf $RPM_BUILD_ROOT%{l_prefix}/include rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/honeyd/README rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/honeyd/config.sample # determine file list %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ %{l_files_std} \ '%not %dir %{l_prefix}/etc/fsl' \ '%config %attr(0750,%{l_susr},%{l_mgrp}) %{l_prefix}/var/honeyd' \ '%config %{l_prefix}/etc/fsl/fsl.honeyd' \ '%config %attr(0750,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/honeyd/honeyd.conf' %files -f files %clean rm -rf $RPM_BUILD_ROOT %pre # before upgrade, save status and stop service [ $1 -eq 2 ] || exit 0 eval `%{l_rc} honeyd status 2>/dev/null | tee %{l_tmpfile}` %{l_rc} honeyd stop 2>/dev/null exit 0 %post if [ $1 -eq 2 ]; then # after upgrade, restore status eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile} [ ".$honeyd_active" = .yes ] && %{l_rc} honeyd start fi exit 0 %preun # before erase, stop service and remove log files [ $1 -eq 0 ] || exit 0 %{l_rc} honeyd stop 2>/dev/null rm -f $RPM_INSTALL_PREFIX/var/honeyd/*.log* >/dev/null 2>&1 || true exit 0