File os-prober.spec of Package os-prober

Name:           os-prober
Version:        1.49
Release:        1
Summary:        Probes disks on the system for installed operating systems

Group:          System Environment/Base
License:        GPL+
URL:            http://kitenet.net/~joey/code/os-prober/
Source0:        http://ftp.de.debian.org/debian/pool/main/o/os-prober/%{name}_%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# move newns binary outside of os-prober subdirectory, so that debuginfo
# can be automatically generated for it
Patch0:         os-prober-newnsdirfix.patch

Requires:       dmraid lvm2 udev coreutils util-linux
Requires:       /bin/grep /bin/sed /sbin/modprobe

%define libexecdir   %{_libexecdir}
%if 0%{?mandriva_version}
%ifarch x86_64
%define libexecdir   %{_prefix}/lib
%endif
%endif

%description
This package detects other OSes available on a system and outputs the results
in a generic machine-readable format. Support for new OSes and Linux
distributions can be added easily. 

%prep
%setup -q -n %{name}
%patch0 -p1 -b .newnsdirfix

%build
%{__make} %{?_smp_mflags} CFLAGS="%{optflags}"

%if 0%{?rhel_version} || 0%{?fedora_version} || 0%{?centos_version}
find -type f -exec sed -i -e 's|usr/lib|usr/libexec|g' {} \;
%endif

%install
install -m 0755 -d %{buildroot}%{_bindir}
install -m 0755 -d %{buildroot}%{_var}/lib/%{name}

install -m 0755 -p os-prober linux-boot-prober %{buildroot}%{_bindir}
install -m 0755 -Dp newns %{buildroot}%{libexecdir}/newns
install -m 0644 -Dp common.sh %{buildroot}%{_datadir}/%{name}/common.sh

%ifarch m68k
ARCH=m68k
%endif
%ifarch ppc ppc64
ARCH=powerpc
%endif
%ifarch sparc sparc64
ARCH=sparc
%endif
%ifarch %{ix86} x86_64
ARCH=x86
%endif

for probes in os-probes os-probes/mounted os-probes/init \
              linux-boot-probes linux-boot-probes/mounted; do
        install -m 755 -d %{buildroot}%{libexecdir}/$probes 
        cp -a $probes/common/* %{buildroot}%{libexecdir}/$probes
        if [ -e "$probes/$ARCH" ]; then 
                cp -a $probes/$ARCH/* %{buildroot}%{libexecdir}/$probes 
        fi
done
if [ "$ARCH" = x86 ]; then
        install -m 755 -p os-probes/mounted/powerpc/20macosx \
            %{buildroot}%{libexecdir}/os-probes/mounted
fi

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%doc README TODO debian/copyright debian/changelog
%{_bindir}/*
%{libexecdir}/*
%{_datadir}/%{name}
%{_var}/lib/%{name}

%changelog
* Mon Dec 12 2011 Agnelo de la Crotche <agnelo@unixversal.com> - 1.49
- Updated to 1.49 release

* Fri Oct 7 2011 Agnelo de la Crotche <agnelo@unixversal.com> - 1.48-2
- ported to openSUSE and Mandriva

* Mon Jul 25 2011 Hedayat Vatankhah <hedayat.fwd+rpmchlog@gmail.com> - 1.48-1
- Updated to 1.48 release

* Thu May 19 2011 Hedayat Vatankhah <hedayat.fwd+rpmchlog@gmail.com> - 1.47-1
- Updated to the new upstream version 1.47

* Wed May 04 2011 Hedayat Vatankhah <hedayat.fwd+rpmchlog@gmail.com> - 1.46-2
- Removed obsolete parts (build tag, defattr, etc)
- Added a patch to move newns outside of os-prober subdirectory
- Added required utilities as package requires

* Sat Apr 30 2011 Hedayat Vatankhah <hedayat.fwd+rpmchlog@gmail.com> - 1.46-1
- Updated to 1.46 release

* Tue Feb 22 2011 Hedayat Vatankhah <hedayat.fwd+rpmchlog@gmail.com> - 1.42-2
- Remove executable permission from common.sh

* Thu Feb 17 2011 Hedayat Vatankhah <hedayat.fwd+rpmchlog@gmail.com> - 1.42-1
- Initial version
openSUSE Build Service is sponsored by