f82d66f
# conditionalize Ocaml support
f82d66f
%ifarch sparc64 s390 s390x
f82d66f
%bcond_with ocaml
f82d66f
%else
f82d66f
%bcond_without ocaml
f82d66f
%endif
f82d66f
1fba63d
Name:           hivex
1a24589
Version:        1.3.3
1a24589
Release:        1%{?dist}
1fba63d
Summary:        Read and write Windows Registry binary hive files
1fba63d
1fba63d
Group:          Development/Libraries
1fba63d
License:        LGPLv2
1fba63d
URL:            http://libguestfs.org/
61eed46
Source0:        http://libguestfs.org/download/hivex/%{name}-%{version}.tar.gz
1fba63d
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
1fba63d
1fba63d
BuildRequires:  perl
ea690fe
BuildRequires:  perl-Test-Simple
ea690fe
BuildRequires:  perl-Test-Pod
ea690fe
BuildRequires:  perl-Test-Pod-Coverage
ea690fe
BuildRequires:  perl-ExtUtils-MakeMaker
33837fc
BuildRequires:  perl-IO-stringy
ea690fe
BuildRequires:  perl-libintl
f82d66f
%if %{with ocaml}
26b2b17
BuildRequires:  ocaml
26b2b17
BuildRequires:  ocaml-findlib-devel
f82d66f
%endif
61eed46
BuildRequires:  python-devel
32358fc
BuildRequires:  ruby-devel
32358fc
BuildRequires:  rubygem-rake
1fba63d
BuildRequires:  readline-devel
1fba63d
BuildRequires:  libxml2-devel
1fba63d
1fba63d
# This library used to be part of libguestfs.  It won't install alongside
1fba63d
# the old version of libguestfs that included this library:
1fba63d
Conflicts:      libguestfs <= 1:1.0.84
1fba63d
4fa487a
# Fix Perl directory install path.
4fa487a
Patch0:         %{name}-1.2.3-dirs.patch
4fa487a
1fba63d
1fba63d
%description
1fba63d
Hive files are the undocumented binary blobs that Windows uses to
1fba63d
store the Windows Registry on disk.  Hivex is a library that can read
1fba63d
and write to these files.
1fba63d
1fba63d
'hivexsh' is a shell you can use to interactively navigate a hive
1fba63d
binary file.
1fba63d
33837fc
'hivexregedit' lets you export and merge to the textual regedit
33837fc
format.
33837fc
1fba63d
'hivexml' can be used to convert a hive file to a more useful XML
1fba63d
format.
1fba63d
1fba63d
In order to get access to the hive files themselves, you can copy them
1fba63d
from a Windows machine.  They are usually found in
1fba63d
%%systemroot%%\system32\config.  For virtual machines we recommend
1fba63d
using libguestfs or guestfish to copy out these files.  libguestfs
1fba63d
also provides a useful high-level tool called 'virt-win-reg' (based on
1fba63d
hivex technology) which can be used to query specific registry keys in
1fba63d
an existing Windows VM.
1fba63d
61eed46
For OCaml bindings, see 'ocaml-hivex-devel'.
61eed46
26b2b17
For Perl bindings, see 'perl-hivex'.
26b2b17
61eed46
For Python bindings, see 'python-hivex'.
26b2b17
32358fc
For Ruby bindings, see 'ruby-hivex'.
32358fc
1fba63d
1fba63d
%package devel
1fba63d
Summary:        Development tools and libraries for %{name}
1fba63d
Group:          Development/Libraries
1fba63d
Requires:       %{name} = %{version}-%{release}
1fba63d
Requires:       pkgconfig
1fba63d
1fba63d
1fba63d
%description devel
1fba63d
%{name}-devel contains development tools and libraries
1fba63d
for %{name}.
1fba63d
1fba63d
2a49721
%package static
2a49721
Summary:        Statically linked library for %{name}
2a49721
Group:          Development/Libraries
2a49721
Requires:       %{name} = %{version}-%{release}
2a49721
2a49721
2a49721
%description static
2a49721
%{name}-static contains the statically linked library
2a49721
for %{name}.
2a49721
2a49721
f82d66f
%if %{with ocaml}
26b2b17
%package -n ocaml-%{name}
26b2b17
Summary:       OCaml bindings for %{name}
26b2b17
Group:         Development/Libraries
26b2b17
Requires:      %{name} = %{version}-%{release}
26b2b17
26b2b17
26b2b17
%description -n ocaml-%{name}
26b2b17
ocaml-%{name} contains OCaml bindings for %{name}.
26b2b17
26b2b17
This is for toplevel and scripting access only.  To compile OCaml
26b2b17
programs which use %{name} you will also need ocaml-%{name}-devel.
26b2b17
26b2b17
26b2b17
%package -n ocaml-%{name}-devel
26b2b17
Summary:       OCaml bindings for %{name}
26b2b17
Group:         Development/Libraries
26b2b17
Requires:      ocaml-%{name} = %{version}-%{release}
26b2b17
26b2b17
26b2b17
%description -n ocaml-%{name}-devel
26b2b17
ocaml-%{name}-devel contains development libraries
26b2b17
required to use the OCaml bindings for %{name}.
f82d66f
%endif
26b2b17
26b2b17
26b2b17
%package -n perl-%{name}
26b2b17
Summary:       Perl bindings for %{name}
26b2b17
Group:         Development/Libraries
26b2b17
Requires:      %{name} = %{version}-%{release}
26b2b17
Requires:      perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
26b2b17
26b2b17
26b2b17
%description -n perl-%{name}
26b2b17
perl-%{name} contains Perl bindings for %{name}.
26b2b17
26b2b17
61eed46
%package -n python-%{name}
61eed46
Summary:       Python bindings for %{name}
61eed46
Group:         Development/Libraries
61eed46
Requires:      %{name} = %{version}-%{release}
61eed46
61eed46
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
61eed46
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
61eed46
61eed46
%description -n python-%{name}
61eed46
python-%{name} contains Python bindings for %{name}.
61eed46
61eed46
32358fc
%package -n ruby-%{name}
32358fc
Summary:       Ruby bindings for %{name}
32358fc
Group:         Development/Libraries
4d2ca6e
Requires:      %{name} = %{version}-%{release}
32358fc
Requires:      ruby(abi) = 1.8
32358fc
Requires:      ruby
32358fc
Provides:      ruby(hivex) = %{version}
32358fc
32358fc
%{!?ruby_sitelib: %global ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")}
32358fc
%{!?ruby_sitearch: %global ruby_sitearch %(ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']")}
32358fc
32358fc
%description -n ruby-%{name}
32358fc
ruby-%{name} contains Ruby bindings for %{name}.
32358fc
32358fc
1fba63d
%prep
1fba63d
%setup -q
4fa487a
e5ee831
%patch0 -p1 -b .dirs
1fba63d
1fba63d
1fba63d
%build
2a49721
%configure
1fba63d
make %{?_smp_mflags}
1fba63d
1fba63d
f090ce1
%check
f090ce1
make check
f090ce1
f090ce1
1fba63d
%install
1fba63d
rm -rf $RPM_BUILD_ROOT
1fba63d
make install DESTDIR=$RPM_BUILD_ROOT
1fba63d
1fba63d
# Remove unwanted libtool *.la file:
1fba63d
rm $RPM_BUILD_ROOT%{_libdir}/libhivex.la
1fba63d
26b2b17
# Remove unwanted Perl files:
26b2b17
find $RPM_BUILD_ROOT -name perllocal.pod -delete
26b2b17
find $RPM_BUILD_ROOT -name .packlist -delete
26b2b17
find $RPM_BUILD_ROOT -name '*.bs' -delete
26b2b17
61eed46
# Remove unwanted Python files:
61eed46
rm $RPM_BUILD_ROOT%{python_sitearch}/libhivexmod.la
61eed46
1fba63d
%find_lang %{name}
1fba63d
1fba63d
1fba63d
%clean
1fba63d
rm -rf $RPM_BUILD_ROOT
1fba63d
1fba63d
1fba63d
%post -p /sbin/ldconfig
1fba63d
1fba63d
%postun -p /sbin/ldconfig
1fba63d
1fba63d
1fba63d
%files -f %{name}.lang
1fba63d
%defattr(-,root,root,-)
1fba63d
%doc README LICENSE
1fba63d
%{_bindir}/hivexget
1fba63d
%{_bindir}/hivexml
33837fc
%{_bindir}/hivexregedit
1fba63d
%{_bindir}/hivexsh
1fba63d
%{_libdir}/libhivex.so.*
1fba63d
%{_mandir}/man1/hivexget.1*
1fba63d
%{_mandir}/man1/hivexml.1*
33837fc
%{_mandir}/man1/hivexregedit.1*
1fba63d
%{_mandir}/man1/hivexsh.1*
1fba63d
1fba63d
1fba63d
%files devel
1fba63d
%defattr(-,root,root,-)
1fba63d
%doc LICENSE
1fba63d
%{_libdir}/libhivex.so
1fba63d
%{_mandir}/man3/hivex.3*
1fba63d
%{_includedir}/hivex.h
1fba63d
%{_libdir}/pkgconfig/hivex.pc
1fba63d
1fba63d
2a49721
%files static
2a49721
%defattr(-,root,root,-)
2a49721
%doc LICENSE
2a49721
%{_libdir}/libhivex.a
2a49721
2a49721
f82d66f
%if %{with ocaml}
26b2b17
%files -n ocaml-%{name}
26b2b17
%defattr(-,root,root,-)
26b2b17
%doc README
26b2b17
%{_libdir}/ocaml/hivex
26b2b17
%exclude %{_libdir}/ocaml/hivex/*.a
26b2b17
%exclude %{_libdir}/ocaml/hivex/*.cmxa
26b2b17
%exclude %{_libdir}/ocaml/hivex/*.cmx
26b2b17
%exclude %{_libdir}/ocaml/hivex/*.mli
26b2b17
%{_libdir}/ocaml/stublibs/*.so
26b2b17
%{_libdir}/ocaml/stublibs/*.so.owner
26b2b17
26b2b17
26b2b17
%files -n ocaml-%{name}-devel
26b2b17
%defattr(-,root,root,-)
26b2b17
%{_libdir}/ocaml/hivex/*.a
26b2b17
%{_libdir}/ocaml/hivex/*.cmxa
26b2b17
%{_libdir}/ocaml/hivex/*.cmx
26b2b17
%{_libdir}/ocaml/hivex/*.mli
f82d66f
%endif
26b2b17
26b2b17
26b2b17
%files -n perl-%{name}
26b2b17
%defattr(-,root,root,-)
26b2b17
%{perl_vendorarch}/*
26b2b17
%{_mandir}/man3/Win::Hivex.3pm*
33837fc
%{_mandir}/man3/Win::Hivex::Regedit.3pm*
26b2b17
26b2b17
61eed46
%files -n python-%{name}
61eed46
%defattr(-,root,root,-)
3822fde
%{python_sitearch}/*.py
3822fde
%{python_sitearch}/*.pyc
3822fde
%{python_sitearch}/*.pyo
3822fde
%{python_sitearch}/*.so
61eed46
61eed46
32358fc
%files -n ruby-%{name}
32358fc
%defattr(-,root,root,-)
32358fc
%doc ruby/doc/site/*
32358fc
%{ruby_sitelib}/hivex.rb
32358fc
%{ruby_sitearch}/_hivex.so
32358fc
32358fc
1fba63d
%changelog
1a24589
* Tue Nov 29 2011 Richard W.M. Jones <rjones@redhat.com> - 1.3.3-1
1a24589
- New upstream version 1.3.3.
1a24589
- Rebased gnulib to work around RHBZ#756981.
1a24589
- Remove patches which are now upstream.
1a24589
ed5bd2e
* Mon Oct 24 2011 Richard W.M. Jones <rjones@redhat.com> - 1.3.2-3
6c8dcb4
- New upstream version 1.3.2.
d91625b
- Add upstream patch to fix building of hivexsh, hivexget.
6c8dcb4
befe5d7
* Fri Aug 26 2011 Richard W.M. Jones <rjones@redhat.com> - 1.3.1-2
751f999
- New upstream version 1.3.1.
751f999
- Remove patch, now upstream.
befe5d7
- Don't need hack for making an unversioned Python module.
751f999
4d2ca6e
* Mon Aug 15 2011 Richard W.M. Jones <rjones@redhat.com> - 1.3.0-3
32358fc
- New upstream version 1.3.0.
32358fc
- This version adds Ruby bindings, so there is a new subpackage 'ruby-hivex'.
e3ff5b8
- Add upstream patch to fix Ruby tests.
4d2ca6e
- Remove epoch macro in ruby-hivex dependency.
32358fc
9ab6190
* Fri Aug 12 2011 Richard W.M. Jones <rjones@redhat.com> - 1.2.8-1
9ab6190
- New upstream version 1.2.8.
9ab6190
- Remove 4 upstream patches.
9ab6190
0558bf0
* Fri Jul 22 2011 Richard W.M. Jones <rjones@redhat.com> - 1.2.7-9
b2ed1b6
- Add upstream patch to fix Perl CCFLAGS for Perl 5.14 on i686.
f090ce1
- Enable 'make check'.
b2ed1b6
403af1c
* Thu Jul 21 2011 Richard W.M. Jones <rjones@redhat.com> - 1.2.7-6
403af1c
- i686 package is broken, experimentally rebuild it.
403af1c
f8176e6
* Fri Jun 17 2011 Marcela Mašláňová <mmaslano@redhat.com> - 1.2.7-5
f8176e6
- Perl mass rebuild
f8176e6
2e74c1c
* Fri Jun 10 2011 Marcela Mašláňová <mmaslano@redhat.com> - 1.2.7-4
2e74c1c
- Perl 5.14 mass rebuild
2e74c1c
2532068
* Tue May 17 2011 Richard W.M. Jones <rjones@redhat.com> - 1.2.7-3
b76e59b
- New upstream version 1.2.7.
b76e59b
- Removed patch which is now upstream.
2532068
- Add upstream patches to fix ocaml install rule.
b76e59b
ccc8f89
* Thu May 12 2011 Richard W.M. Jones <rjones@redhat.com> - 1.2.6-2
f796c36
- New upstream version 1.2.6.
f796c36
- Removed patch which is now upstream.
ccc8f89
- Add upstream patch to fix ocaml tests.
f796c36
5e4fb17
* Thu Apr 28 2011 Richard W.M. Jones <rjones@redhat.com> - 1.2.5-2
5e4fb17
- Fix Python bindings on 32 bit arch with upstream patch.
5e4fb17
5e1b023
* Wed Apr 13 2011 Richard W.M. Jones <rjones@redhat.com> - 1.2.5-1
5e1b023
- New upstream version 1.2.5.
5e1b023
- This version fixes a number of important memory issues found by
5e1b023
  valgrind and upgrading to this version is recommended for all users.
5e1b023
- Remove patch now upstream.
5e1b023
30cad61
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.4-7
30cad61
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
30cad61
3822fde
* Fri Jan 14 2011 Richard W.M. Jones <rjones@redhat.com> - 1.2.4-6
3822fde
- Fix multilib conflicts in *.pyc and *.pyo files.
3822fde
- Only install unversioned *.so file for Python bindings.
3822fde
448cbe3
* Wed Jan  5 2011 Richard W.M. Jones <rjones@redhat.com> - 1.2.4-4
448cbe3
- Rebuild against OCaml 3.12.0.
448cbe3
f940d5b
* Thu Dec 16 2010 Richard W.M. Jones <rjones@redhat.com> - 1.2.4-3
4fa487a
- Backport upstream patch to fix segfault in Hivex.value_value binding.
4fa487a
61eed46
* Thu Dec  2 2010 Richard W.M. Jones <rjones@redhat.com> - 1.2.4-1
61eed46
- New upstream version 1.2.4.
61eed46
- This adds Python bindings (python-hivex subpackage).
61eed46
- Fix Source0.
61eed46
e5ee831
* Fri Nov 19 2010 Dan Horák <dan[at]danny.cz> - 1.2.3-3
e5ee831
- fix built with recent perl
e5ee831
f82d66f
* Tue Sep  7 2010 Dan Horák <dan[at]danny.cz> - 1.2.3-2
f82d66f
- conditionalize ocaml support
f82d66f
9f1e264
* Fri Aug 27 2010 Richard W.M. Jones <rjones@redhat.com> - 1.2.3-1
9f1e264
- New upstream version 1.2.3.
9f1e264
2a49721
* Wed Aug 25 2010 Richard W.M. Jones <rjones@redhat.com> - 1.2.2-3
2a49721
- Create a hivex-static subpackage.
2a49721
6f4b18a
* Thu Apr 29 2010 Marcela Maslanova <mmaslano@redhat.com> - 1.2.2-2
6f4b18a
- Mass rebuild with perl-5.12.0
6f4b18a
805d36f
* Wed Apr 28 2010 Richard W.M. Jones <rjones@redhat.com> - 1.2.2-1
805d36f
- New upstream version 1.2.2.
805d36f
33837fc
* Tue Mar 30 2010 Richard W.M. Jones <rjones@redhat.com> - 1.2.1-1
33837fc
- New upstream version 1.2.1.
33837fc
- Includes new tool for exporting and merging in regedit format.
33837fc
ea690fe
* Mon Mar  1 2010 Richard W.M. Jones <rjones@redhat.com> - 1.2.0-2
26b2b17
- New upstream version 1.2.0.
26b2b17
- This includes OCaml and Perl bindings, so add these as subpackages.
26b2b17
1fba63d
* Mon Feb 22 2010 Richard W.M. Jones <rjones@redhat.com> - 1.1.2-3
1fba63d
- Missing Epoch in conflicts version fixed.
1fba63d
1fba63d
* Mon Feb 22 2010 Richard W.M. Jones <rjones@redhat.com> - 1.1.2-2
1fba63d
- Add Conflicts libguestfs <= 1.0.84.
1fba63d
1fba63d
* Mon Feb 22 2010 Richard W.M. Jones <rjones@redhat.com> - 1.1.2-1
1fba63d
- Initial Fedora RPM.