44ccc6
# conditionalize Ocaml support
44ccc6
%ifarch sparc64 s390 s390x
44ccc6
%bcond_with ocaml
44ccc6
%else
44ccc6
%bcond_without ocaml
44ccc6
%endif
44ccc6
44ccc6
Name:           hivex
44ccc6
Version:        1.3.8
44ccc6
Release:        2%{?dist}
44ccc6
Summary:        Read and write Windows Registry binary hive files
44ccc6
44ccc6
License:        LGPLv2
44ccc6
URL:            http://libguestfs.org/
44ccc6
44ccc6
Source0:        http://libguestfs.org/download/hivex/%{name}-%{version}.tar.gz
44ccc6
44ccc6
# Fix Perl directory install path.
44ccc6
Patch0:         %{name}-1.3.8-dirs.patch
44ccc6
44ccc6
# Use VENDOR*DIR instead of SITE*DIR (not yet upstream).
44ccc6
Patch2:         ruby-vendor-not-site.patch
44ccc6
BuildRequires:  autoconf, automake, libtool, gettext-devel
44ccc6
44ccc6
BuildRequires:  perl
44ccc6
BuildRequires:  perl-Test-Simple
44ccc6
BuildRequires:  perl-Test-Pod
44ccc6
BuildRequires:  perl-Test-Pod-Coverage
44ccc6
BuildRequires:  perl-ExtUtils-MakeMaker
44ccc6
BuildRequires:  perl-IO-stringy
44ccc6
BuildRequires:  perl-libintl
44ccc6
%if %{with ocaml}
44ccc6
BuildRequires:  ocaml
44ccc6
BuildRequires:  ocaml-findlib-devel
44ccc6
%endif
44ccc6
BuildRequires:  python-devel
44ccc6
BuildRequires:  ruby-devel
44ccc6
BuildRequires:  rubygem-rake
44ccc6
BuildRequires:  rubygem(minitest)
44ccc6
BuildRequires:  readline-devel
44ccc6
BuildRequires:  libxml2-devel
44ccc6
44ccc6
# This library used to be part of libguestfs.  It won't install alongside
44ccc6
# the old version of libguestfs that included this library:
44ccc6
Conflicts:      libguestfs <= 1:1.0.84
44ccc6
44ccc6
# https://fedoraproject.org/wiki/Packaging:No_Bundled_Libraries#Packages_granted_exceptions
44ccc6
Provides:      bundled(gnulib)
44ccc6
44ccc6
44ccc6
%description
44ccc6
Hive files are the undocumented binary files that Windows uses to
44ccc6
store the Windows Registry on disk.  Hivex is a library that can read
44ccc6
and write to these files.
44ccc6
44ccc6
'hivexsh' is a shell you can use to interactively navigate a hive
44ccc6
binary file.
44ccc6
44ccc6
'hivexregedit' lets you export and merge to the textual regedit
44ccc6
format.
44ccc6
44ccc6
'hivexml' can be used to convert a hive file to a more useful XML
44ccc6
format.
44ccc6
44ccc6
In order to get access to the hive files themselves, you can copy them
44ccc6
from a Windows machine.  They are usually found in
44ccc6
%%systemroot%%\system32\config.  For virtual machines we recommend
44ccc6
using libguestfs or guestfish to copy out these files.  libguestfs
44ccc6
also provides a useful high-level tool called 'virt-win-reg' (based on
44ccc6
hivex technology) which can be used to query specific registry keys in
44ccc6
an existing Windows VM.
44ccc6
44ccc6
For OCaml bindings, see 'ocaml-hivex-devel'.
44ccc6
44ccc6
For Perl bindings, see 'perl-hivex'.
44ccc6
44ccc6
For Python bindings, see 'python-hivex'.
44ccc6
44ccc6
For Ruby bindings, see 'ruby-hivex'.
44ccc6
44ccc6
44ccc6
%package devel
44ccc6
Summary:        Development tools and libraries for %{name}
44ccc6
Requires:       %{name} = %{version}-%{release}
44ccc6
Requires:       pkgconfig
44ccc6
44ccc6
44ccc6
%description devel
44ccc6
%{name}-devel contains development tools and libraries
44ccc6
for %{name}.
44ccc6
44ccc6
44ccc6
%if %{with ocaml}
44ccc6
%package -n ocaml-%{name}
44ccc6
Summary:       OCaml bindings for %{name}
44ccc6
Requires:      %{name} = %{version}-%{release}
44ccc6
44ccc6
44ccc6
%description -n ocaml-%{name}
44ccc6
ocaml-%{name} contains OCaml bindings for %{name}.
44ccc6
44ccc6
This is for toplevel and scripting access only.  To compile OCaml
44ccc6
programs which use %{name} you will also need ocaml-%{name}-devel.
44ccc6
44ccc6
44ccc6
%package -n ocaml-%{name}-devel
44ccc6
Summary:       OCaml bindings for %{name}
44ccc6
Requires:      ocaml-%{name} = %{version}-%{release}
44ccc6
44ccc6
44ccc6
%description -n ocaml-%{name}-devel
44ccc6
ocaml-%{name}-devel contains development libraries
44ccc6
required to use the OCaml bindings for %{name}.
44ccc6
%endif
44ccc6
44ccc6
44ccc6
%package -n perl-%{name}
44ccc6
Summary:       Perl bindings for %{name}
44ccc6
Requires:      %{name} = %{version}-%{release}
44ccc6
Requires:      perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
44ccc6
44ccc6
44ccc6
%description -n perl-%{name}
44ccc6
perl-%{name} contains Perl bindings for %{name}.
44ccc6
44ccc6
44ccc6
%package -n python-%{name}
44ccc6
Summary:       Python bindings for %{name}
44ccc6
Requires:      %{name} = %{version}-%{release}
44ccc6
44ccc6
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
44ccc6
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
44ccc6
44ccc6
%description -n python-%{name}
44ccc6
python-%{name} contains Python bindings for %{name}.
44ccc6
44ccc6
44ccc6
%package -n ruby-%{name}
44ccc6
Summary:       Ruby bindings for %{name}
44ccc6
Requires:      %{name} = %{version}-%{release}
44ccc6
Requires:      ruby(release) = 2.0.0
44ccc6
Requires:      ruby
44ccc6
Provides:      ruby(hivex) = %{version}
44ccc6
44ccc6
%description -n ruby-%{name}
44ccc6
ruby-%{name} contains Ruby bindings for %{name}.
44ccc6
44ccc6
44ccc6
%prep
44ccc6
%setup -q
44ccc6
44ccc6
%patch0 -p1 -b .dirs
44ccc6
%patch2 -p1 -b .rubyvendor
44ccc6
autoreconf -i
44ccc6
44ccc6
44ccc6
%build
44ccc6
%configure --disable-static
44ccc6
make %{?_smp_mflags}
44ccc6
44ccc6
44ccc6
%check
44ccc6
make check
44ccc6
44ccc6
%if !%{with ocaml}
44ccc6
# Delete OCaml files, in case the user had OCaml installed and it was
44ccc6
# picked up by the configure script.
44ccc6
# XXX Add ./configure --disable-ocaml upstream.
44ccc6
rm -rf $RPM_BUILD_ROOT%{_libdir}/ocaml/hivex
44ccc6
rm -f  $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs/*hivex*
44ccc6
%endif
44ccc6
44ccc6
44ccc6
%install
44ccc6
make install DESTDIR=$RPM_BUILD_ROOT
44ccc6
44ccc6
# Remove unwanted libtool *.la file:
44ccc6
rm $RPM_BUILD_ROOT%{_libdir}/libhivex.la
44ccc6
44ccc6
# Remove unwanted Perl files:
44ccc6
find $RPM_BUILD_ROOT -name perllocal.pod -delete
44ccc6
find $RPM_BUILD_ROOT -name .packlist -delete
44ccc6
find $RPM_BUILD_ROOT -name '*.bs' -delete
44ccc6
44ccc6
# Remove unwanted Python files:
44ccc6
rm $RPM_BUILD_ROOT%{python_sitearch}/libhivexmod.la
44ccc6
44ccc6
%find_lang %{name}
44ccc6
44ccc6
44ccc6
%post -p /sbin/ldconfig
44ccc6
44ccc6
%postun -p /sbin/ldconfig
44ccc6
44ccc6
44ccc6
%files -f %{name}.lang
44ccc6
%doc README LICENSE
44ccc6
%{_bindir}/hivexget
44ccc6
%{_bindir}/hivexml
44ccc6
%{_bindir}/hivexregedit
44ccc6
%{_bindir}/hivexsh
44ccc6
%{_libdir}/libhivex.so.*
44ccc6
%{_mandir}/man1/hivexget.1*
44ccc6
%{_mandir}/man1/hivexml.1*
44ccc6
%{_mandir}/man1/hivexregedit.1*
44ccc6
%{_mandir}/man1/hivexsh.1*
44ccc6
44ccc6
44ccc6
%files devel
44ccc6
%doc LICENSE
44ccc6
%{_libdir}/libhivex.so
44ccc6
%{_mandir}/man3/hivex.3*
44ccc6
%{_includedir}/hivex.h
44ccc6
%{_libdir}/pkgconfig/hivex.pc
44ccc6
44ccc6
44ccc6
%if %{with ocaml}
44ccc6
%files -n ocaml-%{name}
44ccc6
%doc README
44ccc6
%{_libdir}/ocaml/hivex
44ccc6
%exclude %{_libdir}/ocaml/hivex/*.a
44ccc6
%exclude %{_libdir}/ocaml/hivex/*.cmxa
44ccc6
%exclude %{_libdir}/ocaml/hivex/*.cmx
44ccc6
%exclude %{_libdir}/ocaml/hivex/*.mli
44ccc6
%{_libdir}/ocaml/stublibs/*.so
44ccc6
%{_libdir}/ocaml/stublibs/*.so.owner
44ccc6
44ccc6
44ccc6
%files -n ocaml-%{name}-devel
44ccc6
%{_libdir}/ocaml/hivex/*.a
44ccc6
%{_libdir}/ocaml/hivex/*.cmxa
44ccc6
%{_libdir}/ocaml/hivex/*.cmx
44ccc6
%{_libdir}/ocaml/hivex/*.mli
44ccc6
%endif
44ccc6
44ccc6
44ccc6
%files -n perl-%{name}
44ccc6
%{perl_vendorarch}/*
44ccc6
%{_mandir}/man3/Win::Hivex.3pm*
44ccc6
%{_mandir}/man3/Win::Hivex::Regedit.3pm*
44ccc6
44ccc6
44ccc6
%files -n python-%{name}
44ccc6
%{python_sitearch}/*.py
44ccc6
%{python_sitearch}/*.pyc
44ccc6
%{python_sitearch}/*.pyo
44ccc6
%{python_sitearch}/*.so
44ccc6
44ccc6
44ccc6
%files -n ruby-%{name}
44ccc6
%doc ruby/doc/site/*
44ccc6
%{ruby_vendorlibdir}/hivex.rb
44ccc6
%{ruby_vendorarchdir}/_hivex.so
44ccc6
44ccc6
44ccc6
%changelog
44ccc6
* Thu Oct 31 2013 Richard W.M. Jones <rjones@redhat.com> - 1.3.8-2
44ccc6
- Drop hivex-static subpackage
44ccc6
  resolves: rhbz#1020019
44ccc6
44ccc6
* Thu Jul 25 2013 Richard W.M. Jones <rjones@redhat.com> - 1.3.8-1
44ccc6
- New upstream version 1.3.8.
44ccc6
- Fixes handling of keys which use ri-records, for both reading and
44ccc6
  writing (RHBZ#717583, RHBZ#987463).
44ccc6
- Remove upstream patch.
44ccc6
- Rebase dirs patch against new upstream sources.
44ccc6
- Rebase ruby patch against new upstream sources.
44ccc6
- Modernize the RPM spec file.
44ccc6
- Fix .gitignore.
44ccc6
44ccc6
* Wed Jul 17 2013 Petr Pisar <ppisar@redhat.com> - 1.3.7-8
44ccc6
- Perl 5.18 rebuild
44ccc6
44ccc6
* Wed Mar 13 2013 Richard W.M. Jones <rjones@redhat.com> - 1.3.7-7
44ccc6
- Rebuild for Ruby 2.0.0.
44ccc6
- Change ruby(abi) to ruby(release).
44ccc6
44ccc6
* Fri Feb 15 2013 Richard W.M. Jones <rjones@redhat.com> - 1.3.7-6
44ccc6
- Fix for latest Ruby in Rawhide.  Fixes build failure identified
44ccc6
  by mass rebuild yesterday.
44ccc6
- Do not ignore error from running autoreconf.
44ccc6
44ccc6
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.7-3
44ccc6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
44ccc6
44ccc6
* Mon Oct 29 2012 Richard W.M. Jones <rjones@redhat.com> - 1.3.7-2
44ccc6
- Rebuild for OCaml 4.00.1.
44ccc6
44ccc6
* Thu Oct 11 2012 Richard W.M. Jones <rjones@redhat.com> - 1:1.3.7-1
44ccc6
- New upstream version 1.3.7.
44ccc6
44ccc6
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.6-3
44ccc6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
44ccc6
44ccc6
* Wed Jun 27 2012 Petr Pisar <ppisar@redhat.com> - 1.3.6-2
44ccc6
- Perl 5.16 rebuild
44ccc6
44ccc6
* Tue Jun 12 2012 Richard W.M. Jones <rjones@redhat.com> - 1:1.3.6-1
44ccc6
- New upstream version 1.3.6.
44ccc6
- Enable Ocaml bindings on ppc64.
44ccc6
44ccc6
* Sat Jun 09 2012 Richard W.M. Jones <rjones@redhat.com> - 1.3.5-9
44ccc6
- Rebuild for OCaml 4.00.0.
44ccc6
44ccc6
* Fri Jun 08 2012 Petr Pisar <ppisar@redhat.com> - 1.3.5-8
44ccc6
- Perl 5.16 rebuild
44ccc6
44ccc6
* Fri May 18 2012 Richard W.M. Jones <rjones@redhat.com> - 1:1.3.5-7
44ccc6
- "blobs" -> "files" in the description.
44ccc6
44ccc6
* Tue May 15 2012 Richard W.M. Jones <rjones@redhat.com> - 1:1.3.5-6
44ccc6
- Bundled gnulib (RHBZ#821763).
44ccc6
44ccc6
* Fri Mar 23 2012 Richard W.M. Jones <rjones@redhat.com> - 1:1.3.5-5
44ccc6
- Don't need to rerun the generator (thanks Dan Horák).
44ccc6
44ccc6
* Tue Mar 13 2012 Richard W.M. Jones <rjones@redhat.com> - 1:1.3.5-4
44ccc6
- New upstream version 1.3.5.
44ccc6
- Remove upstream patch.
44ccc6
- Depend on automake etc. for the patch.
44ccc6
44ccc6
* Thu Feb  9 2012 Richard W.M. Jones <rjones@redhat.com> - 1.3.3-8
44ccc6
- ruby(abi) 1.9.1.
44ccc6
44ccc6
* Wed Feb  8 2012 Richard W.M. Jones <rjones@redhat.com> - 1.3.3-7
44ccc6
- Bump and rebuild for Ruby update.
44ccc6
- Add upstream patch to fix bindings for Ruby 1.9.
44ccc6
- Add non-upstream patch to pass --vendor flag to extconf.rb
44ccc6
44ccc6
* Fri Jan 06 2012 Richard W.M. Jones <rjones@redhat.com> - 1.3.3-3
44ccc6
- Rebuild for OCaml 3.12.1.
44ccc6
44ccc6
* Thu Dec  8 2011 Richard W.M. Jones <rjones@redhat.com> - 1.3.3-2
44ccc6
- Disable OCaml on ppc64.
44ccc6
- Ensure OCaml files are deleted when not packaged.
44ccc6
44ccc6
* Tue Nov 29 2011 Richard W.M. Jones <rjones@redhat.com> - 1.3.3-1
44ccc6
- New upstream version 1.3.3.
44ccc6
- Rebased gnulib to work around RHBZ#756981.
44ccc6
- Remove patches which are now upstream.
44ccc6
44ccc6
* Mon Oct 24 2011 Richard W.M. Jones <rjones@redhat.com> - 1.3.2-3
44ccc6
- New upstream version 1.3.2.
44ccc6
- Add upstream patch to fix building of hivexsh, hivexget.
44ccc6
44ccc6
* Fri Aug 26 2011 Richard W.M. Jones <rjones@redhat.com> - 1.3.1-2
44ccc6
- New upstream version 1.3.1.
44ccc6
- Remove patch, now upstream.
44ccc6
- Don't need hack for making an unversioned Python module.
44ccc6
44ccc6
* Mon Aug 15 2011 Richard W.M. Jones <rjones@redhat.com> - 1.3.0-3
44ccc6
- New upstream version 1.3.0.
44ccc6
- This version adds Ruby bindings, so there is a new subpackage 'ruby-hivex'.
44ccc6
- Add upstream patch to fix Ruby tests.
44ccc6
- Remove epoch macro in ruby-hivex dependency.
44ccc6
44ccc6
* Fri Aug 12 2011 Richard W.M. Jones <rjones@redhat.com> - 1.2.8-1
44ccc6
- New upstream version 1.2.8.
44ccc6
- Remove 4 upstream patches.
44ccc6
44ccc6
* Fri Jul 22 2011 Richard W.M. Jones <rjones@redhat.com> - 1.2.7-9
44ccc6
- Add upstream patch to fix Perl CCFLAGS for Perl 5.14 on i686.
44ccc6
- Enable 'make check'.
44ccc6
44ccc6
* Thu Jul 21 2011 Richard W.M. Jones <rjones@redhat.com> - 1.2.7-6
44ccc6
- i686 package is broken, experimentally rebuild it.
44ccc6
44ccc6
* Fri Jun 17 2011 Marcela Mašláňová <mmaslano@redhat.com> - 1.2.7-5
44ccc6
- Perl mass rebuild
44ccc6
44ccc6
* Fri Jun 10 2011 Marcela Mašláňová <mmaslano@redhat.com> - 1.2.7-4
44ccc6
- Perl 5.14 mass rebuild
44ccc6
44ccc6
* Tue May 17 2011 Richard W.M. Jones <rjones@redhat.com> - 1.2.7-3
44ccc6
- New upstream version 1.2.7.
44ccc6
- Removed patch which is now upstream.
44ccc6
- Add upstream patches to fix ocaml install rule.
44ccc6
44ccc6
* Thu May 12 2011 Richard W.M. Jones <rjones@redhat.com> - 1.2.6-2
44ccc6
- New upstream version 1.2.6.
44ccc6
- Removed patch which is now upstream.
44ccc6
- Add upstream patch to fix ocaml tests.
44ccc6
44ccc6
* Thu Apr 28 2011 Richard W.M. Jones <rjones@redhat.com> - 1.2.5-2
44ccc6
- Fix Python bindings on 32 bit arch with upstream patch.
44ccc6
44ccc6
* Wed Apr 13 2011 Richard W.M. Jones <rjones@redhat.com> - 1.2.5-1
44ccc6
- New upstream version 1.2.5.
44ccc6
- This version fixes a number of important memory issues found by
44ccc6
  valgrind and upgrading to this version is recommended for all users.
44ccc6
- Remove patch now upstream.
44ccc6
44ccc6
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.4-7
44ccc6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
44ccc6
44ccc6
* Fri Jan 14 2011 Richard W.M. Jones <rjones@redhat.com> - 1.2.4-6
44ccc6
- Fix multilib conflicts in *.pyc and *.pyo files.
44ccc6
- Only install unversioned *.so file for Python bindings.
44ccc6
44ccc6
* Wed Jan  5 2011 Richard W.M. Jones <rjones@redhat.com> - 1.2.4-4
44ccc6
- Rebuild against OCaml 3.12.0.
44ccc6
44ccc6
* Thu Dec 16 2010 Richard W.M. Jones <rjones@redhat.com> - 1.2.4-3
44ccc6
- Backport upstream patch to fix segfault in Hivex.value_value binding.
44ccc6
44ccc6
* Thu Dec  2 2010 Richard W.M. Jones <rjones@redhat.com> - 1.2.4-1
44ccc6
- New upstream version 1.2.4.
44ccc6
- This adds Python bindings (python-hivex subpackage).
44ccc6
- Fix Source0.
44ccc6
44ccc6
* Fri Nov 19 2010 Dan Horák <dan[at]danny.cz> - 1.2.3-3
44ccc6
- fix built with recent perl
44ccc6
44ccc6
* Tue Sep  7 2010 Dan Horák <dan[at]danny.cz> - 1.2.3-2
44ccc6
- conditionalize ocaml support
44ccc6
44ccc6
* Fri Aug 27 2010 Richard W.M. Jones <rjones@redhat.com> - 1.2.3-1
44ccc6
- New upstream version 1.2.3.
44ccc6
44ccc6
* Wed Aug 25 2010 Richard W.M. Jones <rjones@redhat.com> - 1.2.2-3
44ccc6
- Create a hivex-static subpackage.
44ccc6
44ccc6
* Thu Apr 29 2010 Marcela Maslanova <mmaslano@redhat.com> - 1.2.2-2
44ccc6
- Mass rebuild with perl-5.12.0
44ccc6
44ccc6
* Wed Apr 28 2010 Richard W.M. Jones <rjones@redhat.com> - 1.2.2-1
44ccc6
- New upstream version 1.2.2.
44ccc6
44ccc6
* Tue Mar 30 2010 Richard W.M. Jones <rjones@redhat.com> - 1.2.1-1
44ccc6
- New upstream version 1.2.1.
44ccc6
- Includes new tool for exporting and merging in regedit format.
44ccc6
44ccc6
* Mon Mar  1 2010 Richard W.M. Jones <rjones@redhat.com> - 1.2.0-2
44ccc6
- New upstream version 1.2.0.
44ccc6
- This includes OCaml and Perl bindings, so add these as subpackages.
44ccc6
44ccc6
* Mon Feb 22 2010 Richard W.M. Jones <rjones@redhat.com> - 1.1.2-3
44ccc6
- Missing Epoch in conflicts version fixed.
44ccc6
44ccc6
* Mon Feb 22 2010 Richard W.M. Jones <rjones@redhat.com> - 1.1.2-2
44ccc6
- Add Conflicts libguestfs <= 1.0.84.
44ccc6
44ccc6
* Mon Feb 22 2010 Richard W.M. Jones <rjones@redhat.com> - 1.1.2-1
44ccc6
- Initial Fedora RPM.