# $Id: ITO.spec,v 1.12 2011/12/19 18:08:56 ksb Exp $ # $KeyFile: ${echo:-echo} peg.pl # $Level2: ${echo:-echo} FXPegMon %define _tmpdir /tmp %define _local_prefix /usr/local %define _local_bindir %{_local_prefix}/sbin %define _local_etcdir %{_local_prefix}/etc %define _local_mandir %{_local_prefix}/man/man1 # for signing of packages #%_signature gpg #%_gpg_name FIXME@example.org # %dist should be defined on the target but in case it isn't we can guess one %define distguess %(cat /etc/{redhat,fedora,suse,ubuntu}-release | sed -e 's/Fedora Core/fc@/; s/Fedora/f@/; s/Red Hat[^0-9]*\(Enterprise|Server\)*[^0-9]*/rhel@/; s/Red Hat[^0-9]*/rh/; s/.*Suse[^0-9]*/se@/; s/Ubuntu[^0-9]*/ubuntu@/; s/@[^0-9]*//;s/\([0-9][0-9]*\)[^0-9][^0-9]*\([0-9][0-9]*\)/\1_\2/; s/[^0-9]*$//') %{!?dist:%define dist .%{distguess}} # Do not generate debugging packages by default - older versions of rpmbuild # (like RehHat 6.2) choke on the line with the percent in the macro name: # We need a sed spell on RH6.x to "s/\(^.define \)%d/\1d/", Sigh. -- ksb %define debug_package %{nil} Name: FXPegMon Version: 1.16 Release: 2%{?dist} BuildRoot: %{_tmpdir}/%{name}-%{version}-%{release} Vendor: NPCGuild.org Summary: NPC tool for starting up peg collectors Group: Applications/System License: BSD URL: http://patch.sac.fedex.com/RPMS Source: http://patch.sac.fedex.com/tarball/%{name}-%{version}.tgz BuildRequires: gcc m4 msrc_base install_base perl # Autoreq:0 prevents misleading depencies from being generated. Normally, this # is perfectly sane; however, the system is picking up mk directives and # mkcmd directives as well as system depencies. Autoreq: 1 Requires: /bin/ksh install_base perl unixstats %description This provides a startup mechanism for peg. peg reads /usr/local/etc/peg.conf, and starts the samplers accordingly. This negates the need for cron to call the samplers. %prep %setup %build umask 022 mkdir -p $RPM_BUILD_ROOT/%{_local_bindir} mkdir -p $RPM_BUILD_ROOT/%{_local_mandir} mkdir -p $RPM_BUILD_ROOT/%{_local_etcdir} mkdir -p $RPM_BUILD_ROOT/etc/init.d F=`mktemp -d /tmp/bmHMXXXXXX` mmsrc -y INTO=$F -Cauto.cf -- make DESTDIR=$RPM_BUILD_ROOT install rm -rf $F find $RPM_BUILD_ROOT -depth -type d -name OLD -exec rm -rf \{\} \; %clean # Do not confilct with the next user of the fixed-path build directory rm -rf %{buildroot} %files %defattr(-,root,root) %{_local_bindir}/peg /etc/init.d/peg %config %{_local_etcdir}/peg.conf %doc %{_local_mandir}/peg.1 %pre getent passwd | grep ^monitor: 2>/dev/null 1>/dev/null || ( echo "User monitor not found ( suggested uid:11521 )" ; false ) getent group | grep ^monitor: 2>/dev/null 1>/dev/null || ( echo "Group monitor not found ( suggested gid:11521 )" ; false ) %post chkconfig --add peg chkconfig peg reset service peg restart %changelog * Mon Dec 19 2011 KS Braunsdorf - updated the dist macro logic to the current standard * Wed Jan 21 2009 EAnderson - Found and fixed a typo in the examples in peg.conf * Wed Dec 10 2008 TSwan - Built the RPM spec file and added it to the msrc cache