File fam.spec of Package fam

#
# spec file for package fam
#
# 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:           fam
License:        LGPLv2.1+
Group:          System/Daemons
%define lname	libfam0
BuildRequires:  gcc-c++
BuildRequires:  help2man
BuildRequires:  libtool
PreReq:         %install_info_prereq
PreReq:         sysvinit(portmap)
PreReq:         sysvinit(syslog)
# bug437293
%ifarch ppc64
Obsoletes:      fam-64bit
%endif
Version:        2.7.0
Release:        150
#
Summary:        File Alteration Monitoring Daemon
Url:            http://oss.sgi.com/projects/fam/
%define fc_version 0.6.5
Source0:        ftp://oss.sgi.com/projects/fam/download/stable/fam-%{version}.tar.gz
Source1:        sysconfig.fam
Source2:        init.fam
Source3:        http://sourceforge.net/projects/fileschanged/files/fileschanged/%{fc_version}/fileschanged-%{fc_version}.tar.gz
Source4:        fam.xinetd
Source5:        baselibs.conf
Patch1:         fam.conf.diff
Patch2:         cleanup.patch
Patch3:         fam-2.6.8-dnotify.patch
Patch5:         fileschanged.diff
Patch8:         fam-h.diff
Patch9:         fam-man.patch
Patch10:        fam-largefile.diff
Patch11:        fam-gcc43.patch
Patch12:        bug-401247_fam_09_fix_leak.patch
Patch13:        fam-gcc44.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Fam is a file alteration monitoring service. With it, you can receive
signals when files are created or changed.

To use fam notifications (it can reduce the network load on NFS
servers, especially if they host user home directories) you need to run
the fam daemon, which can be found in the fam-server package.

%package -n %lname
Summary:        File Alteration Monitoring Library
Group:          System/Libraries

%description -n %lname
Fam is a file alteration monitoring service. With it, you can receive
signals when files are created or changed.

This package provides libfam, which is used by KDE and GNOME. It also
provides a tool for the console called fileschanged.

To use fam notifications (it can reduce the network load on NFS
servers, especially if they host user home directories) you need to run
the fam daemon, which can be found in the fam-server package.

%package devel
Summary:        Include Files and Libraries Mandatory for Development
Group:          Development/Libraries/C and C++
Requires:       %lname = %{version}
Requires:       glibc-devel
Requires:       libstdc++-devel
Provides:       fam:/usr/include/fam.h

%description devel
Fam is a file alteration monitoring service. This means that you can
receive signals if files are created or changed.

This package provides the files that are needed to compile applications
which use the fam service.

%package server
License:        GPLv2+
Summary:        File Alternation Monitoring Daemon
Group:          System/Daemons
PreReq:         %fillup_prereq
PreReq:         %insserv_prereq
Requires:       fam
Requires:       portmap
Provides:       fam:/etc/fam.conf
Provides:       file_alteration

%description server
fam is a file alternation monitoring service. It provides signals when
files are created or changed.

This package provides the fam daemon and runlevel scripts.

%prep
%setup -q -n fam-%{version} -b 3
%patch1
%patch2 -p1
%patch3 -p1
%patch8 -p1
%patch9 -p1
%patch10
%patch11
%patch12 -p1
%patch13 -p1
cd ../fileschanged-%fc_version
%patch5

%build
%{?suse_update_config:%{suse_update_config -f . }}
rm -f configure
autoreconf -i -f
export CFLAGS="%{optflags} -fno-strict-aliasing"
export CXXFLAGS="%{optflags} $CXXFLAGS -fno-strict-aliasing"
%ifnarch hppa
export CFLAGS="$CFLAGS -fstack-protector"
export CXXFLAGS="$CXXFLAGS -fstack-protector"
%endif
%configure
make %{?_smp_mflags}
cd ../fileschanged-%fc_version/
autoreconf -i -f
export LD_LIBRARY_PATH=../../fam-%{version}/lib/.libs:${LD_LIBRARY_PATH+:$LD_LIBRARY_PATH}
export CFLAGS="-I../../fam-%{version}/include/ -L../../fam-%{version}/lib/.libs/ $CFLAGS"
%configure
make %{?_smp_mflags}

%install
%make_install
#
# Install fam init script
mkdir -p %{buildroot}%{_sysconfdir}/init.d
install -m 0744 %{SOURCE2} %{buildroot}%{_initddir}/fam
ln -sf ../../etc/init.d/fam %{buildroot}%{_sbindir}/rcfam
FILLUP_DIR=%{buildroot}%{_localstatedir}/adm/fillup-templates
mkdir -p $FILLUP_DIR
install -m 644 %{SOURCE1} $FILLUP_DIR/sysconfig.fam
install -d -m 755 %{buildroot}%{_sysconfdir}/xinetd.d
install -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/xinetd.d/fam
cd ../fileschanged-%fc_version/
%make_install
cd -
rm -rf %{buildroot}%{_datadir}/fileschanged
mkdir -p %{buildroot}%{_localstatedir}/run
%find_lang fileschanged

%post server
%{fillup_and_insserv -y -n fam fam}

%postun server
%restart_on_update fam
%insserv_cleanup

%preun server
%stop_on_removal fam

%post -n %lname -p /sbin/ldconfig

%postun -n %lname -p /sbin/ldconfig

%post
%install_info --info-dir=%{_infodir} %{_infodir}/fileschanged.info.gz

%postun
%install_info_delete --info-dir=%{_infodir} %{_infodir}/fileschanged.info.gz

%files -f fileschanged.lang
%defattr(-,root,root)
%doc COPYING AUTHORS ChangeLog TODO README NEWS
%{_bindir}/fileschanged
/%{_mandir}/man1/fileschanged.1.gz
/%{_infodir}/fileschanged.info.gz

%files -n %lname
%defattr(-,root,root)
/%{_libdir}/libfam.so.0
/%{_libdir}/libfam.so.0.0.0

%files devel
%defattr(-,root,root)
%{_includedir}/fam.h
/%{_libdir}/libfam.a
/%{_libdir}/libfam.la
/%{_libdir}/libfam.so
/%{_mandir}/man8/famd.8.gz

%files server
%defattr(-,root,root)
%{_sbindir}/rcfam
%{_sbindir}/famd
%config(noreplace) %{_sysconfdir}/fam.conf
%{_sysconfdir}/init.d/fam
/%{_mandir}/man3/fam.3.gz
/%{_mandir}/man5/famd.conf.5.gz
%{_localstatedir}/adm/fillup-templates/sysconfig.fam
%config(noreplace) %{_sysconfdir}/xinetd.d/fam

%changelog
openSUSE Build Service is sponsored by