]> git.pld-linux.org Git - SPECS.git/blob - h2o.spec
SPECS updated Sat 31 Jul 20:26:02 CEST 2021
[SPECS.git] / h2o.spec
1 # TODO
2 # - libwslay for websockets
3 #
4 # Conditional build:
5 %bcond_without  mruby           # using mruby scripting support (Rack-based)
6
7 Summary:        H2O - an optimized HTTP server with support for HTTP/1.x and HTTP/2
8 Name:           h2o
9 Version:        2.2.2
10 Release:        1
11 License:        MIT
12 Group:          Networking/Daemons/HTTP
13 Source0:        https://github.com/h2o/h2o/archive/v%{version}/%{name}-%{version}.tar.gz
14 # Source0-md5:  efc3a98cd21d3b91d66b2a99b1518255
15 Source1:        index.html
16 Source2:        %{name}.logrotate
17 Source3:        %{name}.init
18 Source4:        %{name}.service
19 Source5:        %{name}.conf
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
29 %if %{with mruby}
30 BuildRequires:  bison
31 BuildRequires:  ruby-devel
32 %endif
33 Requires:       ca-certificates
34 Requires:       perl-Encode
35 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36
37 %define _bindir %{_sbindir}
38
39 %description
40 H2O is a very fast HTTP server written in C
41
42 %package -n libh2o
43 Summary:        H2O Library compiled with libuv
44 Group:          Development/Libraries
45
46 %description -n libh2o
47 libh2o package provides H2O library compiled with libuv which allows
48 you to link your own software to H2O.
49
50 %package -n libh2o-evloop
51 Summary:        H2O Library compiled with its own event loop
52 Group:          Development/Libraries
53
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.
57
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
64
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.
68
69 %prep
70 %setup -q
71 %patch0 -p1
72
73 %build
74 install -d build
75 cd build
76 %cmake \
77         -DBUILD_SHARED_LIBS=on \
78         -DWITH_MRUBY=%{!?with_mruby:OFF}%{?with_mruby:ON} \
79         ..
80 %{__make} \
81         V=1
82
83 %install
84 rm -rf $RPM_BUILD_ROOT
85 %{__make} install -C build \
86         DESTDIR=$RPM_BUILD_ROOT
87
88 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
89
90 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},/etc/{rc.d/init.d,logrotate.d},%{systemdunitdir},%{systemdtmpfilesdir},%{_localstatedir}/{log,run}/h2o}
91
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
97
98 %clean
99 rm -rf $RPM_BUILD_ROOT
100
101 %post
102 /sbin/chkconfig --add %{name}
103 %service %{name} restart
104 %systemd_post %{name}.service
105
106 %preun
107 if [ "$1" = "0" ]; then
108         %service -q %{name} stop
109         /sbin/chkconfig --del %{name}
110 fi
111 %systemd_preun %{name}.service
112
113 %postun
114 %systemd_reload
115
116 %post   -n libh2o -p /sbin/ldconfig
117 %postun -n libh2o -p /sbin/ldconfig
118
119 %post   -n libh2o-evloop -p /sbin/ldconfig
120 %postun -n libh2o-evloop -p /sbin/ldconfig
121
122 %files
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
140
141 %attr(710,root,root) %dir %{_localstatedir}/run/h2o
142 %attr(700,root,root) %dir %{_localstatedir}/log/h2o
143
144 %if %{with mruby}
145 %{_datadir}/%{name}/mruby
146 %endif
147
148 %files -n libh2o
149 %defattr(644,root,root,755)
150 %{_libdir}/libh2o.so.0.13
151 %attr(755,root,root) %{_libdir}/libh2o.so.*.*.*
152
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.*.*.*
157
158 %files -n libh2o-devel
159 %defattr(644,root,root,755)
160 %{_includedir}/h2o.h
161 %{_includedir}/h2o
162 %{_libdir}/libh2o.so
163 %{_libdir}/libh2o-evloop.so
164 %{_pkgconfigdir}/libh2o.pc
165 %{_pkgconfigdir}/libh2o-evloop.pc
This page took 0.547266 seconds and 3 git commands to generate.