summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacek Konieczny2013-05-25 19:26:12 (GMT)
committerJacek Konieczny2013-05-25 19:26:12 (GMT)
commit656d613514a58b5967105fc51afec6328e0f41ef (patch)
treeaa25cf29df01836ed3c574fd2fb14755d5ea758f
parent7fc051ad573efcb81eb31e53f42bf019486e7363 (diff)
downloadcherokee-656d613514a58b5967105fc51afec6328e0f41ef.zip
cherokee-656d613514a58b5967105fc51afec6328e0f41ef.tar.gz
systemd unit addedauto/th/cherokee-1.2.103-1
-rw-r--r--cherokee.service11
-rw-r--r--cherokee.spec16
2 files changed, 25 insertions, 2 deletions
diff --git a/cherokee.service b/cherokee.service
new file mode 100644
index 0000000..7f9e337
--- /dev/null
+++ b/cherokee.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Cherokee web server
+After=network.target syslog.target
+
+[Service]
+Type=forking
+ExecStart=/usr/sbin/cherokee -d
+PIDFile=/var/run/cherokee.pid
+
+[Install]
+WantedBy=multi-user.target
diff --git a/cherokee.spec b/cherokee.spec
index 34ecb80..7d1388e 100644
--- a/cherokee.spec
+++ b/cherokee.spec
@@ -25,6 +25,7 @@ Source1: CTK-20120806.tar.xz
Source2: %{name}.init
Source3: %{name}.sysconfig
Source4: %{name}.upstart
+Source5: %{name}.service
Patch0: %{name}-config.patch
Patch1: %{name}-panic_path.patch
Patch2: ffmpeg0.11.patch
@@ -44,7 +45,7 @@ BuildRequires: php(fcgi)
BuildRequires: pkgconfig
BuildRequires: python-docutils
BuildRequires: rpm-pythonprov
-BuildRequires: rpmbuild(macros) >= 1.561
+BuildRequires: rpmbuild(macros) >= 1.647
BuildRequires: zlib-devel
Requires(post,preun): /sbin/chkconfig
Requires(postun): /usr/sbin/groupdel
@@ -55,6 +56,7 @@ Requires(pre): /usr/sbin/groupadd
Requires(pre): /usr/sbin/useradd
Requires: %{name}-libs = %{version}-%{release}
Requires: rc-scripts >= 0.4.3.0
+Requires: systemd-units >= 38
Suggests: %{name}-admin = %{version}-%{release}
Suggests: php(fcgi)
Provides: group(cherokee)
@@ -169,7 +171,9 @@ touch po/admin/*.po
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{/etc/{init,pam.d,sysconfig,rc.d/init.d},/var/log/%{name}}
+install -d $RPM_BUILD_ROOT/etc/{init,pam.d,sysconfig,rc.d/init.d} \
+ $RPM_BUILD_ROOT/var/log/%{name} \
+ $RPM_BUILD_ROOT%{systemdunitdir}
%{__make} -j1 install \
DESTDIR=$RPM_BUILD_ROOT
@@ -177,6 +181,7 @@ install -d $RPM_BUILD_ROOT{/etc/{init,pam.d,sysconfig,rc.d/init.d},/var/log/%{na
install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
install %{SOURCE4} $RPM_BUILD_ROOT/etc/init/%{name}.conf
+install %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir}/cherokee.service
# users don't need this
mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/cherokee-panic
@@ -218,12 +223,14 @@ if [ "$1" = "2" -a -e %{_sysconfdir}/cherokee.conf ]; then
fi
/sbin/chkconfig --add %{name}
%service %{name} restart "Cherokee webserver"
+%systemd_post %{name}.service
%preun
if [ "$1" = "0" ]; then
%service %{name} stop
/sbin/chkconfig --del %{name}
fi
+%systemd_preun %{name}.service
%postun
if [ "$1" = "0" ]; then
@@ -231,6 +238,10 @@ if [ "$1" = "0" ]; then
%groupremove cherokee
%groupremove http
fi
+%systemd_reload
+
+%triggerpostun -- %{name} < 1.2.103-1
+%systemd_trigger %{name}.service
%post upstart
%upstart_post %{name}
@@ -250,6 +261,7 @@ fi
%config(noreplace) %verify(not md5 mtime size) /etc/pam.d/cherokee
%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cherokee
%attr(754,root,root) /etc/rc.d/init.d/cherokee
+%{systemdunitdir}/%{name}.service
%attr(755,root,root) %{_bindir}/CTK-run
%attr(755,root,root) %{_bindir}/cget