proftpd.spec 6.6 KB

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