Search
j0ke.net Open Build Service
>
Projects
>
SUSE
:
Manager
:
1.2
>
nocpulse-common
> nocpulse-common.spec
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File nocpulse-common.spec of Package nocpulse-common
# # spec file for package nocpulse-common # # Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # Name: nocpulse-common Version: 2.1.19 Release: 0.6.1 Summary: NOCpulse common License: GPL v2 only Url: https://fedorahosted.org/spacewalk Source0: nocpulse-common-git-361cb6a06bfdf13cb58a98094bf2bddb5faf87b0.tar.gz BuildArch: noarch Group: Applications/System BuildRoot: %{_tmppath}/%{name}-%{version}-build %if 0%{?suse_version} Requires(pre): apache2, /usr/sbin/useradd Requires(post): coreutils, openssh Requires: perl-Crypt-SSLeay %else Requires(pre): httpd, /usr/sbin/useradd Requires(post): /sbin/runuser, openssh Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) %endif # merging this two packages together # not backward compatible => no Provides: Obsoletes: NPusers <= 1.17.50-1 Obsoletes: np-config <= 2.110.50-1 Obsoletes: nslogs < 2.3.0 Provides: nslogs = 2.3.0 Obsoletes: ConfigPusher-general < 1.3.0 Provides: ConfigPusher-general = 1.3.0 %if 0%{?suse_version} BuildRequires: apache2 %define webgrp www %else %define webgrp apache %endif %define package_name nocpulse %description NOCpulse provides application, network, systems and transaction monitoring, coupled with a comprehensive reporting system including availability, historical and trending reports in an easy-to-use browser interface. This package installs NOCpulse user shared by other NOCpulse packages, set up logrotate script, contains the NOCpulse configuration file and access libraries for it in perl. %prep %setup -q -n nocpulse-common-git-361cb6a06bfdf13cb58a98094bf2bddb5faf87b0 %build # nothing to do %install rm -rf $RPM_BUILD_ROOT mkdir -p %{buildroot}%{_sysconfdir}/%{package_name} mkdir -p %{buildroot}%{_var}/log/%{package_name} mkdir -p %{buildroot}%{_var}/lib/%{package_name}/.ssh # install log rotation stuff mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d install -m644 nocpulse.logrotate \ $RPM_BUILD_ROOT/etc/logrotate.d/%{name} mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir} install -m644 NOCpulse.ini $RPM_BUILD_ROOT/%{_sysconfdir}/%{package_name}/NOCpulse.ini install -m644 forward $RPM_BUILD_ROOT/%{_var}/lib/%{package_name}/.forward mkdir -p $RPM_BUILD_ROOT%{perl_vendorlib}/NOCpulse/Config/test mkdir -p $RPM_BUILD_ROOT%{_bindir} install -m644 perl-API/NOCpulse/Config.pm $RPM_BUILD_ROOT%{perl_vendorlib}/NOCpulse/ install -m644 perl-API/NOCpulse/NOCpulseini.pm $RPM_BUILD_ROOT%{perl_vendorlib}/NOCpulse/ install -m644 perl-API/NOCpulse/test/TestConfig.pm $RPM_BUILD_ROOT%{perl_vendorlib}/NOCpulse/Config/test/ install -m 755 npConfigValue $RPM_BUILD_ROOT%{_bindir}/ %pre # change nocpulse user & group to system user & group if needed dirs="/home/nocpulse /opt/notification /opt/nocpulse /var/log/nocpulse /var/www/templates /var/tmp" # Fedora guys do not want this stuff (suse guys dont want that too) %if ! 0%{?fedora} && ! 0%{?suse_version} if [ -d /home/nocpulse -a 0`id -u nocpulse 2> /dev/null` -ge 500 ]; then if [ 0`id -g nocpulse` -ge 500 ]; then groupmod -n nocpulse-old nocpulse groupadd -r nocpulse usermod -g nocpulse nocpulse # chgrp of existing fs objects owned by previous nocpulse group for i in $dirs; do find $i -group nocpulse-old -exec chgrp nocpulse '{}' ';' done groupdel nocpulse-old fi # find lowest unused system uid to change nocpulse uid to old_uid=`id -u nocpulse` useradd -r tempnoc -s /bin/bash uid=`id -u tempnoc` userdel tempnoc usermod -u $uid nocpulse # chown of existing fs objects owned by previous nocpulse user for i in $dirs; do find $i -user $old_uid -exec chown nocpulse '{}' ';' done fi %endif getent group %{package_name} >/dev/null || groupadd -r %{package_name} getent passwd %{package_name} >/dev/null || \ useradd -r -g %{package_name} -G %{webgrp} -d %{_var}/lib/%{package_name} -s /bin/bash -c "NOCpulse user" %{package_name} %if ! 0%{?suse_version} /usr/bin/passwd -l %{package_name} >/dev/null %endif # if user already exists (rhnmd creates it too) add nocpulse to apache group getent group %{webgrp} | grep nocpulse >/dev/null || usermod -G %{webgrp} nocpulse %post # Fedora guys do not want this stuff (suse guys don't want that too) %if ! 0%{?fedora} && ! 0%{?suse_version} # migrate things from /home/nocpulse to /var/lib/nocpulse and /var/log/nocpulse if [ `getent passwd nocpulse|awk -F ':' '{ print $6 }'` = "/home/nocpulse" ]; then # /var/lib/nocpulse is new homedir for nocpulse user usermod -d %{_var}/lib/%{package_name} nocpulse [ -f /home/nocpulse/etc/SatCluster.ini ] && mv /home/nocpulse/etc/SatCluster.ini %{_sysconfdir}/nocpulse mv /home/nocpulse/.ssh/* %{_var}/lib/%{package_name}/.ssh mv /home/nocpulse/.bash* /home/nocpulse/var/*.db \ /home/nocpulse/var/scheduler.xml /home/nocpulse/var/events.frozen \ %{_var}/lib/%{package_name} 2>/dev/null # archive of log files into /var/log/nocpulse mv /home/nocpulse/var/archives/* \ %{_var}/log/%{package_name} 2> /dev/null fi %endif %files %defattr(-, root,root,-) %dir %{_sysconfdir}/nocpulse %config(missingok,noreplace) %{_sysconfdir}/%{package_name}/NOCpulse.ini %config(missingok,noreplace) %attr(-, %{package_name},%{package_name}) %{_var}/lib/%{package_name}/.forward %{_bindir}/npConfigValue %dir %{perl_vendorlib}/NOCpulse %{perl_vendorlib}/NOCpulse/* %dir %attr(775, %{package_name},%{webgrp}) %{_var}/log/%{package_name} %dir %attr(-, %{package_name},%{package_name}) %{_var}/lib/%{package_name} %dir %attr(700, %{package_name},%{package_name})%{_var}/lib/%{package_name}/.ssh %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} %doc README.upgrade-rhn example.pl NOCpulse.ini.txt %clean rm -rf $RPM_BUILD_ROOT %changelog * Sun Jan 30 2011 mc@suse.de - do not create nocpulse ssh key during package installation. (bnc#666999) * Tue Jan 25 2011 mc@suse.de - require perl-Crypt-SSLeay for https support (bnc#665896) * Tue Sep 14 2010 mantel@suse.de - Initial release of nocpulse-common