proftpd.spec 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. ##
  2. ## proftpd.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2002 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2002 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2002 Ralf S. Engelschall <rse@engelschall.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 options
  26. %ifndef with_pam
  27. %define with_pam no
  28. %endif
  29. # package information
  30. Name: proftpd
  31. Summary: Professional FTP Daemon
  32. URL: http://www.proftpd.net/
  33. Vendor: The ProFTPD Project
  34. Packager: The OpenPKG Project
  35. Distribution: OpenPKG [BASE]
  36. Group: FTP
  37. License: GPL
  38. Version: 1.2.5
  39. Release: 20020807
  40. # list of sources
  41. Source0: ftp://ftp.proftpd.net/distrib/source/proftpd-%{version}.tar.bz2
  42. Source1: proftpd.conf
  43. Source2: proftpd.msg.goaway
  44. Source3: proftpd.msg.login
  45. Source4: rc.proftpd
  46. # build information
  47. Prefix: %{l_prefix}
  48. BuildRoot: %{l_buildroot}
  49. BuildPreReq: OpenPKG, openpkg >= 20020206, make
  50. PreReq: OpenPKG, openpkg >= 20020206
  51. %if "%{with_pam}" == "yes"
  52. BuildPreReq: PAM
  53. PreReq: PAM
  54. %endif
  55. AutoReq: no
  56. AutoReqProv: no
  57. %description
  58. ProFTPD grew out of the desire to have a secure and configurable FTP
  59. server, and out of a significant admiration of the Apache web server.
  60. There are currently a very limited number of FTP servers running on unix
  61. (or unix-like) hosts. The most commonly used server is probably wu-ftpd.
  62. While wu-ftpd provides excellent performance and is generally a good
  63. product, it lacks numerous features found in newer Win32 FTP servers, and
  64. has a poor security history. Many people, including the developers who
  65. work on ProFTPD have spent a great deal of time fixing bugs and hacking
  66. features into wu-ftpd. Unfortunately, it quickly became clear that a
  67. complete redesign was necessary in order to implement the configurability
  68. and features desired. ProFTPD is not a hack based on any other server,
  69. it's an independent source tree from the ground up. Click here for a small
  70. list of some of the sites ProFTPD powers -- many of them handling large
  71. volumes of traffic on a daily basis.
  72. Options: with_pam=%{with_pam}
  73. %prep
  74. %setup -q
  75. %build
  76. # make non-standard "rundir" the same as standard "sysconfdir"
  77. %{l_shtool} subst \
  78. -e 's;^\(rundir=@localstatedir@\)/proftpd;\1;' \
  79. Make.rules.in
  80. # configure the ProFTPd source tree
  81. CC="%{l_cc}" \
  82. CFLAGS="%{l_cflags -O}" \
  83. %if "%{with_pam}" == "yes"
  84. CPPFLAGS="-I`%{l_prefix}/etc/rc --query pam_incdir`" \
  85. LDFLAGS="-L`%{l_prefix}/etc/rc --query pam_libdir`" \
  86. %endif
  87. ./configure \
  88. --prefix=%{l_prefix} \
  89. --sysconfdir=%{l_prefix}/etc/proftpd \
  90. --localstatedir=%{l_prefix}/var/proftpd \
  91. --with-modules=mod_ratio:mod_readme \
  92. %if "%{with_pam}" == "yes"
  93. --enable-pam
  94. %endif
  95. # build ProFTPd programs
  96. %{l_make} %{l_mflags -O}
  97. %install
  98. rm -rf $RPM_BUILD_ROOT
  99. # make sure the "install" procedure does not try
  100. # to perform explicit ownership assignments
  101. %{l_shtool} subst -v \
  102. -e 's;-o $(INSTALL_USER) -g $(INSTALL_GROUP);;g' \
  103. -e 's;chown;true;g' \
  104. Makefile
  105. # perform the "install" procedure while redirecting
  106. # it to the temporarily install area
  107. %{l_make} %{l_mflags} \
  108. install-proftpd install-utils install-man \
  109. prefix=$RPM_BUILD_ROOT%{l_prefix} \
  110. sysconfdir=$RPM_BUILD_ROOT%{l_prefix}/etc/proftpd \
  111. localstatedir=$RPM_BUILD_ROOT%{l_prefix}/var/proftpd \
  112. rundir=$RPM_BUILD_ROOT%{l_prefix}/var/proftpd
  113. # strip installation
  114. rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/in.proftpd
  115. # install more stuff manually
  116. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/share/proftpd
  117. %{l_shtool} install -c -m 644 doc/faq.html \
  118. $RPM_BUILD_ROOT%{l_prefix}/share/proftpd/faq.html
  119. %{l_shtool} install -c -m 644 doc/Configuration.html \
  120. $RPM_BUILD_ROOT%{l_prefix}/share/proftpd/cfg.html
  121. # extended installation with own stuff
  122. %{l_shtool} install -c -m 644 \
  123. -e 's;@l_prefix@;%{l_prefix};g' \
  124. -e 's;@l_nusr@;%{l_nusr};g' \
  125. -e 's;@l_ngrp@;%{l_ngrp};g' \
  126. %{SOURCE proftpd.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/proftpd/
  127. %{l_shtool} install -c -m 644 \
  128. %{SOURCE proftpd.msg.goaway} \
  129. %{SOURCE proftpd.msg.login} \
  130. $RPM_BUILD_ROOT%{l_prefix}/etc/proftpd/
  131. %{l_shtool} install -c -m 644 \
  132. %{SOURCE proftpd.msg.login} \
  133. $RPM_BUILD_ROOT%{l_prefix}/share/proftpd/.msg.login
  134. %{l_shtool} install -c -m 644 \
  135. %{SOURCE proftpd.msg.goaway} \
  136. $RPM_BUILD_ROOT%{l_prefix}/share/proftpd/.msg.goaway
  137. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  138. %{l_shtool} install -c -m 755 -e 's;@l_prefix@;%{l_prefix};g' \
  139. %{SOURCE rc.proftpd} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  140. # determine the package ingredients
  141. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  142. %{l_files_std} \
  143. '%config %{l_prefix}/etc/proftpd/proftpd.conf'
  144. %files -f files
  145. %clean
  146. rm -rf $RPM_BUILD_ROOT
  147. %post
  148. %if "%{with_pam}" == "yes"
  149. # add PAM configuration entry
  150. if [ $1 -eq 1 ]; then
  151. $RPM_INSTALL_PREFIX/sbin/pamtool -a -s -n "proftpd"
  152. fi
  153. %endif
  154. %preun
  155. %if "%{with_pam}" == "yes"
  156. # remove PAM configuration entry
  157. if [ $1 -eq 0 ]; then
  158. $RPM_INSTALL_PREFIX/sbin/pamtool -r -s -n "proftpd"
  159. fi
  160. %endif
  161. if [ $1 -eq 0 ]; then
  162. $RPM_INSTALL_PREFIX/etc/rc proftpd stop
  163. rm -f $RPM_INSTALL_PREFIX/var/proftpd/*.log
  164. rm -f $RPM_INSTALL_PREFIX/var/proftpd/*.pid
  165. fi