pureftpd.spec 5.7 KB

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