proftpd.spec 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. ##
  2. ## proftpd.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2001 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2001 Ralf S. Engelschall <rse@engelschall.com>
  5. ##
  6. ## Permission to use, copy, modify, and distribute this software for
  7. ## any purpose with or without fee is hereby granted, provided that
  8. ## the above copyright notice and this permission notice appear in all
  9. ## copies.
  10. ##
  11. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. ## SUCH DAMAGE.
  23. ##
  24. # package information
  25. Name: proftpd
  26. Summary: Professional FTP Daemon
  27. URL: http://www.proftpd.net/
  28. Vendor: The ProFTPD Project
  29. Packager: The OpenPKG Project
  30. Distribution: OpenPKG [EXP]
  31. Group: FTP
  32. License: GPL
  33. Version: 1.2.4
  34. Release: 0
  35. # list of sources
  36. Source0: ftp://ftp.proftpd.net/distrib/proftpd-%{version}.tar.bz2
  37. Source1: proftpd.conf
  38. Source2: proftpd.msg.goaway
  39. Source3: proftpd.msg.login
  40. Source4: rc.proftpd
  41. # build information
  42. Prefix: %{l_prefix}
  43. BuildRoot: %{l_buildroot}
  44. BuildPreReq: OpenPKG, openpkg >= 0.9-33
  45. PreReq: OpenPKG, openpkg >= 0.9-33
  46. AutoReq: no
  47. AutoReqProv: no
  48. %description
  49. ProFTPD grew out of the desire to have a secure and configurable FTP
  50. server, and out of a significant admiration of the Apache web server.
  51. There are currently a very limited number of FTP servers running on unix
  52. (or unix-like) hosts. The most commonly used server is probably wu-ftpd.
  53. While wu-ftpd provides excellent performance and is generally a good
  54. product, it lacks numerous features found in newer Win32 FTP servers, and
  55. has a poor security history. Many people, including the developers who
  56. work on ProFTPD have spent a great deal of time fixing bugs and hacking
  57. features into wu-ftpd. Unfortunately, it quickly became clear that a
  58. complete redesign was necessary in order to implement the configurability
  59. and features desired. ProFTPD is not a hack based on any other server,
  60. it's an independent source tree from the ground up. Click here for a small
  61. list of some of the sites ProFTPD powers -- many of them handling large
  62. volumes of traffic on a daily basis.
  63. %prep
  64. %setup -q
  65. %build
  66. # make non-standard "rundir" the same as standard "sysconfdir"
  67. %{l_rpmtool} subst \
  68. 's;^\(rundir=@localstatedir@\)/proftpd;\1;' \
  69. -- Make.rules.in
  70. # configure the ProFTPd source tree
  71. CC="%{l_cc}" \
  72. CFLAGS="%{l_cflags -O}" \
  73. ./configure \
  74. --prefix=%{l_prefix} \
  75. --sysconfdir=%{l_prefix}/etc/proftpd \
  76. --localstatedir=%{l_prefix}/var/proftpd \
  77. --with-modules=mod_ratio:mod_readme \
  78. --enable-pam
  79. # build ProFTPd programs
  80. %{l_make} %{l_mflags -O}
  81. %install
  82. rm -rf $RPM_BUILD_ROOT
  83. # make sure the "install" procedure does not try
  84. # to perform explicit ownership assignments
  85. %{l_rpmtool} subst -v \
  86. 's;-o $(INSTALL_USER) -g $(INSTALL_GROUP);;g' \
  87. 's;chown;true;g' \
  88. -- Makefile
  89. # perform the "install" procedure while redirecting
  90. # it to the temporarily install area
  91. %{l_make} %{l_mflags} \
  92. install-proftpd install-utils install-man \
  93. prefix=$RPM_BUILD_ROOT%{l_prefix} \
  94. sysconfdir=$RPM_BUILD_ROOT%{l_prefix}/etc/proftpd \
  95. localstatedir=$RPM_BUILD_ROOT%{l_prefix}/var/proftpd \
  96. rundir=$RPM_BUILD_ROOT%{l_prefix}/var/proftpd
  97. # strip installation
  98. rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/in.proftpd
  99. # install more stuff manually
  100. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/share/proftpd
  101. %{l_shtool} install -c -m 644 doc/FAQ-config.html \
  102. $RPM_BUILD_ROOT%{l_prefix}/share/proftpd/faq.html
  103. %{l_shtool} install -c -m 644 doc/Configuration.html \
  104. $RPM_BUILD_ROOT%{l_prefix}/share/proftpd/cfg.html
  105. # extended installation with own stuff
  106. %{l_shtool} install -c -m 644 \
  107. -e "s;@l_prefix@;%{l_prefix};g" \
  108. -e "s;@l_npusr@;%{l_npusr};g" \
  109. -e "s;@l_npgrp@;%{l_npgrp};g" \
  110. %{SOURCE proftpd.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/proftpd/
  111. %{l_shtool} install -c -m 644 \
  112. %{SOURCE proftpd.msg.goaway} \
  113. %{SOURCE proftpd.msg.login} \
  114. $RPM_BUILD_ROOT%{l_prefix}/etc/proftpd/
  115. %{l_shtool} install -c -m 644 \
  116. %{SOURCE proftpd.msg.login} \
  117. $RPM_BUILD_ROOT%{l_prefix}/share/proftpd/.msg.login
  118. %{l_shtool} install -c -m 644 \
  119. %{SOURCE proftpd.msg.goaway} \
  120. $RPM_BUILD_ROOT%{l_prefix}/share/proftpd/.msg.goaway
  121. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  122. %{l_shtool} install -c -m 755 -e "s;@l_prefix@;%{l_prefix};g" \
  123. %{SOURCE rc.proftpd} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  124. # determine the package ingredients
  125. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  126. %{l_files_std} \
  127. '%config %{l_prefix}/etc/proftpd/proftpd.conf'
  128. %files -f files
  129. %clean
  130. rm -rf $RPM_BUILD_ROOT
  131. %post
  132. # add PAM configuration entry
  133. check=`grep '^#<OpenPKG pkg=proftpd>' /etc/pam.conf`
  134. if [ ".$check" = . ]; then
  135. ( echo "#<OpenPKG pkg=proftpd>"
  136. case "%{l_target}" in
  137. *-freebsd* )
  138. echo "proftpd auth sufficient pam_skey.so"
  139. echo "proftpd auth required pam_unix.so try_first_pass"
  140. echo "proftpd account required pam_unix.so try_first_pass"
  141. echo "proftpd session required pam_permit.so"
  142. ;;
  143. *-linux* )
  144. echo "proftpd auth required /lib/security/pam_unix.so shadow nodelay"
  145. echo "proftpd auth required /lib/security/pam_nologin.so"
  146. echo "proftpd account required /lib/security/pam_unix.so"
  147. echo "proftpd session required /lib/security/pam_unix.so"
  148. ;;
  149. *-solaris* )
  150. echo "proftpd auth required /usr/lib/security/pam_unix.so try_first_pass"
  151. echo "proftpd account required /usr/lib/security/pam_unix.so try_first_pass"
  152. echo "proftpd session required /usr/lib/security/pam_unix.so"
  153. ;;
  154. esac
  155. echo "#</OpenPKG>"
  156. ) >>/etc/pam.conf
  157. fi
  158. %preun
  159. # remove PAM configuration entry
  160. if [ $1 -eq 0 ]; then
  161. check=`grep '^#<OpenPKG pkg=proftpd>' /etc/pam.conf`
  162. if [ ".$check" != . ]; then
  163. cp /etc/pam.conf /etc/pam.conf.tmp && \
  164. sed -e '/^#<OpenPKG pkg=proftpd>/,/^#<\/OpenPKG>/d' \
  165. </etc/pam.conf.tmp >/etc/pam.conf && \
  166. rm -f /etc/pam.conf.tmp
  167. fi
  168. $RPM_INSTALL_PREFIX/etc/rc proftpd stop
  169. rm -f $RPM_INSTALL_PREFIX/var/proftpd/*.log
  170. rm -f $RPM_INSTALL_PREFIX/var/proftpd/*.pid
  171. fi