socat/socat.spec

Mon, 28 Jan 2013 17:37:18 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Mon, 28 Jan 2013 17:37:18 +0100
changeset 758
a2c6460cfb16
parent 507
b38213c8f8c3
permissions
-rw-r--r--

Correct socket error reporting improvement with IPv6 portable code,
after helpful recommendation by Saúl Ibarra Corretgé on OSips devlist.

michael@507 1 ##
michael@507 2 ## socat.spec -- OpenPKG RPM Package Specification
michael@507 3 ## Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/>
michael@507 4 ##
michael@507 5 ## Permission to use, copy, modify, and distribute this software for
michael@507 6 ## any purpose with or without fee is hereby granted, provided that
michael@507 7 ## the above copyright notice and this permission notice appear in all
michael@507 8 ## copies.
michael@507 9 ##
michael@507 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@507 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@507 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@507 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@507 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@507 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@507 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@507 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@507 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@507 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@507 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@507 21 ## SUCH DAMAGE.
michael@507 22 ##
michael@507 23
michael@507 24 # package version
michael@507 25 %define V_major 1.7.2
michael@507 26 %define V_minor 1
michael@507 27
michael@507 28 # package information
michael@507 29 Name: socat
michael@507 30 Summary: Socket Client
michael@507 31 URL: http://www.dest-unreach.org/socat/
michael@507 32 Vendor: Gerhard Rieger
michael@507 33 Packager: OpenPKG Foundation e.V.
michael@507 34 Distribution: OpenPKG Community
michael@507 35 Class: BASE
michael@507 36 Group: Network
michael@507 37 License: GPL
michael@507 38 Version: %{V_major}.%{V_minor}
michael@508 39 Release: 20120800
michael@507 40
michael@507 41 # package options
michael@507 42 %option with_readline yes
michael@507 43 %option with_ssl yes
michael@507 44
michael@507 45 # list of sources
michael@507 46 Source0: http://www.dest-unreach.org/socat/download/socat-%{V_major}.%{V_minor}.tar.bz2
michael@507 47
michael@507 48 # build information
michael@508 49 BuildPreReq: OpenPKG, openpkg >= 20100101, make, gcc
michael@507 50 PreReq: OpenPKG, openpkg >= 20100101
michael@507 51 %if "%{with_readline}" == "yes"
michael@507 52 BuildPreReq: readline
michael@507 53 PreReq: readline
michael@507 54 %endif
michael@507 55 %if "%{with_ssl}" == "yes"
michael@507 56 BuildPreReq: openssl
michael@507 57 PreReq: openssl
michael@507 58 %endif
michael@507 59
michael@507 60 %description
michael@507 61 Socat is a relay for bi-directional data transfer between two
michael@507 62 independent data channels. Each of these data channels may be a
michael@507 63 file, pipe, device (terminal, modem, etc), socket (UNIX, IP4, IP6,
michael@507 64 raw, UDP, TCP), a file descriptor (stdin, etc), a program, or an
michael@507 65 arbitrary combination of two of these.
michael@507 66
michael@507 67 %track
michael@507 68 prog socat = {
michael@507 69 version = %{version}
michael@507 70 url = http://www.dest-unreach.org/socat/download/
michael@507 71 regex = socat-(\d+\.\d+\.\d+(?:\.\d+))\.tar\.bz2
michael@507 72 }
michael@507 73
michael@507 74 %prep
michael@507 75 %setup -q -n socat-%{V_major}.%{V_minor}
michael@508 76 %{l_shtool} subst \
michael@508 77 -e 's;if ((from.ll.sll_pkttype & PACKET_OUTGOING);if (1;' \
michael@508 78 xioread.c
michael@507 79
michael@507 80 %build
michael@507 81 CC="%{l_cc} %{l_cflags -O} %{l_cppflags}" \
michael@507 82 CFLAGS="%{l_cflags -O} %{l_cppflags}" \
michael@507 83 CPPFLAGS="%{l_cppflags}" \
michael@507 84 LDFLAGS="%{l_ldflags}" \
michael@507 85 ./configure \
michael@507 86 --prefix=%{l_prefix} \
michael@507 87 --mandir=%{l_prefix}/man \
michael@507 88 --enable-msglevel=debug \
michael@507 89 %if "%{with_readline}" == "yes"
michael@507 90 --enable-readline \
michael@507 91 %else
michael@507 92 --disable-readline \
michael@507 93 %endif
michael@507 94 %if "%{with_ssl}" == "yes"
michael@507 95 --enable-openssl \
michael@507 96 %else
michael@507 97 --disable-openssl \
michael@507 98 %endif
michael@507 99 --disable-libwrap
michael@507 100
michael@507 101 %{l_make} %{l_mflags -O}
michael@507 102
michael@507 103 %install
michael@507 104 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
michael@507 105 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
michael@507 106 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
michael@507 107
michael@507 108 %files -f files
michael@507 109
michael@507 110 %clean
michael@507 111

mercurial