Skip to content

Commit

Permalink
Latest 1.2.x upstream release
Browse files Browse the repository at this point in the history
.spec corrections for optional build for systemd
Resolves bz 710474
Resolves bz 713307
Resolves bz 680691
  • Loading branch information
Pavel Lisý committed Oct 10, 2011
1 parent f91c349 commit afbdddc
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ clog
cherokee-1.2.1.tar.gz
cherokee-1.2.99.tar.gz
openssl-1.0.0d.tar.gz
/cherokee-1.2.100.tar.gz
36 changes: 21 additions & 15 deletions cherokee.spec
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
%define home %{_var}/lib/%{name}
%define shortversion %(echo %{version} | grep -oE '[0-9]+\.[0-9]+')
%define shortversion %(echo %{version} | sed -e 's/^\([0-9]+\.[0-9]+\)\.[0-9]+/\1/g')
%define opensslversion 1.0.0d
%{!?_unitdir:%define _unitdir /lib/systemd/system}

Name: cherokee
Version: 1.2.99
Release: 2%{?dist}
Version: 1.2.100
Release: 1%{?dist}
Summary: Flexible and Fast Webserver

Group: Applications/Internet
Expand Down Expand Up @@ -34,7 +34,7 @@ BuildRequires: gettext
# For spawn-fcgi
Requires: spawn-fcgi

%if "%{dist}" == ".f15" || "%{dist}" == ".f16"
%if "%{dist}" == ".fc15" || "%{dist}" == ".fc16" || "%{dist}" == ".fc17"
Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units
Expand Down Expand Up @@ -109,7 +109,7 @@ make install DESTDIR=%{buildroot}
%{__install} -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
%{__install} -d %{buildroot}%{_var}/{log,lib}/%{name}/
%{__install} -d %{buildroot}%{_sysconfdir}/pki/%{name}
%if "%{dist}" == ".f15" || "%{dist}" == ".f16"
%if "%{dist}" == ".fc15" || "%{dist}" == ".fc16" || "%{dist}" == ".fc17"
%{__install} -d %{buildroot}%{_unitdir}
%{__install} -D -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}/%{name}.service
%else
Expand Down Expand Up @@ -149,14 +149,8 @@ useradd -r -g %{name} -d %{home} -s /sbin/nologin \
-c "%{name} web server" %{name}
exit 0

%preun
if [ $1 = 0 ] ; then
/sbin/service %{name} stop >/dev/null 2>&1
/sbin/chkconfig --del %{name}
fi

%post
%if "%{dist}" == ".f15" || "%{dist}" == ".f16"
%if "%{dist}" == ".fc15" || "%{dist}" == ".fc16" || "%{dist}" == ".fc17"
if [ $1 -eq 1 ] ; then
# Initial installation: enabled by default
/bin/systemctl enable cherokee.service >/dev/null 2>&1 || :
Expand All @@ -166,17 +160,22 @@ fi
/sbin/chkconfig --add %{name}
%endif

%if "%{dist}" == ".f15" || "%{dist}" == ".f16"
%preun
%if "%{dist}" == ".fc15" || "%{dist}" == ".fc16" || "%{dist}" == ".fc17"
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
/bin/systemctl --no-reload disable cherokee.service > /dev/null 2>&1 || :
/bin/systemctl stop cherokee.service > /dev/null 2>&1 || :
fi
%else
if [ $1 = 0 ] ; then
/sbin/service %{name} stop >/dev/null 2>&1
/sbin/chkconfig --del %{name}
fi
%endif

%postun
%if "%{dist}" == ".f15" || "%{dist}" == ".f16"
%if "%{dist}" == ".fc15" || "%{dist}" == ".fc16" || "%{dist}" == ".fc17"
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
Expand All @@ -188,7 +187,7 @@ fi

%files
%defattr(-,root,root,-)
%if "%{dist}" == ".f15" || "%{dist}" == ".f16"
%if "%{dist}" == ".fc15" || "%{dist}" == ".fc16" || "%{dist}" == ".fc17"
%{_unitdir}/%{name}.service
%else
%{_sysconfdir}/init.d/%{name}
Expand Down Expand Up @@ -248,6 +247,13 @@ fi
%{_libdir}/lib%{name}-*.so

%changelog
* Mon Oct 10 2011 Pavel Lisý <pali@fedoraproject.org> - 1.2.100-1
- Latest 1.2.x upstream release
- .spec corrections for optional build for systemd
- Resolves bz 710474
- Resolves bz 713307
- Resolves bz 680691

* Wed Sep 14 2011 Pavel Lisý <pali@fedoraproject.org> - 1.2.99-2
- .spec corrections for EL4 build

Expand Down
3 changes: 1 addition & 2 deletions sources
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
40b6ea380cc8a5bf9734c2f8bf7e701e openssl-1.0.0d.tar.gz
c83115c3eebb29e6f2b4cc6fe699affe cherokee-1.2.99.tar.gz
ccbb3865d0544f8772a1b163efb3be34 cherokee-1.2.100.tar.gz

0 comments on commit afbdddc

Please sign in to comment.