]> git.pld-linux.org Git - packages/pure-ftpd.git/blob - pure-ftpd.spec
- added my pure-config parser to extra bcond
[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 #
11 Summary:        Small, fast and secure FTP server
12 Summary(pl):    Ma³y, szybki i bezpieczny serwer FTP
13 Name:           pure-ftpd
14 Version:        1.0.20
15 Release:        3%{?with_extra:extra}
16 Epoch:          0
17 License:        BSD-like%{?with_extra:, GLPv2 for pure-config due to libcfg+ license}
18 Group:          Daemons
19 Source0:        ftp://ftp.pureftpd.org/pub/pure-ftpd/releases/%{name}-%{version}.tar.bz2
20 # Source0-md5:  e928e9e15adf6b52bfe6183fdad20144
21 Source1:        %{name}.pamd
22 Source2:        %{name}.init
23 Source3:        ftpusers.tar.bz2
24 # Source3-md5:  76c80b6ec9f4d079a1e27316edddbe16
25 Source4:        ftp://distfiles.pld-linux.org/src/pure-config-20041106.tar.gz
26 # Source4-md5:  a9e40fa1eabde41f8599133da2d92b18        
27 Patch0:         %{name}-config.patch
28 Patch1:         %{name}-path_to_ssl_cert_in_config.patch
29 Patch2:         %{name}-pure-pw_passwd.patch
30 Patch3:         %{name}-userlength.patch
31 URL:            http://www.pureftpd.org/
32 BuildRequires:  libcap-devel
33 %{?with_extra:BuildRequires:    libcfg+-devel >= 0.6.2}
34 %{?with_ldap:BuildRequires:     openldap-devel}
35 %{?with_mysql:BuildRequires:    mysql-devel}
36 %{?with_pgsql:BuildRequires:    postgresql-devel}
37 %{?with_tls:BuildRequires:      openssl-devel}
38 BuildRequires:  pam-devel
39 PreReq:         rc-scripts
40 Requires(post,preun):/sbin/chkconfig
41 Requires:       pam >= 0.77.3
42 %{!?with_extra:Requires:        perl-base}
43 Provides:       ftpserver
44 Obsoletes:      ftpserver
45 Obsoletes:      anonftp
46 Obsoletes:      bftpd
47 Obsoletes:      ftpd-BSD
48 Obsoletes:      glftpd
49 Obsoletes:      heimdal-ftpd
50 Obsoletes:      linux-ftpd
51 Obsoletes:      muddleftpd
52 Obsoletes:      proftpd
53 Obsoletes:      proftpd-common
54 Obsoletes:      proftpd-inetd
55 Obsoletes:      proftpd-standalone
56 Obsoletes:      troll-ftpd
57 Obsoletes:      vsftpd
58 Obsoletes:      wu-ftpd
59 Conflicts:      man-pages < 1.51
60 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
61
62 %define         _sysconfdir     /etc/ftpd
63 %define         _ftpdir         /home/services/ftp
64
65 %description
66 Pure-FTPd is a fast, production-quality, standard-comformant FTP
67 server, based upon Troll-FTPd. Unlike other popular FTP servers, it
68 has no known security flaw, it is really trivial to set up and it is
69 especially designed for modern Linux kernels (setfsuid, sendfile,
70 capabilities) . Features include PAM support, IPv6, chroot()ed home
71 directories, virtual domains, built-in LS, anti-warez system, bounded
72 ports for passive downloads...
73
74 %description -l pl
75 Pure-FTPD to szybki, wysokiej jako¶ci, odpowiadaj±cy standardom serwer
76 FTP bazuj±cy na Troll-FTPd. W przeciwieñstwie do innych serwerów FTP
77 nie ma znanych luk w bezpieczeñstwie. Ponadto jest trywialny w
78 konfiguracji i specjalnie zaprojektowany dla nowych kerneli Linuksa
79 (setfsuid, sendfile, capabilibies). Mo¿liwo¶ci to wsparcie dla PAM-a,
80 IPv6, chroot()owanych katalogów domowych, virtualne domeny, wbudowany
81 LS, system anty-warezowy, ograniczanie portów dla pasywnych
82 po³±czeñ...
83
84 %prep
85 %setup -q
86 %setup -q -a 4
87 %patch0 -p0
88 %{?with_longusername:%patch3 -p1}
89 %{?with_extra:%patch1 -p1}
90 %{?with_extra:%patch2 -p1}
91
92 %build
93 %configure \
94         --with-boring \
95         --with-altlog \
96         --with-cookie \
97         --with-diraliases \
98         --with-extauth \
99         --with-ftpwho \
100         --with-language=english \
101         --with-largefile \
102         %{?with_ldap:--with-ldap} \
103         %{?with_mysql:CPPFLAGS="-I%{_includedir}/mysql" --with-mysql} \
104         --with-pam \
105         --with-peruserlimits \
106         %{?with_pgsql:--with-pgsql} \
107         --with-privsep \
108         %{?with_puredb:--with-puredb} \
109         --with-quotas \
110         --with-ratios \
111         --with-throttling \
112         %{?with_tls:--with-tls --with-certfile=%{_sharedstatedir}/openssl/certs/ftpd.pem} \
113         --with-uploadscript \
114         --with-virtualchroot \
115         --with-virtualhosts 
116
117 %if %{with extra}
118 cd pure-config
119 %{__aclocal}
120 %{__autoconf}
121 %{__autoheader}
122 %{__automake}
123 %configure
124 %{__make}
125 %endif
126          
127 %install
128 rm -rf $RPM_BUILD_ROOT
129 install -d $RPM_BUILD_ROOT/etc/{pam.d,sysconfig,security,rc.d/init.d} \
130         $RPM_BUILD_ROOT{%{_sysconfdir}/vhosts,%{_ftpdir}}
131
132 %{__make} install \
133         DESTDIR=$RPM_BUILD_ROOT
134
135 install %{SOURCE1} $RPM_BUILD_ROOT/etc/pam.d/%{name}
136 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
137
138 %{?with_ldap:install pureftpd-ldap.conf $RPM_BUILD_ROOT%{_sysconfdir}/pureftpd-ldap.conf}
139 %{?with_mysql:install pureftpd-mysql.conf $RPM_BUILD_ROOT%{_sysconfdir}/pureftpd-mysql.conf}
140 %{?with_pgsql:install pureftpd-pgsql.conf $RPM_BUILD_ROOT%{_sysconfdir}/pureftpd-pgsql.conf}
141 install configuration-file/pure-ftpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/pureftpd.conf
142 %{!?with_extra:install configuration-file/pure-config.pl $RPM_BUILD_ROOT%{_sbindir}}
143 touch $RPM_BUILD_ROOT/etc/security/blacklist.ftp
144
145 ln -s vhosts $RPM_BUILD_ROOT%{_sysconfdir}/pure-ftpd
146
147 bzip2 -dc %{SOURCE3} | tar xf - -C $RPM_BUILD_ROOT%{_mandir}
148
149 %if %{with extra}
150 cd pure-config
151 %{__make} install DESTDIR=$RPM_BUILD_ROOT
152 %endif
153
154 %clean
155 rm -rf $RPM_BUILD_ROOT
156
157 %post
158 /sbin/chkconfig --add %{name}
159 if [ -f %{_var}/lock/subsys/%{name} ]; then
160         /etc/rc.d/init.d/%{name} restart 1>&2
161 else
162         echo "Run \"/etc/rc.d/init.d/%{name} start\" to start PureFTPD daemon."
163 fi
164
165 %preun
166 if [ "$1" = "0" ]; then
167         if [ -f %{_var}/lock/subsys/%{name} ]; then
168                 /etc/rc.d/init.d/%{name} stop 1>&2
169         fi
170         /sbin/chkconfig --del %{name}
171 fi
172
173 %files
174 %defattr(644,root,root,755)
175 %doc AUTHORS ChangeLog CONTACT FAQ HISTORY NEWS README* THANKS pure*.conf pureftpd.schema
176 %attr(755,root,root) %{_bindir}/*
177 %attr(755,root,root) %{_sbindir}/*
178 %attr(754,root,root) /etc/rc.d/init.d/%{name}
179 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/*
180 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/security/blacklist.ftp
181 %{?with_ldap:%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pureftpd-ldap.conf}
182 %{?with_mysql:%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pureftpd-mysql.conf}
183 %{?with_pgsql:%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pureftpd-pgsql.conf}
184 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pureftpd.conf
185 %attr(710,root,ftp) %dir %{_sysconfdir}
186 %dir %{_sysconfdir}/vhosts
187 %dir %{_sysconfdir}/pure-ftpd
188 %dir %{_ftpdir}
189 %{_mandir}/man?/*
190 %lang(ja) %{_mandir}/ja/man5/ftpusers*
191 %lang(pl) %{_mandir}/pl/man5/ftpusers*
192 %lang(pt_BR) %{_mandir}/pt_BR/man5/ftpusers*
193 %lang(ru) %{_mandir}/ru/man5/ftpusers*
This page took 0.081053 seconds and 4 git commands to generate.