#
# spec file for package xfsdump
#
# Copyright (c) 2012 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:           xfsdump
#BuildRequires:  e2fsprogs-devel
#BuildRequires:  libattr-devel
#BuildRequires:  ncurses-devel
#BuildRequires:  xfsprogs-devel
Version:        3.1.2
Release:        1.1
Url:            http://oss.sgi.com/projects/xfs/
Summary:        Administrative Utilities for the XFS File System
License:        GPL-2.0+
Group:          System/Filesystems
Source0:        xfsdump-%version.tar.gz
Patch0:         xfsdump-docdir.diff
Patch1:         xfsdump-3.0.1-fix-bufferoverflow.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:	i486
%description                                                         
The xfsdump package contains xfsdump, xfsrestore, and a number of other
utilities for administering XFS file systems.

xfsdump examines files in a file system, determines which files need to
be backed up, and copies those files to a specified disk, tape, or
other storage medium.  It uses XFS-specific directives for optimizing
the dump of an XFS file system and also knows how to backup XFS
extended attributes.  Backups created with xfsdump are "endian safe"
and can thus be transferred between Linux machines of different
architectures and also between IRIX machines.

xfsrestore performs the inverse function of xfsdump.  It can restore a
full backup of a file system.  Subsequent incremental backups can then
be layered on top of the full backup.  Single files and directory
subtrees may be restored from full or partial backups.



Authors:
--------
    SGI

%prep
%setup -q
#%patch0
#%patch1 -p1

%build
export DEBUG=-DNDEBUG
%configure --bindir=%_sbindir \
--enable-gettext 
make %{?_smp_mflags}

%install
export DIST_ROOT="$RPM_BUILD_ROOT"
make install
# Remove the link created by the make file
rm $RPM_BUILD_ROOT/%{_sbindir}/{xfsdump,xfsrestore}
mv $RPM_BUILD_ROOT/sbin/{xfsdump,xfsrestore} $RPM_BUILD_ROOT/%{_sbindir}
#UsrMerge
ln -sf %{_sbindir}/xfsdump $RPM_BUILD_ROOT/sbin
ln -sf %{_sbindir}/xfsrestore $RPM_BUILD_ROOT/sbin
#EndUsrMerge 
%find_lang %name

%files -f %name.lang
%defattr(-,root,root,755)
%{_sbindir}/*
#UsrMerge
/sbin/*
#EndUsrMerge 
%doc %{_defaultdocdir}/%name
%{_mandir}/man8/*



%changelog
* Sat May 26 2012 jengelh@inai.de
- Remove redundant tags/sections from specfile
- Parallel build with %%_smp_mflags
* Thu Mar  1 2012 rschweikert@suse.com
- really place the binaries in /usr (UsrMerge project)
  The configure and Makefiles do not respect the user settings to
  configure for certain binaries. This lead to circular linkage on package
  build and improper linkage on package install.
* Mon Feb  6 2012 rschweikert@suse.com
- use %%configure
* Thu Feb  2 2012 rschweikert@suse.com
- place binaries in /usr tree (UsrMerge project)
* Mon Jun 20 2011 mmarek@novell.com
- updated to 3.0.5
  - Release tags will now be digitally signed
  - Quota files will now be dumped, regardless of the maxsize
    setting
  - The new "-s sessid" flag allows inventory sessions to be pruned
    by their session ID.
  - Fixed a bug in handling long dump filenames, and dropped
    (undocumented) support for encoding certain parameters within
    the dump filename
  - NODECHK is now off by default, meaning xfsrestore will now
    support 16 times more directory entries (4 billion)
  - nrh_t is now 64 bits wide, allowing xfsrestore to support dumps
    with up to 4 billion directory entries
  - nix_t is no longer useful, and has been eliminated
  - Memory use in xfsrestore is better managed now.  Segments of
    nodes are now power-of-2 sized, and allocated nodes are no
    longer needlessly zeroed and linked into the free list.
  - Pathname resolution in xfsrestore has a number of performance
    improvements
  - Better checking has been implemented for compatibility when
    resuming a cumulative restore
  - Build system output has been cleaned up considerably
  - Dead "namreg" code has been removed
  - Build dependencies are now determined automatically
  - Other miscellaneous build system improvements, as well bug
    fixes thanks to Mike Frysinger and Arkadiusz Miśkiewicz.
  - Improve xfsinvutil man page and argument processing.
  - Fix timestamp handling on 64-bit architectures in xfsinvutil.
  - Various build system improvements.
* Mon Feb 22 2010 seife@opensuse.org
- fix buffer overflow (detected by gcc-4.5)
* Tue Jun 23 2009 mmarek@suse.cz
- updated to 3.0.1
  - Bump major package version number to signify changed
    dependencies and moved binaries (xfs_fsr and estimate
    have moved into xfsprogs).
  - xfsdump should no longer make use of internal XFS
    headers and libraries, in particular no use of libxfs
    is permitted in this package anymore (such detailed
    on-disk format knowledge is the realm of xfsprogs).
* Mon Jan 12 2009 mmarek@suse.cz
- fixed xfsdump on ia64 with 64k page size (bnc#450668)
* Tue Jan  6 2009 mmarek@suse.cz
- fixed two pointer comparison errors in librmt (bnc#433393)
* Thu Mar 20 2008 mmarek@suse.cz
- updated to 2.2.48
  * Prune dump sessions with 0 media files even when using -m.
  * Correctly detect whether a tape device is in variable or
    fixed block mode when using the TS tape driver.
* Tue Oct 23 2007 mmarek@suse.cz
- updated to 2.2.46
  * includes last fix
* Fri Aug 31 2007 mmarek@suse.cz
- fixed missing mode arguments to open()
* Fri Jun 22 2007 mmarek@suse.cz
- updated to 2.2.45
  * Change fsr's temp directory mode to 0700 to deny full access.
  * Update fsr's usage text.
  * Fix use of getopt's optopt variable. Thanks to Kouta Ooizumi.
  * Initialize xfsdump's logging facility earlier. Thanks to
    Kouta Ooizumi.
  * Log a message for each quota file restored, not just the first.
  * When using -z, check a file's size against the max dump file
    size just before dumping the file, rather than only during the
    initial scan, to account for changes during the dump.
  * A sync needs to be issued before the first inode scan to avoid
    potentially skipping modified files in an incremental dump.
  * Change the inode scans to seek to the next inode of
    interest, rather than always doing a full scan. Useful
    for dumps that contain only a subset of the inodes
    in a filesystem (incrementals, subtree dumps, etc.).
  * Produce a more accurate dump size estimate when
    it is worthwhile to do so (when using multiple dump
    streams or when skipping files based on size).
- specfile cleanup
* Thu Mar 29 2007 mmarek@suse.de
- added ncurses-devel to BuildRequires (needed for xfsinvutil)
* Fri Oct 20 2006 mjancar@suse.cz
- update to 2.2.42
  * Rework code to remove the DMAPI build and run-time dependency.
  * Fix issues with makedepend on libtool libraries.
  * Fix annoying "ignores datarootdir" warning from configure.
  * Fix issues with makedepend build infrastructure.
  * Fix for parallel compiles, thanks to Robin H. Johnson.
* Thu Jul 27 2006 mjancar@suse.cz
- update to 2.2.38
  * Performance improvements for dumping subtrees.
  * Fix xfs_fsr memory and file descriptor leaks.
  * Fix xfs_fsr handling some of the extended inode flags
  and fields (like project IDs, extsize, realtime, etc).
  * Fix Debian packaging for libc-dev build dependency.
  * Fix up auto lib64 install detection for x86_64 platforms.
  * Use -O2 optimisation by default now like everywhere else.
  * Default to using a single media file for each strategy.
    Multiple media files can be enabled on tape strategies
    by using the -d option.
  * Fix a bug in restoring multiple links to files with the
    immutable bit set.
  * Fix a regression that caused xfsrestore to fail when
    restoring files that were changing during the dump.
  * Remove some overhead in restoring files that were dumped
    in multiple extent groups (> 16 MiB).
  * Add simple interface to HSM-specific code in xfsrestore,
    similar to that already in xfsdump.
  * Fix fsr mishandling directories given as arguments.
  * Fix build dependency on recent xfsprogs header files.
  * Minor man page fixups with respect to hyphenation.
  * Optimizations to increase the performance of xfsdump and
    xfsrestore, especially on filesystems with millions of inodes.
    Many small changes were made to minimize the number of system
    calls required per inode.
  * Significant changes to xfsdump:
    o Cache the gen number of each inode during the initial inode
    scan so that a bulkstat single does not need to be done for
    each inode when dumping directories.
    o No longer retrieve the DMF attribute when estimating the dump
    size of a file. Use information from the bulkstat instead.
    o Retrieve DMF attribute by handle instead of doing
    open/attr_getf/close.
    o In determining where to split multi-stream dumps, take into
    consideration the number of files and not just the file size.
    This allows filesystems with large amounts of inodes but
    relatively little data (DMF filesystem) to be split correctly.
  * Significant changes to xfsrestore:
    o Buffer writes to the namreg file to eliminate 2 very small
    write system calls per directory entry.
    o Buffer writes to dirattr file to eliminate a small write system
    call per directory.
    o Speedup the check to see if a particular window of the tree
    file is mapped. This allows xfsrestore to use more, smaller
    windows which is beneficial if we can't fit them all in memory
    and have to start unmapping them. This also makes the -w
    option obsolete so that option now has no effect.
    o Change the hash function to give a better distribution among
    the hash buckets.
    o Do not make an unnecessary unlink call if the file being
    restored does not already exist.
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Tue Jan 17 2006 mjancar@suse.cz
- update to 2.2.33
* Thu Sep 29 2005 dmueller@suse.de
- add norootforbuild
* Tue Aug  2 2005 mjancar@suse.cz
- update to 2.2.30
* Wed Jun 22 2005 agruen@suse.de
- xfs-restore-lazy-alloc.diff: Fix for ENOSPC errors on write
  (91036).
* Tue Apr  5 2005 mmj@suse.de
- static char *progname -> char *progname
* Mon Feb  7 2005 mjancar@suse.cz
- update to 2.2.25
* Fri Oct  1 2004 mjancar@suse.cz
- link dynamicaly aganist libuuid (#44531)
* Fri Aug 13 2004 mjancar@suse.cz
- update to 2.2.21
* Thu Feb 26 2004 mjancar@suse.cz
- update to 2.2.16
* Fri Aug  8 2003 ja@suse.cz
- Updated to 2.2.13.
- fix ST/TS tape driver compatibility issues in drive_scsitape.
- fix multiple backups to a single tape (TS AND ST).
* Fri Jun 20 2003 ja@suse.cz
- Upgrade to version 2.2.12.
* Tue Apr 29 2003 jderfina@suse.cz
- update to version 2.2.10
- switch from using mktemp to using mkstemp for xfs_copy log.
- use a FHS compliant name for the xfs_copy log file.
- add initial support for TS tape driver.
- fix xfsdump -I option to set correct fsid.
* Wed Feb 12 2003 jderfina@suse.cz
- update to version 2.2.6
- add initial internationalisation support.
- fix build fallout from macro changes in XFS headers.
* Fri Dec 13 2002 jderfina@suse.cz
- upgrade to version 2.2.4
* Thu Oct 10 2002 jderfina@suse.cz
- upgrade to version 2.2.1
* Tue Aug 20 2002 mge@suse.de
- update to 2.1.3
* Sun Apr 21 2002 kukuk@suse.de
- Make compile on architectures with lib64
* Mon Feb 25 2002 ro@suse.de
- update to 2.0.0
* Tue Aug 21 2001 ro@suse.de
- added xfsprogs attr attr-devel to neededforbuild
* Tue Aug 21 2001 adostal@suse.cz
- split xfsdump-1.0.9 from package xfsprogs
- use DESTDIR from %%install (...destdir.patch)
- create  ...dirs.patch