Blame SPECS/libguestfs-winsupport.spec

7a9ee6
%global         ntfs_version 2017.3.23
7a9ee6
%global         compression_version 1.0
7a9ee6
7a9ee6
# debuginfo makes no sense for this package, so disable it
7a9ee6
%global         debug_package %{nil}
7a9ee6
7a9ee6
Name:           libguestfs-winsupport
7a9ee6
Version:        8.2
7a9ee6
Release:        4%{?dist}
7a9ee6
Summary:        Add support for Windows guests to virt-v2v and virt-p2v
7a9ee6
7a9ee6
URL:            http://www.ntfs-3g.org/
7a9ee6
# and URL:      https://github.com/ebiggers/ntfs-3g-system-compression
7a9ee6
License:        GPLv2+
7a9ee6
7a9ee6
# This package shouldn't be installed without installing the base
7a9ee6
# libguestfs package.
7a9ee6
Requires:       libguestfs >= 1:1.38.2
7a9ee6
7a9ee6
# Source and patches for ntfs-3g and ntfs-3g-system-compression.
7a9ee6
Source0:        http://tuxera.com/opensource/ntfs-3g_ntfsprogs-%{ntfs_version}.tgz
7a9ee6
Source1:        https://github.com/ebiggers/ntfs-3g-system-compression/archive/v%{version}/ntfs-3g-system-compression-%{compression_version}.tar.gz
7a9ee6
7a9ee6
Patch0:         ntfs-3g_ntfsprogs-2011.10.9-RC-ntfsck-unsupported-return-0.patch
7a9ee6
Patch1:         check-mftmirr.patch
7a9ee6
Patch2:         ntfs-3g-big-sectors.patch
7a9ee6
# Fix for ntfsclone crash.
7a9ee6
# Discussed with upstream developer but not upstream yet, see:
7a9ee6
# https://bugzilla.redhat.com/show_bug.cgi?id=1601146#c4
7a9ee6
Patch3:         ntfsclone-full-clusters-bz1601146.patch
7a9ee6
# CVE-2019-9755 (https://bugzilla.redhat.com/show_bug.cgi?id=1698502)
7a9ee6
Patch4:         0001-Fixed-reporting-an-error-when-failed-to-build-the-mo.patch
7a9ee6
7a9ee6
BuildRequires:  gcc
7a9ee6
BuildRequires:  libtool, libattr-devel
7a9ee6
BuildRequires:  libconfig-devel, libgcrypt-devel, gnutls-devel, libuuid-devel
7a9ee6
BuildRequires:  autoconf, automake, libtool, fuse-devel
7a9ee6
7a9ee6
7a9ee6
%description
7a9ee6
This optional package adds support for Windows guests (NTFS) to the
7a9ee6
virt-v2v and virt-p2v programs.
7a9ee6
7a9ee6
This package also supports system compression ("Compact OS") using the
7a9ee6
plugin from https://github.com/ebiggers/ntfs-3g-system-compression
7a9ee6
7a9ee6
7a9ee6
%prep
7a9ee6
%setup -q -n ntfs-3g_ntfsprogs-%{ntfs_version}
7a9ee6
%setup -n ntfs-3g_ntfsprogs-%{ntfs_version} -T -D -a 1
7a9ee6
%patch0 -p1 -b .unsupported
7a9ee6
%patch1 -p0 -b .check-mftmirr
7a9ee6
%patch2 -p0 -b .big-sectors
7a9ee6
%patch3 -p0 -b .ntfsclone
7a9ee6
%patch4 -p1
7a9ee6
7a9ee6
7a9ee6
%build
7a9ee6
CFLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64"
7a9ee6
%configure \
7a9ee6
        --disable-static \
7a9ee6
        --disable-ldconfig \
7a9ee6
        --exec-prefix=/ \
7a9ee6
        --enable-posix-acls \
7a9ee6
        --enable-xattr-mappings \
7a9ee6
        --enable-crypto \
7a9ee6
        --enable-extras \
7a9ee6
        --enable-quarantined
7a9ee6
make %{?_smp_mflags} LIBTOOL=%{_bindir}/libtool
7a9ee6
7a9ee6
# Build ntfs-3g-system-compression plugin.
7a9ee6
pushd ntfs-3g-system-compression-%{compression_version}
7a9ee6
autoreconf -i
7a9ee6
# Trick the plugin into using the just-compiled ntfs-3g.
7a9ee6
cp ../libntfs-3g/libntfs-3g.pc .
7a9ee6
sed -i \
7a9ee6
    -e 's,^libdir=.*,libdir=../libntfs-3g,' \
7a9ee6
    -e 's,^includedir=.*,includedir=../include,' \
7a9ee6
    libntfs-3g.pc
7a9ee6
export PKG_CONFIG_PATH=.
7a9ee6
%configure
7a9ee6
%make_build
7a9ee6
popd
7a9ee6
7a9ee6
7a9ee6
%install
7a9ee6
# Build it into a destdir which is not the final buildroot.
7a9ee6
mkdir destdir
7a9ee6
make LIBTOOL=%{_bindir}/libtool DESTDIR=$(pwd)/destdir install
7a9ee6
rm -rf destdir/%{_libdir}/*.la
7a9ee6
rm -rf destdir/%{_libdir}/*.a
7a9ee6
7a9ee6
rm -rf destdir/%{_sbindir}/mount.ntfs-3g
7a9ee6
cp -a destdir/%{_bindir}/ntfs-3g destdir/%{_sbindir}/mount.ntfs-3g
7a9ee6
7a9ee6
# Actually make some symlinks for simplicity...
7a9ee6
# ... since we're obsoleting ntfsprogs-fuse
7a9ee6
pushd destdir/%{_bindir}
7a9ee6
ln -s ntfs-3g ntfsmount
7a9ee6
popd
7a9ee6
pushd destdir/%{_sbindir}
7a9ee6
ln -s mount.ntfs-3g mount.ntfs-fuse
7a9ee6
# And since there is no other package in Fedora that provides an ntfs 
7a9ee6
# mount...
7a9ee6
ln -s mount.ntfs-3g mount.ntfs
7a9ee6
# Need this for fsck to find it
7a9ee6
ln -s ../bin/ntfsck fsck.ntfs
7a9ee6
popd
7a9ee6
mv destdir/sbin/* destdir/%{_sbindir}
7a9ee6
rmdir destdir/sbin
7a9ee6
7a9ee6
# We get this on our own, thanks.
7a9ee6
rm -r destdir/%{_defaultdocdir}
7a9ee6
7a9ee6
# Remove development files.
7a9ee6
rm -r destdir/%{_includedir}
7a9ee6
rm -r destdir/%{_libdir}/pkgconfig
7a9ee6
7a9ee6
# Install ntfs-3g-system-compression plugin in the same place.
7a9ee6
pushd ntfs-3g-system-compression-%{compression_version}
7a9ee6
%make_install DESTDIR=$(pwd)/../destdir
7a9ee6
popd
7a9ee6
rm -rf destdir/%{_libdir}/ntfs-3g/*.la
7a9ee6
7a9ee6
# Take the destdir and put it into a tarball for the libguestfs appliance.
7a9ee6
mkdir -p %{buildroot}%{_libdir}/guestfs/supermin.d
7a9ee6
pushd destdir
7a9ee6
tar zvcf %{buildroot}%{_libdir}/guestfs/supermin.d/zz-winsupport.tar.gz .
7a9ee6
popd
7a9ee6
7a9ee6
7a9ee6
%files
7a9ee6
%doc AUTHORS ChangeLog COPYING CREDITS NEWS README
7a9ee6
7a9ee6
%{_libdir}/guestfs/supermin.d/zz-winsupport.tar.gz
7a9ee6
7a9ee6
7a9ee6
%changelog
7a9ee6
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 8.2-4
7a9ee6
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
7a9ee6
  Related: rhbz#1991688
7a9ee6
7a9ee6
* Wed Jun 02 2021 Richard W.M. Jones <rjones@redhat.com> - 8.2-3
7a9ee6
- Add gating tests (for RHEL 9)
7a9ee6
7a9ee6
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 8.2-2
7a9ee6
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
7a9ee6
7a9ee6
* Wed Jan 29 2020 Richard W.M. Jones <rjones@redhat.com> - 8.2-1
7a9ee6
- Rebuild for RHEL AV 8.2.
7a9ee6
- Include ntfs-3g-system-compression plugin.
7a9ee6
  resolves: rhbz#1705234, rhbz#1796073
7a9ee6
7a9ee6
* Fri Jun 28 2019 Danilo de Paula <ddepaula@redhat.com> - 8.0-4
7a9ee6
- Rebuild all virt packages to fix RHEL's upgrade path
7a9ee6
- Resolves: rhbz#1695587
7a9ee6
  (Ensure modular RPM upgrade path)
7a9ee6
7a9ee6
* Wed Apr 10 2019 Richard W.M. Jones <rjones@redhat.com> - 8.0-3
7a9ee6
- Fix for CVE-2019-9755
7a9ee6
  (heap-based buffer overflow leads to local root privilege escalation)
7a9ee6
  resolves: rhbz#1698503
7a9ee6
7a9ee6
* Mon Jul 16 2018 Richard W.M. Jones <rjones@redhat.com> - 8.0-2
7a9ee6
- Fix for ntfsclone crash (RHBZ#1601146).
7a9ee6
7a9ee6
* Wed Jul 11 2018 Richard W.M. Jones <rjones@redhat.com> - 8.0-1
7a9ee6
- Rebase to 2017.3.23.
7a9ee6
- Remove patches which are now upstream.
7a9ee6
- Resynch with Fedora package.
7a9ee6
- Enable all architectures for RHEL 8.
7a9ee6
7a9ee6
* Wed Feb 22 2017 Richard W.M. Jones <rjones@redhat.com> - 7.2-2
7a9ee6
- Fix for handling guest filenames with invalid or incomplete
7a9ee6
  multibyte or wide characters
7a9ee6
  resolves: rhbz#1301593
7a9ee6
7a9ee6
* Tue Jul 07 2015 Richard W.M. Jones <rjones@redhat.com> - 7.2-1
7a9ee6
- Rebase and rebuild for RHEL 7.2
7a9ee6
  resolves: rhbz#1240278
7a9ee6
7a9ee6
* Tue Jun 30 2015 Richard W.M. Jones <rjones@redhat.com> - 7.1-6
7a9ee6
- Bump version and rebuild.
7a9ee6
  related: rhbz#1221583
7a9ee6
7a9ee6
* Fri May 15 2015 Richard W.M. Jones <rjones@redhat.com> - 7.1-5
7a9ee6
- Enable aarch64 architecture.
7a9ee6
  resolves: rhbz#1221583
7a9ee6
7a9ee6
* Thu Aug 28 2014 Richard W.M. Jones <rjones@redhat.com> - 7.1-4
7a9ee6
- Enable debuginfo support and stripping.
7a9ee6
  resolves: rhbz#1100319
7a9ee6
7a9ee6
* Thu Aug 28 2014 Richard W.M. Jones <rjones@redhat.com> - 7.1-3
7a9ee6
- Add patches from Fedora package which add fstrim support.
7a9ee6
  resolves: rhbz#1100319
7a9ee6
7a9ee6
* Mon Jul 21 2014 Richard W.M. Jones <rjones@redhat.com> - 7.1-2
7a9ee6
- New package for RHEL 7.1
7a9ee6
- Rebase to ntfs-3g 2014.2.15
7a9ee6
  resolves: rhbz#1100319
7a9ee6
- Change the package so it works with supermin5.
7a9ee6
- Remove dependency on external FUSE.
7a9ee6
7a9ee6
* Wed Apr  3 2013 Richard W.M. Jones <rjones@redhat.com> - 7.0-2
7a9ee6
- Resync against Rawhide package (ntfs-3g 2013.1.13).
7a9ee6
- Drop HAL file since HAL is dead.
7a9ee6
  resolves: rhbz#819939
7a9ee6
7a9ee6
* Thu Dec 20 2012 Richard W.M. Jones <rjones@redhat.com> - 7.0-1
7a9ee6
- New package for RHEL 7
7a9ee6
  resolves: rhbz#819939
7a9ee6
- Resync against Rawhide package.
7a9ee6
7a9ee6
* Mon Mar 28 2011 Richard W.M. Jones <rjones@redhat.com> - 1.0-7
7a9ee6
- Disable debuginfo package.
7a9ee6
  resolves: RHBZ#691555.
7a9ee6
7a9ee6
* Tue Mar  8 2011 Richard W.M. Jones <rjones@redhat.com> - 1.0-6
7a9ee6
- Require libguestfs 1.7.17 (newer version in RHEL 6.1).
7a9ee6
- Require febootstrap-supermin-helper instead of febootstrap
7a9ee6
  resolves: RHBZ#670299.
7a9ee6
7a9ee6
* Thu Jul  1 2010 Richard W.M. Jones <rjones@redhat.com> - 1.0-5
7a9ee6
- Make sure intermediate lib* directories are created in hostfiles (RHBZ#603429)
7a9ee6
7a9ee6
* Thu Jun  3 2010 Richard W.M. Jones <rjones@redhat.com> - 1.0-4
7a9ee6
- Requires fuse-libs (RHBZ#599300).
7a9ee6
7a9ee6
* Fri May 21 2010 Richard W.M. Jones <rjones@redhat.com> - 1.0-3
7a9ee6
- ExclusiveArch x86_64.
7a9ee6
7a9ee6
* Tue May 18 2010 Richard W.M. Jones <rjones@redhat.com> - 1.0-2
7a9ee6
- Package Windows support for libguestfs.