f82d66
# conditionalize Ocaml support
f82d66
%ifarch sparc64 s390 s390x
f82d66
%bcond_with ocaml
f82d66
%else
f82d66
%bcond_without ocaml
f82d66
%endif
f82d66
1fba63
Name:           hivex
b76e59
Version:        1.2.7
253206
Release:        3%{?dist}
1fba63
Summary:        Read and write Windows Registry binary hive files
1fba63
1fba63
Group:          Development/Libraries
1fba63
License:        LGPLv2
1fba63
URL:            http://libguestfs.org/
61eed4
Source0:        http://libguestfs.org/download/hivex/%{name}-%{version}.tar.gz
1fba63
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
1fba63
1fba63
BuildRequires:  perl
ea690f
BuildRequires:  perl-Test-Simple
ea690f
BuildRequires:  perl-Test-Pod
ea690f
BuildRequires:  perl-Test-Pod-Coverage
ea690f
BuildRequires:  perl-ExtUtils-MakeMaker
33837f
BuildRequires:  perl-IO-stringy
ea690f
BuildRequires:  perl-libintl
f82d66
%if %{with ocaml}
26b2b1
BuildRequires:  ocaml
26b2b1
BuildRequires:  ocaml-findlib-devel
f82d66
%endif
61eed4
BuildRequires:  python-devel
1fba63
BuildRequires:  readline-devel
1fba63
BuildRequires:  libxml2-devel
1fba63
1fba63
# This library used to be part of libguestfs.  It won't install alongside
1fba63
# the old version of libguestfs that included this library:
1fba63
Conflicts:      libguestfs <= 1:1.0.84
1fba63
4fa487
# Fix Perl directory install path.
4fa487
Patch0:         %{name}-1.2.3-dirs.patch
4fa487
253206
# Add upstream patches to fix ocaml install rule.
7036c3
Patch1:         0001-ocaml-Set-package-name-when-installing-native-bindin.patch
253206
Patch2:         0002-ocaml-Really-fix-make-install-rule.patch
253206
Patch3:         ocaml-Fix-autotools.patch
7036c3
1fba63
1fba63
%description
1fba63
Hive files are the undocumented binary blobs that Windows uses to
1fba63
store the Windows Registry on disk.  Hivex is a library that can read
1fba63
and write to these files.
1fba63
1fba63
'hivexsh' is a shell you can use to interactively navigate a hive
1fba63
binary file.
1fba63
33837f
'hivexregedit' lets you export and merge to the textual regedit
33837f
format.
33837f
1fba63
'hivexml' can be used to convert a hive file to a more useful XML
1fba63
format.
1fba63
1fba63
In order to get access to the hive files themselves, you can copy them
1fba63
from a Windows machine.  They are usually found in
1fba63
%%systemroot%%\system32\config.  For virtual machines we recommend
1fba63
using libguestfs or guestfish to copy out these files.  libguestfs
1fba63
also provides a useful high-level tool called 'virt-win-reg' (based on
1fba63
hivex technology) which can be used to query specific registry keys in
1fba63
an existing Windows VM.
1fba63
61eed4
For OCaml bindings, see 'ocaml-hivex-devel'.
61eed4
26b2b1
For Perl bindings, see 'perl-hivex'.
26b2b1
61eed4
For Python bindings, see 'python-hivex'.
26b2b1
1fba63
1fba63
%package devel
1fba63
Summary:        Development tools and libraries for %{name}
1fba63
Group:          Development/Libraries
1fba63
Requires:       %{name} = %{version}-%{release}
1fba63
Requires:       pkgconfig
1fba63
1fba63
1fba63
%description devel
1fba63
%{name}-devel contains development tools and libraries
1fba63
for %{name}.
1fba63
1fba63
2a4972
%package static
2a4972
Summary:        Statically linked library for %{name}
2a4972
Group:          Development/Libraries
2a4972
Requires:       %{name} = %{version}-%{release}
2a4972
2a4972
2a4972
%description static
2a4972
%{name}-static contains the statically linked library
2a4972
for %{name}.
2a4972
2a4972
f82d66
%if %{with ocaml}
26b2b1
%package -n ocaml-%{name}
26b2b1
Summary:       OCaml bindings for %{name}
26b2b1
Group:         Development/Libraries
26b2b1
Requires:      %{name} = %{version}-%{release}
26b2b1
26b2b1
26b2b1
%description -n ocaml-%{name}
26b2b1
ocaml-%{name} contains OCaml bindings for %{name}.
26b2b1
26b2b1
This is for toplevel and scripting access only.  To compile OCaml
26b2b1
programs which use %{name} you will also need ocaml-%{name}-devel.
26b2b1
26b2b1
26b2b1
%package -n ocaml-%{name}-devel
26b2b1
Summary:       OCaml bindings for %{name}
26b2b1
Group:         Development/Libraries
26b2b1
Requires:      ocaml-%{name} = %{version}-%{release}
26b2b1
26b2b1
26b2b1
%description -n ocaml-%{name}-devel
26b2b1
ocaml-%{name}-devel contains development libraries
26b2b1
required to use the OCaml bindings for %{name}.
f82d66
%endif
26b2b1
26b2b1
26b2b1
%package -n perl-%{name}
26b2b1
Summary:       Perl bindings for %{name}
26b2b1
Group:         Development/Libraries
26b2b1
Requires:      %{name} = %{version}-%{release}
26b2b1
Requires:      perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
26b2b1
26b2b1
26b2b1
%description -n perl-%{name}
26b2b1
perl-%{name} contains Perl bindings for %{name}.
26b2b1
26b2b1
61eed4
%package -n python-%{name}
61eed4
Summary:       Python bindings for %{name}
61eed4
Group:         Development/Libraries
61eed4
Requires:      %{name} = %{version}-%{release}
61eed4
61eed4
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
61eed4
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
61eed4
61eed4
%description -n python-%{name}
61eed4
python-%{name} contains Python bindings for %{name}.
61eed4
61eed4
1fba63
%prep
1fba63
%setup -q
4fa487
e5ee83
%patch0 -p1 -b .dirs
7036c3
%patch1 -p1
253206
%patch2 -p1
253206
%patch3 -p1
1fba63
1fba63
1fba63
%build
2a4972
%configure
1fba63
make %{?_smp_mflags}
1fba63
1fba63
1fba63
%install
1fba63
rm -rf $RPM_BUILD_ROOT
1fba63
make install DESTDIR=$RPM_BUILD_ROOT
1fba63
1fba63
# Remove unwanted libtool *.la file:
1fba63
rm $RPM_BUILD_ROOT%{_libdir}/libhivex.la
1fba63
26b2b1
# Remove unwanted Perl files:
26b2b1
find $RPM_BUILD_ROOT -name perllocal.pod -delete
26b2b1
find $RPM_BUILD_ROOT -name .packlist -delete
26b2b1
find $RPM_BUILD_ROOT -name '*.bs' -delete
26b2b1
61eed4
# Remove unwanted Python files:
61eed4
rm $RPM_BUILD_ROOT%{python_sitearch}/libhivexmod.a
61eed4
rm $RPM_BUILD_ROOT%{python_sitearch}/libhivexmod.la
61eed4
3822fd
# Only install unversioned *.so file for Python bindings.
3822fd
rm $RPM_BUILD_ROOT%{python_sitearch}/libhivexmod.so
3822fd
mv $RPM_BUILD_ROOT%{python_sitearch}/libhivexmod.so.0.0.0 \
3822fd
   $RPM_BUILD_ROOT%{python_sitearch}/libhivexmod.so
3822fd
rm $RPM_BUILD_ROOT%{python_sitearch}/libhivexmod.so.0*
61eed4
1fba63
%find_lang %{name}
1fba63
1fba63
1fba63
%clean
1fba63
rm -rf $RPM_BUILD_ROOT
1fba63
1fba63
1fba63
%post -p /sbin/ldconfig
1fba63
1fba63
%postun -p /sbin/ldconfig
1fba63
1fba63
1fba63
%files -f %{name}.lang
1fba63
%defattr(-,root,root,-)
1fba63
%doc README LICENSE
1fba63
%{_bindir}/hivexget
1fba63
%{_bindir}/hivexml
33837f
%{_bindir}/hivexregedit
1fba63
%{_bindir}/hivexsh
1fba63
%{_libdir}/libhivex.so.*
1fba63
%{_mandir}/man1/hivexget.1*
1fba63
%{_mandir}/man1/hivexml.1*
33837f
%{_mandir}/man1/hivexregedit.1*
1fba63
%{_mandir}/man1/hivexsh.1*
1fba63
1fba63
1fba63
%files devel
1fba63
%defattr(-,root,root,-)
1fba63
%doc LICENSE
1fba63
%{_libdir}/libhivex.so
1fba63
%{_mandir}/man3/hivex.3*
1fba63
%{_includedir}/hivex.h
1fba63
%{_libdir}/pkgconfig/hivex.pc
1fba63
1fba63
2a4972
%files static
2a4972
%defattr(-,root,root,-)
2a4972
%doc LICENSE
2a4972
%{_libdir}/libhivex.a
2a4972
2a4972
f82d66
%if %{with ocaml}
26b2b1
%files -n ocaml-%{name}
26b2b1
%defattr(-,root,root,-)
26b2b1
%doc README
26b2b1
%{_libdir}/ocaml/hivex
26b2b1
%exclude %{_libdir}/ocaml/hivex/*.a
26b2b1
%exclude %{_libdir}/ocaml/hivex/*.cmxa
26b2b1
%exclude %{_libdir}/ocaml/hivex/*.cmx
26b2b1
%exclude %{_libdir}/ocaml/hivex/*.mli
26b2b1
%{_libdir}/ocaml/stublibs/*.so
26b2b1
%{_libdir}/ocaml/stublibs/*.so.owner
26b2b1
26b2b1
26b2b1
%files -n ocaml-%{name}-devel
26b2b1
%defattr(-,root,root,-)
26b2b1
%{_libdir}/ocaml/hivex/*.a
26b2b1
%{_libdir}/ocaml/hivex/*.cmxa
26b2b1
%{_libdir}/ocaml/hivex/*.cmx
26b2b1
%{_libdir}/ocaml/hivex/*.mli
f82d66
%endif
26b2b1
26b2b1
26b2b1
%files -n perl-%{name}
26b2b1
%defattr(-,root,root,-)
26b2b1
%{perl_vendorarch}/*
26b2b1
%{_mandir}/man3/Win::Hivex.3pm*
33837f
%{_mandir}/man3/Win::Hivex::Regedit.3pm*
26b2b1
26b2b1
61eed4
%files -n python-%{name}
61eed4
%defattr(-,root,root,-)
3822fd
%{python_sitearch}/*.py
3822fd
%{python_sitearch}/*.pyc
3822fd
%{python_sitearch}/*.pyo
3822fd
%{python_sitearch}/*.so
61eed4
61eed4
1fba63
%changelog
253206
* Tue May 17 2011 Richard W.M. Jones <rjones@redhat.com> - 1.2.7-3
b76e59
- New upstream version 1.2.7.
b76e59
- Removed patch which is now upstream.
253206
- Add upstream patches to fix ocaml install rule.
b76e59
ccc8f8
* Thu May 12 2011 Richard W.M. Jones <rjones@redhat.com> - 1.2.6-2
f796c3
- New upstream version 1.2.6.
f796c3
- Removed patch which is now upstream.
ccc8f8
- Add upstream patch to fix ocaml tests.
f796c3
5e4fb1
* Thu Apr 28 2011 Richard W.M. Jones <rjones@redhat.com> - 1.2.5-2
5e4fb1
- Fix Python bindings on 32 bit arch with upstream patch.
5e4fb1
5e1b02
* Wed Apr 13 2011 Richard W.M. Jones <rjones@redhat.com> - 1.2.5-1
5e1b02
- New upstream version 1.2.5.
5e1b02
- This version fixes a number of important memory issues found by
5e1b02
  valgrind and upgrading to this version is recommended for all users.
5e1b02
- Remove patch now upstream.
5e1b02
30cad6
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.4-7
30cad6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
30cad6
3822fd
* Fri Jan 14 2011 Richard W.M. Jones <rjones@redhat.com> - 1.2.4-6
3822fd
- Fix multilib conflicts in *.pyc and *.pyo files.
3822fd
- Only install unversioned *.so file for Python bindings.
3822fd
448cbe
* Wed Jan  5 2011 Richard W.M. Jones <rjones@redhat.com> - 1.2.4-4
448cbe
- Rebuild against OCaml 3.12.0.
448cbe
f940d5
* Thu Dec 16 2010 Richard W.M. Jones <rjones@redhat.com> - 1.2.4-3
4fa487
- Backport upstream patch to fix segfault in Hivex.value_value binding.
4fa487
61eed4
* Thu Dec  2 2010 Richard W.M. Jones <rjones@redhat.com> - 1.2.4-1
61eed4
- New upstream version 1.2.4.
61eed4
- This adds Python bindings (python-hivex subpackage).
61eed4
- Fix Source0.
61eed4
e5ee83
* Fri Nov 19 2010 Dan Horรกk <dan[at]danny.cz> - 1.2.3-3
e5ee83
- fix built with recent perl
e5ee83
f82d66
* Tue Sep  7 2010 Dan Horรกk <dan[at]danny.cz> - 1.2.3-2
f82d66
- conditionalize ocaml support
f82d66
9f1e26
* Fri Aug 27 2010 Richard W.M. Jones <rjones@redhat.com> - 1.2.3-1
9f1e26
- New upstream version 1.2.3.
9f1e26
2a4972
* Wed Aug 25 2010 Richard W.M. Jones <rjones@redhat.com> - 1.2.2-3
2a4972
- Create a hivex-static subpackage.
2a4972
6f4b18
* Thu Apr 29 2010 Marcela Maslanova <mmaslano@redhat.com> - 1.2.2-2
6f4b18
- Mass rebuild with perl-5.12.0
6f4b18
805d36
* Wed Apr 28 2010 Richard W.M. Jones <rjones@redhat.com> - 1.2.2-1
805d36
- New upstream version 1.2.2.
805d36
33837f
* Tue Mar 30 2010 Richard W.M. Jones <rjones@redhat.com> - 1.2.1-1
33837f
- New upstream version 1.2.1.
33837f
- Includes new tool for exporting and merging in regedit format.
33837f
ea690f
* Mon Mar  1 2010 Richard W.M. Jones <rjones@redhat.com> - 1.2.0-2
26b2b1
- New upstream version 1.2.0.
26b2b1
- This includes OCaml and Perl bindings, so add these as subpackages.
26b2b1
1fba63
* Mon Feb 22 2010 Richard W.M. Jones <rjones@redhat.com> - 1.1.2-3
1fba63
- Missing Epoch in conflicts version fixed.
1fba63
1fba63
* Mon Feb 22 2010 Richard W.M. Jones <rjones@redhat.com> - 1.1.2-2
1fba63
- Add Conflicts libguestfs <= 1.0.84.
1fba63
1fba63
* Mon Feb 22 2010 Richard W.M. Jones <rjones@redhat.com> - 1.1.2-1
1fba63
- Initial Fedora RPM.