]>
Commit | Line | Data |
---|---|---|
1 | Summary: Multipurpose relay | |
2 | Summary(pl.UTF-8): Przekaźnik o wielu zastosowaniach | |
3 | Name: socat | |
4 | Version: 1.7.4.1 | |
5 | Release: 1 | |
6 | License: GPL | |
7 | Group: Networking/Utilities | |
8 | Source0: http://www.dest-unreach.org/socat/download/%{name}-%{version}.tar.bz2 | |
9 | # Source0-md5: 36cad050ecf4981ab044c3fbd75c643f | |
10 | Source1: %{name}.init | |
11 | Source2: %{name}.sysconfig | |
12 | Source3: %{name}.tmpfiles | |
13 | URL: http://www.dest-unreach.org/socat/ | |
14 | BuildRequires: libwrap-devel >= 7.6-30 | |
15 | BuildRequires: openssl-devel >= 0.9.7d | |
16 | BuildRequires: readline-devel | |
17 | BuildRequires: yodl | |
18 | Requires: rc-scripts >= 0.4.1.26-2 | |
19 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
20 | ||
21 | %description | |
22 | Socat is a relay for bidirectional data transfer between two | |
23 | independent data channels. Each of these data channels may be a file, | |
24 | pipe, device (terminal or modem, etc.), socket (Unix, IPv4, IPv6 - | |
25 | raw, UDP, TCP), a client for SOCKS4, proxy CONNECT, or SSL, etc. It | |
26 | provides forking, logging, and dumping, different modes for | |
27 | interprocess communication, and many more options. It can be used, for | |
28 | example, as a TCP relay (one-shot or daemon), as a daemon-based | |
29 | socksifier, as a shell interface to Unix sockets, as an IPv6 relay, | |
30 | for redirecting TCP-oriented programs to a serial line, or to | |
31 | establish a relatively secure environment (su and chroot) for running | |
32 | client or server shell scripts with network connections. | |
33 | ||
34 | %description -l pl.UTF-8 | |
35 | Socat to przekaźnik do dwukierunkowego przesyłania danych pomiędzy | |
36 | dwoma niezależnymi kanałami danych. Każdy z tych kanałów może być | |
37 | plikiem, potokiem, urządzeniem (terminalem, modemem itp.), gniazdem | |
38 | (uniksowym, IPv4, IPv6 - surowym, UDP, TCP), klientem SOCKS4, proxy | |
39 | CONNECT, albo SSL itp. Socat ma możliwość forkowania, logowania i | |
40 | zrzucania danych, różne tryby komunikacji międzyprocesowej oraz wiele | |
41 | innych opcji. Może być używane np. jako przekaźnik TCP (jednorazowy | |
42 | lub demon), jako demon przesyłający przez SOCKS, jako interfejs dla | |
43 | powłoki do gniazd uniksowych, jako przekaźnik IPv6, do | |
44 | przekierowywania programów korzystających z TCP na port szeregowy albo | |
45 | do stworzenia względnie bezpiecznego środowiska (su i chroot) do | |
46 | uruchamiania klienckich lub serwerowych skryptów powłoki z | |
47 | połączeniami sieciowymi. | |
48 | ||
49 | %prep | |
50 | %setup -q | |
51 | sed -i -e 's#-lssl#-lssl -lcrypto#g' configure* | |
52 | ||
53 | %build | |
54 | %{__gettextize} | |
55 | %{__libtoolize} | |
56 | %{__aclocal} | |
57 | %{__autoconf} | |
58 | %configure \ | |
59 | CFLAGS="%{rpmcflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" | |
60 | %{__make} | |
61 | ||
62 | %install | |
63 | rm -rf $RPM_BUILD_ROOT | |
64 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1,/var/run/%{name}} \ | |
65 | $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,%{name}} \ | |
66 | $RPM_BUILD_ROOT/usr/lib/tmpfiles.d | |
67 | ||
68 | %{__make} install \ | |
69 | DESTDIR=$RPM_BUILD_ROOT | |
70 | ||
71 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} | |
72 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name} | |
73 | install %{SOURCE3} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/%{name}.conf | |
74 | ||
75 | cat >> $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/example.conf <<'EOF' | |
76 | # socat [options] <bi-address> <bi-address> | |
77 | OPTIONS="" | |
78 | BIADDRESS1="UNIX-LISTEN:/var/lib/mysql/mysql.sock,fork,user=mysql,group=mysql,mode=777" | |
79 | BIADDRESS2="TCP:localhost:3306" | |
80 | EOF | |
81 | ||
82 | %clean | |
83 | rm -rf $RPM_BUILD_ROOT | |
84 | ||
85 | %post | |
86 | /sbin/chkconfig --add %{name} | |
87 | %service socat restart "socat" | |
88 | ||
89 | %preun | |
90 | if [ "$1" = "0" ]; then | |
91 | %service socat stop | |
92 | /sbin/chkconfig --del socat | |
93 | fi | |
94 | ||
95 | %files | |
96 | %defattr(644,root,root,755) | |
97 | %doc BUGREPORTS CHANGES DEVELOPMENT EXAMPLES FAQ README SECURITY | |
98 | %dir %{_sysconfdir}/%{name} | |
99 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf | |
100 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} | |
101 | %attr(754,root,root) /etc/rc.d/init.d/%{name} | |
102 | %attr(755,root,root) %{_bindir}/* | |
103 | %dir /var/run/%{name} | |
104 | /usr/lib/tmpfiles.d/%{name}.conf | |
105 | %{_mandir}/man?/* |