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
34 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36 %define _bindir %{_sbindir}
39 H2O is a very fast HTTP server written in C
42 Summary: H2O Library compiled with libuv
43 Group: Development/Libraries
45 %description -n libh2o
46 libh2o package provides H2O library compiled with libuv which allows
47 you to link your own software to H2O.
49 %package -n libh2o-evloop
50 Summary: H2O Library compiled with its own event loop
51 Group: Development/Libraries
53 %description -n libh2o-evloop
54 libh2o-evloop package provides H2O library compiled with its own event
55 loop which allows you to link your own software to H2O.
57 %package -n libh2o-devel
58 Summary: Development interfaces for H2O
59 Group: Development/Libraries
60 Requires: libh2o = %{version}-%{release}
61 Requires: libh2o-evloop = %{version}-%{release}
62 Requires: openssl-devel
64 %description -n libh2o-devel
65 libh2o-devel package provides H2O header files and helpers which allow
66 you to build your own software using H2O.
76 -DBUILD_SHARED_LIBS=on \
77 -DWITH_MRUBY=%{!?with_mruby:OFF}%{?with_mruby:ON} \
83 rm -rf $RPM_BUILD_ROOT
84 %{__make} install -C build \
85 DESTDIR=$RPM_BUILD_ROOT
87 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
89 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},/etc/{rc.d/init.d,logrotate.d},%{systemdunitdir},%{systemdtmpfilesdir},%{_localstatedir}/{log,run}/h2o}
91 cp -p %{_sourcedir}/h2o.conf $RPM_BUILD_ROOT%{_sysconfdir}/h2o/h2o.conf
92 cp -p %{_sourcedir}/h2o.service $RPM_BUILD_ROOT%{systemdunitdir}/h2o.service
93 cp -p %{_sourcedir}/h2o.tmpfiles $RPM_BUILD_ROOT%{systemdtmpfilesdir}/h2o.conf
94 install -p %{_sourcedir}/h2o.init $RPM_BUILD_ROOT/etc/rc.d/init.d/h2o
95 cp -p %{_sourcedir}/h2o.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/h2o
98 rm -rf $RPM_BUILD_ROOT
101 /sbin/chkconfig --add %{name}
102 %service %{name} restart
103 %systemd_post %{name}.service
106 if [ "$1" = "0" ]; then
107 %service -q %{name} stop
108 /sbin/chkconfig --del %{name}
110 %systemd_preun %{name}.service
115 %post -n libh2o -p /sbin/ldconfig
116 %postun -n libh2o -p /sbin/ldconfig
118 %post -n libh2o-evloop -p /sbin/ldconfig
119 %postun -n libh2o-evloop -p /sbin/ldconfig
122 %defattr(644,root,root,755)
123 %doc README.md Changes LICENSE
124 %attr(755,root,root) %{_sbindir}/h2o
125 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/h2o.conf
126 %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/h2o
127 %attr(754,root,root) /etc/rc.d/init.d/h2o
128 %{systemdunitdir}/h2o.service
129 %{systemdtmpfilesdir}/h2o.conf
130 %dir %{_datadir}/%{name}
131 %{_datadir}/%{name}/status
132 %attr(755,root,root) %{_datadir}/%{name}/annotate-backtrace-symbols
133 %attr(755,root,root) %{_datadir}/%{name}/fastcgi-cgi
134 %attr(755,root,root) %{_datadir}/%{name}/fetch-ocsp-response
135 %attr(755,root,root) %{_datadir}/%{name}/kill-on-close
136 %attr(755,root,root) %{_datadir}/%{name}/setuidgid
137 %attr(755,root,root) %{_datadir}/%{name}/start_server
140 %{_datadir}/%{name}/mruby
144 %defattr(644,root,root,755)
145 %{_libdir}/libh2o.so.0.13
146 %attr(755,root,root) %{_libdir}/libh2o.so.*.*.*
148 %files -n libh2o-evloop
149 %defattr(644,root,root,755)
150 %{_libdir}/libh2o-evloop.so.0.13
151 %attr(755,root,root) %{_libdir}/libh2o-evloop.so.*.*.*
153 %files -n libh2o-devel
154 %defattr(644,root,root,755)
158 %{_libdir}/libh2o-evloop.so
159 %{_pkgconfigdir}/libh2o.pc
160 %{_pkgconfigdir}/libh2o-evloop.pc