proftpd.spec 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. ##
  2. ## proftpd.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2003 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 [BASE]
  32. Group: FTP
  33. License: GPL
  34. Version: 1.2.7
  35. Release: 20030103
  36. # package options
  37. %option with_pam no
  38. # list of sources
  39. Source0: ftp://ftp.proftpd.net/distrib/source/proftpd-%{version}.tar.bz2
  40. Source1: proftpd.conf
  41. Source2: proftpd.msg.goaway
  42. Source3: proftpd.msg.login
  43. Source4: rc.proftpd
  44. # build information
  45. Prefix: %{l_prefix}
  46. BuildRoot: %{l_buildroot}
  47. BuildPreReq: OpenPKG, openpkg >= 20030103, ncurses, make
  48. PreReq: OpenPKG, openpkg >= 20030103, ncurses
  49. %if "%{with_pam}" == "yes"
  50. BuildPreReq: PAM
  51. PreReq: PAM
  52. %endif
  53. AutoReq: no
  54. AutoReqProv: no
  55. %description
  56. ProFTPD grew out of the desire to have a secure and configurable FTP
  57. server, and out of a significant admiration of the Apache web server.
  58. There are currently a very limited number of FTP servers running on unix
  59. (or unix-like) hosts. The most commonly used server is probably wu-ftpd.
  60. While wu-ftpd provides excellent performance and is generally a good
  61. product, it lacks numerous features found in newer Win32 FTP servers, and
  62. has a poor security history. Many people, including the developers who
  63. work on ProFTPD have spent a great deal of time fixing bugs and hacking
  64. features into wu-ftpd. Unfortunately, it quickly became clear that a
  65. complete redesign was necessary in order to implement the configurability
  66. and features desired. ProFTPD is not a hack based on any other server,
  67. it's an independent source tree from the ground up. Click here for a small
  68. list of some of the sites ProFTPD powers -- many of them handling large
  69. volumes of traffic on a daily basis.
  70. %prep
  71. %setup -q
  72. %build
  73. # make non-standard "rundir" the same as standard "sysconfdir"
  74. %{l_shtool} subst \
  75. -e 's;^\(rundir=@localstatedir@\)/proftpd;\1;' \
  76. Make.rules.in
  77. # configure the ProFTPd source tree
  78. CC="%{l_cc}" \
  79. CFLAGS="%{l_cflags -O}" \
  80. %if "%{with_pam}" == "yes"
  81. CPPFLAGS="%{l_cppflags ncurses} -I`%{l_prefix}/etc/rc --query pam_incdir`" \
  82. LDFLAGS="%{l_ldflags} -L`%{l_prefix}/etc/rc --query pam_libdir`" \
  83. %else
  84. CPPFLAGS="%{l_cppflags ncurses}" \
  85. LDFLAGS="%{l_ldflags}" \
  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_pam="#"
  123. %if "%{with_pam}" == "yes"
  124. l_pam=""
  125. %endif
  126. %{l_shtool} install -c -m 644 \
  127. -e 's;@l_prefix@;%{l_prefix};g' \
  128. -e 's;@l_nusr@;%{l_nusr};g' \
  129. -e 's;@l_ngrp@;%{l_ngrp};g' \
  130. -e "s;@l_pam@;${l_pam};g" \
  131. %{SOURCE proftpd.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/proftpd/
  132. %{l_shtool} install -c -m 644 \
  133. %{SOURCE proftpd.msg.goaway} \
  134. %{SOURCE proftpd.msg.login} \
  135. $RPM_BUILD_ROOT%{l_prefix}/etc/proftpd/
  136. %{l_shtool} install -c -m 644 \
  137. %{SOURCE proftpd.msg.login} \
  138. $RPM_BUILD_ROOT%{l_prefix}/share/proftpd/.msg.login
  139. %{l_shtool} install -c -m 644 \
  140. %{SOURCE proftpd.msg.goaway} \
  141. $RPM_BUILD_ROOT%{l_prefix}/share/proftpd/.msg.goaway
  142. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  143. %{l_shtool} install -c -m 755 -e 's;@l_prefix@;%{l_prefix};g' \
  144. %{SOURCE rc.proftpd} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  145. # determine the package ingredients
  146. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  147. %{l_files_std} \
  148. '%config %{l_prefix}/etc/proftpd/proftpd.conf'
  149. %files -f files
  150. %clean
  151. rm -rf $RPM_BUILD_ROOT
  152. %post
  153. %if "%{with_pam}" == "yes"
  154. # add PAM configuration entry
  155. if [ $1 -eq 1 ]; then
  156. $RPM_INSTALL_PREFIX/sbin/pamtool --add --smart --name=proftpd
  157. fi
  158. %endif
  159. %preun
  160. %if "%{with_pam}" == "yes"
  161. # remove PAM configuration entry
  162. if [ $1 -eq 0 ]; then
  163. $RPM_INSTALL_PREFIX/sbin/pamtool --remove --smart --name=proftpd
  164. fi
  165. %endif
  166. if [ $1 -eq 0 ]; then
  167. $RPM_INSTALL_PREFIX/etc/rc proftpd stop
  168. rm -f $RPM_INSTALL_PREFIX/var/proftpd/*.log
  169. rm -f $RPM_INSTALL_PREFIX/var/proftpd/*.pid
  170. fi