hivex/hivex.spec

268 lines
7.0 KiB
RPMSpec
Raw Normal View History

2019-12-07 00:33:34 +08:00
%ifarch %{ocaml_native_compiler}
%bcond_without ocaml
%else
%bcond_with ocaml
%endif
Name: hivex
2023-10-09 14:09:33 +08:00
Version: 1.3.23
Release: 2
2022-10-08 11:04:37 +08:00
Summary: Read and write Windows Registry binary hive files
2019-12-07 00:33:34 +08:00
License: LGPLv2
URL: http://libguestfs.org/
2019-12-09 22:22:04 +08:00
Source0: http://libguestfs.org/download/hivex/%{name}-%{version}.tar.gz
Source1: http://libguestfs.org/download/hivex/%{name}-%{version}.tar.gz.sig
Source2: libguestfs.keyring
2023-10-09 14:09:33 +08:00
# https://github.com/libguestfs/hivex/commit/fbcff7fbd8f96214c7f13f36bd7669a9142824ab
Patch0: 0001-ruby-Replace-MiniTest-with-Minitest.patch
# https://github.com/libguestfs/hivex/commit/6dbbc474d3df5cdfd21ed5e692b3a58136fffc42
Patch1: 0002-ruby-Get-rid-of-old-Test-Unit-compatibility.patch
# https://github.com/libguestfs/hivex/commit/326399ceef0c904f78cdd5da17f7ca724292b4f
Patch2: 0003-build-Go-back-to-gettext-0.19.patch
2019-12-09 22:22:04 +08:00
2022-10-08 11:04:37 +08:00
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
2019-12-07 00:33:34 +08:00
%if %{with ocaml}
BuildRequires: ocaml
BuildRequires: ocaml-findlib-devel
%endif
2022-10-08 11:04:37 +08:00
BuildRequires: python3-devel
BuildRequires: ruby-devel
BuildRequires: rubygem-rake
BuildRequires: rubygem(json)
BuildRequires: rubygem(minitest)
BuildRequires: rubygem(rdoc)
BuildRequires: readline-devel
BuildRequires: libxml2-devel
BuildRequires: gnupg2
BuildRequires: make
2023-10-09 14:09:33 +08:00
BuildRequires: autoconf automake libtool gettext-devel
2022-10-08 11:04:37 +08:00
Provides: bundled(gnulib)
%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.
2019-12-07 00:33:34 +08:00
2022-10-08 11:04:37 +08:00
'hivexsh' is a shell you can use to interactively navigate a hive binary file.
2019-12-07 00:33:34 +08:00
2022-10-08 11:04:37 +08:00
'hivexregedit' (in perl-hivex) lets you export and merge to the textual regedit format.
2019-12-07 00:33:34 +08:00
2022-10-08 11:04:37 +08:00
'hivexml' can be used to convert a hive file to a more useful XML format.
2019-12-11 00:20:05 +08:00
2022-10-08 11:04:37 +08:00
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.
2019-12-07 00:33:34 +08:00
2022-10-08 11:04:37 +08:00
For OCaml bindings, see 'ocaml-hivex-devel'.
2019-12-07 00:33:34 +08:00
2022-10-08 11:04:37 +08:00
For Perl bindings, see 'perl-hivex'.
2019-12-07 00:33:34 +08:00
2022-10-08 11:04:37 +08:00
For Python 3 bindings, see 'python3-hivex'.
2019-12-07 00:33:34 +08:00
2022-10-08 11:04:37 +08:00
For Ruby bindings, see 'ruby-hivex'.
2019-12-07 00:33:34 +08:00
2019-12-11 00:20:05 +08:00
2019-12-07 00:33:34 +08:00
%package devel
2022-10-08 11:04:37 +08:00
Summary: Development tools and libraries for %{name}
2019-12-07 00:33:34 +08:00
Requires: %{name} = %{version}-%{release}
Requires: pkgconfig
2019-12-11 06:54:02 +08:00
Provides: %{name}-static = %{version}-%{release}
Obsoletes: %{name}-static < %{version}-%{release}
2019-12-10 21:25:05 +08:00
2019-12-07 00:33:34 +08:00
%description devel
2022-10-08 11:04:37 +08:00
%{name}-devel contains development tools and libraries for %{name}.
2019-12-07 00:33:34 +08:00
2019-12-09 22:22:04 +08:00
%package_help
2019-12-07 00:33:34 +08:00
%if %{with ocaml}
%package -n ocaml-%{name}
2022-10-08 11:04:37 +08:00
Summary: OCaml bindings for %{name}
2019-12-07 00:33:34 +08:00
Requires: %{name} = %{version}-%{release}
2022-10-08 11:04:37 +08:00
2019-12-07 00:33:34 +08:00
%description -n ocaml-%{name}
2022-10-08 11:04:37 +08:00
ocaml-%{name} contains OCaml bindings for %{name}.
2019-12-07 00:33:34 +08:00
2022-10-08 11:04:37 +08:00
This is for toplevel and scripting access only. To compile OCaml
programs which use %{name} you will also need ocaml-%{name}-devel.
2019-12-07 00:33:34 +08:00
%package -n ocaml-%{name}-devel
2022-10-08 11:04:37 +08:00
Summary: OCaml bindings for %{name}
2019-12-07 00:33:34 +08:00
Requires: ocaml-%{name} = %{version}-%{release}
Requires: %{name}-devel = %{version}-%{release}
2022-10-08 11:04:37 +08:00
2019-12-07 00:33:34 +08:00
%description -n ocaml-%{name}-devel
2022-10-08 11:04:37 +08:00
ocaml-%{name}-devel contains development libraries
required to use the OCaml bindings for %{name}.
2019-12-07 00:33:34 +08:00
%endif
%package -n perl-%{name}
2022-10-08 11:04:37 +08:00
Summary: Perl bindings for %{name}
2019-12-07 00:33:34 +08:00
Requires: %{name} = %{version}-%{release}
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
2022-10-08 11:04:37 +08:00
2019-12-07 00:33:34 +08:00
%description -n perl-%{name}
2022-10-08 11:04:37 +08:00
perl-%{name} contains Perl bindings for %{name}.
2019-12-07 00:33:34 +08:00
%package -n python3-%{name}
2022-10-08 11:04:37 +08:00
Summary: Python 3 bindings for %{name}
2019-12-07 00:33:34 +08:00
Requires: %{name} = %{version}-%{release}
%description -n python3-%{name}
2022-10-08 11:04:37 +08:00
python3-%{name} contains Python 3 bindings for %{name}.
2019-12-07 00:33:34 +08:00
%package -n ruby-%{name}
2022-10-08 11:04:37 +08:00
Summary: Ruby bindings for %{name}
2019-12-07 00:33:34 +08:00
Requires: %{name} = %{version}-%{release}
Requires: ruby(release)
Requires: ruby
Provides: ruby(hivex) = %{version}
%description -n ruby-%{name}
2022-10-08 11:04:37 +08:00
ruby-%{name} contains Ruby bindings for %{name}.
2019-12-07 00:33:34 +08:00
%prep
2019-12-10 21:25:05 +08:00
tmphome="$(mktemp -d)" && gpgv2 --homedir "$tmphome" --keyring %{SOURCE2} %{SOURCE1} %{SOURCE0}
2023-10-09 14:09:33 +08:00
%autosetup -n %{name}-%{version} -p1
autoreconf -fi
2019-12-07 00:33:34 +08:00
2019-12-11 00:20:05 +08:00
2019-12-07 00:33:34 +08:00
%build
%configure \
2022-10-08 11:04:37 +08:00
PYTHON=%{__python3} \
2019-12-07 00:33:34 +08:00
%if !%{with ocaml}
--disable-ocaml \
%endif
%{nil}
2019-12-10 21:25:05 +08:00
%make_build V=1 INSTALLDIRS=vendor
2019-12-07 00:33:34 +08:00
2019-12-11 00:20:05 +08:00
2019-12-07 00:33:34 +08:00
%install
2019-12-11 13:58:21 +08:00
%make_install INSTALLDIRS=vendor
2019-12-07 00:33:34 +08:00
%find_lang %{name}
%check
make check
2019-12-10 21:25:05 +08:00
%files -f %{name}.lang
2023-10-09 14:09:33 +08:00
%doc README.md
%license LICENSE
2019-12-10 21:25:05 +08:00
%{_bindir}/hivexget
%{_bindir}/hivexml
%{_bindir}/hivexsh
%{_libdir}/libhivex.so.*
%exclude %{_libdir}/libhivex.la
%exclude %{_libdir}/perl5/perllocal.pod
%exclude %{python3_sitearch}/libhivexmod.la
2019-12-07 00:33:34 +08:00
%files devel
%doc LICENSE
%{_libdir}/libhivex.so
%{_includedir}/hivex.h
%{_libdir}/pkgconfig/hivex.pc
%{_libdir}/libhivex.a
2019-12-10 21:25:05 +08:00
2019-12-09 22:22:04 +08:00
%files help
%{_mandir}/man1/hivexget.1*
%{_mandir}/man1/hivexml.1*
%{_mandir}/man1/hivexsh.1*
2019-12-10 21:25:05 +08:00
%{_mandir}/man1/hivexregedit.1*
2019-12-09 22:22:04 +08:00
%{_mandir}/man3/hivex.3*
%{_mandir}/man3/Win::Hivex.3pm*
%{_mandir}/man3/Win::Hivex::Regedit.3pm*
2019-12-10 21:25:05 +08:00
2019-12-07 00:33:34 +08:00
%if %{with ocaml}
%files -n ocaml-%{name}
2023-10-09 14:09:33 +08:00
%doc README.md
2019-12-07 00:33:34 +08:00
%{_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
%files -n ocaml-%{name}-devel
%{_libdir}/ocaml/hivex/*.a
%ifnarch sw_64
2019-12-07 00:33:34 +08:00
%{_libdir}/ocaml/hivex/*.cmxa
%{_libdir}/ocaml/hivex/*.cmx
%endif
2019-12-07 00:33:34 +08:00
%{_libdir}/ocaml/hivex/*.mli
%endif
%files -n perl-%{name}
%{perl_vendorarch}/*
%{_bindir}/hivexregedit
%files -n python3-%{name}
%{python3_sitearch}/hivex/
%{python3_sitearch}/*.so
%files -n ruby-%{name}
%doc ruby/doc/site/*
%{ruby_vendorlibdir}/hivex.rb
%{ruby_vendorarchdir}/_hivex.so
%changelog
* Sat Mar 15 2025 mahailiang <mahailiang@uniontech.com> - 1.3.23-2
- fix sw_64 build error
2023-10-09 14:09:33 +08:00
* Mon Oct 09 2023 yaoxin <yao_xin001@hoperun.com> - 1.3.23-1
- Upgrade to 1.3.23
2022-10-08 11:04:37 +08:00
* Wed Oct 12 2022 hantingxiang <hantingxiang@gmail.com> - 1.3.21-1
- update version to 1.3.21
2021-09-24 09:50:37 +08:00
* Fri Sep 24 2021 yaoxin <yaoxin30@huawei.com> - 1.3.17-5
- Fix CVE-2021-3622
2021-05-25 14:43:49 +08:00
* Tue May 25 2021 wangyue <wangyue92@huawei.com> - 1.3.17-4
- Fix CVE-2021-3504
2020-10-29 10:37:29 +08:00
* Wed Oct 21 2020 leiju <leiju4@163.com> - 1.3.17-3
- remove python2 subpackage
2019-12-11 00:20:05 +08:00
* Sat Nov 30 2019 jiaxiya <jiaxiyajiaxiya@163.com> - 1.3.17-2
2019-12-07 00:33:34 +08:00
- Package init