%if 0%{?fedora} > 14 || 0%{?rhel} > 6 %global with_systemd 1 %endif %global upstream_name LogCentral Name: LogService Version: 2.8.0 Release: 1%{?dist} Summary: DIET middleware logging service Group: System Environment/Daemons License: CeCILL URL: http://graal.ens-lyon.fr/DIET/logservice.html Source0: %{name}-%{version}.tar.gz Source1: %{upstream_name}.init Source2: %{upstream_name}.config Source3: %{upstream_name}.service BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: cmake >= 2.6.3 BuildRequires: chrpath BuildRequires: omniORB-devel >= 4.1.2 BuildRequires: doxygen BuildRequires: python-docutils %if 0%{?with_systemd} Requires(post): systemd-units Requires(preun): systemd-units Requires(postun): systemd-units %else Requires(post): chkconfig Requires(preun): chkconfig Requires(pre): shadow-utils # This is for /sbin/service Requires(postun): initscripts %endif %description DIET grid middleware logging service %package devel Summary: Development files for %{name} Group: System Environment/Libraries Requires: %{name} = %{version}-%{release} %description devel This package contains development files for %{name}. %prep %setup -q %build %cmake -DLOGSERVICE_BUILD_DOXYGEN:BOOL=ON . make %{?_smp_mflags} %install rm -rf %{buildroot} make install DESTDIR=%{buildroot} %if 0%{?with_systemd} mkdir -p %{buildroot}/lib/systemd/system/ install -m 0644 %{SOURCE3} %{buildroot}/lib/systemd/system/ %else # install service init script install -D -m0755 %{SOURCE1} %{buildroot}%{_initddir}/%{upstream_name} %endif # install service configuration file install -D -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/%{upstream_name} chrpath --delete %{buildroot}%{_bindir}/* chrpath --delete %{buildroot}%{_libdir}/* %clean rm -rf %{buildroot} %pre getent group %{upstream_name} >/dev/null || groupadd -r %{upstream_name} getent passwd %{upstream_name} >/dev/null || \ useradd -r -g %{upstream_name} -d %{_sharedstatedir}/%{upstream_name} -s /sbin/nologin \ -c "LogCentral Log Server for distributed applications" %{upstream_name} exit 0 %if 0%{?with_systemd} %post if [ $1 -eq 1 ]; then # Package install, not upgrade /bin/systemctl daemon-reload >/dev/null 2>&1 || : fi /sbin/ldconfig %preun if [ $1 -eq 0 ] ; then # Package removal, not upgrade /bin/systemctl disable %{upstream_name}.service > /dev/null 2>&1 || : /bin/systemctl stop %{upstream_name}.service > /dev/null 2>&1 || : fi %postun /bin/systemctl daemon-reload >/dev/null 2>&1 || : if [ $1 -ge 1 ] ; then # Package upgrade, not uninstall /bin/systemctl try-restart %{upstream_name}.service >/dev/null 2>&1 || : fi /sbin/ldconfig %else %post /sbin/chkconfig --add %{upstream_name} /sbin/ldconfig %preun if [ $1 = 0 ] ; then /sbin/service stop >/dev/null 2>&1 /sbin/chkconfig --del %{upstream_name} fi %postun if [ "$1" -ge "1" ] ; then /sbin/service %{nameserver} condrestart >/dev/null 2>&1 || : fi /sbin/ldconfig %endif %files %defattr(-,root,root,-) %doc README LICENCE_eng LICENCE_fr %if 0%{?with_systemd} /lib/systemd/system/%{upstream_name}.service %else %{_initddir}/%{upstream_name} %endif %config(noreplace) %{_sysconfdir}/sysconfig/%{upstream_name} %{_bindir}/logForwarder %{_bindir}/LogCentral %{_bindir}/testComponent %{_bindir}/DIETtestTool %{_libdir}/libLogForwarderUtils.so.%{version} %{_libdir}/libLogServiceToolBase.so.%{version} %{_libdir}/libLogServiceComponentBase.so.%{version} %{_mandir}/man1/* %files devel %defattr(-,root,root,-) %doc %{_includedir}/*.hh %{_libdir}/libLogForwarderUtils.so %{_libdir}/libLogServiceToolBase.so %{_libdir}/libLogServiceComponentBase.so %{_docdir}/%{name}/html/* %{_mandir}/man3/* %changelog * Mon Oct 31 2011 Haïkel Guémar - 2.8.0-1 - upstream 2.8.0 * Wed May 11 2011 Haïkel Guémar - 2.7.0-1 - first packaging