]> git.pld-linux.org Git - packages/stunnel.git/blob - stunnel.spec
- added subpackages stunnel-{standalone,inetd} and related %post,
[packages/stunnel.git] / stunnel.spec
1 Summary:        Universal SSL tunnel
2 Summary(pl):    Uniwersalne narzêdzie do bezpiecznego tunelowania
3 Name:           stunnel
4 Version:        4.05
5 Release:        1.1
6 License:        GPL v2
7 Group:          Networking/Daemons
8 Source0:        ftp://stunnel.mirt.net/stunnel/%{name}-%{version}.tar.gz
9 # Source0-md5:  e28a03cf694a43a7f144ec3d5c064456
10 Source1:        %{name}.init
11 Source2:        %{name}.sysconfig
12 Source3:        %{name}.inet
13 Patch0:         %{name}-gethostbyname_is_in_libc_aka_no_libnsl.patch
14 Patch1:         %{name}-authpriv.patch
15 Patch2:         %{name}-ac_fixes.patch
16 Patch3:         %{name}-am.patch
17 Patch4:         %{name}-getgrnam.patch
18 Patch5:         %{name}-libwrap_srv_name_log.patch
19 Patch6:         %{name}-config.patch
20 URL:            http://www.stunnel.org/
21 BuildRequires:  autoconf
22 BuildRequires:  automake
23 BuildRequires:  libtool
24 BuildRequires:  openssl-devel >= 0.9.7d
25 BuildRequires:  openssl-tools >= 0.9.7d
26 BuildRequires:  libwrap-devel
27 PreReq:         rc-scripts
28 Requires(pre):  /bin/id
29 Requires(pre):  /usr/bin/getgid
30 Requires(pre):  /usr/sbin/groupadd
31 Requires(pre):  /usr/sbin/useradd
32 Requires(postun):       /usr/sbin/userdel
33 Requires(postun):       /usr/sbin/groupdel
34 Requires(post,preun):   /sbin/chkconfig
35 Requires(post,postun):  /sbin/ldconfig
36 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37
38 %description
39 The stunnel program is designed to work as SSL encryption wrapper
40 between remote client and local (inetd-startable) or remote server.
41 The concept is that having non-SSL aware daemons running on your
42 system you can easily setup them to communicate with clients over
43 secure SSL channel. stunnel can be used to add SSL functionality to
44 commonly used inetd daemons like POP-2, POP-3 and IMAP servers without
45 any changes in the programs' code.
46
47 %description -l pl
48 Stunnel umo¿liwia stawianie silnie kodowanych tuneli pomiêdzy serwerem
49 a komputerem klienta. Przy jego u¿yciu mo¿na ³atwo zrealizowaæ us³ugi
50 pop3s lub https.
51
52 %package standalone
53 Summary:        stunnel acts as standalone server 
54 Summary(pl):    stunnel dzia³aj±cy jako samodzielny serwer
55 Group:          Networking/Daemons
56 Requires:       %{name} = %{version}-%{release}
57 Obsoletes:      %{name}-inetd
58
59 %description standalone
60 stunnel acts as standalone server.
61
62 %description standalone -l pl
63 stunnel dzia³aj±cy jako samodzielny serwer.
64
65 %package inetd 
66 Summary:        stunnel acts as inetd service
67 Summary(pl):    stunnel dzia³aj±cy jako us³uga inetd
68 Group:          Networking/Daemons
69 Requires:       %{name} = %{version}-%{release}
70 Obsoletes:      %{name}-standalone
71
72 %description inetd
73 stunnel acts as inetd service.
74
75 %description standalone -l pl
76 stunnel dzia³aj±cy jako us³uga inetd.
77
78 %prep
79 %setup -q
80 %patch0 -p1
81 %patch1 -p1
82 %patch2 -p1
83 %patch3 -p1
84 %patch4 -p1
85 %patch5 -p1
86 %patch6 -p1
87
88 %build
89 %{__libtoolize}
90 %{__aclocal}
91 %{__autoconf}
92 %{__automake}
93 %configure
94 %{__make}
95
96 %install
97 rm -rf $RPM_BUILD_ROOT
98 install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig/rc-inetd},%{_mandir}/{pl,fr}/man8,%{_var}/run/stunnel}
99
100 %{__make} install \
101         DESTDIR=$RPM_BUILD_ROOT
102
103 mv -f $RPM_BUILD_ROOT%{_mandir}/man8/stunnel.fr.8 $RPM_BUILD_ROOT%{_mandir}/fr/man8/stunnel.8
104 mv -f $RPM_BUILD_ROOT%{_mandir}/man8/stunnel.pl.8 $RPM_BUILD_ROOT%{_mandir}/pl/man8/stunnel.8
105 mv -f $RPM_BUILD_ROOT/etc/stunnel/stunnel.conf-sample $RPM_BUILD_ROOT/etc/stunnel/stunnel.conf
106
107 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/stunnel
108 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/stunnel
109 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/stunnel
110
111 %clean
112 rm -rf $RPM_BUILD_ROOT
113
114 %post   -p /sbin/ldconfig
115
116 %pre
117 if [ -n "`getgid stunnel`" ]; then
118         if [ "`getgid stunnel`" != "130" ]; then
119                 echo "Error: group stunnel doesn't have gid=130. Correct this before installing stunnel." 1>&2
120                 exit 1
121         fi
122 else
123         /usr/sbin/groupadd -g 130 -r -f stunnel
124 fi
125 if [ -n "`id -u stunnel 2>/dev/null`" ]; then
126         if [ "`id -u stunnel`" != "130" ]; then
127                 echo "Error: user stunnel doesn't have uid=130. Correct this before installing stunnel." 1>&2
128                 exit 1
129         fi
130 else
131         /usr/sbin/useradd -u 130 -r -d /var/run/stunnel -s /bin/false -c "stunnel User" -g stunnel stunnel 1>&2
132 fi
133
134 %postun 
135 /sbin/ldconfig
136 if [ "$1" = "0" ]; then
137         /usr/sbin/userdel stunnel
138         /usr/sbin/groupdel stunnel
139 fi
140
141 %post standalone
142 /sbin/chkconfig --add stunnel
143 if [ -f /var/lock/subsys/stunnel ]; then
144         /etc/rc.d/init.d/stunnel restart 1>&2
145 else
146         echo "Run \"/etc/rc.d/init.d/stunnel start\" to start stunnel daemon."
147 fi
148
149 %preun standalone
150 if [ "$1" = "0" ]; then
151         if [ -f /var/lock/subsys/stunnel ]; then
152                 /etc/rc.d/init.d/stunnel stop 1>&2
153         fi
154         /sbin/chkconfig --del stunnel
155 fi
156
157 %post inetd
158 if [ -f /var/lock/subsys/rc-inetd ]; then
159         /etc/rc.d/init.d/rc-inetd restart 1>&2
160 else
161         echo "Type \"/etc/rc.d/init.d/rc-inetd start\" to start inet server" 1>&2
162 fi
163
164 %postun inetd
165 if [ "$1" = "0" -a -f /var/lock/subsys/rc-inetd ]; then
166         /etc/rc.d/init.d/rc-inetd reload 1>&2
167 fi
168
169 %files
170 %defattr(644,root,root,755)
171 # note: this COPYING contains general information not GPL text
172 %doc AUTHORS BUGS COPYING CREDITS ChangeLog NEWS PORTS README TODO doc/en/* doc/stunnel.html
173 %doc src/stunnel.exe  tools/{ca.*,importCA.*}
174 %doc %lang(fr) doc/stunnel.fr.html
175 %doc %lang(pl) doc/pl/* doc/stunnel.pl.html
176 %attr(750,stunnel,stunnel) %{_var}/run/stunnel
177 %dir /etc/stunnel
178 %config(noreplace) %verify(not size mtime md5) /etc/stunnel/*
179 %attr(755,root,root) %{_sbindir}/*
180 %attr(755,root,root) %{_libdir}/*
181 %{_mandir}/man8/*
182 %lang(fr) %{_mandir}/fr/man8/*
183 %lang(pl) %{_mandir}/pl/man8/*
184
185 %files standalone
186 %defattr(644,root,root,755)
187 %attr(754,root,root) /etc/rc.d/init.d/stunnel
188 /etc/sysconfig/stunnel
189
190 %files inetd
191 %defattr(644,root,root,755)
192 %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/rc-inetd/stunnel
This page took 0.048582 seconds and 4 git commands to generate.