thttpd.spec 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. ##
  2. ## thttpd.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2022 OpenPKG Project <http://openpkg.org/>
  4. ##
  5. ## Permission to use, copy, modify, and distribute this software for
  6. ## any purpose with or without fee is hereby granted, provided that
  7. ## the above copyright notice and this permission notice appear in all
  8. ## copies.
  9. ##
  10. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  11. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  13. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  14. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  20. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  21. ## SUCH DAMAGE.
  22. ##
  23. # package information
  24. Name: thttpd
  25. Summary: Tiny HTTP Daemon
  26. URL: http://www.acme.com/software/thttpd/
  27. Vendor: Jef Poskanzer
  28. Packager: OpenPKG Project
  29. Distribution: OpenPKG Community
  30. Class: PLUS
  31. Group: Web
  32. License: MIT-style
  33. Version: 2.29
  34. Release: 20180527
  35. # package options
  36. %option with_fsl yes
  37. # list of sources
  38. Source0: http://www.acme.com/software/thttpd/thttpd-%{version}.tar.gz
  39. Source1: rc.thttpd
  40. Source2: fsl.thttpd
  41. Source3: thttpd.conf
  42. Patch0: thttpd.patch
  43. # build information
  44. BuildPreReq: OpenPKG, openpkg >= 20160101, make
  45. PreReq: OpenPKG, openpkg >= 20160101
  46. %if "%{with_fsl}" == "yes"
  47. BuildPreReq: fsl
  48. PreReq: fsl
  49. %endif
  50. %description
  51. thttpd is a simple, small, fast, and secure HTTP server. It doesn't
  52. have a lot of special features, but it suffices for most uses of
  53. the web, it's about as fast as the best full-featured servers
  54. (Apache, NCSA Netscape), and it has one extremely useful feature
  55. (URL-traffic-based throttling) that no other server currently has.
  56. %track
  57. prog thttpd = {
  58. version = %{version}
  59. url = http://www.acme.com/software/thttpd/
  60. regex = thttpd-(__VER__)\.tar\.gz
  61. }
  62. %prep
  63. %setup -q
  64. %patch -p0
  65. %build
  66. # configure program
  67. export CC="%{l_cc}"
  68. export CFLAGS="%{l_cflags -O}"
  69. export CPPFLAGS="%{l_cppflags}"
  70. export LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}"
  71. export LIBS="%{l_fsl_libs}"
  72. case "%{l_platform -t}" in
  73. *-sunos* ) LIBS="$LIBS -ldl" ;;
  74. esac
  75. echo "ac_cv_lbl_static_flag=unknown" >config.cache
  76. ./configure \
  77. --cache-file=./config.cache \
  78. --prefix=%{l_prefix}
  79. # build program
  80. %{l_make} %{l_mflags}
  81. %install
  82. # install program
  83. %{l_shtool} mkdir -f -p -m 755 \
  84. $RPM_BUILD_ROOT%{l_prefix}/bin \
  85. $RPM_BUILD_ROOT%{l_prefix}/sbin \
  86. $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
  87. $RPM_BUILD_ROOT%{l_prefix}/man/man8 \
  88. $RPM_BUILD_ROOT%{l_prefix}/cgi
  89. %{l_make} %{l_mflags} install \
  90. DESTDIR=$RPM_BUILD_ROOT
  91. # post-adjust and strip-down installation
  92. mv $RPM_BUILD_ROOT%{l_prefix}/sbin/htpasswd \
  93. $RPM_BUILD_ROOT%{l_prefix}/bin/htpasswd
  94. mv $RPM_BUILD_ROOT%{l_prefix}/sbin/makeweb \
  95. $RPM_BUILD_ROOT%{l_prefix}/bin/makeweb
  96. strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
  97. # install default configuration
  98. %{l_shtool} mkdir -f -p -m 755 \
  99. $RPM_BUILD_ROOT%{l_prefix}/etc/thttpd
  100. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  101. %{SOURCE thttpd.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/thttpd/
  102. # create directory for pid and log files
  103. %{l_shtool} mkdir -f -p -m 755 \
  104. $RPM_BUILD_ROOT%{l_prefix}/var/thttpd
  105. # install run-command script
  106. %{l_shtool} mkdir -f -p -m 755 \
  107. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  108. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  109. %{SOURCE rc.thttpd} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  110. # install OSSP fsl configuration
  111. %{l_shtool} mkdir -f -p -m 755 \
  112. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  113. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  114. %{SOURCE fsl.thttpd} \
  115. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  116. # determine installation files
  117. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  118. %{l_files_std} \
  119. '%config %{l_prefix}/etc/fsl/*' \
  120. '%config %{l_prefix}/etc/thttpd/*' \
  121. '%attr(755,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/thttpd'
  122. %files -f files
  123. %clean