]> git.pld-linux.org Git - packages/h2o.git/blobdiff - h2o.spec
add init scripts, lograote and index page
[packages/h2o.git] / h2o.spec
index 27cd440917a7fb9b0fff50ae8376260ad2ebb07b..572f9ac11bd376df0dc2c8f8bf681d6363964c3d 100644 (file)
--- a/h2o.spec
+++ b/h2o.spec
@@ -7,11 +7,16 @@
 Summary:       H2O - an optimized HTTP server with support for HTTP/1.x and HTTP/2
 Name:          h2o
 Version:       2.2.2
-Release:       0.1
+Release:       0.2
 License:       MIT
 Group:         Networking/Daemons/HTTP
 Source0:       https://github.com/h2o/h2o/archive/v%{version}/%{name}-%{version}.tar.gz
 # Source0-md5: efc3a98cd21d3b91d66b2a99b1518255
+Source1:       index.html
+Source2:       %{name}.logrotate
+Source3:       %{name}.init
+Source4:       %{name}.service
+Source5:       %{name}.conf
 Patch0:                system-ca.patch
 URL:           https://h2o.examp1e.net/
 BuildRequires: cmake >= 2.8.11
@@ -81,9 +86,32 @@ rm -rf $RPM_BUILD_ROOT
 
 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
 
+install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},/etc/{rc.d/init.d,logrotate.d},%{systemdunitdir},%{systemdtmpfilesdir},%{_localstatedir}/{log,run}/h2o}
+
+cp -p %{_sourcedir}/h2o.conf $RPM_BUILD_ROOT%{_sysconfdir}/h2o/h2o.conf
+cp -p %{_sourcedir}/h2o.service $RPM_BUILD_ROOT%{systemdunitdir}/h2o.service
+cp -p %{_sourcedir}/h2o.tmpfiles $RPM_BUILD_ROOT%{systemdtmpfilesdir}/h2o.conf
+install -p %{_sourcedir}/h2o.init $RPM_BUILD_ROOT/etc/rc.d/init.d/h2o
+cp -p %{_sourcedir}/h2o.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/h2o
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%post
+/sbin/chkconfig --add %{name}
+%service %{name} restart
+%systemd_post %{name}.service
+
+%preun
+if [ "$1" = "0" ]; then
+       %service -q %{name} stop
+       /sbin/chkconfig --del %{name}
+fi
+%systemd_preun %{name}.service
+
+%postun
+%systemd_reload
+
 %post  -n libh2o -p /sbin/ldconfig
 %postun        -n libh2o -p /sbin/ldconfig
 
@@ -94,6 +122,11 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(644,root,root,755)
 %doc README.md Changes LICENSE
 %attr(755,root,root) %{_sbindir}/h2o
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/h2o.conf
+%config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/h2o
+%attr(754,root,root) /etc/rc.d/init.d/h2o
+%{systemdunitdir}/h2o.service
+%{systemdtmpfilesdir}/h2o.conf
 %dir %{_datadir}/%{name}
 %{_datadir}/%{name}/status
 %attr(755,root,root) %{_datadir}/%{name}/annotate-backtrace-symbols
This page took 0.060294 seconds and 4 git commands to generate.