lighttpd.spec 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. ##
  2. ## lighttpd.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2005 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2005 Ralf S. Engelschall <http://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: lighttpd
  26. Summary: Flexible High-Performance Web Server
  27. URL: http://www.lighttpd.net/
  28. Vendor: Jan Kneschke
  29. Packager: OpenPKG
  30. Distribution: OpenPKG
  31. Class: EVAL
  32. Group: Web
  33. License: MIT-style
  34. Version: 1.4.0
  35. Release: 20050820
  36. # package options
  37. %option with_fsl yes
  38. %option with_ipv6 no
  39. %option with_mysql no
  40. %option with_ssl no
  41. # list of sources
  42. Source0: http://www.lighttpd.net/download/lighttpd-%{version}.tar.gz
  43. Source1: lighttpd.conf
  44. Source2: rc.lighttpd
  45. Source3: fsl.lighttpd
  46. # build information
  47. Prefix: %{l_prefix}
  48. BuildRoot: %{l_buildroot}
  49. BuildPreReq: OpenPKG, openpkg >= 20040130, make, gcc
  50. PreReq: OpenPKG, openpkg >= 20040130
  51. %if "%{with_fsl}" == "yes"
  52. BuildPreReq: fsl >= 1.5.0
  53. PreReq: fsl >= 1.5.0
  54. %endif
  55. %if "%{with_mysql}" == "yes"
  56. BuildPreReq: mysql, zlib
  57. PreReq: mysql, zlib
  58. %endif
  59. %if "%{with_ssl}" == "yes"
  60. BuildPreReq: openssl
  61. PreReq: openssl
  62. %endif
  63. AutoReq: no
  64. AutoReqProv: no
  65. %description
  66. lighttpd is a secure, fast, compliant and very flexible web-server
  67. which has been optimized for high-performance environments. It has
  68. a very low memory footprint compared to other webservers and takes
  69. care of cpu-load. Its advanced feature-set (FastCGI, CGI, Auth,
  70. output compression, URL-rewriting and many more) make lighttpd the
  71. perfect web-server software for every server that is suffering load
  72. problems.
  73. As lighttpd is hard to pronounce you might call it lighty instead.
  74. %track
  75. prog lighttpd = {
  76. version = %{version}
  77. url = http://www.lighttpd.net/download/
  78. regex = lighttpd-(__VER__)\.tar\.gz
  79. }
  80. %prep
  81. %setup -q
  82. %{l_shtool} subst \
  83. -e 's;\(/etc/lighttpd/lighttpd.conf\);%{l_prefix}\1;' \
  84. doc/lighttpd.1
  85. %build
  86. # configure program
  87. CC="%{l_cc}" \
  88. CFLAGS="%{l_cflags -O}" \
  89. CXXFLAGS="%{l_cxxflags -O}" \
  90. LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \
  91. LIBS="%{l_fsl_libs}" \
  92. ./configure \
  93. --prefix=%{l_prefix} \
  94. --sysconfdir=%{l_prefix}/etc/lighttpd \
  95. --libdir=%{l_prefix}/lib/lighttpd \
  96. %if "%{with_ipv6}" == "yes"
  97. --enable-ipv6 \
  98. %else
  99. --disable-ipv6 \
  100. %endif
  101. --without-ldap \
  102. %if "%{with_mysql}" == "yes"
  103. --with-mysql=%{l_prefix}/bin/mysql_config \
  104. %else
  105. --without-mysql \
  106. %endif
  107. %if "%{with_ssl}" == "yes"
  108. --with-openssl=%{l_prefix}
  109. %else
  110. --without-openssl
  111. %endif
  112. # build program
  113. %{l_make} %{l_mflags -O}
  114. %install
  115. rm -rf $RPM_BUILD_ROOT
  116. # create directories
  117. %{l_shtool} mkdir -f -p -m 755 \
  118. $RPM_BUILD_ROOT%{l_prefix}/etc/lighttpd \
  119. $RPM_BUILD_ROOT%{l_prefix}/var/lighttpd/log
  120. # install lighttpd
  121. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  122. # install default configuration
  123. %{l_shtool} install -c -m 640 %{l_value -s -a} \
  124. -e 's;@l_openpkg_release@;%{l_openpkg_release -F "OpenPKG-%s"};' \
  125. %{SOURCE lighttpd.conf} \
  126. $RPM_BUILD_ROOT%{l_prefix}/etc/lighttpd/
  127. # install run-command script
  128. %{l_shtool} mkdir -f -p -m 755 \
  129. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  130. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  131. %{SOURCE rc.lighttpd} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  132. # install OSSP fsl configuration
  133. %{l_shtool} mkdir -f -p -m 755 \
  134. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  135. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  136. %{SOURCE fsl.lighttpd} \
  137. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  138. # strip installation
  139. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  140. strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
  141. # determine installation files
  142. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
  143. '%not %dir %{l_prefix}/etc/fsl' \
  144. '%config %{l_prefix}/etc/fsl/fsl.lighttpd' \
  145. '%config %attr(0600,%{l_susr},%{l_mgrp}) %{l_prefix}/etc/lighttpd/*' \
  146. '%dir %attr(0775,%{l_mgrp},%{l_ngrp}) %{l_prefix}/var/lighttpd/log'
  147. %files -f files
  148. %clean
  149. rm -rf $RPM_BUILD_ROOT
  150. %post
  151. # after upgrade, restart service
  152. [ $1 -eq 2 ] || exit 0
  153. eval `%{l_rc} lighttpd status 2>/dev/null`
  154. [ ".$lighttpd_active" = .yes ] && %{l_rc} lighttpd restart
  155. exit 0
  156. %preun
  157. # before erase, stop service and remove log files
  158. [ $1 -eq 0 ] || exit 0
  159. %{l_rc} lighttpd stop 2>/dev/null
  160. rm -rf $RPM_INSTALL_PREFIX/var/lighttpd/log/* >/dev/null 2>&1 || true
  161. exit 0