2 # - bcond with digest and with ndbm authorization (I'm not gonna do it)
4 %bcond_with suexec # enable suexec
5 %bcond_with vhosts # enable vhosts
6 %bcond_with ssl # enable ssl (not working)
8 Summary: Secure and efficient HTTP server with advanced features
9 Summary(pl.UTF-8): Bezpieczny i wydajny serwer HTTP z rozbudowanymi możliwościami
14 Group: Networking/Daemons
15 Source0: http://www.wnserver.org/%{name}-%{version}.tar.gz
16 # Source0-md5: c146f34444a1228e3a478ba7f6b9fdf1
17 Source1: %{name}-Makefile
18 Source2: %{name}-config.h
20 Patch0: %{name}-build.patch
21 URL: http://www.wnserver.org/
22 BuildRequires: openssl-devel >= 0.9.7d
23 BuildRequires: pam-devel
24 BuildRequires: perl-base
25 BuildRequires: rpmbuild(macros) >= 1.202
26 %{?with_vhosts:BuildRequires: sed >= 4.0}
27 Requires(post): fileutils
28 Requires(post,postun): /sbin/ldconfig
29 Requires(post,preun): /sbin/chkconfig
30 Requires(postun): /usr/sbin/groupdel
31 Requires(postun): /usr/sbin/userdel
32 Requires(pre): /bin/id
33 Requires(pre): /usr/bin/getgid
34 Requires(pre): /usr/sbin/groupadd
35 Requires(pre): /usr/sbin/useradd
36 Requires: /etc/mime.types
40 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43 WN is a server for the Hypertext Transfer Protocol (HTTP/1.1). Its
44 primary design goals are security and functionality usually available
45 only with complex CGI scripts without the necessity of writing or
46 using these scripts. This includes extensive security checks, full
47 text searching and conditionally served text.
49 Despite this extensive functionality the WN executable is
50 substantially smaller than the CERN or NCSA servers. Both a
51 stand-alone daemon and a version intended for use under inetd are
52 provided. The inetd version is designed to minimize the use of system
53 resources and it is appropriate for moderate or lightly loaded servers
54 which cannot be totally dedicated to Web serving.
56 WN's security model is based on the use of a small flat database in
57 each directory with information about the files in that directory.
58 Fields associated with a file include its title, and may include
59 keywords, expiration date and any user defined fields like author or
60 document id. Unlike other servers, the default action for WN is to
61 deny access to a file.A file can only be served if explicit permission
62 to do so has been granted by entering it in this database
64 %description -l pl.UTF-8
65 WN to serwer dla protokołu HTTP w wersji 1.1. Jego główną zaletą jest
66 bezpieczeństwo oraz wbudowana funkcjonalność, która z reguły dostępna
67 jest jedynie dzięki rozbudowanym skryptom CGI: różnorakie
68 zabezpieczenia, przeszukiwanie całego tekstu oraz warunkowe
71 Rozbudowane możliwości nie wpłynęły jednak na rozmiar pliku
72 wykonywalnego serwera, który pozostaje mniejszy niż serwery CERN lub
73 NCSA. Pakiet dostarcza zarówno wersji samodzielnej jak i inetd serwera
74 WN. Ta druga została zoptymalizowana do zajmowania jak najmniejszej
75 liczby zasobów i jest zalecana dla serwerów z małym bądź ograniczonym
78 Model bezpieczeństwa WN oparty jest na umieszczaniu w każdym katalogu
79 małych, kartotekowych baz danych zawierających informacje o plikach
80 w nim się znajdujących. Pola związane z plikami to tytuł, słowa
81 kluczowe, data wygaśnięcia oraz dodatkowe zdefiniowane przez
82 użytkownika np. autor. W przeciwieństwie do innych serwerów WN
83 domyślnie nie daje dostępu do pliku, plik może zostać udostępniony
84 klientom HTTP tylko w przypadku zezwolenia na to w bazie danych.
91 %{__perl} configure <<_EOF_
94 install %{SOURCE1} ./Makefile
95 install %{SOURCE2} ./config.h
99 sed -i -e "s/^#define USE_VIRTUAL_HOSTS.*/#define USE_VIRTUAL_HOSTS\t\(TRUE\)/" config.h
103 sed -e "s/^#define WN_SU_EXEC.*/#define WN_SU_EXEC\t\(TRUE\)/" config.h
108 %{?with_suexec:SUEXEC=suexec} \
109 CFLAGS="%{rpmcflags} -I../wn -I../md5"
111 rm fdl* Gnu_License Makefile md5*
115 rm -rf $RPM_BUILD_ROOT
116 # create directories if necessary
117 install -d $RPM_BUILD_ROOT{%{_mandir}/man{1,3,8},%{_sbindir},%{_bindir}}
120 SERVBINDIR=$RPM_BUILD_ROOT%{_sbindir} \
121 BINDIR=$RPM_BUILD_ROOT%{_bindir}
123 install docs/man/man1/* $RPM_BUILD_ROOT%{_mandir}/man1/
124 install docs/man/man3/* $RPM_BUILD_ROOT%{_mandir}/man3/
125 install docs/man/man8/* $RPM_BUILD_ROOT%{_mandir}/man8/
126 # This breaks short-ciruit, but what the heck, the package is 500 kb
127 # you cand do a rebuild.
130 install -d $RPM_BUILD_ROOT%{_var}/log/wn
131 touch $RPM_BUILD_ROOT%{_var}/log/wn/wn_{access,error}.log
133 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
134 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/wn
137 rm -rf $RPM_BUILD_ROOT
140 %groupadd -g 51 -r http
141 %useradd -u 51 -r -d /home/services/httpd -s /bin/false -c "HTTP User" -g http http
145 /sbin/chkconfig --add wn
147 touch /var/log/wn/wn_{access,error}.log
148 if [ -f /var/lock/subsys/wn ]; then
149 /etc/rc.d/init.d/wn restart 1>&2
151 echo "Run \"/etc/rc.d/init.d/wn start\" to start wn HTTP daemon."
155 if [ "$1" = "0" ]; then
156 if [ -f /var/lock/subsys/wn ]; then
157 /etc/rc.d/init.d/wn stop 1>&2
159 /sbin/chkconfig --del wn
164 if [ "$1" = "0" ]; then
171 %defattr(644,root,root,755)
172 %doc docs README.wnssl
173 %attr(754,root,root) /etc/rc.d/init.d/wn
174 %attr(755,root,root) %{_bindir}/md5
175 %attr(755,root,root) %{_bindir}/wn*
176 %attr(755,root,root) %{_sbindir}/wn*
178 %attr(750,http,http) %dir %{_var}/log/wn
179 %attr(640,http,http) %{_var}/log/wn/*