1 |
%define name ocsigenserver |
2 |
%define upversion 2.0.3 |
3 |
%define rev a |
4 |
%define release %mkrel 1 |
5 |
|
6 |
Summary: Full featured Web server written in Ocaml |
7 |
Name: %{name} |
8 |
Version: %{upversion}%{rev} |
9 |
Release: %{release} |
10 |
Source0: http://ocsigen.org/download/%{name}-%{version}.tar.gz |
11 |
Source1: %{name}.init |
12 |
Source2: %{name}.sysconfig |
13 |
Source3: %{name}.service |
14 |
Patch0: ocsigenserver-2.0.3a-fix-install.patch |
15 |
License: LGPLv2+ |
16 |
Group: System/Servers |
17 |
Url: http://ocsigen.org/ocsigenserver/ |
18 |
|
19 |
BuildRequires: ocaml |
20 |
BuildRequires: camlp4 |
21 |
BuildRequires: ocaml-findlib |
22 |
BuildRequires: ocaml-pcre-devel |
23 |
BuildRequires: ocaml-ssl-devel |
24 |
BuildRequires: ocaml-ocamlnet-devel |
25 |
BuildRequires: ocaml-cryptokit-devel |
26 |
BuildRequires: ocaml-calendar-devel |
27 |
BuildRequires: ocaml-sqlite3-devel |
28 |
BuildRequires: ocaml-text-devel |
29 |
BuildRequires: ocaml-react-devel |
30 |
BuildRequires: ocaml-camlzip-devel |
31 |
BuildRequires: ocaml-lwt-devel |
32 |
BuildRequires: ocaml-tyxml-devel |
33 |
BuildRequires: ocamlduce |
34 |
BuildRequires: pkgconfig(libev) |
35 |
BuildRequires: gdbm-devel |
36 |
|
37 |
|
38 |
# Not sure if it should provide that ... |
39 |
# Provides: webserver |
40 |
|
41 |
|
42 |
%description |
43 |
Ocsigen Server is a full featured Web server. It implements most features |
44 |
of the HTTP protocol, and has a very powerful extension mechanism that make |
45 |
very easy to plug your own OCaml modules for generating pages. Many |
46 |
extensions are already written, like a reverse proxy, content compression, |
47 |
access control, authentication, etc. |
48 |
|
49 |
%package -n ocaml-%{name} |
50 |
Summary: Runtime and development files for the Ocsigen server |
51 |
Group: Development/Other |
52 |
Requires: %{name} = %{version}-%{release} |
53 |
|
54 |
%description -n ocaml-%{name} |
55 |
The ocaml-%{name} package contains the bytecode libraries and signature |
56 |
files for running applications that use %{name}. |
57 |
|
58 |
|
59 |
%package -n ocaml-%{name}-devel |
60 |
Summary: Development files for the Ocsigen server |
61 |
Group: Development/Other |
62 |
Requires: ocaml-%{name} = %{version}-%{release} |
63 |
|
64 |
%description -n ocaml-%{name}-devel |
65 |
The ocaml-%{name}-devel package contains the headers and native code |
66 |
libraries to develop applications that use %{name}. |
67 |
|
68 |
|
69 |
%package doc |
70 |
Summary: Documentation for the Ocsigen web server |
71 |
Group: Books/Computer books |
72 |
Requires: %{name} = %{version}-%{release} |
73 |
|
74 |
%description doc |
75 |
Documentation for the Ocsigen web server. |
76 |
|
77 |
|
78 |
%define unixuser $(USER) |
79 |
%define unixgroup $(USER) |
80 |
%define webroot %{_var}/www/ocsigenserver |
81 |
|
82 |
|
83 |
%prep |
84 |
%setup -q -n %{name}-%{upversion} |
85 |
%patch0 -p 1 |
86 |
|
87 |
%build |
88 |
export C_INCLUDE_PATH=/usr/include/libev |
89 |
sh configure \ |
90 |
--enable-natdynlink \ |
91 |
--with-sqlite \ |
92 |
--with-dbm \ |
93 |
--with-camlzip \ |
94 |
--prefix %{_prefix} \ |
95 |
--bindir %{_bindir} \ |
96 |
--mandir %{_mandir}/man1 \ |
97 |
--docdir %{_docdir} \ |
98 |
--staticpagesdir %{webroot} \ |
99 |
--datadir %{_localstatedir}/lib/%{name} \ |
100 |
--sysconfdir %{_sysconfdir}/%{name} \ |
101 |
--ocsigen-user ocsigen \ |
102 |
--ocsigen-group ocsigen |
103 |
|
104 |
make |
105 |
make doc |
106 |
|
107 |
%install |
108 |
%makeinstall_std TEMPROOT=%{buildroot} |
109 |
|
110 |
mkdir -p %{buildroot}%{_logdir}/ocsigenserver |
111 |
|
112 |
install -D -m 755 %{SOURCE3} %{buildroot}%{_unitdir}/%{name}.service |
113 |
|
114 |
mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d |
115 |
cat > %{buildroot}%{_sysconfdir}/logrotate.d/%{name} <<EOF |
116 |
%{_logdir}/%{name}/*.log { |
117 |
size=20M |
118 |
rotate 5 |
119 |
weekly |
120 |
missingok |
121 |
notifempty |
122 |
postrotate |
123 |
service %{name} reload |
124 |
endscript |
125 |
} |
126 |
EOF |
127 |
|
128 |
mkdir -p %{buildroot}%{webroot}/html |
129 |
|
130 |
mkdir -p %{buildroot}%{_sysconfdir}/init.d/ |
131 |
cp %{SOURCE1} %{buildroot}%{_sysconfdir}/init.d/ |
132 |
mkdir -p %{buildroot}%{_sysconfdir}/sysconfig/ |
133 |
cp %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/%{name} |
134 |
|
135 |
mkdir -p %{buildroot}%{_sysconfdir}/%{name}/conf.d/ |
136 |
|
137 |
# Opening port 8080 by default |
138 |
#sed -i 's|80|8080|g' %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf |
139 |
|
140 |
# Removing fifo |
141 |
%{__rm} -f %{buildroot}%{_localstatedir}/run/ocsigen_command |
142 |
|
143 |
%pre |
144 |
%_pre_useradd ocsigen %{_localstatedir}/lib/%{name} /bin/bash |
145 |
|
146 |
%post |
147 |
%_post_service %{name} |
148 |
|
149 |
%preun |
150 |
%_preun_service %{name} |
151 |
|
152 |
%postun |
153 |
%_postun_userdel ocsigen |
154 |
|
155 |
%files |
156 |
%{_bindir}/ocsigenserver |
157 |
%{_bindir}/ocsigenserver.opt |
158 |
%attr(0755,root,root) %{_sysconfdir}/init.d/ocsigenserver.init |
159 |
%attr(0600,root,root) %{_sysconfdir}/sysconfig/ocsigenserver |
160 |
%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf |
161 |
%dir %{_sysconfdir}/%{name}/conf.d/ |
162 |
%{_sysconfdir}/%{name}/%{name}.conf.sample |
163 |
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name} |
164 |
%config(noreplace) %{_sysconfdir}/%{name}/mime.types |
165 |
%{_unitdir}/%{name}.service |
166 |
%{_mandir}/man1/*.xz |
167 |
%dir %{_sysconfdir}/%{name}/ |
168 |
%attr(0750,ocsigen,ocsigen) %dir %{_localstatedir}/lib/ocsigenserver |
169 |
%attr(0750,ocsigen,ocsigen) %dir %{_localstatedir}/log/ocsigenserver |
170 |
%attr(0750,ocsigen,ocsigen) %dir %{webroot} |
171 |
%config(noreplace) %{webroot}/index.html |
172 |
%attr(0750,ocsigen,ocsigen) %dir %{webroot}/ocsigenstuff |
173 |
%{webroot}/ocsigenstuff/*.png |
174 |
%{webroot}/ocsigenstuff/*.css |
175 |
|
176 |
%files -n ocaml-%{name} |
177 |
%dir %{_libdir}/ocaml/%{name} |
178 |
%dir %{_libdir}/ocaml/%{name}/extensions |
179 |
%{_libdir}/ocaml/%{name}/META |
180 |
%{_libdir}/ocaml/%{name}/*.cma |
181 |
%{_libdir}/ocaml/%{name}/*.cmi |
182 |
%{_libdir}/ocaml/%{name}/*.cmo |
183 |
%{_libdir}/ocaml/%{name}/*.cmxs |
184 |
%{_libdir}/ocaml/%{name}/extensions/*.cma |
185 |
%{_libdir}/ocaml/%{name}/extensions/*.cmi |
186 |
%{_libdir}/ocaml/%{name}/extensions/*.cmo |
187 |
%{_libdir}/ocaml/%{name}/extensions/*.cmxs |
188 |
%{_libdir}/ocaml/%{name}/extensions/ocsidbm |
189 |
%{_libdir}/ocaml/%{name}/extensions/ocsidbm.opt |
190 |
|
191 |
%files -n ocaml-%{name}-devel |
192 |
%{_libdir}/ocaml/%{name}/*.a |
193 |
%{_libdir}/ocaml/%{name}/*.o |
194 |
%{_libdir}/ocaml/%{name}/*.mli |
195 |
%{_libdir}/ocaml/%{name}/*.cmx |
196 |
%{_libdir}/ocaml/%{name}/*.cmxa |
197 |
%{_libdir}/ocaml/%{name}/extensions/*.a |
198 |
%{_libdir}/ocaml/%{name}/extensions/*.o |
199 |
%{_libdir}/ocaml/%{name}/extensions/*.mli |
200 |
%{_libdir}/ocaml/%{name}/extensions/*.cmx |
201 |
%{_libdir}/ocaml/%{name}/extensions/*.cmxa |
202 |
|
203 |
|
204 |
|
205 |
%files doc |
206 |
%doc LICENSE README CHANGES doc/api-html doc/manual-wiki |