proftpd.spec 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  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.6
  39. Release: 20020916
  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:
  73. --define 'with_pam %{with_pam}'
  74. %prep
  75. %setup -q
  76. %build
  77. # make non-standard "rundir" the same as standard "sysconfdir"
  78. %{l_shtool} subst \
  79. -e 's;^\(rundir=@localstatedir@\)/proftpd;\1;' \
  80. Make.rules.in
  81. # configure the ProFTPd source tree
  82. CC="%{l_cc}" \
  83. CFLAGS="%{l_cflags -O}" \
  84. %if "%{with_pam}" == "yes"
  85. CPPFLAGS="-I`%{l_prefix}/etc/rc --query pam_incdir`" \
  86. LDFLAGS="-L`%{l_prefix}/etc/rc --query pam_libdir`" \
  87. %endif
  88. ./configure \
  89. --prefix=%{l_prefix} \
  90. --sysconfdir=%{l_prefix}/etc/proftpd \
  91. --localstatedir=%{l_prefix}/var/proftpd \
  92. --with-modules=mod_ratio:mod_readme \
  93. %if "%{with_pam}" == "yes"
  94. --enable-pam
  95. %endif
  96. # build ProFTPd programs
  97. %{l_make} %{l_mflags -O}
  98. %install
  99. rm -rf $RPM_BUILD_ROOT
  100. # make sure the "install" procedure does not try
  101. # to perform explicit ownership assignments
  102. %{l_shtool} subst -v \
  103. -e 's;-o $(INSTALL_USER) -g $(INSTALL_GROUP);;g' \
  104. -e 's;chown;true;g' \
  105. Makefile
  106. # perform the "install" procedure while redirecting
  107. # it to the temporarily install area
  108. %{l_make} %{l_mflags} \
  109. install-proftpd install-utils install-man \
  110. prefix=$RPM_BUILD_ROOT%{l_prefix} \
  111. sysconfdir=$RPM_BUILD_ROOT%{l_prefix}/etc/proftpd \
  112. localstatedir=$RPM_BUILD_ROOT%{l_prefix}/var/proftpd \
  113. rundir=$RPM_BUILD_ROOT%{l_prefix}/var/proftpd
  114. # strip installation
  115. rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/in.proftpd
  116. # install more stuff manually
  117. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/share/proftpd
  118. %{l_shtool} install -c -m 644 doc/faq.html \
  119. $RPM_BUILD_ROOT%{l_prefix}/share/proftpd/faq.html
  120. %{l_shtool} install -c -m 644 doc/Configuration.html \
  121. $RPM_BUILD_ROOT%{l_prefix}/share/proftpd/cfg.html
  122. # extended installation with own stuff
  123. %{l_shtool} install -c -m 644 \
  124. -e 's;@l_prefix@;%{l_prefix};g' \
  125. -e 's;@l_nusr@;%{l_nusr};g' \
  126. -e 's;@l_ngrp@;%{l_ngrp};g' \
  127. %{SOURCE proftpd.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/proftpd/
  128. %{l_shtool} install -c -m 644 \
  129. %{SOURCE proftpd.msg.goaway} \
  130. %{SOURCE proftpd.msg.login} \
  131. $RPM_BUILD_ROOT%{l_prefix}/etc/proftpd/
  132. %{l_shtool} install -c -m 644 \
  133. %{SOURCE proftpd.msg.login} \
  134. $RPM_BUILD_ROOT%{l_prefix}/share/proftpd/.msg.login
  135. %{l_shtool} install -c -m 644 \
  136. %{SOURCE proftpd.msg.goaway} \
  137. $RPM_BUILD_ROOT%{l_prefix}/share/proftpd/.msg.goaway
  138. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  139. %{l_shtool} install -c -m 755 -e 's;@l_prefix@;%{l_prefix};g' \
  140. %{SOURCE rc.proftpd} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  141. # determine the package ingredients
  142. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  143. %{l_files_std} \
  144. '%config %{l_prefix}/etc/proftpd/proftpd.conf'
  145. %files -f files
  146. %clean
  147. rm -rf $RPM_BUILD_ROOT
  148. %post
  149. %if "%{with_pam}" == "yes"
  150. # add PAM configuration entry
  151. if [ $1 -eq 1 ]; then
  152. $RPM_INSTALL_PREFIX/sbin/pamtool --add --smart --name=proftpd
  153. fi
  154. %endif
  155. %preun
  156. %if "%{with_pam}" == "yes"
  157. # remove PAM configuration entry
  158. if [ $1 -eq 0 ]; then
  159. $RPM_INSTALL_PREFIX/sbin/pamtool --remove --smart --name=proftpd
  160. fi
  161. %endif
  162. if [ $1 -eq 0 ]; then
  163. $RPM_INSTALL_PREFIX/etc/rc proftpd stop
  164. rm -f $RPM_INSTALL_PREFIX/var/proftpd/*.log
  165. rm -f $RPM_INSTALL_PREFIX/var/proftpd/*.pid
  166. fi