xfs
[Top] [All Lists]

am-utils xfs PATCH

To: linux-xfs@xxxxxxxxxxx
Subject: am-utils xfs PATCH
From: Chris Bednar <cjb@xxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 17 Jul 2001 15:19:23 -0500 (CDT)
Sender: owner-linux-xfs@xxxxxxxxxxx
   Hi

   The following are (1) a patch to am-utils-6.0.5 (a la
RedHat 7.1) to get it to build on a system with XFS installed,
and (2) a spec file for RPM with configure options to go with
the patch.

   This is pretty kludgy, but it does work... it basically just
adds an #include <xfs/libxfs.h> to amd/ops_xfs.c and adds

  --enable-am-cflags="-I/usr/include/xfs -Dxfs_args_t=xfs_da_args_t"

to the configure. It's cheap and dirty, but it works.



----
Chris J. Bednar   <http://optics.tamu.edu/~bednar/>
Director, Distributed Computing Product Group
http://AdvancedDataSolutions.com/

--The patch:-------------------------------

--- am-utils-6.0.5/amd/ops_xfs.c.xfslinux       Sun Jul 15 16:39:52 2001
+++ am-utils-6.0.5/amd/ops_xfs.c        Sun Jul 15 16:40:49 2001
@@ -52,6 +52,11 @@
 #include <am_defs.h>
 #include <amd.h>
 
+/*
+ * Need this for Linux XFS:
+ */
+#include <xfs/libxfs.h>
+
 /* forward declarations */
 static char *xfs_match(am_opts *fo);
 static int xfs_fmount(mntfs *mf);


--The spec:---------------------------------
Summary: Automount utilities including an updated version of Amd.
Name: am-utils
Version: 6.0.5
Release: cjb1
Copyright: BSD
Epoch: 5
Group: System Environment/Daemons
URL: http://am-utils.org/
Source: ftp://ftp.am-utils.org/pub/am-utils/am-utils-%{version}.tar.gz
Source1: am-utils.init
Source2: am-utils.conf
Source3: am-utils.sysconf
Source4: am-utils.net.map
Patch: am-utils-6.0.4-nfs3.patch
Patch100: am-utils-6.0.5-xfslinux.patch
BuildRoot: %{_tmppath}/%{name}-root
BuildPrereq: openldap-devel
Requires: portmap, grep, gawk, findutils
Prereq: /sbin/install-info, /sbin/chkconfig, grep
Obsoletes: amd

%description
Am-utils includes an updated version of Amd, the popular BSD
automounter.  An automounter is a program which maintains a cache 
of mounted filesystems.  Filesystems are mounted when they are 
first referenced by the user and unmounted after a certain period of 
inactivity. Amd supports a variety of filesystems, including NFS, UFS, 
CD-ROMS and local drives.  

You should install am-utils if you need a program for automatically
mounting and unmounting filesystems.

%prep
%setup -q
%patch -p1 -b .nfs3
%patch100 -p1 -b .xfslinux
autoheader
autoconf

%build
%configure --enable-shared --enable-libs="-lnsl -lresolv" --disable-amq-mount 
--enable-am-cflags="-I/usr/include/xfs -Dxfs_args_t=xfs_da_args_t"
make

%install
rm -rf $RPM_BUILD_ROOT
%makeinstall
mkdir -p $RPM_BUILD_ROOT/etc/{sysconfig,rc.d/init.d}
install -m 755 $RPM_SOURCE_DIR/am-utils.sysconf 
$RPM_BUILD_ROOT/etc/sysconfig/amd
install -m 755 $RPM_SOURCE_DIR/am-utils.init $RPM_BUILD_ROOT/etc/rc.d/init.d/amd
strip $RPM_BUILD_ROOT/usr/sbin/* $RPM_BUILD_ROOT/usr/bin/* || :
gzip -q9f $RPM_BUILD_ROOT/%{_infodir}/*info*
mkdir -p $RPM_BUILD_ROOT/.automount
rm -f $RPM_BUILD_ROOT/usr/sbin/ctl-amd

# install the default config and map files
install -m 600 %{SOURCE2} $RPM_BUILD_ROOT/etc/amd.conf
install -m 640 %{SOURCE4} $RPM_BUILD_ROOT/etc/amd.net


%clean
rm -rf $RPM_BUILD_ROOT

%pre
# Check if we have an old fashioned amd.conf and rename if to amd.net
if [ "$1" = "0" ] ; then
    if grep -q "auto_dir" /etc/amd.conf 2>/dev/null ; then
        # this is okay
        exit 0
    else
        # this needs to be renamed. Still, if /etc/amd.net exists, then
        # don't bother renamig it. RPM will handle it better than us here.
        if [ -e /etc/amd.net ] ; then
            exit 0
        else
            mv -f /etc/amd.conf /etc/amd.net
        fi
    fi
fi
exit 0

%post
/sbin/ldconfig
/sbin/chkconfig --add amd
/sbin/install-info %{_infodir}/am-utils.info.gz %{_infodir}/dir

%preun
if [ $1 = 0 ]; then
   /sbin/install-info --delete %{_infodir}/am-utils.info.gz %{_infodir}/dir
   /sbin/service amd stop >/dev/null 2>&1
   /sbin/chkconfig --del amd
fi

%postun
if [ $1 -ge 1 ]; then
    /sbin/service amd condrestart >/dev/null 2>&1
fi
/sbin/ldconfig

%files
%defattr(-,root,root)
%doc doc/*.ps AUTHORS BUGS ChangeLog NEWS README* scripts/*-sample
%dir /.automount
/usr/bin/pawd
/usr/sbin/*
%{_mandir}/man[58]/*
%{_mandir}/man1/pawd.1*
%config(noreplace) /etc/amd.net
%config(noreplace) /etc/amd.conf
%config(noreplace) /etc/sysconfig/amd
%config /etc/rc.d/init.d/amd
%{_infodir}/*info*.gz
/usr/lib/libamu.so.*.*

%changelog
* Sun Jul 15 2001 Chris J Bednar <cjb@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Try to get past XFS. Need to do the following:
-
-  1) -I/usr/include/xfs
-  2) amd/ops_xfs.c : #include <libxfs.h>
-  3) #define xfs_args_t xfs_da_args_t
-  4) Get configure to determine that xfs_args_t.flags exists

* Sat Apr  7 2001 Nalin Dahyabhai <nalin@xxxxxxxxxx>
- update to 6.0.5
- remove /net from the default MOUNTPTS

* Tue Mar 13 2001 Nalin Dahyabhai <nalin@xxxxxxxxxx>
- use MOUNTPTS when starting

* Fri Mar  2 2001 Nalin Dahyabhai <nalin@xxxxxxxxxx>
- rebuild in new environment

* Wed Feb 14 2001 Nalin Dahyabhai <nalin@xxxxxxxxxx>
- redo i18n for the init script

* Tue Jan 23 2001 Nalin Dahyabhai <nalin@xxxxxxxxxx>
- re-do workaround from advice from the am-utils maintainers
- redo i18n for the init script

* Sat Jan 20 2001 Nalin Dahyabhai <nalin@xxxxxxxxxx>
- work around clash with nfs3_fh definition in 2.4

* Tue Jan 16 2001 Nalin Dahyabhai <nalin@xxxxxxxxxx>
- gettextize the init script (#24087)

* Tue Dec 19 2000 Nalin Dahyabhai <nalin@xxxxxxxxxx>
- add ldconfig to %%postun
- chuck the hesiod patch -- new bind-utils doesn't have the support for it

* Fri Sep  8 2000 Nalin Dahyabhai <nalin@xxxxxxxxxx>
- rebuild in new environment

* Sat Jul 15 2000 Bill Nottingham <notting@xxxxxxxxxx>
- move initscript back

* Wed Jul 12 2000 Prospector <bugzilla@xxxxxxxxxx>
- automatic rebuild

* Thu Jul  6 2000 Nalin Dahyabhai <nalin@xxxxxxxxxx>
- only create /var/lock/subsys/amd if startup succeeds
- revamp shutdown procedure to minimize time spent just spinning
- change initscripts dependency to /etc/init.d

* Tue Jul  4 2000 Florian La Roche <Florian.LaRoche@xxxxxxxxxx>
- delete noreplace from initscript

* Wed Jun 28 2000 Nalin Dahyabhai <nalin@xxxxxxxxxx>
- fix postun script
- add requires: initscripts

* Tue Jun 27 2000 Nalin Dahyabhai <nalin@xxxxxxxxxx>
- remove unnecessary libamu.so symlink

* Mon Jun 26 2000 Nalin Dahyabhai <nalin@xxxxxxxxxx>
- move init script to /etc/init.d
- add URL: tag

* Wed Jun 21 2000 Preston Brown <pbrown@xxxxxxxxxx>
- noreplace config files
- gracefully stop/restart service

* Fri Jun 16 2000 Matt Wilson <msw@xxxxxxxxxx>
- FHS paths
- 6.0.4 snapshot (as it builds against kernel 2.4 headers)

* Wed Feb 16 2000 Cristian Gafton <gafton@xxxxxxxxxx>
- version 6.0.3
- enhance init script to be more wait4amd2die-like
- make default map type to be file (#9185)
- get rid of the kludges

* Thu Feb 03 2000 Cristian Gafton <gafton@xxxxxxxxxx>
- man pages are compressed
- version 6.0.2
- fix descriptions

* Mon Sep 13 1999 Cristian Gafton <gafton@xxxxxxxxxx>
- version 6.0.1 final

* Tue Aug 24 1999 Cristian Gafton <gafton@xxxxxxxxxx>
- remove the noldap patch
- add amd.net file as the default config map file
- change the config file to teh new config file format instead of a
  simple map file name.
- try to avoid some damage with a new %pre script
- prereq grep now
- modify the init file so it calls amd -F /etc/amd.conf now

* Tue Aug 24 1999 Bill Nottingham <notting@xxxxxxxxxx>
- update to 6.0.1s11

* Fri Jun 19 1999 Bill Nottingham <notting@xxxxxxxxxx>
- don't run by default

* Mon May 31 1999 Kenneth Skaar <kenneths@xxxxxxxxxxxxx>
- Fixed amd -F core dump and related dumps by other programs 

* Thu Apr 08 1999 Preston Brown <pbrown@xxxxxxxxxx>
- kill -HUP on reload, restart does a real restart.

* Fri Mar 26 1999 Bill Nottingham <notting@xxxxxxxxxx>
- twiddle an echo in initscript

* Tue Mar 23 1999 Cristian Gafton <gafton@xxxxxxxxxx>
- version 6.0 proper
- Serial:1 because to enforce versioning

* Sun Mar 21 1999 Cristian Gafton <gafton@xxxxxxxxxx> 
- auto rebuild in the new build environment (release 6)

* Wed Jan 06 1999 Cristian Gafton <gafton@xxxxxxxxxx>
- rebuild for glibc 2.1
- strip all binaries

* Thu Aug 13 1998 Jeff Johnson <jbj@xxxxxxxxxx>
- add missing ':' to default 'opts:=nosuid,nodev'
- install info pages

* Mon Jul 13 1998 Cristian Gafton <gafton@xxxxxxxxxx>
- added the NIS support that the broken configure script failed to detect

* Tue May 05 1998 Cristian Gafton <gafton@xxxxxxxxxx>
- disabled autofs support on alpha
- run ldconfig in postinstall

* Mon May 04 1998 Cristian Gafton <gafton@xxxxxxxxxx>
- new package to replace the old and unmaintained amd



<Prev in Thread] Current Thread [Next in Thread>