# Copyright (C) 2007 Platform Computing Inc # # This program is free software; you can redistribute it and/or modify # it under the terms of version 2 of the GNU General Public License as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA # # # %define subversion 1 Summary: Ntop Component Name: component-ntop-v3_3 Version: 3.3 Release: 11 License: GPLv2 Group: System Environment/Base Vendor: Platform Computing Corporation BuildArchitectures: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root Requires: rrdtool, ntop, shadow-utils Source: component-ntop-v3_3-%{version}.%{subversion}.tar.gz %description This package a meta package for ntop and provides configuration A default ntop password file if one does not already exist. The default password is "admin" (without the quotes). %prep %setup -q -n %{name} %build %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/etc/rc.kusu.d /usr/bin/install -m 644 S15-ntop.rc.py $RPM_BUILD_ROOT/etc/rc.kusu.d %clean rm -rf $RPM_BUILD_ROOT %files /etc/rc.kusu.d/S15-ntop.rc.py* %post if [ -e /var/lock/subsys/kusu-installer ]; then exit 0; fi getent group ntop >/dev/null || groupadd -r ntop -g 453 getent passwd ntop >/dev/null || /usr/sbin/useradd -u 453 -r -g ntop -d /var/lib/ntop -s /sbin/nologin \ -c 'Network traffic probe' ntop if [ -f /etc/rc.kusu.d/S15-ntop.rc.py ]; then echo "Running Kusu RC Script: Ntop" /opt/kusu/bin/kusurc /etc/rc.kusu.d/S15-ntop.rc.py fi if [ ! -f /var/lock/subsys/ntop ]; then /sbin/service ntop start fi chkconfig ntop on > /dev/null 2>&1 %postun # Place any component uninstall code here # Remove CFM symlinks for i in `/opt/kusu/sbin/sqlrunner -q 'SELECT ngname FROM nodegroups WHERE ngid = 1 AND ngid < 5'`; do if [ -d /etc/cfm/$i/opt/ntop ]; then rm -rf /etc/cfm/$i/opt/ntop fi done for i in `/opt/kusu/sbin/sqlrunner -q 'SELECT ngid FROM nodegroups WHERE ngid = 1 AND ngid < 5'`; do if [ -d /opt/kusu/cfm/$i/opt/ntop ]; then rm -rf /opt/kusu/cfm/$i/opt/ntop fi done # Generate scripts for the CFM to remove other packages /bin/cat << 'EOF' >> /opt/kusu/lib/plugins/cfmclient/%{name}.remove #!/bin/sh rpm -e ntop > /dev/null 2>&1 rpm -e rrdtool > /dev/null 2>&1 rm -rf /opt/kusu/lib/plugins/cfmclient/%{name}.remove EOF %changelog * Tue Feb 2 2009 Meng Kuan 3.3-11 - Port to Kit ASK 0.2 * Tue Feb 2 2009 Meng Kuan 3.3-10 - Final release of the old-style kits * Tue Sep 23 2008 Mike Frisch 3.3-7 - Allow package to be built as non-root user * Wed Sep 17 2008 Mike Frisch 3.3-6 - Add dummy Platform SSL certificate (#115584) * Wed May 28 2008 Shawn Starr 3.3-5 - move user/group creation to kit (#109339) * Thu Jan 30 2008 Shawn Starr 3.3-0 - Initial release.