pureftpd.spec 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. ##
  2. ## pureftpd.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2009 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ##
  5. ## Permission to use, copy, modify, and distribute this software for
  6. ## any purpose with or without fee is hereby granted, provided that
  7. ## the above copyright notice and this permission notice appear in all
  8. ## copies.
  9. ##
  10. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  11. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  13. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  14. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  20. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  21. ## SUCH DAMAGE.
  22. ##
  23. # package information
  24. Name: pureftpd
  25. Summary: Alternative FTP Server
  26. URL: http://www.pureftpd.org/
  27. Vendor: A.Gulbrandsen, Frank DENIS
  28. Packager: OpenPKG Foundation e.V.
  29. Distribution: OpenPKG Community
  30. Class: BASE
  31. Group: FTP
  32. License: BSD
  33. Version: 1.0.26
  34. Release: 20091115
  35. # package options
  36. %option with_fsl yes
  37. %option with_pam no
  38. %option with_ldap no
  39. %option with_mysql no
  40. %option with_pgsql no
  41. %option with_minimal no
  42. %option with_everything no
  43. # list of sources
  44. Source0: ftp://ftp.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-%{version}.tar.gz
  45. Source1: rc.pureftpd
  46. Source2: fsl.pureftpd
  47. # build information
  48. Prefix: %{l_prefix}
  49. BuildRoot: %{l_buildroot}
  50. BuildPreReq: OpenPKG, openpkg >= 20060823, make, gcc
  51. PreReq: OpenPKG, openpkg >= 20060823
  52. %if "%{with_fsl}" == "yes"
  53. BuildPreReq: fsl
  54. PreReq: fsl
  55. %endif
  56. %if "%{with_pam}" == "yes"
  57. BuildPreReq: PAM
  58. PreReq: PAM
  59. %endif
  60. %if "%{with_ldap}" == "yes"
  61. BuildPreReq: openldap, openssl
  62. PreReq: openldap, openssl
  63. %endif
  64. %if "%{with_mysql}" == "yes"
  65. BuildPreReq: mysql
  66. PreReq: mysql
  67. %endif
  68. %if "%{with_pgsql}" == "yes"
  69. BuildPreReq: postgresql
  70. PreReq: postgresql
  71. %endif
  72. AutoReq: no
  73. AutoReqProv: no
  74. %description
  75. Pure-FTPd is a fast, production-quality, standard-conformant FTP
  76. server, based upon Troll-FTPd. Unlike other popular FTP servers,
  77. it's designed to be secure in default configuration, has no known
  78. buffer overflow, it is really trivial to set up and it is especially
  79. designed for modern kernels. Features include PAM support, IPv6,
  80. chroot()ed home directories, virtual domains, built-in 'ls',
  81. anti-warez system, bounded ports for passive downloads, FXP
  82. protocol, bandwidth throttling, ratios, LDAP, XML and HTML reports,
  83. support for external programs to post-process uploads and more.
  84. %track
  85. prog pureftpd = {
  86. version = %{version}
  87. url = ftp://ftp.pureftpd.org/pub/pure-ftpd/releases/
  88. regex = pure-ftpd-(__VER__)\.tar\.gz
  89. }
  90. %prep
  91. %setup -q -n pure-ftpd-%{version}
  92. %build
  93. CC="%{l_cc}" \
  94. CFLAGS="%{l_cflags -O}" \
  95. LDFLAGS="%{l_fsl_ldflags}" \
  96. LIBS="%{l_fsl_libs}" \
  97. %if "%{with_pam}" == "yes"
  98. CPPFLAGS="-I`%{l_rc} --query pam_incdir`" \
  99. LDFLAGS="-L`%{l_rc} --query pam_libdir` ${LDFLAGS}" \
  100. %endif
  101. %if "%{with_ldap}" == "yes"
  102. LIBS="${LIBS} -lldap -llber -lssl -lcrypto" \
  103. %endif
  104. ./configure \
  105. --prefix=%{l_prefix} \
  106. --sysconfdir=%{l_prefix}/etc/pureftpd \
  107. --without-inetd \
  108. --without-humor \
  109. --without-cookie \
  110. --without-welcomemsg \
  111. %if "%{with_pam}" == "yes"
  112. --with-pam \
  113. %endif
  114. %if "%{with_ldap}" == "yes"
  115. --with-ldap=%{l_prefix} \
  116. %endif
  117. %if "%{with_mysql}" == "yes"
  118. --with-mysql=%{l_prefix} \
  119. %endif
  120. %if "%{with_pgsql}" == "yes"
  121. --with-pgsql=%{l_prefix} \
  122. %endif
  123. %if "%{with_minimal}" == "yes"
  124. --with-minimal \
  125. %endif
  126. %if "%{with_everything}" == "yes"
  127. --with-everything \
  128. %endif
  129. --with-ftpwho \
  130. --with-virtualhosts \
  131. --with-language=english \
  132. --with-largefile
  133. # workaround broken configure:
  134. # "checking whether realpath likes unreadable directories"
  135. # can leave a test directory, which is not removable.
  136. test -d x && chmod 755 x || true
  137. %{l_make} %{l_mflags -O}
  138. %install
  139. rm -rf $RPM_BUILD_ROOT
  140. %{l_shtool} mkdir -f -p -m 755 \
  141. $RPM_BUILD_ROOT%{l_prefix}/var/pureftpd \
  142. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  143. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  144. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  145. strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
  146. # install run-command script
  147. %{l_shtool} mkdir -f -p -m 755 \
  148. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  149. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  150. %{SOURCE rc.pureftpd} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  151. # install OSSP fsl configuration
  152. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  153. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  154. %{SOURCE fsl.pureftpd} \
  155. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  156. # determine installation files
  157. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  158. %{l_files_std} \
  159. '%config %{l_prefix}/etc/fsl/fsl.pureftpd'
  160. %files -f files
  161. %clean
  162. rm -rf $RPM_BUILD_ROOT
  163. %pre
  164. # before upgrade, save status and stop service
  165. [ $1 -eq 2 ] || exit 0
  166. eval `%{l_rc} pureftpd status 2>/dev/null | tee %{l_tmpfile}`
  167. %{l_rc} pureftpd stop 2>/dev/null
  168. exit 0
  169. %post
  170. %if "%{with_pam}" == "yes"
  171. if [ $1 -eq 1 ]; then
  172. # after install, add PAM configuration entry
  173. $RPM_INSTALL_PREFIX/sbin/pamtool --add --smart --name=pureftpd
  174. fi
  175. %endif
  176. if [ $1 -eq 2 ]; then
  177. # after upgrade, restore status
  178. { eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile}; true; } >/dev/null 2>&1
  179. [ ".$pureftpd_active" = .yes ] && %{l_rc} pureftpd start
  180. fi
  181. exit 0
  182. %preun
  183. # before erase, stop service and remove log files
  184. [ $1 -eq 0 ] || exit 0
  185. %{l_rc} pureftpd stop 2>/dev/null
  186. rm -f $RPM_INSTALL_PREFIX/var/pureftpd/pureftpd.log* >/dev/null 2>&1 || true
  187. %if "%{with_pam}" == "yes"
  188. # remove PAM configuration entry
  189. $RPM_INSTALL_PREFIX/sbin/pamtool --remove --smart --name=pureftpd
  190. %endif
  191. exit 0