]> git.pld-linux.org Git - packages/cherokee.git/commitdiff
systemd unit added auto/th/cherokee-1.2.103-1
authorJacek Konieczny <jajcus@jajcus.net>
Sat, 25 May 2013 19:26:12 +0000 (21:26 +0200)
committerJacek Konieczny <jajcus@jajcus.net>
Sat, 25 May 2013 19:26:12 +0000 (21:26 +0200)
cherokee.service [new file with mode: 0644]
cherokee.spec

diff --git a/cherokee.service b/cherokee.service
new file mode 100644 (file)
index 0000000..7f9e337
--- /dev/null
@@ -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
index 34ecb8035a6a57a79e840882ba8acb62f76aadb2..7d1388e1ee82087013948d38a36969831a1b73e7 100644 (file)
@@ -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
This page took 0.092406 seconds and 4 git commands to generate.