]> git.pld-linux.org Git - packages/proftpd.git/blob - proftpd.spec
tls && ipv6 fixed
[packages/proftpd.git] / proftpd.spec
1
2 # Conditional builds:
3 # bcond_off_pam - disable PAM support
4 # bcond_on_ldap - enable LDAP suppoer
5 # bcond_on_mysql - enable MySQL suppoer
6 # bcond_on_quota - enable quota support
7 # bcond_on_linuxprivs - enable libcap support
8 # bcond_off_ipv6 - disable IPv6 and TCPD support
9 # bcond_off_ssl - disbale TLS/SSL support
10 # --without pam --with ldap --with mysql --with quota --with linuxprivs
11 Summary:        PROfessional FTP Daemon with apache-like configuration syntax
12 Summary(pl):    PROfesionalny serwer FTP  
13 Name:           proftpd
14 Version:        1.2.1
15 Release:        0.1
16 License:        GPL
17 Group:          Daemons
18 Group(de):      Server
19 Group(pl):      Serwery
20 Source0:        ftp://ftp.proftpd.org/distrib/source/%{name}-%{version}.tar.bz2
21 Source1:        %{name}.conf
22 Source2:        %{name}.logrotate
23 Source3:        ftp.pamd
24 Source4:        %{name}.inetd
25 Source5:        %{name}.sysconfig
26 Source6:        %{name}.init
27 Source7:        %{name}-mod_tcpd.c
28 Patch0:         %{name}-1.2.1-v6-20010303.patch.gz
29 # ftp://ftp.runestig.com/pub/proftpd-tls/
30 Patch1:         %{name}-1.2.1+v6-tls.20010303.patch.gz
31 Patch2:         %{name}-umode_t.patch
32 Patch3:         %{name}-glibc.patch
33 Patch4:         %{name}-paths.patch
34 Patch5:         %{name}-release.patch
35 Patch6:         %{name}-noautopriv.patch
36 Patch7:         %{name}-betterlog.patch
37 Patch8:         %{name}-DESTDIR.patch
38 Patch9:         %{name}-wtmp.patch
39 Patch10:        %{name}-link.patch
40 URL:            http://www.proftpd.org/
41 %{?!bcond_off_pam:BuildRequires:        pam-devel}
42 %{?bcond_on_ldap:BuildRequires:         openldap-devel}
43 %{?bcond_on_mysql:BuildRequires:        mysql-devel}
44 %{?!bcond_off_ssl:BuildRequires:        openssl-devel}
45 Prereq:         awk
46 Prereq:         rc-inetd
47 Prereq:         fileutils
48 Requires:       logrotate
49 %{?!bcond_off_pam:Requires:     pam >= 0.67}
50 Requires:       %{name}-setup = %{version}
51 Requires:       inetdaemon
52 Provides:       ftpserver
53 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
54 Obsoletes:      ftpserver
55 Obsoletes:      anonftp
56 Obsoletes:      bftpd
57 Obsoletes:      ftpd-BSD
58 Obsoletes:      heimdal-ftpd
59 Obsoletes:      linux-ftpd
60 Obsoletes:      pure-ftpd
61 Obsoletes:      wu-ftpd
62
63 %define         _sysconfdir     /etc/ftpd
64 %define         _localstatedir  /var/run
65
66 %description
67 ProFTPD is a highly configurable ftp daemon for unix and unix-like
68 operating systems. ProFTPD is designed to be somewhat of a "drop-in"
69 replacement for wu-ftpd. Full online documentation is available at
70 http://www.proftpd.org/, including a server configuration directive
71 reference manual.
72
73 %description -l pl
74 ProFTPD jest wysoce konfigurowalnym serwerem ftp dla systemów Unix.
75 ProFTPD jest robiony jako bezpo¶redni zamiennik wu-ftpd. Pe³na
76 dokunentacja jest dostêpna on-line pod http://www.proftpd.org/
77 w³±cznie z dokumentacj± dotycz±c± konfigurowania.
78
79 %package inetd
80 Summary:        inetd configs for proftpd
81 Group:          Daemons
82 Group(de):      Server
83 Group(pl):      Serwery
84 Prereq:         %{name} = %{version}
85 Provides:       %{name}-setup
86 Obsoletes:      proftpd-standalone
87
88 %description inetd
89 ProFTPD configs for running from inetd.
90
91 %package standalone
92 Summary:        standalone daemon configs for proftpd
93 Group:          Daemons
94 Group(de):      Server
95 Group(pl):      Serwery
96 Prereq:         %{name} = %{version}
97 Provides:       %{name}-setup
98 Obsoletes:      proftpd-inetd
99
100 %description standalone
101 ProFTPD configs for running as a standalone daemon.
102
103 %prep
104 %setup  -q 
105 %patch0 -p1
106 %patch1 -p1
107 %patch2 -p1
108 %patch3 -p1
109 %patch4 -p1
110 %patch5 -p1 
111 %patch6 -p1
112 %patch7 -p1
113 %patch8 -p1
114 %patch9 -p1
115 %patch10 -p1
116 install -m644 %{SOURCE7} contrib/mod_tcpd.c
117
118 %build
119 autoconf
120 RUN_DIR=%{_localstatedir} ; export RUN_DIR
121 %configure \
122         --enable-autoshadow \
123         --with-modules=mod_ratio:mod_readme%{?!bcond_off_ipv6::mod_tcpd}%{?!bcond_off_pam::mod_pam}%{?bcond_on_ldap::mod_ldap}%{?bcond_on_quota::mod_quota}%{?bcond_on_linuxprivs::mod_linuxprivs}%{?bcond_on_mysql::mod_sql:mod_sql_mysql} \
124         %{?!bcond_off_ipv6:--enable-ipv6} \
125         %{?bcond_off_ssl:--disable-tls} \
126         --enable-sendfile
127
128 %{__make}
129
130 %install
131 rm -rf $RPM_BUILD_ROOT
132
133 install -d $RPM_BUILD_ROOT/etc/{logrotate.d,pam.d,sysconfig/rc-inetd,rc.d/init.d} \
134         $RPM_BUILD_ROOT/{home/ftp/pub/Incoming,var/log}
135
136 %{__make} install DESTDIR=$RPM_BUILD_ROOT \
137         INSTALL_USER=`id -u` \
138         INSTALL_GROUP=`id -g`
139
140 rm -f $RPM_BUILD_ROOT%{_sbindir}/in.proftpd
141
142 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}
143 install %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/ftpd
144 %{?!bcond_off_pam:install %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/ftp}
145 install %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/ftpd
146 install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/proftpd
147 install %{SOURCE6} $RPM_BUILD_ROOT/etc/rc.d/init.d/proftpd
148 install contrib/xferstats.* $RPM_BUILD_ROOT%{_bindir}/xferstat
149
150 mv -f contrib/README contrib/README.modules
151
152 :> $RPM_BUILD_ROOT%{_sysconfdir}/ftpusers.default
153 :> $RPM_BUILD_ROOT%{_sysconfdir}/ftpusers
154 :> $RPM_BUILD_ROOT/var/log/xferlog
155
156 ln -s proftpd $RPM_BUILD_ROOT%{_sbindir}/ftpd
157
158 gzip -9nf sample-configurations/{virtual,anonymous}.conf ChangeLog README \
159         README.linux-* contrib/README.modules README.IPv6 README.PAM \
160         README.TLS
161
162 %post 
163 touch /var/log/xferlog
164 awk 'BEGIN { FS = ":" }; { if(($3 < 1000)&&($1 != "ftp")) print $1; }' < /etc/passwd >> %{_sysconfdir}/ftpusers.default
165 if [ ! -f %{_sysconfdir}/ftpusers ]; then
166         ( cd %{_sysconfdir}; mv -f ftpusers.default ftpusers )
167 fi
168
169 %post inetd
170 if grep -iEqs "^ServerType[[:space:]]+standalone" %{_sysconfdir}/proftpd.conf ; then
171         cp -a %{_sysconfdir}/proftpd.conf %{_sysconfdir}/proftpd.conf.rpmorig
172         sed -e "s/^ServerType[[:space:]]\+standalone/ServerType                 inetd/g" \
173                 %{_sysconfdir}/proftpd.conf.rpmorig >%{_sysconfdir}/proftpd.conf
174 fi
175 if [ -f /var/lock/subsys/rc-inetd ]; then
176         /etc/rc.d/init.d/rc-inetd restart 1>&2
177 else
178         echo "Type \"/etc/rc.d/init.d/rc-inetd start\" to start inet sever" 1>&2
179 fi
180
181 %postun inetd
182 if [ "$1" = "0" -a -f /var/lock/subsys/rc-inetd ]; then
183         /etc/rc.d/init.d/rc-inetd reload 1>&2
184 fi
185
186 %post standalone
187 /sbin/chkconfig --add proftpd
188 if grep -iEqs "^ServerType[[:space:]]+inetd" %{_sysconfdir}/proftpd.conf ; then
189         cp -a %{_sysconfdir}/proftpd.conf %{_sysconfdir}/proftpd.conf.rpmorig
190         sed -e "s/^ServerType[[:space:]]\+inetd/ServerType                      standalone/g" \
191                 %{_sysconfdir}/proftpd.conf.rpmorig >%{_sysconfdir}/proftpd.conf
192 fi
193 if [ -f /var/lock/subsys/proftpd ]; then
194         /etc/rc.d/init.d/proftpd restart 1>&2
195 else
196         echo "Run \"/etc/rc.d/init.d/proftpd start\" to start ProFTPD daemon."
197 fi
198
199 %preun standalone
200 if [ "$1" = "0" -a -f /var/lock/subsys/proftpd ]; then
201         /etc/rc.d/init.d/proftpd stop 1>&2
202 fi
203 /sbin/chkconfig --del proftpd
204
205 %clean
206 rm -rf $RPM_BUILD_ROOT
207
208 %files
209 %defattr(644,root,root,755)
210 %doc {ChangeLog,README*}.gz contrib/README.modules.gz
211 %doc sample-configurations/{virtual,anonymous}.conf.gz 
212 %doc doc/*html
213
214 %attr(750,root,root) %dir %{_sysconfdir}
215 %attr(640,root,root) /etc/logrotate.d/*
216 %attr(640,root,root) %ghost /var/log/*
217 %{?!bcond_off_pam:%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/*}
218
219 %attr(640,root,root) %{_sysconfdir}/ftpusers.default
220 %attr(640,root,root) %ghost %{_sysconfdir}/ftpusers
221
222 %attr(755,root,root) %{_bindir}/*
223 %attr(755,root,root) %{_sbindir}/*
224
225 %{_mandir}/man[158]/*
226
227 %dir /home/ftp/pub
228 %attr(711,root,root) %dir /home/ftp/pub/Incoming
229
230 %files inetd
231 %defattr(644,root,root,755)
232 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.conf
233 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/rc-inetd/ftpd
234
235 %files standalone
236 %defattr(644,root,root,755)
237 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.conf
238 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/proftpd
239 %attr(754,root,root) /etc/rc.d/init.d/proftpd
This page took 0.094521 seconds and 3 git commands to generate.