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