]> git.pld-linux.org Git - packages/h2o.git/blob - h2o.spec
pldized initscript
[packages/h2o.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:        0.2
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 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35
36 %define _bindir %{_sbindir}
37
38 %description
39 H2O is a very fast HTTP server written in C
40
41 %package -n libh2o
42 Summary:        H2O Library compiled with libuv
43 Group:          Development/Libraries
44
45 %description -n libh2o
46 libh2o package provides H2O library compiled with libuv which allows
47 you to link your own software to H2O.
48
49 %package -n libh2o-evloop
50 Summary:        H2O Library compiled with its own event loop
51 Group:          Development/Libraries
52
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.
56
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
63
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.
67
68 %prep
69 %setup -q
70 %patch0 -p1
71
72 %build
73 install -d build
74 cd build
75 %cmake \
76         -DBUILD_SHARED_LIBS=on \
77         -DWITH_MRUBY=%{!?with_mruby:OFF}%{?with_mruby:ON} \
78         ..
79 %{__make} \
80         V=1
81
82 %install
83 rm -rf $RPM_BUILD_ROOT
84 %{__make} install -C build \
85         DESTDIR=$RPM_BUILD_ROOT
86
87 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
88
89 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},/etc/{rc.d/init.d,logrotate.d},%{systemdunitdir},%{systemdtmpfilesdir},%{_localstatedir}/{log,run}/h2o}
90
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
96
97 %clean
98 rm -rf $RPM_BUILD_ROOT
99
100 %post
101 /sbin/chkconfig --add %{name}
102 %service %{name} restart
103 %systemd_post %{name}.service
104
105 %preun
106 if [ "$1" = "0" ]; then
107         %service -q %{name} stop
108         /sbin/chkconfig --del %{name}
109 fi
110 %systemd_preun %{name}.service
111
112 %postun
113 %systemd_reload
114
115 %post   -n libh2o -p /sbin/ldconfig
116 %postun -n libh2o -p /sbin/ldconfig
117
118 %post   -n libh2o-evloop -p /sbin/ldconfig
119 %postun -n libh2o-evloop -p /sbin/ldconfig
120
121 %files
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
138
139 %if %{with mruby}
140 %{_datadir}/%{name}/mruby
141 %endif
142
143 %files -n libh2o
144 %defattr(644,root,root,755)
145 %{_libdir}/libh2o.so.0.13
146 %attr(755,root,root) %{_libdir}/libh2o.so.*.*.*
147
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.*.*.*
152
153 %files -n libh2o-devel
154 %defattr(644,root,root,755)
155 %{_includedir}/h2o.h
156 %{_includedir}/h2o
157 %{_libdir}/libh2o.so
158 %{_libdir}/libh2o-evloop.so
159 %{_pkgconfigdir}/libh2o.pc
160 %{_pkgconfigdir}/libh2o-evloop.pc
This page took 0.061442 seconds and 3 git commands to generate.