daq/daq.spec

changeset 551
d7ae7fd8a214
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/daq/daq.spec	Tue Aug 28 18:32:00 2012 +0200
     1.3 @@ -0,0 +1,109 @@
     1.4 +##
     1.5 +##  daq.spec -- OpenPKG RPM Package Specification
     1.6 +##  Copyright (c) 2012 Michael Schloh von Bennewitz <michael@schloh.com>
     1.7 +##
     1.8 +##  Permission to use, copy, modify, and distribute this software for
     1.9 +##  any purpose with or without fee is hereby granted, provided that
    1.10 +##  the above copyright notice and this permission notice appear in all
    1.11 +##  copies.
    1.12 +##
    1.13 +##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    1.14 +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    1.15 +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    1.16 +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    1.17 +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    1.18 +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    1.19 +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    1.20 +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    1.21 +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    1.22 +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    1.23 +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    1.24 +##  SUCH DAMAGE.
    1.25 +##
    1.26 +
    1.27 +#   package information
    1.28 +Name:         daq
    1.29 +Summary:      Data Acquisition Library
    1.30 +URL:          http://www.snort.org/
    1.31 +Vendor:       B. Caswell, M. Roesch
    1.32 +Packager:     Michael Schloh von Bennewitz
    1.33 +Distribution: Europalab Networks Production
    1.34 +Class:        EVAL
    1.35 +Group:        Network
    1.36 +License:      GPL
    1.37 +Version:      1.1.1
    1.38 +Release:      20120800
    1.39 +
    1.40 +#   list of sources
    1.41 +Source0:      http://dl.snort.org/snort-current/daq-%{version}.tar.gz
    1.42 +
    1.43 +#   build information
    1.44 +BuildPreReq:  OpenPKG, openpkg >= 20100101, make, gcc, flex, bison
    1.45 +PreReq:       OpenPKG, openpkg >= 20100101
    1.46 +BuildPreReq:  libpcap
    1.47 +PreReq:       libpcap
    1.48 +
    1.49 +%description
    1.50 +    DAQ, or Data Acquisition library, provides packet I/O. The DAQ
    1.51 +    replaces direct calls to PCAP functions with an abstraction layer
    1.52 +    that facilitates operation on a variety of hardware and software
    1.53 +    interfaces without requiring changes to dependent applications.
    1.54 +    It is possible to select the DAQ type and mode when invoking an
    1.55 +    application to perform PCAP readback or inline operation, for
    1.56 +    example. The modular nature allows for building new modules for
    1.57 +    other platforms.
    1.58 +
    1.59 +%track
    1.60 +    prog daq = {
    1.61 +        version   = %{version}
    1.62 +        url       = http://www.snort.org/downloads
    1.63 +        regex     = daq-(__VER__)\.tar\.gz
    1.64 +    }
    1.65 +
    1.66 +%prep
    1.67 +    %setup -q
    1.68 +    %{l_shtool} subst \
    1.69 +        -e 's;u_int\([0-9]*\)_t;uint\1_t;g' \
    1.70 +        sfbpf/*
    1.71 +
    1.72 +%build
    1.73 +    #   configure program
    1.74 +    LIBS=""
    1.75 +    case "%{l_platform -t}" in
    1.76 +        *-sunos* ) LIBS="$LIBS -lsocket -lnsl" ;;
    1.77 +    esac
    1.78 +    CC="%{l_cc}" \
    1.79 +    CFLAGS="%{l_cflags -O}" \
    1.80 +    CPPFLAGS="%{l_cppflags}" \
    1.81 +    LDFLAGS="%{l_ldflags}" \
    1.82 +    LIBS="$LIBS" \
    1.83 +    ./configure \
    1.84 +        --prefix=%{l_prefix} \
    1.85 +        --with-libpcap-includes=%{l_prefix}/include \
    1.86 +        --with-libpcap-libraries=%{l_prefix}/lib \
    1.87 +        --enable-static
    1.88 +
    1.89 +    #   build program
    1.90 +    %{l_make} %{l_mflags -O}
    1.91 +
    1.92 +
    1.93 +%install
    1.94 +    #   install program
    1.95 +    %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
    1.96 +
    1.97 +    #   remove unwanted shared libs
    1.98 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/*.so*
    1.99 +
   1.100 +    #   adjust static only libs
   1.101 +    %{l_shtool} subst \
   1.102 +        -e 's;dlname=.*;dlname=;g' \
   1.103 +        -e 's;library_names=.*;library_names=;g' \
   1.104 +        $RPM_BUILD_ROOT%{l_prefix}/lib/*.la
   1.105 +
   1.106 +    #   determine installation files
   1.107 +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
   1.108 +
   1.109 +%files -f files
   1.110 +
   1.111 +%clean
   1.112 +

mercurial