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