]> git.pld-linux.org Git - SPECS.git/blob - wn.spec
SPECS updated Wed 28 Jul 14:48:01 CEST 2021
[SPECS.git] / wn.spec
1 # TODO:
2 # - bcond with digest and with ndbm authorization (I'm not gonna do it)
3 #
4 %bcond_with     suexec  # enable suexec
5 %bcond_with     vhosts  # enable vhosts
6 %bcond_with     ssl     # enable ssl (not working)
7
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
10 Name:           wn
11 Version:        2.4.7
12 Release:        1
13 License:        GPL
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
19 Source3:        %{name}.init
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
37 Provides:       group(http)
38 Provides:       user(http)
39 Provides:       webserver
40 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42 %description
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.
48
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.
55
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
63
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
69 udostępnianie tekstu.
70
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
76 obciążeniem.
77
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.
85
86 %prep
87 %setup -q
88 %patch0 -p1
89
90 %build
91 %{__perl} configure <<_EOF_
92 _EOF_
93
94 install %{SOURCE1} ./Makefile
95 install %{SOURCE2} ./config.h
96
97
98 %if %{with vhosts}
99 sed -i -e "s/^#define USE_VIRTUAL_HOSTS.*/#define USE_VIRTUAL_HOSTS\t\(TRUE\)/" config.h
100 %endif
101
102 %if %{with suexec}
103 sed -e "s/^#define WN_SU_EXEC.*/#define WN_SU_EXEC\t\(TRUE\)/" config.h
104 %endif
105
106 %{__make} \
107         CC="%{__cc}" \
108         %{?with_suexec:SUEXEC=suexec} \
109         CFLAGS="%{rpmcflags} -I../wn -I../md5"
110 cd docs
111 rm fdl* Gnu_License Makefile md5*
112 cd ../
113
114 %install
115 rm -rf $RPM_BUILD_ROOT
116 # create directories if necessary
117 install -d $RPM_BUILD_ROOT{%{_mandir}/man{1,3,8},%{_sbindir},%{_bindir}}
118
119 %{__make} install \
120         SERVBINDIR=$RPM_BUILD_ROOT%{_sbindir} \
121         BINDIR=$RPM_BUILD_ROOT%{_bindir}
122
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.
128 rm -rf docs/man
129
130 install -d $RPM_BUILD_ROOT%{_var}/log/wn
131 touch $RPM_BUILD_ROOT%{_var}/log/wn/wn_{access,error}.log
132
133 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
134 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/wn
135
136 %clean
137 rm -rf $RPM_BUILD_ROOT
138
139 %pre
140 %groupadd -g 51 -r http
141 %useradd -u 51 -r -d /home/services/httpd -s /bin/false -c "HTTP User" -g http http
142
143 %post
144 /sbin/ldconfig
145 /sbin/chkconfig --add wn
146 umask 137
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
150 else
151         echo "Run \"/etc/rc.d/init.d/wn start\" to start wn HTTP daemon."
152 fi
153
154 %preun
155 if [ "$1" = "0" ]; then
156         if [ -f /var/lock/subsys/wn ]; then
157                 /etc/rc.d/init.d/wn stop 1>&2
158         fi
159         /sbin/chkconfig --del wn
160 fi
161
162 %postun
163 /sbin/ldconfig
164 if [ "$1" = "0" ]; then
165         %userremove http
166         %groupremove http
167 fi
168
169
170 %files
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*
177 %{_mandir}/man?/*
178 %attr(750,http,http) %dir %{_var}/log/wn
179 %attr(640,http,http) %{_var}/log/wn/*
This page took 0.211792 seconds and 3 git commands to generate.