File attr.spec of Package attr

# spec file for package attr
# Copyright (c) 2013 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

Name:           attr
%define lname	libattr1
Summary:        Commands for Manipulating Extended Attributes
License:        GPL-2.0+ and LGPL-2.1+
Group:          System/Filesystems
Version:        2.4.47
Release:        0

#Git-Clone:	git://
Source3:        %name.keyring
Source4:        xattr.conf
Source5:        baselibs.conf
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
#BuildRequires:  gpg-offline
Conflicts:      xfsdump < 2.0.0

A set of tools for manipulating extended attributes on file system
objects, in particular getfattr(1) and setfattr(1). An attr(1) command
is also provided, which is largely compatible with the SGI IRIX tool of
the same name.

%package -n %lname
Summary:        A dynamic library for filesystem extended attribute support
Group:          System/Libraries
# bug437293
%ifarch ppc64
Obsoletes:      libattr-64bit
# Added for 12.1
Obsoletes:      libattr < %version-%release
Provides:       libattr = %version-%release

%description -n %lname
This package contains the dynamic library, which contains
the extended attribute library functions.

%package -n libattr-devel
Summary:        Include Files and Libraries mandatory for Development
Group:          Development/Libraries/C and C++
Provides:       attr-devel = %version-%release
Obsoletes:      attr-devel < %version-%release
# bug437293
%ifarch ppc64
Obsoletes:      libattr-devel-64bit
Requires:       %lname = %version
Requires:       glibc-devel

%description -n libattr-devel
This package contains the libraries and header files needed to develop
programs which make use of extended attributes. For Linux programs, the
documented system call API is the recommended interface, but an SGI
IRIX compatibility interface is also provided.

%package -n libattr-devel-static
Summary:        Include Files and Libraries mandatory for Development
Group:          Development/Libraries/C and C++
Provides:       libattr-devel:%{_libdir}/libattr.a
Requires:       libattr-devel = %version

%description -n libattr-devel-static
This package contains the static library of libattr which is needed to develop
statically linked programs which make use of extended attributes.

%setup -q

%configure --with-pic --enable-static
%{__make} %{?_smp_mflags}

make install install-lib install-dev DESTDIR="$b" PKG_DOC_DIR="%_docdir/%name"

mkdir -p "$b/%_lib/"
mv "$b/%_libdir"/* "$b/%_lib/"
t=$(readlink "$b/%_libdir/")
ln -sf "/%_lib/$t" "$b/%_libdir/"
rm -f "$b/%_libdir"/*.la
rm -fv $RPM_BUILD_ROOT%{_mandir}/man2/*xattr.2*
install -d -m 755 $RPM_BUILD_ROOT/%{_sysconfdir}
install -m 644 %_sourcedir/xattr.conf $RPM_BUILD_ROOT/%{_sysconfdir}
%find_lang %name

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

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

%files -f %{name}.lang
%defattr (-,root,root)
%dir %attr(755,root,root) /usr/share/doc/packages/attr
%doc %attr(644,root,root) /usr/share/doc/packages/attr/README
%doc %attr(644,root,root) /usr/share/doc/packages/attr/CHANGES.gz
%doc %attr(644,root,root) /usr/share/doc/packages/attr/COPYING
%doc %attr(644,root,root) /usr/share/doc/packages/attr/PORTING
%doc %attr(644,root,root) %{_mandir}/man1/attr.1.gz
%doc %attr(644,root,root) %{_mandir}/man1/getfattr.1.gz
%doc %attr(644,root,root) %{_mandir}/man1/setfattr.1.gz
%doc %attr(644,root,root) %{_mandir}/man5/attr.5.gz
%attr(755,root,root) %{_bindir}/attr
%attr(755,root,root) %{_bindir}/getfattr
%attr(755,root,root) %{_bindir}/setfattr

%files -n libattr-devel
%dir %attr(755,root,root) %{_includedir}/attr
%attr(644,root,root) %{_includedir}/attr/attributes.h
%attr(644,root,root) %{_includedir}/attr/error_context.h
%attr(644,root,root) %{_includedir}/attr/libattr.h
%attr(644,root,root) %{_includedir}/attr/xattr.h
%attr(755,root,root) %{_libdir}/
%doc %attr(644,root,root) %{_mandir}/man3/attr_get.3.gz*
%doc %attr(644,root,root) %{_mandir}/man3/attr_list.3.gz*
%doc %attr(644,root,root) %{_mandir}/man3/attr_multi.3.gz*
%doc %attr(644,root,root) %{_mandir}/man3/attr_remove.3.gz*
%doc %attr(644,root,root) %{_mandir}/man3/attr_set.3.gz*
%doc %attr(644,root,root) %{_mandir}/man3/attr_getf.3.gz*
%doc %attr(644,root,root) %{_mandir}/man3/attr_listf.3.gz*
%doc %attr(644,root,root) %{_mandir}/man3/attr_multif.3.gz*
%doc %attr(644,root,root) %{_mandir}/man3/attr_removef.3.gz*
%doc %attr(644,root,root) %{_mandir}/man3/attr_setf.3.gz*

%files -n libattr-devel-static

%files -n %lname
%defattr (-,root,root)
%config %{_sysconfdir}/xattr.conf
%dir %attr(755,root,root) /usr/share/doc/packages/attr
%doc %attr(644,root,root) /usr/share/doc/packages/attr/COPYING.LGPL