From f5e23cd58ff35f1e23d58481fd7e8adce21cc16c Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Mar 10 2010 14:10:29 +0000 Subject: - run the test-suite if possible --- diff --git a/attr-2.4.44-tests.patch b/attr-2.4.44-tests.patch new file mode 100644 index 0000000..a856cf2 --- /dev/null +++ b/attr-2.4.44-tests.patch @@ -0,0 +1,22 @@ +diff --git a/test/attr.test b/test/attr.test +index d394562..e8f134c 100644 +--- a/test/attr.test ++++ b/test/attr.test +@@ -264,7 +264,7 @@ Tests for proper path recursion reported by Tony Ernst bnc#457660 + $ setfattr -n "user.9" 1/2/3 + $ setfattr -n "user.a" 1/2/3 + +- $ getfattr -h -L -R -m '.' -e hex 1 | ./sort-getfattr-output ++ $ getfattr -h -L -R -m '.' -e hex 1 | grep -v ^security\\.selinux | ./sort-getfattr-output + > # file: 1 + > user.9 + > user.a +@@ -278,7 +278,7 @@ Tests for proper path recursion reported by Tony Ernst bnc#457660 + > user.a + > + +- $ getfattr -h -P -R -m '.' -e hex 1/2 | ./sort-getfattr-output ++ $ getfattr -h -P -R -m '.' -e hex 1/2 | grep -v ^security\\.selinux | ./sort-getfattr-output + > # file: 1/2 + > user.9 + > user.a diff --git a/attr.spec b/attr.spec index 4ed7b2c..8b068b4 100644 --- a/attr.spec +++ b/attr.spec @@ -1,12 +1,23 @@ Summary: Utilities for managing filesystem extended attributes Name: attr Version: 2.4.44 -Release: 3%{?dist} +Release: 4%{?dist} Conflicts: xfsdump < 2.0.0 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Source: http://download.savannah.gnu.org/releases-noredirect/attr/attr-%{version}.src.tar.gz -Patch2: attr-2.4.32-build.patch -Patch3: attr-2.4.43-leak.patch + +# a file available in the upstream git repo, but not in the release +Source2: sort-getfattr-output + +# make it ready for rpmbuild +Patch1: attr-2.4.32-build.patch + +# bz #485473 +Patch2: attr-2.4.43-leak.patch + +# prepare the test-suite for SELinux +Patch3: attr-2.4.44-tests.patch + License: GPLv2+ URL: http://oss.sgi.com/projects/xfs/ Group: System Environment/Base @@ -51,18 +62,31 @@ you'll also want to install attr. %prep %setup -q - -# make it ready for rpmbuild +%patch1 -p1 %patch2 -p1 - -# applied upstream %patch3 -p1 +# test-suite helper script +install -m0755 %{SOURCE2} test/ + %build # attr abuses libexecdir %configure --libdir=/%{_lib} --libexecdir=%{_libdir} make %{?_smp_mflags} LIBTOOL="libtool --tag=CC" +%check +if ./setfattr/setfattr -n user.name -v value .; then + make tests || exit $? + + # FIXME: root-tests are not ready for the SELinux + #if test 0 = `id -u`; then + # make root-tests || exit $? + #fi +else + echo '*** xattrs are probably not supported by the file system,' \ + 'the test-suite will NOT run ***' +fi + %install rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT @@ -113,6 +137,9 @@ rm -rf $RPM_BUILD_ROOT /%{_lib}/libattr.so.* %changelog +* Wed Mar 10 2010 Kamil Dudka 2.2.44-4 +- run the test-suite if possible + * Tue Jan 19 2010 Kamil Dudka 2.2.44-3 - do not package a static library (#556038) - remove multilib patch no longer useful diff --git a/sort-getfattr-output b/sort-getfattr-output new file mode 100755 index 0000000..9901ed3 --- /dev/null +++ b/sort-getfattr-output @@ -0,0 +1,4 @@ +#! /usr/bin/perl -w + +undef $/; +print join("\n\n", sort split(/\n\n/, <>)), "\n\n";