thttpd-vl.spec 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  1. # Where the default web root will be configured and default files installed
  2. %define webroot /var/www/thttpd
  3. Summary: Simple, small, portable, fast, and secure HTTP server
  4. Summary(ja): シンプル/小さい/ポータブル/高速/セキュアなHTTPサーバ
  5. Name: thttpd
  6. Version: 2.25b
  7. Release: 1%{?_dist_release}
  8. License: BSD
  9. Group: System Environment/Daemons
  10. URL: http://www.acme.com/software/thttpd/
  11. Source0: http://www.acme.com/software/thttpd/thttpd-%{version}.tar.gz
  12. Source1: thttpd.init
  13. Source2: thttpd.logrotate
  14. Source10: thttpd-index.html
  15. Source11: thttpd_powered_3.png
  16. Patch0: thttpd-2.25b-CVE-2005-3124.patch
  17. Patch1: thttpd-2.25b-fixes.patch
  18. Patch2: thttpd-2.25b-getline.patch
  19. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
  20. Requires(pre): shadow-utils
  21. Requires(post): chkconfig
  22. Requires(preun): initscripts, chkconfig
  23. Requires(postun): initscripts
  24. Provides: webserver
  25. Vendor: Project Vine
  26. Distribution: Vine Linux
  27. Packager: daisuke
  28. %description
  29. Thttpd is a very compact no-frills httpd serving daemon that can handle
  30. very high loads. While lacking many of the advanced features of
  31. Apache, thttpd operates without forking and is extremely efficient in
  32. memory use. Basic support for cgi scripts, authentication, and ssi is
  33. provided for. Advanced features include the ability to throttle traffic.
  34. Available rpmbuild rebuild options :
  35. --with : showversion expliciterrors makeweb
  36. --without : indexes
  37. %prep
  38. %setup -q
  39. %patch0 -p1 -b .CVE-2005-3124
  40. %patch1 -p1 -b .fixes
  41. %patch2 -p1 -b .getline
  42. # Convert man pages to UTF8
  43. for man in *.8 */*.8 */*.1; do
  44. iconv -f iso8859-1 -t utf-8 -o tmp ${man}
  45. %{__mv} -f tmp ${man}
  46. done
  47. %build
  48. %configure
  49. # Hacks :-)
  50. %{__perl} -pi -e 's/-o bin -g bin//g' Makefile
  51. %{__perl} -pi -e 's/-m 444/-m 644/g; s/-m 555/-m 755/g' Makefile
  52. %{__perl} -pi -e 's/.*chgrp.*//g; s/.*chmod.*//g' extras/Makefile
  53. # Config changes
  54. %{?_without_indexes: %{__perl} -pi -e 's/#define GENERATE_INDEXES/#undef GENERATE_INDEXES/g' config.h}
  55. %{!?_with_showversion: %{__perl} -pi -e 's/#define SHOW_SERVER_VERSION/#undef SHOW_SERVER_VERSION/g' config.h}
  56. %{!?_with_expliciterrors: %{__perl} -pi -e 's/#define EXPLICIT_ERROR_PAGES/#undef EXPLICIT_ERROR_PAGES/g' config.h}
  57. # (list SUBDIRS to exclude "cgi-src")
  58. %{__make} %{?_smp_mflags} SUBDIRS="extras" WEBDIR=%{webroot} STATICFLAG="" \
  59. CCOPT="%{optflags} -D_FILE_OFFSET_BITS=64"
  60. %install
  61. %{__rm} -rf %{buildroot}
  62. # Prepare required directories
  63. %{__mkdir_p} %{buildroot}%{webroot}
  64. %{__mkdir_p} %{buildroot}%{_mandir}/man{1,8}
  65. %{__mkdir_p} %{buildroot}%{_sbindir}
  66. # Install init script and logrotate entry
  67. %{__install} -Dpm 0755 %{SOURCE1} %{buildroot}%{_sysconfdir}/rc.d/init.d/thttpd
  68. %{__install} -Dpm 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/thttpd
  69. # Main install (list SUBDIRS to exclude "cgi-src")
  70. %{__make} install SUBDIRS="extras" \
  71. BINDIR=%{buildroot}%{_sbindir} \
  72. MANDIR=%{buildroot}%{_mandir} \
  73. WEBDIR=%{buildroot}%{webroot}
  74. # Rename htpasswd in case apache is installed too
  75. %{__mkdir_p} %{buildroot}%{_bindir}
  76. %{__mv} %{buildroot}%{_sbindir}/htpasswd \
  77. %{buildroot}%{_bindir}/thtpasswd
  78. %{__mv} %{buildroot}%{_mandir}/man1/htpasswd.1 \
  79. %{buildroot}%{_mandir}/man1/thtpasswd.1
  80. # Install the default index.html and related files
  81. %{__install} -pm 0644 %{SOURCE10} \
  82. %{buildroot}%{webroot}/index.html
  83. %{__install} -pm 0644 %{SOURCE11} \
  84. %{buildroot}%{webroot}/
  85. # Symlink for the powered-by-$DISTRO image
  86. %{__ln_s} %{_datadir}/pixmaps/vine/vinebar.png \
  87. %{buildroot}%{webroot}/poweredby.png
  88. # Install a default configuration file
  89. %{__cat} << EOF > %{buildroot}%{_sysconfdir}/thttpd.conf
  90. # BEWARE : No empty lines are allowed!
  91. # This section overrides defaults
  92. dir=%{webroot}
  93. chroot
  94. user=thttpd # default = nobody
  95. logfile=/var/log/thttpd.log
  96. pidfile=/var/run/thttpd.pid
  97. # This section _documents_ defaults in effect
  98. # port=80
  99. # nosymlink # default = !chroot
  100. # novhost
  101. # nocgipat
  102. # nothrottles
  103. # host=0.0.0.0
  104. # charset=iso-8859-1
  105. EOF
  106. %clean
  107. %{__rm} -rf %{buildroot}
  108. %pre
  109. /usr/sbin/groupadd -r www &>/dev/null || :
  110. /usr/sbin/useradd -s /bin/false -c "Web server user" \
  111. -d %{webroot} -M -r -g www thttpd &>/dev/null || :
  112. %post
  113. if [ $1 -eq 1 ]; then
  114. /sbin/chkconfig --add thttpd
  115. fi
  116. %preun
  117. if [ $1 -eq 0 ]; then
  118. /sbin/service thttpd stop &>/dev/null || :
  119. /sbin/chkconfig --del thttpd
  120. fi
  121. %postun
  122. if [ $1 -ge 1 ]; then
  123. /sbin/service thttpd condrestart &>/dev/null || :
  124. fi
  125. %files
  126. %defattr(-,root,root,-)
  127. %doc README TODO
  128. %{_sysconfdir}/rc.d/init.d/thttpd
  129. %config(noreplace) %{_sysconfdir}/logrotate.d/thttpd
  130. %config(noreplace) %{_sysconfdir}/thttpd.conf
  131. %{_bindir}/thtpasswd
  132. %if 0%{?_with_makeweb:1}
  133. %attr(2755,root,www) %{_sbindir}/makeweb
  134. %{_mandir}/man1/makeweb.1*
  135. %else
  136. %exclude %{_sbindir}/makeweb
  137. %exclude %{_mandir}/man1/makeweb.1*
  138. %endif
  139. %{_sbindir}/syslogtocern
  140. %{_sbindir}/thttpd
  141. %{webroot}/
  142. %{_mandir}/man1/thtpasswd.1*
  143. %{_mandir}/man8/syslogtocern.8*
  144. %{_mandir}/man8/thttpd.8*
  145. # Hack to own parent directory for the default "webroot". Remove if needed.
  146. %dir /var/www
  147. %changelog
  148. * Sat Apr 30 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 2.25b-1
  149. - initial build for Vine Linux
  150. * Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.25b-24
  151. - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
  152. * Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.25b-23
  153. - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
  154. * Sun Apr 12 2009 Matthias Saou <http://freshrpms.net/> 2.25b-22
  155. - Update init script all the way.
  156. * Sat Apr 11 2009 Matthias Saou <http://freshrpms.net/> 2.25b-21
  157. - Include patch to rename conflicting "getline" function (stdio.h).
  158. - Fix so that makeweb gets compiled in "build" section with the right WEBDIR.
  159. * Thu Apr 9 2009 Matthias Saou <http://freshrpms.net/> 2.25b-20
  160. - Fix thttpd-2.25b-CVE-2005-3124.patch (#483733).
  161. - Remove unwanted .orig files from patches (#484205).
  162. - Don't ship useless man pages (#484205).
  163. - Reorganize all of the webroot files under /var/www/thttpd, remove cgi-bin
  164. by default, remove useless log directory.
  165. - Have makeweb be conditional and disabled by default.
  166. - Fix thttpd mode from 555 to 755.
  167. - Add new init block to the init script (commands and exit status need work).
  168. - Re-enable indexes by default, it's possible to turn them off with dir modes.
  169. - Don't even compile the CGI programs instead of just excluding them.
  170. - No longer build htpasswd as static.
  171. * Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org>
  172. - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
  173. * Tue Dec 2 2008 Matthias Saou <http://freshrpms.net/> 2.25b-18
  174. - Own /var/www in a hack-ish way, but comment it well (#474024).
  175. * Thu Sep 25 2008 Matthias Saou <http://freshrpms.net/> 2.25b-17
  176. - Update patches to remove fuzz.
  177. * Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org>
  178. - Autorebuild for GCC 4.3
  179. * Mon Oct 22 2007 Matthias Saou <http://freshrpms.net/> 2.25b-15
  180. - Update to latest upstream sources, same filename, only email address changes.
  181. - Remove trademarked Fedora logo button and replace with a symlink to the
  182. main system-logo provided button image.
  183. - Update default index.html to UTF-8 and thttpd green background color.
  184. * Thu Aug 23 2007 Matthias Saou <http://freshrpms.net/> 2.25b-14
  185. - Rebuild to fix wrong execmem requirement on ppc32.
  186. * Tue Jun 19 2007 Matthias Saou <http://freshrpms.net/> 2.25b-13
  187. - Add missing requirements for the scriplets, they could cause the thttpd user
  188. to not be added when thttpd was installed from the F7 media (#234740).
  189. - Preserve timestamps for all the installed sources.
  190. - Init scripts are *not* config files.
  191. - Default service to disable.
  192. * Mon Aug 28 2006 Matthias Saou <http://freshrpms.net/> 2.25b-12
  193. - FC6 rebuild.
  194. * Mon Mar 6 2006 Matthias Saou <http://freshrpms.net/> 2.25b-11
  195. - Include "fixes" patch from Debian (#191095) to fix thtpasswd and makeweb.
  196. - Rename htpasswd as thtpasswd instead of htpasswd.thttpd.
  197. * Mon Mar 6 2006 Matthias Saou <http://freshrpms.net/> 2.25b-10
  198. - FC5 rebuild.
  199. * Thu Feb 9 2006 Matthias Saou <http://freshrpms.net/> 2.25b-9
  200. - Rebuild for new gcc/glibc.
  201. - Remove prever stuff, 2.25b final has been around for while now.
  202. * Mon Nov 7 2005 Matthias Saou <http://freshrpms.net/> 2.25b-8
  203. - Add patch from Gentoo to fix CVE-2005-3124 (#172469, Ville Skyttä).
  204. - Minor cosmetic spec file changes.
  205. * Sun May 22 2005 Jeremy Katz <katzj@redhat.com> - 2.25b
  206. - rebuild on all arches
  207. * Fri Apr 7 2005 Michael Schwendt <mschwendt[AT]users.sf.net>
  208. - rebuilt
  209. * Thu Jan 20 2005 Matthias Saou <http://freshrpms.net/> 2.25b-5
  210. - Compile with -D_FILE_OFFSET_BITS=64 to support > 2GB log files.
  211. * Tue Nov 16 2004 Matthias Saou <http://freshrpms.net/> 2.25b-4
  212. - Bump release to provide Extras upgrade path.
  213. - Re-brand Fedora where it was freshrpms previously.
  214. * Thu Jul 10 2004 Dag Wieers <dag@wieers.com> - 2.25b-3
  215. - Fixed location of service in logrotate conf. (Peter Bieringer)
  216. * Wed May 19 2004 Matthias Saou <http://freshrpms.net/> 2.25b-2
  217. - Rebuild for Fedora Core 2.
  218. * Mon Apr 26 2004 Matthias Saou <http://freshrpms.net/> 2.25b-2
  219. - Add logrotate entry, it needs to restart thttpd completely because
  220. of the permissions dropped after opening the log file :-(
  221. * Sun Jan 4 2004 Matthias Saou <http://freshrpms.net/> 2.25b-1
  222. - Update to 2.25b.
  223. * Tue Nov 11 2003 Matthias Saou <http://freshrpms.net/> 2.24-1
  224. - Update to 2.24 final.
  225. * Fri Nov 7 2003 Matthias Saou <http://freshrpms.net/> 2.23-0.beta1.3
  226. - Rebuild for Fedora Core 1.
  227. - Escaped the %%install and others later in this changelog.
  228. * Wed Oct 22 2003 Matthias Saou <http://freshrpms.net/>
  229. - Added build options and now default to no indexes, explicit errors or
  230. showing version.
  231. * Mon Nov 4 2002 Matthias Saou <http://freshrpms.net/>
  232. - Update to 2.23beta1.
  233. * Fri May 4 2001 Matthias Saou <http://freshrpms.net/>
  234. - Spec file cleanup for Red Hat 7.
  235. - New, clean initscript.
  236. - Built the latest 2.21b version since 2.20b won't compile even with kgcc.
  237. - Custom config file based on the contrib/redhat one.
  238. * Wed Sep 13 2000 Jef Poskanzer <jef@acme.com>
  239. - Updated to 2.20
  240. * Mon Sep 11 2000 Bennett Todd <bet@rahul.net>
  241. - added thttpd.conf, took config info out of init script
  242. - switched to logging in /var/log, used pidfile
  243. * Thu Jun 15 2000 Jef Poskanzer <jef@acme.com>
  244. - Updated to 2.19
  245. * Thu May 18 2000 Jef Poskanzer <jef@acme.com>
  246. - Updated to 2.18
  247. * Fri Mar 17 2000 Jef Poskanzer <jef@acme.com>
  248. - Updated to 2.17
  249. * Mon Feb 28 2000 Jef Poskanzer <jef@acme.com>
  250. - Updated to 2.16
  251. * Thu Feb 03 2000 Jef Poskanzer <jef@acme.com>
  252. - Updated to 2.15
  253. * Thu Jan 21 2000 Jef Poskanzer <jef@acme.com>
  254. - Updated to 2.14
  255. * Thu Jan 6 2000 Jef Poskanzer <jef@acme.com>
  256. - Updated to 2.13
  257. * Mon Jan 3 2000 Bennett Todd <bet@rahul.net>
  258. - updated to 2.12, tweaked to move thttpd.init into tarball
  259. * Mon Dec 13 1999 Bennett Todd <bet@mordor.net>
  260. - Updated to 2.09
  261. * Fri Dec 10 1999 Bennett Todd <bet@mordor.net>
  262. - Updated to 2.08
  263. * Wed Nov 24 1999 Bennett Todd <bet@mordor.net>
  264. - updated to 2.06, parameterized Version string in source url
  265. - changed to use "make install", simplified %%files list
  266. * Wed Nov 10 1999 Bennett Todd <bet@mordor.net>
  267. - Version 2.05, reset release to 1
  268. - dropped bugfix patch since Jef included that
  269. - streamlined install
  270. * Sun Jul 25 1999 Bennett Todd <bet@mordor.net>
  271. - Release 4, added mime type swf
  272. * Mon May 3 1999 Bennett Todd <bet@mordor.net>
  273. - Release 2, added patch to set cgi-timelimit up to 10 minutes
  274. fm default 30 seconds
  275. * Wed Feb 10 1999 Bennett Todd <bet@mordor.net>
  276. - based on 2.00-2, bumped to 2.04, reset release back to 1
  277. - fixed a couple of broken entries in %%install to reference %{buildroot}
  278. - simplified %%files to populate /usr/doc/... with just [A-Z]* (TODO had gone
  279. away, this simplification makes it liklier to be trivially portable to
  280. future releases).
  281. - added %%doc tags for the man pages