# $Id: rpm.spec.in,v 1.1.1.1 2003/04/15 04:21:50 michael Exp $ # # DO NOT EDIT rpm.spec - edit rpm.spec.in instead. rpm.spec is generated # from rpm.spec.in by the configure script generated by autoconf. # # Because rpm won't let you do -bb --short-circuit, if you only want to # fiddle with the layout of the installed files in the packages or your # %post & %postun commands, you can do a "make DESTDIR=/tmp/foo install" # in the top-level directory, and cd to build/rpm, and # "make BOGO_RPM_SHORT_CIRCUIT=/tmp/foo rpm". Instead of doing the build # and install phases, it will copy everything from $BOGO_RPM_SHORT_CIRCUIT # to the directory it *would* have installed into, and then assemble the # images. Much faster for development work! # Summary: fam, the File Alteration Monitor %define name @PACKAGE@ %define version @VERSION@ %define release 1 %define fullname %{name}-%{version} %define source %{fullname}.tar.gz Name: %{name} Version: %{version} Release: %{release} Group: System Environment/Daemons Vendor: SGI # Copyright: Copyright © 1999, 2000 Silicon Graphics, Inc., All rights reserved. # License: GPL/LGPL Copyright: GPL/LGPL URL: http://oss.sgi.com/projects/fam/ BuildRoot: %{_topdir}/tmp/fam # If you add a BuildArchitecture, you will also need to add the # corresponding directory to RPM_SUBDIRS in the Makefile, because # rpm doesn't seem to know how to mkdir. BuildArchitectures: i386 Source: %{source} Requires: /usr/sbin/inetd %description fam, the File Alteration Monitor, provides a daemon and an API which applications can use to be notified when specific files or directories are changed. fam works best if your kernel has imon. (Otherwise, it has to poll the filesystem instead of being notified as operations are performed on the files it's monitoring.) See http://oss.sgi.com/projects/fam/ for more information on fam and imon. #Obsoletes: %prep if test "no$BOGO_RPM_SHORT_CIRCUIT" = "no"; then \ rm -rf %{fullname}; \ gzip -dc %{_topdir}/SOURCES/%{source} | tar -xvvf - ; \ cd %{fullname}; \ chmod -Rf a+rX,g-w,o-w . ; \ else \ echo "DANGER %prep SKIPPED BECAUSE \$BOGO_RPM_SHORT_CIRCUIT IS SET!"; \ fi # # Rather than running the configure script read from the source tarball, # this uses the config.status which was used to generate the source tarball. # This way, the commands # ./configure --prefix=/tmp/foo # make rpm # rpm -ivh build/rpm/your_package.rpm # will use your configuration arguments to build the RPM package. # %build if test "no$BOGO_RPM_SHORT_CIRCUIT" = "no"; then \ cd %{fullname}; \ test -f ../../../../../libtool && cp ../../../../../libtool . ; \ cp ../../../../../config.status . ; \ ./config.status; \ make RPM_OPT_FLAGS="$RPM_OPT_FLAGS"; \ else \ echo "DANGER %build SKIPPED BECAUSE \$BOGO_RPM_SHORT_CIRCUIT IS SET!"; \ fi %install if test "no$BOGO_RPM_SHORT_CIRCUIT" = "no"; then \ cd %{fullname}; \ echo "RPM_BUILD_ROOT=$RPM_BUILD_ROOT"; \ make DESTDIR="$RPM_BUILD_ROOT" install; \ else \ echo "DANGER %install SKIPPED BECAUSE \$BOGO_RPM_SHORT_CIRCUIT IS SET!"; \ rm -rf $RPM_BUILD_ROOT; \ mkdir $RPM_BUILD_ROOT; \ cd $BOGO_RPM_SHORT_CIRCUIT; \ tar cBf - . | (cd $RPM_BUILD_ROOT && tar xBf -) ; \ fi %clean # We don't actually do any cleaning here; the top-level Makefile will clean up # our entire %{_topdir}. if test "no$BOGO_RPM_SHORT_CIRCUIT" != "no"; then \ echo "DANGER!!! These packages were built from images installed in" \ "BOGO_RPM_SHORT_CIRCUIT $BOGO_RPM_SHORT_CIRCUIT, not from the" \ "source tarball! Unset BOGO_RPM_SHORT_CIRCUIT to build properly!"; \ fi %post %define editconf perl /usr/local/lib/fam/editconf.perl # This if test "$1" business is to work around RPM running our install & # uninstall scripts in a stupid order during an upgrade. if test "$1" = 1; then echo "Adding /usr/local/lib to ld.so.conf..." %{editconf} ld.so.conf add /usr/local/lib /usr/local/lib echo "Running ldconfig..." ldconfig echo "Adding fam to rpc..." %{editconf} rpc add 391002 "sgi_fam 391002" echo "Adding fam to inetd.conf..." %{editconf} inetd.conf add '\b(fam|FAM)\b' \ "# fam, the File Alteration Monitor, http://oss.sgi.com/projects/fam/" \ "sgi_fam/1-2 stream rpc/tcp wait root /usr/local/bin/fam fam" echo "Restarting inetd..." killall -HUP inetd else echo "Not adding /usr/local/lib to ld.so.conf, since this is an upgrade." echo "Not running ldconfig, since this is an upgrade." echo "Not adding fam to rpc, since this is an upgrade." echo "Not adding fam to inetd.conf, since this is an upgrade." echo "Not restarting inetd, since this is an upgrade." fi # This is preun, rather than postun, so that we can use our script before # it gets removed. %preun # This if test "$1" business is to work around RPM running our install & # uninstall scripts in a stupid order during an upgrade. if test "$1" = 0; then echo "Removing fam from rpc..." %{editconf} rpc remove 391002 echo "Removing fam from inetd.conf..." %{editconf} inetd.conf remove '\b(fam|FAM)\b' echo "Restarting inetd..." killall -HUP inetd else echo "Not removing fam from rpc, since this is an upgrade." echo "Not removing fam from inetd.conf, since this is an upgrade." echo "Not restarting inetd, since this is an upgrade." fi %postun if test "$1" = 0; then echo "Running ldconfig..." ldconfig else echo "Not running ldconfig, since this is an upgrade." fi %triggerpostun -- fam = 2.6.4 echo "" echo "Fixing damage caused by fam-2.6.4's pre-uninstall script being run after" echo "fam-%{version}'s post-install script:" echo " Adding fam to rpc..." %{editconf} rpc add 391002 "sgi_fam 391002" echo " Adding fam to inetd.conf..." %{editconf} inetd.conf add '\b(fam|FAM)\b' \ "# fam, the File Alteration Monitor, http://oss.sgi.com/projects/fam/" \ "sgi_fam/1-2 stream rpc/tcp wait root /usr/local/bin/fam fam" echo " Restarting inetd..." killall -HUP inetd %files %defattr(-,root,root) %doc ChangeLog COPYING INSTALL INSTALL.rpm README TODO /usr/local/bin/fam %config /usr/local/etc/fam.conf # Will all these libtool files exist when someone generates the rpm # on their own system?!? #/usr/local/lib/libfam.so.1 #/usr/local/lib/libfam.a #/usr/local/lib/libfam.so #/usr/local/lib/libfam.la #/usr/local/lib/libfam.so.1.0 # The anwer is no. Grrr!!! Guess we take everything in the directory. # This bites!! /usr/local/lib /usr/local/man/man1/fam.1m /usr/local/man/man3/fam.3x /usr/local/include/fam.h # This is included by /usr/local/lib above? #/usr/local/lib/fam/editconf.perl