Tony Earnshaw wrote:

/var/tmp/fam-2.7.0-2-root/usr/lib64 ~/rpm/BUILD/fam-2.7.0
+ ln -s libfam.0.0.0 libfam.so.0
ln: `libfam.so.0': File exists
error: Bad exit status from /var/tmp/rpm-tmp.30176 (%install)

Comment out line 65, "ln -s libfam.0.0.0 libfam.so.0" and try again. It will work.

Attached is a modified spec file that looks to see if there's already a link and if there is, it doesn't try to make it. I developed on RHAS4 and needed to hand make the link, I then built again on RHAS3 and found what Jonathan found - the hand-made link is superfluous. The attached spec also corrects a false .la link that doesn't affect famd, but could affect other stuff.

--Tonni

--
Tony Earnshaw
Email: [EMAIL PROTECTED]
Summary:   fam 2.7.0
Name:      fam
Version:   2.7.0
Release:   2
Packager: Tony Earnshaw <[EMAIL PROTECTED]>
Vendor: Translucent Systems BV
License: SGI OSS
Group: Network System Environment/Daemons
Provides: fam
Requires: gcc, autoconf, automake, rpm >= 4
Source: http://oss.sgi.com/projects/fam/download/fam-latest.tar.gz
Patch1: fam-2.7.0-dnotify-1.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root

%description
fam is a server that tracks changes to the filesystem and relays these
changes to interested applications.  Applications such as fm(1G) and
mailbox(1) present an up-to-date view of the filesystem.  In the absence
of fam, these applications and others like them are forced to poll the
filesystem to detect changes.  fam is more efficient.

%define _man_dir %{_prefix}/man
%define _sh_man_dir %{_prefix}/share/man
%define _doc_dir %{_prefix}/share/doc/%{name}-base-%{version}

%package base
Summary: Base fam daemon, conf and documentation
Group: Network System Environment/Daemons
%description base
fam is a server that tracks changes to the filesystem and relays these
changes to interested applications.  Applications such as fm(1G) and
mailbox(1) present an up-to-date view of the filesystem.  In the absence
of fam, these applications and others like them are forced to poll the
filesystem to detect changes.  fam is more efficient.

%package devel
Summary: Development header and docs for fam
Group: Network System Environment/Daemons
Requires: base
%description devel
Development header and docs for the SGI fam daemon

%prep
%setup -q
%patch1 -p1 -b .orig
%build
set -x
umask 022

chmod a+w configure

CXXFLAGS="-Wno-deprecated" \
./configure \
        --prefix=/
make

%install
rm -fr $RPM_BUILD_ROOT
%makeinstall
%{__mkdir_p} 
$RPM_BUILD_ROOT{%_sysconfdir,%_sbindir,%_includedir,%_libdir,%_man_dir/man3,%_man_dir/man5,%_man_dir/man8}
%{__install} -m 644 $RPM_BUILD_DIR/%{name}-%{version}/conf/fam.conf 
$RPM_BUILD_ROOT%{_sysconfdir}
%{__install} -m 644 $RPM_BUILD_DIR/%{name}-%{version}/include/fam.h 
$RPM_BUILD_ROOT%{_includedir}
cp -pr $RPM_BUILD_DIR/%{name}-%{version}/lib/.libs/* $RPM_BUILD_ROOT%{_libdir}
rm $RPM_BUILD_ROOT%{_libdir}/libfam.la
cp -p $RPM_BUILD_DIR/%{name}-%{version}/lib/libfam.la $RPM_BUILD_ROOT%{_libdir}
if [ ! -h $RPM_BUILD_ROOT/%{_libdir}/libfam.so.0 ]; then
  pushd $RPM_BUILD_ROOT%{_libdir}
    ln -s libfam.0.0.0 libfam.so.0
  popd
fi
%{__install} -m 644 $RPM_BUILD_DIR/%{name}-%{version}/man/*.3 
$RPM_BUILD_ROOT%_man_dir/man3
%{__install} -m 644 $RPM_BUILD_DIR/%{name}-%{version}/man/*.5 
$RPM_BUILD_ROOT%_man_dir/man5
%{__install} -m 644 $RPM_BUILD_DIR/%{name}-%{version}/man/*.8 
$RPM_BUILD_ROOT%_man_dir/man8
%{__install} -m 755 $RPM_BUILD_DIR/%{name}-%{version}/src/famd 
$RPM_BUILD_ROOT%{_sbindir}

cat $RPM_BUILD_ROOT%_man_dir/man5/famd.conf.5 | sed -s 
's|\/usr\/local\/etc|\/etc|' > /var/tmp/famd.conf.5; mv /var/tmp/famd.conf.5 
$RPM_BUILD_ROOT%_man_dir/man5
cat $RPM_BUILD_ROOT%_man_dir/man8/famd.8 | sed -s 's|\/usr\/local\/etc|\/etc|' 
> /var/tmp/famd.8; mv /var/tmp/famd.8 $RPM_BUILD_ROOT%_man_dir/man8


%files base
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING INSTALL NEWS README TODO
%{_sbindir}/famd
%{_libdir}/*
%{_sysconfdir}/fam.conf
%_man_dir/man5/*
%_man_dir/man8/*
%_sh_man_dir/man5/*
%_sh_man_dir/man8/*

%files devel
%defattr(-,root,root)
%{_includedir}/fam.h
%_man_dir/man3/*
%_sh_man_dir/man3/*

%post base
ldconfig
cat <<EOF>>%{_doc_dir}/INSTALL

---------------------------------

The default way of running famd is by using xinetd. To enable this, cd
/etc/xinetd.d and edit fam. Replace "disable = yes" with "disable = no"
and 'kill -HUP \`cat /var/run/xinetd.pid\`'

If you'd rather that famd runs as a standalone daemon, start it by doing
'/usr/sbin/famd -T 0 &' (that's -T null). To enable famd on system startup,
instead (you obviously can't have both) you'll have to have a script in
/etc/rc.d/init.d that does this. An example, /etc/rc.d/init.d/famd, that
does this might look like:

#!/bin/sh
#
# This is a sample /etc/init.d file for famd
#
# chkconfig: 2345 80 30
# description: famd server
#
#

. /etc/init.d/functions

case "\$1" in
start)
        daemon /usr/sbin/famd -T 0 &
        echo"";echo -n "Starting famd daemon";echo""
;;

stop)
        # Stop famd
        echo"";echo "Stopping famd daemon"
        daemon kill \`cat /var/run/famd.pid\`
        ;;


restart)
        \$0 stop
        \$0 start
        ;;
esac
exit 0

Do 'chkconfig famd on' and start and stop it with
'service famd start|stop|restart' 
EOF

if ! grep fam /etc/rpc > /dev/null 2>&1; then
  echo "fam         391002  famd             # File Alteration Monitor" >> 
/etc/rpc
  fi
                                                                                
                   
if [ ! -f "/etc/xinetd.d/fam" ]; then
  cat << EOF > /etc/xinetd.d/fam
{
  type            = RPC UNLISTED
  socket_type     = stream
  user            = root
  group           = nobody
  server          = /usr/sbin/famd
  wait            = yes
  protocol        = tcp
  rpc_version     = 2
  rpc_number      = 391002
  disable         = yes
}
EOF
fi

#%clean
#rm -rf $RPM_BUILD_ROOT %{_tmppath}/rpm-tmp*

%changelog
* Thu Dec 29 2005 Tony Earnshaw <[EMAIL PROTECTED]>
- fam-2.7.0-dnotify-1.patch, thanks Jonathan Chong <[EMAIL PROTECTED]>
  and of course Jim Gifford (jim at linuxfromscratch dot org), whose patch it is
* Thu Jun 23 2005 Tony Earnshaw <[EMAIL PROTECTED]> 2.7.0-1
- Initial package

Reply via email to