proftpd.spec 7.5 KB

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