diff --git a/hivex-1.3.23.tar.gz b/hivex-1.3.23.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..53967eb6826a06881be40cce8e466b60c7384577 Binary files /dev/null and b/hivex-1.3.23.tar.gz differ diff --git a/hivex.spec b/hivex.spec new file mode 100644 index 0000000000000000000000000000000000000000..6fbfb70b2d78b5a78a22ef27118c6e379ef5d2d9 --- /dev/null +++ b/hivex.spec @@ -0,0 +1,276 @@ +%define anolis_release 1 + +%undefine _package_note_flags +%ifarch %{ocaml_native_compiler} +%bcond_without ocaml +%else +%bcond_with ocaml +%endif + +Name: hivex +Version: 1.3.23 +Release: %{anolis_release}%{?dist} +Summary: Read and write Windows Registry binary hive files +License: LGPLv2 +URL: http://libguestfs.org/ +Source0: http://libguestfs.org/download/hivex/%{name}-%{version}.tar.gz + +BuildRequires: make +BuildRequires: autoconf, automake, libtool, gettext-devel +BuildRequires: perl-interpreter +BuildRequires: perl-devel +BuildRequires: perl-generators +BuildRequires: %{_bindir}/pod2html +BuildRequires: %{_bindir}/pod2man +BuildRequires: perl(bytes) +BuildRequires: perl(Carp) +BuildRequires: perl(Encode) +BuildRequires: perl(ExtUtils::MakeMaker) +BuildRequires: perl(Exporter) +BuildRequires: perl(IO::Scalar) +BuildRequires: perl(IO::Stringy) +BuildRequires: perl(strict) +BuildRequires: perl(Test::More) +BuildRequires: perl(utf8) +BuildRequires: perl(vars) +BuildRequires: perl(warnings) +BuildRequires: perl(XSLoader) +BuildRequires: perl(Test::Pod) >= 1.00 +BuildRequires: perl(Test::Pod::Coverage) >= 1.00 +%if %{with ocaml} +BuildRequires: ocaml +BuildRequires: ocaml-findlib-devel +%endif +BuildRequires: python3-devel +BuildRequires: ruby-devel +BuildRequires: rubygem-rake +BuildRequires: rubygem(json) +BuildRequires: rubygem(minitest) +BuildRequires: rubygem(rdoc) +BuildRequires: readline-devel +BuildRequires: libxml2-devel + +Requires: %{name}-libs = %{version}-%{release} +Conflicts: %{name} < 1.3.20-6 +Obsoletes: %{name} < 1.3.20-6 + +%description +Hive files are the undocumented binary files that Windows uses to +store the Windows Registry on disk. Hivex is a library that can read +and write to these files. + +'hivexsh' is a shell you can use to interactively navigate a hive +binary file. + +'hivexregedit' (in perl-hivex) lets you export and merge to the +textual regedit format. + +'hivexml' can be used to convert a hive file to a more useful XML +format. + +In order to get access to the hive files themselves, you can copy them +from a Windows machine. They are usually found in +%%systemroot%%\system32\config. For virtual machines we recommend +using libguestfs or guestfish to copy out these files. libguestfs +also provides a useful high-level tool called 'virt-win-reg' (based on +hivex technology) which can be used to query specific registry keys in +an existing Windows VM. + +For OCaml bindings, see 'ocaml-hivex-devel'. + +For Perl bindings, see 'perl-hivex'. + +For Python 3 bindings, see 'python3-hivex'. + +For Ruby bindings, see 'ruby-hivex'. + +%package libs +Summary: Library for %{name} +Conflicts: %{name} < 1.3.20-6 +Obsoletes: %{name} < 1.3.20-6 + +%description libs +%{name}-libs contains the library for %{name}. + +%package devel +Summary: Development tools and libraries for %{name} +Requires: %{name}-libs = %{version}-%{release} +Requires: pkgconfig + +%description devel +%{name}-devel contains development tools and libraries +for %{name}. + +%package static +Summary: Statically linked library for %{name} +Requires: %{name}-devel = %{version}-%{release} + +%description static +%{name}-static contains the statically linked library for %{name}. + +%if %{with ocaml} +%package -n ocaml-%{name} +Summary: OCaml bindings for %{name} +Requires: %{name}-libs = %{version}-%{release} + +%description -n ocaml-%{name} +ocaml-%{name} contains OCaml bindings for %{name}. + +This is for toplevel and scripting access only. To compile OCaml +programs which use %{name} you will also need ocaml-%{name}-devel. + +%package -n ocaml-%{name}-devel +Summary: OCaml bindings for %{name} +Requires: ocaml-%{name} = %{version}-%{release} +Requires: %{name}-devel = %{version}-%{release} + +%description -n ocaml-%{name}-devel +ocaml-%{name}-devel contains development libraries +required to use the OCaml bindings for %{name}. +%endif + +%package -n perl-%{name} +Summary: Perl bindings for %{name} +Requires: %{name}-libs = %{version}-%{release} + +%description -n perl-%{name} +perl-%{name} contains Perl bindings for %{name}. + +%package -n python3-%{name} +Summary: Python 3 bindings for %{name} +Requires: %{name}-libs = %{version}-%{release} + +%description -n python3-%{name} +python3-%{name} contains Python 3 bindings for %{name}. + +%package -n ruby-%{name} +Summary: Ruby bindings for %{name} +Requires: %{name}-libs = %{version}-%{release} +Requires: ruby(release) +Requires: ruby +Provides: ruby(hivex) = %{version} + +%description -n ruby-%{name} +ruby-%{name} contains Ruby bindings for %{name}. + +%package doc +Summary: Documentation files for %{name} +Requires: %{name} = %{EVR} +BuildArch: noarch + +%description doc +The %{name}-doc package contains documentation files for %{name}. + +%prep +%setup -q +%autopatch -p1 +autoreconf -fi + +%build +%configure \ + PYTHON=%{__python3} \ +%if !%{with ocaml} + --disable-ocaml \ +%endif + %{nil} +make V=1 INSTALLDIRS=vendor %{?_smp_mflags} + +%install +make install DESTDIR=$RPM_BUILD_ROOT INSTALLDIRS=vendor + +# Remove unwanted libtool *.la file: +rm $RPM_BUILD_ROOT%{_libdir}/libhivex.la + +# Remove unwanted Perl files: +find $RPM_BUILD_ROOT -name perllocal.pod -delete +find $RPM_BUILD_ROOT -name .packlist -delete +find $RPM_BUILD_ROOT -name '*.bs' -delete + +# Remove unwanted Python files: +rm $RPM_BUILD_ROOT%{python3_sitearch}/libhivexmod.la + +%find_lang %{name} +%generate_compatibility_deps + +%check +if ! make check -k; then + for f in $( find -name test-suite.log | xargs grep -l ^FAIL: ); do + echo + echo "***" $f "***" + cat $f + echo + done + exit 1 +fi + +%files -f %{name}.lang +%license LICENSE +%{_bindir}/hivexget +%{_bindir}/hivexml +%{_bindir}/hivexsh +%{_mandir}/man1/hivexget.1* +%{_mandir}/man1/hivexml.1* +%{_mandir}/man1/hivexsh.1* + +%files libs +%doc README.md +%license LICENSE +%{_libdir}/libhivex.so.* +%dir %{abidir} +%{abidir}/libhivex.dump + +%files devel +%license LICENSE +%{_libdir}/libhivex.so +%{_mandir}/man3/hivex.3* +%{_includedir}/hivex.h +%{_libdir}/pkgconfig/hivex.pc + +%files static +%license LICENSE +%{_libdir}/libhivex.a + +%if %{with ocaml} +%files -n ocaml-%{name} +%doc README.md +%{_libdir}/ocaml/hivex +%exclude %{_libdir}/ocaml/hivex/*.a +%exclude %{_libdir}/ocaml/hivex/*.cmxa +%exclude %{_libdir}/ocaml/hivex/*.cmx +%exclude %{_libdir}/ocaml/hivex/*.mli +%{_libdir}/ocaml/stublibs/*.so +%{_libdir}/ocaml/stublibs/*.so.owner +%{abidir}/dllmlhivex.dump + +%files -n ocaml-%{name}-devel +%{_libdir}/ocaml/hivex/*.a +%{_libdir}/ocaml/hivex/*.cmxa +%{_libdir}/ocaml/hivex/*.cmx +%{_libdir}/ocaml/hivex/*.mli +%endif + +%files -n perl-%{name} +%{perl_vendorarch}/* +%{_mandir}/man3/Win::Hivex.3pm* +%{_mandir}/man3/Win::Hivex::Regedit.3pm* +%{_bindir}/hivexregedit +%{_mandir}/man1/hivexregedit.1* +%{abidir}/Hivex.dump + +%files -n python3-%{name} +%{python3_sitearch}/hivex/ +%{python3_sitearch}/*.so +%{abidir}/libhivexmod.cpython-*.dump + +%files -n ruby-%{name} +%doc ruby/doc/site/* +%{ruby_vendorlibdir}/hivex.rb +%{ruby_vendorarchdir}/_hivex.so +%{abidir}/_hivex.dump + +%files doc +%doc README.md + +%changelog +* Tue Mar 21 2023 Yuanhong Peng - 1.3.23-1 +- Init from upstream