Update sogo.spec
parent
36a70b161c
commit
c9ec636a53
|
@ -14,6 +14,13 @@
|
||||||
|
|
||||||
%{!?python_sys_pyver: %global python_sys_pyver %(/usr/bin/python -c "import sys; print sys.hexversion")}
|
%{!?python_sys_pyver: %global python_sys_pyver %(/usr/bin/python -c "import sys; print sys.hexversion")}
|
||||||
|
|
||||||
|
# Systemd for fedora >= 17 or el 7
|
||||||
|
%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7
|
||||||
|
%global _with_systemd 1
|
||||||
|
%else
|
||||||
|
%global _with_systemd 0
|
||||||
|
%endif
|
||||||
|
|
||||||
%define sogo_user sogo
|
%define sogo_user sogo
|
||||||
|
|
||||||
Summary: SOGo
|
Summary: SOGo
|
||||||
|
@ -217,7 +224,13 @@ make DESTDIR=${RPM_BUILD_ROOT} \
|
||||||
GNUSTEP_INSTALLATION_DOMAIN=SYSTEM \
|
GNUSTEP_INSTALLATION_DOMAIN=SYSTEM \
|
||||||
CC="$cc" LDFLAGS="$ldflags" \
|
CC="$cc" LDFLAGS="$ldflags" \
|
||||||
install
|
install
|
||||||
|
|
||||||
|
%if 0%{?_with_systemd}
|
||||||
|
install -d ${RPM_BUILD_ROOT}/usr/lib/systemd/system/
|
||||||
|
%else
|
||||||
install -d ${RPM_BUILD_ROOT}/etc/init.d
|
install -d ${RPM_BUILD_ROOT}/etc/init.d
|
||||||
|
%endif
|
||||||
|
|
||||||
install -d ${RPM_BUILD_ROOT}/etc/cron.d
|
install -d ${RPM_BUILD_ROOT}/etc/cron.d
|
||||||
install -d ${RPM_BUILD_ROOT}/etc/cron.daily
|
install -d ${RPM_BUILD_ROOT}/etc/cron.daily
|
||||||
install -d ${RPM_BUILD_ROOT}/etc/logrotate.d
|
install -d ${RPM_BUILD_ROOT}/etc/logrotate.d
|
||||||
|
@ -236,8 +249,15 @@ install -m 600 Scripts/sogo.cron ${RPM_BUILD_ROOT}/etc/cron.d/sogo
|
||||||
cp Scripts/tmpwatch ${RPM_BUILD_ROOT}/etc/cron.daily/sogo-tmpwatch
|
cp Scripts/tmpwatch ${RPM_BUILD_ROOT}/etc/cron.daily/sogo-tmpwatch
|
||||||
chmod 755 ${RPM_BUILD_ROOT}/etc/cron.daily/sogo-tmpwatch
|
chmod 755 ${RPM_BUILD_ROOT}/etc/cron.daily/sogo-tmpwatch
|
||||||
cp Scripts/logrotate ${RPM_BUILD_ROOT}/etc/logrotate.d/sogo
|
cp Scripts/logrotate ${RPM_BUILD_ROOT}/etc/logrotate.d/sogo
|
||||||
|
|
||||||
|
%if 0%{?_with_systemd}
|
||||||
|
cp Scripts/sogo-systemd-redhat ${RPM_BUILD_ROOT}/usr/lib/systemd/system/sogod.service
|
||||||
|
chmod 644 ${RPM_BUILD_ROOT}/usr/lib/systemd/system/sogod.service
|
||||||
|
%else
|
||||||
cp Scripts/sogo-init.d-redhat ${RPM_BUILD_ROOT}/etc/init.d/sogod
|
cp Scripts/sogo-init.d-redhat ${RPM_BUILD_ROOT}/etc/init.d/sogod
|
||||||
chmod 755 ${RPM_BUILD_ROOT}/etc/init.d/sogod
|
chmod 755 ${RPM_BUILD_ROOT}/etc/init.d/sogod
|
||||||
|
%endif
|
||||||
|
|
||||||
cp Scripts/sogo-default ${RPM_BUILD_ROOT}/etc/sysconfig/sogo
|
cp Scripts/sogo-default ${RPM_BUILD_ROOT}/etc/sysconfig/sogo
|
||||||
rm -rf ${RPM_BUILD_ROOT}%{_bindir}/test_quick_extract
|
rm -rf ${RPM_BUILD_ROOT}%{_bindir}/test_quick_extract
|
||||||
|
|
||||||
|
@ -365,14 +385,24 @@ fi
|
||||||
%post
|
%post
|
||||||
# update timestamp on imgs,css,js to let apache know the files changed
|
# update timestamp on imgs,css,js to let apache know the files changed
|
||||||
find %{_libdir}/GNUstep/SOGo/WebServerResources -exec touch {} \;
|
find %{_libdir}/GNUstep/SOGo/WebServerResources -exec touch {} \;
|
||||||
|
%if 0%{?_with_systemd}
|
||||||
|
systemctl enable sogod
|
||||||
|
systemctl start sogod > /dev/null 2>&1
|
||||||
|
%else
|
||||||
/sbin/chkconfig --add sogod
|
/sbin/chkconfig --add sogod
|
||||||
/etc/init.d/sogod condrestart >&/dev/null
|
/etc/init.d/sogod condrestart >&/dev/null
|
||||||
|
%endif
|
||||||
|
|
||||||
%preun
|
%preun
|
||||||
if [ "$1" == "0" ]
|
if [ "$1" == "0" ]
|
||||||
then
|
then
|
||||||
|
%if 0%{?_with_systemd}
|
||||||
|
systemctl disable sogod
|
||||||
|
systemctl stop sogod > /dev/null 2>&1
|
||||||
|
%else
|
||||||
/sbin/chkconfig --del sogod
|
/sbin/chkconfig --del sogod
|
||||||
/sbin/service sogod stop > /dev/null 2>&1
|
/sbin/service sogod stop > /dev/null 2>&1
|
||||||
|
%endif
|
||||||
fi
|
fi
|
||||||
|
|
||||||
%postun
|
%postun
|
||||||
|
@ -387,6 +417,9 @@ fi
|
||||||
|
|
||||||
# ********************************* changelog *************************
|
# ********************************* changelog *************************
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Mar 31 2015. Inverse inc. <support@inverse.ca>
|
||||||
|
- Change script start sogod for systemd
|
||||||
|
|
||||||
* Wed Oct 8 2014 Inverse inc. <support@inverse.ca>
|
* Wed Oct 8 2014 Inverse inc. <support@inverse.ca>
|
||||||
- fixed the library move to "sogo" app dir
|
- fixed the library move to "sogo" app dir
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue