2 # - libwslay for websockets
5 %bcond_without mruby # using mruby scripting support (Rack-based)
7 Summary: H2O - an optimized HTTP server with support for HTTP/1.x and HTTP/2
12 Group: Networking/Daemons/HTTP
13 Source0: https://github.com/h2o/h2o/archive/v%{version}/%{name}-%{version}.tar.gz
14 # Source0-md5: efc3a98cd21d3b91d66b2a99b1518255
16 Source2: %{name}.logrotate
18 Source4: %{name}.service
20 Patch0: system-ca.patch
21 URL: https://h2o.examp1e.net/
22 BuildRequires: cmake >= 2.8.11
23 BuildRequires: libstdc++-devel
24 BuildRequires: libuv-devel >= 1.0.0
25 BuildRequires: openssl-devel >= 1.0.2
26 BuildRequires: pkgconfig
27 BuildRequires: yaml-devel
28 BuildRequires: zlib-devel
31 BuildRequires: ruby-devel
33 Requires: ca-certificates
35 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37 %define _bindir %{_sbindir}
40 H2O is a very fast HTTP server written in C
43 Summary: H2O Library compiled with libuv
44 Group: Development/Libraries
46 %description -n libh2o
47 libh2o package provides H2O library compiled with libuv which allows
48 you to link your own software to H2O.
50 %package -n libh2o-evloop
51 Summary: H2O Library compiled with its own event loop
52 Group: Development/Libraries
54 %description -n libh2o-evloop
55 libh2o-evloop package provides H2O library compiled with its own event
56 loop which allows you to link your own software to H2O.
58 %package -n libh2o-devel
59 Summary: Development interfaces for H2O
60 Group: Development/Libraries
61 Requires: libh2o = %{version}-%{release}
62 Requires: libh2o-evloop = %{version}-%{release}
63 Requires: openssl-devel
65 %description -n libh2o-devel
66 libh2o-devel package provides H2O header files and helpers which allow
67 you to build your own software using H2O.
77 -DBUILD_SHARED_LIBS=on \
78 -DWITH_MRUBY=%{!?with_mruby:OFF}%{?with_mruby:ON} \
84 rm -rf $RPM_BUILD_ROOT
85 %{__make} install -C build \
86 DESTDIR=$RPM_BUILD_ROOT
88 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
90 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},/etc/{rc.d/init.d,logrotate.d},%{systemdunitdir},%{systemdtmpfilesdir},%{_localstatedir}/{log,run}/h2o}
92 cp -p %{_sourcedir}/h2o.conf $RPM_BUILD_ROOT%{_sysconfdir}/h2o/h2o.conf
93 cp -p %{_sourcedir}/h2o.service $RPM_BUILD_ROOT%{systemdunitdir}/h2o.service
94 cp -p %{_sourcedir}/h2o.tmpfiles $RPM_BUILD_ROOT%{systemdtmpfilesdir}/h2o.conf
95 install -p %{_sourcedir}/h2o.init $RPM_BUILD_ROOT/etc/rc.d/init.d/h2o
96 cp -p %{_sourcedir}/h2o.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/h2o
99 rm -rf $RPM_BUILD_ROOT
102 /sbin/chkconfig --add %{name}
103 %service %{name} restart
104 %systemd_post %{name}.service
107 if [ "$1" = "0" ]; then
108 %service -q %{name} stop
109 /sbin/chkconfig --del %{name}
111 %systemd_preun %{name}.service
116 %post -n libh2o -p /sbin/ldconfig
117 %postun -n libh2o -p /sbin/ldconfig
119 %post -n libh2o-evloop -p /sbin/ldconfig
120 %postun -n libh2o-evloop -p /sbin/ldconfig
123 %defattr(644,root,root,755)
124 %doc README.md Changes LICENSE
125 %attr(755,root,root) %{_sbindir}/h2o
126 %dir %{_sysconfdir}/%{name}
127 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/h2o.conf
128 %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/h2o
129 %attr(754,root,root) /etc/rc.d/init.d/h2o
130 %{systemdunitdir}/h2o.service
131 %{systemdtmpfilesdir}/h2o.conf
132 %dir %{_datadir}/%{name}
133 %{_datadir}/%{name}/status
134 %attr(755,root,root) %{_datadir}/%{name}/annotate-backtrace-symbols
135 %attr(755,root,root) %{_datadir}/%{name}/fastcgi-cgi
136 %attr(755,root,root) %{_datadir}/%{name}/fetch-ocsp-response
137 %attr(755,root,root) %{_datadir}/%{name}/kill-on-close
138 %attr(755,root,root) %{_datadir}/%{name}/setuidgid
139 %attr(755,root,root) %{_datadir}/%{name}/start_server
141 %attr(710,root,root) %dir %{_localstatedir}/run/h2o
142 %attr(700,root,root) %dir %{_localstatedir}/log/h2o
145 %{_datadir}/%{name}/mruby
149 %defattr(644,root,root,755)
150 %{_libdir}/libh2o.so.0.13
151 %attr(755,root,root) %{_libdir}/libh2o.so.*.*.*
153 %files -n libh2o-evloop
154 %defattr(644,root,root,755)
155 %{_libdir}/libh2o-evloop.so.0.13
156 %attr(755,root,root) %{_libdir}/libh2o-evloop.so.*.*.*
158 %files -n libh2o-devel
159 %defattr(644,root,root,755)
163 %{_libdir}/libh2o-evloop.so
164 %{_pkgconfigdir}/libh2o.pc
165 %{_pkgconfigdir}/libh2o-evloop.pc