proftpd.spec 7.6 KB

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