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