File man-pages-posix.spec of Package man-pages-posix

#
# spec file for package man-pages-posix
#
# 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 http://bugs.opensuse.org/
#


Name:           man-pages-posix
BuildRequires:  fdupes
Url:            http://www.kernel.org/pub/linux/docs/man-pages/man-pages-posix/
Version:        2003a
Release:        0
Summary:        POSIX Manual Pages
License:        SUSE-IEEE
Group:          Documentation/Man
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Source:         https://www.kernel.org/pub/linux/docs/man-pages/%{name}/%{name}-2003-a.tar.bz2
BuildArch:      noarch
#split provides for update from <=11.0
Provides:       man-pages:%{_mandir}/man3p/open.3p.gz

%description
A large collection of man pages (reference material) from the IEEE Std
1003.1, 2003 Edition, Standard for Information Technology -- Portable
Operating System Interface (POSIX), The Open Group Base Specifications
Issue 6, Copyright (C) 2001-2003 by the Institute of Electrical and
Electronics Engineers, Inc and The Open Group. The man pages are 
organized into the following sections: 0p: POSIX headers 1p: POSIX 
utilities 3p: POSIX functions



%prep
%setup -q -n man-pages-posix-2003-a
#find -name "*.orig" | xargs rm -fv

%build

%install
mkdir -p $RPM_BUILD_ROOT%{_mandir}
for i in man?p ; do
  mkdir -p $RPM_BUILD_ROOT%{_mandir}/$i
  cp -p $i/* $RPM_BUILD_ROOT%{_mandir}/$i/
done
cd $RPM_BUILD_ROOT%{_mandir}
RETVAL=0
ARE_MISSING=""
for i in */* ; do
    FOUND=0
    grep "^.so man" $i && FOUND=1
    if [ $FOUND == 1 ] ; then
      if [ ! -f `grep "^.so man" $i | awk '{print $2}'` ]; then
	ARE_MISSING="$i $ARE_MISSING"
        RETVAL=1
      fi
    fi
done
echo ""
echo "The following manual pages are now missing (for .so reference):"
echo $ARE_MISSING
echo ""
if [ $RETVAL -ne 0 ] ; then
  exit $RETVAL
fi
%fdupes -s $RPM_BUILD_ROOT

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(644,root,root,755)
%dir %{_mandir}/man?p
%doc %{_mandir}/man*/*.gz
%doc README
%doc POSIX-COPYRIGHT
%doc man-pages-*.Announce
%doc man-pages-*.lsm
%doc Changes

%changelog
openSUSE Build Service is sponsored by