2e96e6
Name:           os-prober
2e96e6
Version:        1.58
2e96e6
Release:        9%{?dist}
2e96e6
Summary:        Probes disks on the system for installed operating systems
2e96e6
2e96e6
Group:          System Environment/Base
2e96e6
# For more information about licensing, see copyright file.
2e96e6
License:        GPLv2+ and GPL+
2e96e6
URL:            http://kitenet.net/~joey/code/os-prober/
2e96e6
Source0:        http://ftp.de.debian.org/debian/pool/main/o/os-prober/%{name}_%{version}.tar.gz
2e96e6
# move newns binary outside of os-prober subdirectory, so that debuginfo
2e96e6
# can be automatically generated for it
2e96e6
Patch0001: 0001-Change-filepath-to-newns.patch
2e96e6
Patch0002: 0002-Don-t-count-dummy-mach_kernel-as-MacOS-X-811412.patch
2e96e6
Patch0003: 0003-Detect-OS-installed-to-mdraid-partition-752402.patch
2e96e6
Patch0004: 0004-Yaboot-allows-spaces-in-append-825041.patch
2e96e6
Patch0005: 0005-Detect-ld.so-after-usr-move-826754.patch
2e96e6
Patch0006: 0006-Use-shell-processing-instead-of-basename-875356.patch
2e96e6
Patch0007: 0007-Add-option-for-less-logging-893997.patch
2e96e6
Patch0008: 0008-Improve-btrfs-detection-support-888341.patch
2e96e6
Patch0009: 0009-Support-detection-on-btrfs-software-raid-906847.patch
2e96e6
Patch0010: 0010-Name-lvm-boot-partitions-by-fstab-entry-893472.patch
2e96e6
Patch0011: 0011-Set-correct-boot-partition-906886.patch
2e96e6
Patch0012: 0012-Factor-out-unnecessary-logger-calls-875356.patch
2e96e6
Patch0013: 0013-Issue-with-EFI-detection-in-logger-873207.patch
2e96e6
Patch0014: 0014-Man-pages-missing-948848.patch
2e96e6
Patch0015: 0015-Properly-handle-extended-dos-partitions-1322957.patch
2e96e6
Patch0016: 0016-Windows-detection-requires-binary-grep-1322956.patch
2e96e6
Patch0017: 0017-Add-Windows-10-detection-support-1322956.patch
2e96e6
Patch0018: 0018-Suppress-non-blocking-dmraid-error-info-1198918.patch
2e96e6
Patch0019: 0019-Do-not-resolve-device-mapper-symlinks-1300262.patch
2e96e6
Patch0020: 0020-Use-POSIX-shell-syntax-1300262.patch
2e96e6
Patch0021: 0021-Fix-extended-dos-partition-regex-1322957.patch
2e96e6
2e96e6
Requires:       udev coreutils util-linux
2e96e6
Requires:       grep /bin/sed /sbin/modprobe
2e96e6
2e96e6
%description
2e96e6
This package detects other OSes available on a system and outputs the results
2e96e6
in a generic machine-readable format. Support for new OSes and Linux
2e96e6
distributions can be added easily. 
2e96e6
2e96e6
%prep
2e96e6
%setup -q
2e96e6
%patch01 -p1
2e96e6
%patch02 -p1
2e96e6
%patch03 -p1
2e96e6
%patch04 -p1
2e96e6
%patch05 -p1
2e96e6
%patch06 -p1
2e96e6
%patch07 -p1
2e96e6
%patch08 -p1
2e96e6
%patch09 -p1
2e96e6
%patch10 -p1
2e96e6
%patch11 -p1
2e96e6
%patch12 -p1
2e96e6
%patch13 -p1
2e96e6
%patch14 -p1
2e96e6
%patch15 -p1
2e96e6
%patch16 -p1
2e96e6
%patch17 -p1
2e96e6
%patch18 -p1
2e96e6
%patch19 -p1
2e96e6
%patch20 -p1
2e96e6
%patch21 -p1
2e96e6
2e96e6
find -type f -exec sed -i -e 's|usr/lib|usr/libexec|g' {} \;
2e96e6
sed -i -e 's|grub-probe|grub2-probe|g' os-probes/common/50mounted-tests \
2e96e6
     linux-boot-probes/common/50mounted-tests
2e96e6
2e96e6
%build
2e96e6
make %{?_smp_mflags} CFLAGS="%{optflags}"
2e96e6
2e96e6
%install
2e96e6
install -m 0755 -d %{buildroot}%{_bindir}
2e96e6
install -m 0755 -d %{buildroot}%{_var}/lib/%{name}
2e96e6
install -d 0755 -d %{buildroot}%{_mandir}/man1/
2e96e6
2e96e6
install -m 0755 -p os-prober linux-boot-prober %{buildroot}%{_bindir}
2e96e6
install -m 0755 -Dp newns %{buildroot}%{_libexecdir}/newns
2e96e6
install -m 0644 -Dp common.sh %{buildroot}%{_datadir}/%{name}/common.sh
2e96e6
install -m 0644 -Dp *.1 %{buildroot}%{_mandir}/man1/
2e96e6
2e96e6
%ifarch m68k
2e96e6
ARCH=m68k
2e96e6
%endif
2e96e6
%ifarch ppc ppc64
2e96e6
ARCH=powerpc
2e96e6
%endif
2e96e6
%ifarch sparc sparc64
2e96e6
ARCH=sparc
2e96e6
%endif
2e96e6
%ifarch %{ix86} x86_64
2e96e6
ARCH=x86
2e96e6
%endif
2e96e6
2e96e6
for probes in os-probes os-probes/mounted os-probes/init \
2e96e6
              linux-boot-probes linux-boot-probes/mounted; do
2e96e6
        install -m 755 -d %{buildroot}%{_libexecdir}/$probes 
2e96e6
        cp -a $probes/common/* %{buildroot}%{_libexecdir}/$probes
2e96e6
        if [ -e "$probes/$ARCH" ]; then 
2e96e6
                cp -a $probes/$ARCH/* %{buildroot}%{_libexecdir}/$probes 
2e96e6
        fi
2e96e6
done
2e96e6
if [ "$ARCH" = x86 ]; then
2e96e6
        install -m 755 -p os-probes/mounted/powerpc/20macosx \
2e96e6
            %{buildroot}%{_libexecdir}/os-probes/mounted
2e96e6
fi
2e96e6
2e96e6
%files
2e96e6
%doc README TODO debian/copyright debian/changelog
2e96e6
%{_bindir}/*
2e96e6
%{_datadir}/%{name}
2e96e6
%{_libexecdir}/*
2e96e6
%{_mandir}/man1/*
2e96e6
%{_var}/lib/%{name}
2e96e6
2e96e6
%changelog
2e96e6
* Wed Sep 14 2016 rmarshall@redhat.com - 1.58-9
2e96e6
- Fix regular expression that missed a corner case when detecting
2e96e6
  extended dos partitions.
2e96e6
  Resolves: rhbz#1322957
2e96e6
2e96e6
* Wed Jul 06 2016 rmarshall@redhat.com - 1.58-8
2e96e6
- Resolve some coverity concerns with how the previous patch detected
2e96e6
  whether or not a partition was a device mapper device.
2e96e6
  Related: rhbz#1300262
2e96e6
2e96e6
* Tue Jul 05 2016 rmarshall@redhat.com - 1.58-7
2e96e6
- Do not resolve device mapper links when generating stanzas
2e96e6
  for bootloader.
2e96e6
  Resolves: rhbz#1300262
2e96e6
2e96e6
* Wed May 04 2016 rmarshall@redhat.com - 1.58-6
2e96e6
- Adding handling to skip probing extended dos partitions
2e96e6
  Resolves: rhbz#1322957
2e96e6
- Improve Windows detection for dual boot and support Windows 10
2e96e6
  Resolves: rhbz#1322956
2e96e6
- Suppress non-blocking dmraid sector size warning message
2e96e6
  Resolves: rhbz#1198918
2e96e6
2e96e6
* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 1.58-5
2e96e6
- Mass rebuild 2014-01-24
2e96e6
2e96e6
* Mon Jan 20 2014 Peter Jones <pjones@redhat.com> - 1.58-4
2e96e6
- Add man pages.
2e96e6
  Resolves: rhbz#948848
2e96e6
2e96e6
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 1.58-3
2e96e6
- Mass rebuild 2013-12-27
2e96e6
2e96e6
* Tue Jun 18 2013 Hedayat Vatankhah <hedayat.fwd+rpmchlog@gmail.com> - 1.58-2
2e96e6
- Fix a bug in EFI detection because of redirecting result output
2e96e6
2e96e6
* Sun May 05 2013 Hedayat Vatankhah <hedayat.fwd+rpmchlog@gmail.com> - 1.58-1
2e96e6
- Update to upstream version 1.58, with UEFI support
2e96e6
2e96e6
* Sat Feb 02 2013 Hedayat Vatankhah <hedayat.fwd+rpmchlog@gmail.com> - 1.57-2
2e96e6
- Fix a bug in recent btrfs patch when an extended partition is examined. 
2e96e6
  (H.J. Lu) (bug #906847)
2e96e6
- Fix naming of /boot partitions according to their fstab entry (bug #893472)
2e96e6
- Don't generate .btrfsfix files which will be included in final rpm
2e96e6
- Fix wrong boot partition set by linux-boot-prober when / and /boot are
2e96e6
  mounted (bug #906886)
2e96e6
- Factor out 'logger', so that it is run once and logs are piped to it (John
2e96e6
  Reiser) (bug #875356)
2e96e6
2e96e6
* Tue Jan 22 2013 Hedayat Vatankhah <hedayat.fwd+rpmchlog@gmail.com> - 1.57-1
2e96e6
- Update to 1.57 (#890409)
2e96e6
- Use shell string processing rather than 'basename' (#875356)
2e96e6
- Make it possible to disable logging debug messages by assigning a value to
2e96e6
  OS_PROBER_DISABLE_DEBUG environment variable (Gene Czarcinski) (#893997).
2e96e6
- Detect multi btrfs pools/volumes (Gene Czarcinski) (#888341)
2e96e6
2e96e6
* Thu Oct 11 2012 Hedayat Vatankhah <hedayat.fwd+rpmchlog@gmail.com> - 1.56-1
2e96e6
- Update to 1.56 with a bug fix and applied one of my patches
2e96e6
2e96e6
* Mon Aug 27 2012 Hedayat Vatankhah <hedayat.fwd+rpmchlog@gmail.com> - 1.55-1
2e96e6
- Update to new upstream version: 1.55
2e96e6
2e96e6
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.53-4
2e96e6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
2e96e6
2e96e6
* Sat Jun 02 2012 Hedayat Vatankhah <hedayat.fwd+rpmchlog@gmail.com> - 1.53-3
2e96e6
- Consider usrmoved distribtions in fallback linux detector (bug #826754)
2e96e6
- Remove patch backup files from final rpm package (by not creating a backup!)
2e96e6
2e96e6
* Fri May 25 2012 Hedayat Vatankhah <hedayat.fwd+rpmchlog@gmail.com> - 1.53-2
2e96e6
- Add support for OSes installed on Linux mdraid partitions, bug #752402
2e96e6
- Add Fedora's grub2 config path, fixes generating menu entries for other
2e96e6
  installed Fedora's
2e96e6
- Fixed bug in parsing yaboot.conf: accept spaces around '=' for append, 
2e96e6
  bug #825041
2e96e6
2e96e6
* Fri May 11 2012 Hedayat Vatankhah <hedayat.fwd+rpmchlog@gmail.com> - 1.53-1
2e96e6
- Updated to 1.53 for a bugfix
2e96e6
- Fixed directory name in upstream tarbal
2e96e6
2e96e6
* Thu May 10 2012 Peter Jones <pjones@redhat.com> - 1.52-3
2e96e6
- Don't detect our Mac boot blocks as OS X.
2e96e6
  Resolves: rhbz#811412
2e96e6
2e96e6
* Sun Apr 29 2012 Hedayat Vatankhah <hedayat.fwd+rpmchlog@gmail.com> - 1.52-2
2e96e6
- use correct directory name for setup
2e96e6
2e96e6
* Sun Apr 29 2012 Hedayat Vatankhah <hedayat.fwd+rpmchlog@gmail.com> - 1.52-1
2e96e6
- Updated to 1.52, supports win 8
2e96e6
2e96e6
* Wed Mar 28 2012 Hedayat Vatankhah <hedayat.fwd+rpmchlog@gmail.com> - 1.51-1
2e96e6
- Update to latest upstream version, 1.51
2e96e6
2e96e6
* Sat Jan 21 2012 Hedayat Vatankhah <hedayat.fwd+rpmchlog@gmail.com> - 1.48-3
2e96e6
- Remove dmraid and lvm2 dependency. bug #770393
2e96e6
2e96e6
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.48-2
2e96e6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
2e96e6
2e96e6
* Mon Jul 25 2011 Hedayat Vatankhah <hedayat.fwd+rpmchlog@gmail.com> - 1.48-1
2e96e6
- Updated to 1.48 release
2e96e6
2e96e6
* Thu May 19 2011 Hedayat Vatankhah <hedayat.fwd+rpmchlog@gmail.com> - 1.47-1
2e96e6
- Updated to the new upstream version 1.47
2e96e6
2e96e6
* Wed May 04 2011 Hedayat Vatankhah <hedayat.fwd+rpmchlog@gmail.com> - 1.46-2
2e96e6
- Removed obsolete parts (build tag, defattr, etc)
2e96e6
- Added a patch to move newns outside of os-prober subdirectory
2e96e6
- Added required utilities as package requires
2e96e6
2e96e6
* Sat Apr 30 2011 Hedayat Vatankhah <hedayat.fwd+rpmchlog@gmail.com> - 1.46-1
2e96e6
- Updated to 1.46 release
2e96e6
2e96e6
* Tue Feb 22 2011 Hedayat Vatankhah <hedayat.fwd+rpmchlog@gmail.com> - 1.42-2
2e96e6
- Remove executable permission from common.sh
2e96e6
2e96e6
* Thu Feb 17 2011 Hedayat Vatankhah <hedayat.fwd+rpmchlog@gmail.com> - 1.42-1
2e96e6
- Initial version