]> git.pld-linux.org Git - packages/pure-ftpd.git/blob - pure-ftpd.spec
85a9fb4bb969eaa129f67df3eb3db65bf08d1923
[packages/pure-ftpd.git] / pure-ftpd.spec
1 #
2 # Conditional build:
3 %bcond_with     extra           # with additional, maybe useful, but unmaintained features
4 %bcond_without  ldap            # disable LDAP auth
5 %bcond_without  longusername    # with username length = 128 (default 32)
6 %bcond_without  mysql           # disable MySQL auth but disables PAM auth
7 %bcond_without  pgsql           # disable PostgreSQL support
8 %bcond_without  puredb          # disable pure-db support
9 %bcond_without  tls             # disable SSL/TLS support
10 %bcond_without  cap             # disable capabilities
11
12 %define rel     3
13 Summary:        Small, fast and secure FTP server
14 Summary(pl.UTF-8):      Mały, szybki i bezpieczny serwer FTP
15 Name:           pure-ftpd
16 Version:        1.0.36
17 Release:        %{rel}%{?with_extra:extra}
18 Epoch:          0
19 License:        BSD-like%{?with_extra:, GLPv2 for pure-config due to libcfg+ license}
20 Group:          Daemons
21 Source0:        http://download.pureftpd.org/pub/pure-ftpd/releases/%{name}-%{version}.tar.bz2
22 # Source0-md5:  7899c75c1fed7dbad0352eb31080e066
23 Source1:        %{name}.pamd
24 Source2:        %{name}.init
25 Source3:        %{name}.sysconfig
26 Source4:        ftpusers.tar.bz2
27 # Source4-md5:  76c80b6ec9f4d079a1e27316edddbe16
28 Source5:        http://twittner.host.sk/files/pure-config/pure-config-20041201.tar.gz
29 # Source5-md5:  3f2ff6b00b5c38ee11ce588ee5af6cf6
30 Patch0:         %{name}-config.patch
31 Patch1:         %{name}-path_to_ssl_cert_in_config.patch
32 Patch2:         %{name}-pure-pw_passwd.patch
33 Patch3:         %{name}-mysql_config.patch
34 Patch4:         %{name}-allauth.patch
35 Patch5:         %{name}-passwd_location.patch
36 Patch6:         %{name}-additionalgid.patch
37 Patch7:         audit_cap.patch
38 Patch8:         pure-ftpd-apparmor.patch
39 URL:            http://www.pureftpd.org/
40 %{?with_extra:BuildRequires:    autoconf}
41 %{?with_extra:BuildRequires:    automake}
42 %{?with_cap:BuildRequires:      libcap-devel}
43 %{?with_extra:BuildRequires:    libcfg+-devel >= 0.6.2}
44 %{?with_mysql:BuildRequires:    mysql-devel}
45 %{?with_ldap:BuildRequires:     openldap-devel >= 2.3.0}
46 %{?with_tls:BuildRequires:      openssl-devel}
47 BuildRequires:  libapparmor-devel
48 BuildRequires:  pam-devel
49 %{?with_pgsql:BuildRequires:    postgresql-devel}
50 BuildRequires:  rpmbuild(macros) >= 1.304
51 Requires(post,preun):   /sbin/chkconfig
52 Requires:       pam >= 0.79.0
53 %{!?with_extra:Requires:        perl-base}
54 Requires:       rc-scripts
55 Provides:       ftpserver
56 Conflicts:      man-pages < 1.51
57 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
58
59 %define         _sysconfdir     /etc/ftpd
60 %define         _ftpdir         /home/services/ftp
61 %define         schemadir       /usr/share/openldap/schema
62
63 %description
64 Pure-FTPd is a fast, production-quality, standard-comformant FTP
65 server, based upon Troll-FTPd. Unlike other popular FTP servers, it
66 has no known security flaw, it is really trivial to set up and it is
67 especially designed for modern Linux kernels (setfsuid, sendfile,
68 capabilities) . Features include PAM support, IPv6, chroot()ed home
69 directories, virtual domains, built-in LS, anti-warez system, bounded
70 ports for passive downloads...
71
72 %description -l pl.UTF-8
73 Pure-FTPD to szybki, wysokiej jakości, odpowiadający standardom serwer
74 FTP bazujący na Troll-FTPd. W przeciwieństwie do innych serwerów FTP
75 nie ma znanych luk w bezpieczeństwie. Ponadto jest trywialny w
76 konfiguracji i specjalnie zaprojektowany dla nowych kerneli Linuksa
77 (setfsuid, sendfile, capabilibies). Możliwości to wsparcie dla PAM-a,
78 IPv6, chroot()owanych katalogów domowych, virtualne domeny, wbudowany
79 LS, system anty-warezowy, ograniczanie portów dla pasywnych
80 połączeń...
81
82 %package -n openldap-schema-pureftpd
83 Summary:        Pure-FTPd LDAP schema
84 Summary(pl.UTF-8):      Schemat LDAP dla Pure-FTPd
85 Group:          Networking/Daemons
86 Requires(post,postun):  sed >= 4.0
87 Requires:       openldap-servers
88 Requires:       sed >= 4.0
89 %if "%{_rpmversion}" >= "5"
90 BuildArch:      noarch
91 %endif
92
93 %description -n openldap-schema-pureftpd
94 This package contains an Pure-FTPd openldap schema.
95
96 %description -n openldap-schema-pureftpd -l pl.UTF-8
97 Ten pakiet zawiera schemat Pure-FTPd pureftpd.schema dla openldapa.
98
99 %prep
100 %setup -q -a 5
101 %patch0 -p0
102 %patch3 -p1
103 %patch4 -p1
104 %patch5 -p1
105 %patch6 -p1
106 %patch7 -p1
107 %patch8 -p1
108
109 %{?with_extra:%patch1 -p1}
110 %{?with_extra:%patch2 -p1}
111
112 %build
113 %{__aclocal} -Im4
114 %{__autoconf}
115 %{__autoheader}
116 %configure \
117         CFLAGS="%{rpmcflags} %{rpmcppflags} -DALLOW_DELETION_OF_TEMPORARY_FILES=1 -DALWAYS_SHOW_RESOLVED_SYMLINKS=1" \
118         --with-boring \
119         --with-altlog \
120         --with-cookie \
121         --with-diraliases \
122         --with-extauth \
123         --with-ftpwho \
124         --with-language=english \
125         %{!?with_cap:--without-capabilities} \
126         %{?with_ldap:--with-ldap} \
127         %{?with_mysql:CPPFLAGS="-I%{_includedir}/mysql" --with-mysql} \
128         --with-pam \
129         --with-peruserlimits \
130         --with-rfc2640 \
131         %{?with_pgsql:--with-pgsql} \
132         --with-privsep \
133         %{?with_puredb:--with-puredb} \
134         --with-quotas \
135         --with-ratios \
136         --with-throttling \
137         %{?with_tls:--with-tls --with-certfile=%{_sharedstatedir}/openssl/certs/ftpd.pem} \
138         --with-uploadscript \
139         --with-virtualchroot \
140         --with-virtualhosts \
141         --with-apparmor
142
143 %if %{with extra}
144 cd pure-config
145 %{__aclocal}
146 %{__autoconf}
147 %{__autoheader}
148 %{__automake}
149 %configure
150 %{__make}
151 %endif
152
153 %install
154 rm -rf $RPM_BUILD_ROOT
155 install -d $RPM_BUILD_ROOT/etc/{pam.d,sysconfig,security,rc.d/init.d} \
156         $RPM_BUILD_ROOT{%{_sysconfdir}/vhosts,%{_ftpdir},%{schemadir}}
157
158 %{__make} install \
159         DESTDIR=$RPM_BUILD_ROOT
160
161 install %{SOURCE1} $RPM_BUILD_ROOT/etc/pam.d/%{name}
162 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
163 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
164
165 %{?with_ldap:install pureftpd-ldap.conf $RPM_BUILD_ROOT%{_sysconfdir}/pureftpd-ldap.conf}
166 %{?with_mysql:install pureftpd-mysql.conf $RPM_BUILD_ROOT%{_sysconfdir}/pureftpd-mysql.conf}
167 %{?with_pgsql:install pureftpd-pgsql.conf $RPM_BUILD_ROOT%{_sysconfdir}/pureftpd-pgsql.conf}
168 install configuration-file/pure-ftpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/pureftpd.conf
169 %{!?with_extra:install configuration-file/pure-config.pl $RPM_BUILD_ROOT%{_sbindir}}
170 install pureftpd.schema $RPM_BUILD_ROOT%{schemadir}/pureftpd.schema
171
172 touch $RPM_BUILD_ROOT%{_sysconfdir}/{ftpusers,pureftpd-dir-aliases}
173
174 ln -s vhosts $RPM_BUILD_ROOT%{_sysconfdir}/pure-ftpd
175
176 bzip2 -dc %{SOURCE4} | tar xf - -C $RPM_BUILD_ROOT%{_mandir}
177 rm -f $RPM_BUILD_ROOT%{_mandir}/ftpusers-path.diff
178
179 %if %{with extra}
180 %{__make} -C pure-config install \
181         DESTDIR=$RPM_BUILD_ROOT
182 %endif
183
184 %clean
185 rm -rf $RPM_BUILD_ROOT
186
187 %post
188 /sbin/chkconfig --add %{name}
189 %service %{name} restart "PureFTPD daemon"
190
191 %preun
192 if [ "$1" = "0" ]; then
193         %service %{name} stop
194         /sbin/chkconfig --del %{name}
195 fi
196
197 %post -n openldap-schema-pureftpd
198 %openldap_schema_register %{schemadir}/pureftpd.schema -d core
199 %service -q ldap restart
200
201 %postun -n openldap-schema-pureftpd
202 if [ "$1" = "0" ]; then
203         %openldap_schema_unregister %{schemadir}/pureftpd.schema
204         %service -q ldap restart
205 fi
206
207
208 %files
209 %defattr(644,root,root,755)
210 %doc AUTHORS ChangeLog CONTACT COPYING FAQ HISTORY NEWS README* THANKS pure*.conf pureftpd.schema
211 %attr(755,root,root) %{_bindir}/*
212 %attr(755,root,root) %{_sbindir}/*
213 %attr(754,root,root) /etc/rc.d/init.d/%{name}
214 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/*
215 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/*
216 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ftpusers
217 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pureftpd-dir-aliases
218 %{?with_ldap:%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pureftpd-ldap.conf}
219 %{?with_mysql:%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pureftpd-mysql.conf}
220 %{?with_pgsql:%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pureftpd-pgsql.conf}
221 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pureftpd.conf
222 %attr(710,root,ftp) %dir %{_sysconfdir}
223 %dir %{_sysconfdir}/vhosts
224 %dir %{_sysconfdir}/pure-ftpd
225 %dir %{_ftpdir}
226 %{_mandir}/man?/*
227 %lang(ja) %{_mandir}/ja/man5/ftpusers*
228 %lang(pl) %{_mandir}/pl/man5/ftpusers*
229 %lang(pt_BR) %{_mandir}/pt_BR/man5/ftpusers*
230 %lang(ru) %{_mandir}/ru/man5/ftpusers*
231
232 %files -n openldap-schema-pureftpd
233 %defattr(644,root,root,755)
234 %{schemadir}/pureftpd.schema
This page took 0.039066 seconds and 3 git commands to generate.