update spec

This commit is contained in:
jiaxiya 2019-12-10 21:25:05 +08:00
parent ef72a499ab
commit 724eb2501a
6 changed files with 121 additions and 67 deletions

View File

@ -0,0 +1,48 @@
From be51757920b56a77e2e63247f9a8409ce994d33c Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Mon, 26 Feb 2018 12:38:12 +0000
Subject: [PATCH] ocaml: Link the C bindings with LDFLAGS (RHBZ#1548536).
Use the ocamlmklib -ldopt flag to pass the general $(LDFLAGS) when
calling gcc to link dllmlhivex.so. We were already passing $(CFLAGS)
when building the object file.
When building using Fedora's standard hardening flags this gives:
ocamlmklib -o mlhivex hivex_c.o hivex.cmo \
-verbose -ldopt '-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld' \
-L../lib/.libs -lhivex
+ gcc -shared -o ./dllmlhivex.so hivex_c.o -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -L../lib/.libs -lhivex
+ ar rc ./libmlhivex.a hivex_c.o; ranlib ./libmlhivex.a
+ /usr/bin/ocamlc -a -o mlhivex.cma hivex.cmo -dllib -lmlhivex -cclib -lmlhivex -cclib -L../lib/.libs -cclib -lhivex
This also works if $(LDFLAGS) is empty, because ocamlmklib ignores
-ldopt ''.
---
ocaml/Makefile.am | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am
index 61db095..85655b6 100644
--- a/ocaml/Makefile.am
+++ b/ocaml/Makefile.am
@@ -41,10 +41,14 @@ OBJS = hivex_c.o hivex.cmo
XOBJS = $(OBJS:.cmo=.cmx)
mlhivex.cma: $(OBJS)
- $(OCAMLMKLIB) -o mlhivex $^ -L$(top_builddir)/lib/.libs -lhivex
+ $(OCAMLMKLIB) -o mlhivex $^ \
+ -ldopt '$(LDFLAGS)' \
+ -L$(top_builddir)/lib/.libs -lhivex
mlhivex.cmxa: $(XOBJS)
- $(OCAMLMKLIB) -o mlhivex $^ -L$(top_builddir)/lib/.libs -lhivex
+ $(OCAMLMKLIB) -o mlhivex $^ \
+ -ldopt '$(LDFLAGS)' \
+ -L$(top_builddir)/lib/.libs -lhivex
hivex_c.o: hivex_c.c
$(CC) $(AM_CPPFLAGS) $(CFLAGS) -fPIC -Wall -c $<
--
2.13.2

BIN
hivex-1.3.15.tar.gz Normal file

Binary file not shown.

16
hivex-1.3.15.tar.gz.sig Normal file
View File

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIcBAABAgAGBQJalDSOAAoJEJFzj3Pht2igdNYP/2R2+SkPNutZfQpUZfiKD/vQ
RRAQjePYncUjNUc2WgX7LXmJN1z9WfKRzUGqQG7sD/B7BnecBtEOP4Dyw5PpjgBQ
ae4ErdeU6uFv5xSiprnYErfGJrhYSBfDKilDjrdO7J4AlTlVVlgfeb7C5TopER81
brVJ7iXuF6rbZmQP3c0D3GWdez3Nw719e6MmdM9FFGQQS8hg9vZlNYQPyiFEQx1U
nNjSMaoft+OWYEQp56arjPOLj4JiIcIH9B/HLu8Tcl4FEogTCVyMsodyEFXzfBUm
21UfIn/RNEXjI8DJ/k7kh35uWEwv8hb/0YszGAWNpSt+rrdx9+decjNdNI2DZs65
XEcuboWN7UOZJf2p+8f78QVcbwNPRjpnfGZaVLYJYNON3y/lyvhrA8je5FOzsyVA
4G6BwU3ythoS2NTK3Q76I7UdMDvz6vydgsLAruVVtMX5x1M7fXoplRxi1nkRjCvQ
Qgmo0L/rwwDUitRmlRyyJqZK7j+lMlltuZAck9XCUtd72VRAUj4f56I8Xo2wwT0Y
ioFer6o02K18pjhGLikV4ujUUKAkC1lAK1QhsEsp7y2isOe1mA3ptcGrz4rElcaH
f78Yr7b28Gl9HSGg98uhYEwWVCl5fUwXhDUQVVNutDRPKI479O390uGG7ZNZTghS
Lv/P/Uz1ijp+m8Hi5WsX
=gmjv
-----END PGP SIGNATURE-----

Binary file not shown.

View File

@ -1,17 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQJFBAABCAAvFiEE93dPsa0HSn6Mh2fqkXOPc+G3aKAFAlxHnNsRHHJpY2hAYW5u
ZXhpYS5vcmcACgkQkXOPc+G3aKCbkxAAortQKeA7TDTeiTk3dwI/tQ+4VVqe90lt
L/xWnDtR6ZH5DZ4FgcJbaKx9PCBtaQxyFBjA5qcrEClK8fTfm3NGNPQuSX4YDN83
3jJx2uOtM7Io5hpFrXeWC22m77dqQKeU0r1oblJtf1kK1SEef6HL44flCtGr+HlM
37nwm29ToSl5Ksp9XvBqT5smQVuUPjqwcm+4jYUR88SnFmkTpneZYYTstDbqzvUm
RT089O/q+4JLh6egfyA66wXTfzhsqe3HRZtG7pPhe+j/HBIfYmAigEi4Cm/6pFrc
vNJAZ9KJ50no69A2jZ86Dfy4/4nwjYc/aDZ0vIZ4Fairj+LzTxQwfQeYk1BCqb2z
XNNRl3pUDkrk3jrAPnxqR2z/2qsEgoSrVDEQlhVUZ1n/WOTqxst1F0YHOeHHWun5
O1d2nV8i1A8JAysHx77smKscpKtu4jcymr4SmqXYSG90BvuqxJgpPsX6rln38DKX
qA3Zj7wKkqOTBbX+JInBwMcWOzzAO38hQkQjuOG71CQ6CKVGdnovp4OHDcwsmkp4
KbCjnXgIl5DOxCrnVaWtPV5Zy6smst982fG0zPD/m42Dz7+Tb4O1np8zfLH9C4Dx
CdD3otIo0XOJM50Bvu9Oqn/SP8j8nDqMZtiCg+gXBRyVdl37EGqtwd/2bt7TRWSV
xmddKuLdf6Q=
=+f/m
-----END PGP SIGNATURE-----

View File

@ -5,8 +5,8 @@
%endif
Name: hivex
Version: 1.3.17
Release: 2
Version: 1.3.15
Release: 12
Summary: Windows Registry "hive" extraction library
License: LGPLv2
URL: http://libguestfs.org/
@ -15,7 +15,9 @@ Source0: http://libguestfs.org/download/hivex/%{name}-%{version}.tar.gz
Source1: http://libguestfs.org/download/hivex/%{name}-%{version}.tar.gz.sig
Source2: libguestfs.keyring
BuildRequires: autoconf, automake, libtool, gettext-devel, perl-interpreter, perl-devel, perl-generators, %{_bindir}/pod2html, %{_bindir}/pod2man
Patch1: 0001-ocaml-Link-the-C-bindings-with-LDFLAGS-RHBZ-1548536.patch
BuildRequires: autoconf, automake, libtool, gettext-devel, perl-interpreter, perl-devel, perl-generators, perl, perl-podlators
BuildRequires: perl(bytes), perl(Carp), perl(Encode), perl(ExtUtils::MakeMaker), perl(Exporter), perl(IO::Scalar), perl(IO::Stringy), perl(strict), perl(Test::More), perl(utf8), perl(vars), perl(warnings), perl(XSLoader), perl(Test::Pod) >= 1.00, perl(Test::Pod::Coverage) >= 1.00
%if %{with ocaml}
@ -43,14 +45,16 @@ If you just want to export or modify the Registry of a Windows virtual machine,
Hivex is also comes with language bindings for OCaml, Perl, Python and Ruby.
%package devel
Summary: Development tools and libraries for %{name}
Summary: Development package for %{name}
Requires: %{name} = %{version}-%{release}
Requires: pkgconfig
Provides: %{name}-devel
Obsoletes: %{name}-devel
%description devel
%{name}-devel contains development tools and libraries
for %{name}.
Development tools and libraries for %{name} are included in %{name}-devel.
%package_help
@ -58,79 +62,75 @@ for %{name}.
%if %{with ocaml}
%package -n ocaml-%{name}
Summary: OCaml bindings for %{name}
Summary: Provide OCaml bindings for %{name}
Requires: %{name} = %{version}-%{release}
%description -n ocaml-%{name}
ocaml-%{name} contains OCaml bindings for %{name}.
OCaml bindings for %{name} are included in ocaml-%{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}
Summary: Development package for %{name} OCaml bindings
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}.
Development libraries required to use the OCaml bindings for %{name} are in ocaml-%{name}-devel.
%endif
%package -n perl-%{name}
Summary: Perl bindings for %{name}
Summary: Provide perl bindings for %{name}
Requires: %{name} = %{version}-%{release}
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
%description -n perl-%{name}
perl-%{name} contains Perl bindings for %{name}.
Perl bindings for %{name} are included in perl-%{name}.
%package -n python2-%{name}
Summary: Python 2 bindings for %{name}
Summary: Provide python 2 bindings for %{name}
Requires: %{name} = %{version}-%{release}
Obsoletes: python-%{name} < %{version}-%{release}
Provides: python-%{name} = %{version}-%{release}
%description -n python2-%{name}
python2-%{name} contains Python 2 bindings for %{name}.
Python 2 bindings for %{name} are included in python2-%{name}.
%package -n python3-%{name}
Summary: Python 3 bindings for %{name}
Summary: Provide python 3 bindings for %{name}
Requires: %{name} = %{version}-%{release}
%description -n python3-%{name}
python3-%{name} contains Python 3 bindings for %{name}.
Python 3 bindings for %{name} are included in python3-%{name}.
%package -n ruby-%{name}
Summary: Ruby bindings for %{name}
Summary: Provide ruby bindings for %{name}
Requires: %{name} = %{version}-%{release}
Requires: ruby(release)
Requires: ruby
Provides: ruby(hivex) = %{version}
%description -n ruby-%{name}
ruby-%{name} contains Ruby bindings for %{name}.
Ruby bindings for %{name} are included ruby-%{name}.
%prep
tmphome="$(mktemp -d)"
gpgv2 --homedir "$tmphome" --keyring %{SOURCE2} %{SOURCE1} %{SOURCE0}
tmphome="$(mktemp -d)" && gpgv2 --homedir "$tmphome" --keyring %{SOURCE2} %{SOURCE1} %{SOURCE0}
%autosetup -p1 -n %{name}-%{version}
autoreconf -i -f
copy="$(mktemp -d)"
cp -a . "$copy"
mv "$copy" python3
copy="$(mktemp -d)" && cp -a . "$copy" && mv "$copy" python3
%build
%configure \
@ -138,33 +138,31 @@ mv "$copy" python3
--disable-ocaml \
%endif
%{nil}
make V=1 INSTALLDIRS=vendor %{?_smp_mflags}
%make_build V=1 INSTALLDIRS=vendor
pushd python3
cd python3
%configure \
PYTHON=/usr/bin/python3 \
--disable-ocaml --disable-perl --disable-ruby
make V=1 INSTALLDIRS=vendor %{?_smp_mflags}
popd
%make_build V=1 INSTALLDIRS=vendor
cd ..
%install
pushd python3
make install DESTDIR=$RPM_BUILD_ROOT INSTALLDIRS=vendor
popd
make install DESTDIR=$RPM_BUILD_ROOT INSTALLDIRS=vendor
cd python3
%make_install DESTDIR=$RPM_BUILD_ROOT INSTALLDIRS=vendor
cd ..
%make_install DESTDIR=$RPM_BUILD_ROOT INSTALLDIRS=vendor
# Remove unwanted libtool *.la file:
rm $RPM_BUILD_ROOT%{_libdir}/libhivex.la
#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
# 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%{python2_sitearch}/libhivexmod.la
rm $RPM_BUILD_ROOT%{python3_sitearch}/libhivexmod.la
# rm $RPM_BUILD_ROOT%{python2_sitearch}/libhivexmod.la
# rm $RPM_BUILD_ROOT%{python3_sitearch}/libhivexmod.la
%find_lang %{name}
@ -172,9 +170,22 @@ rm $RPM_BUILD_ROOT%{python3_sitearch}/libhivexmod.la
%check
make check
pushd python3
cd python3
make check
popd
cd ..
%files -f %{name}.lang
%doc README LICENSE
%{_bindir}/hivexget
%{_bindir}/hivexml
%{_bindir}/hivexsh
%{_libdir}/libhivex.so.*
%exclude %{_libdir}/libhivex.la
%exclude %{_libdir}/perl5/perllocal.pod
%exclude %{python2_sitearch}/libhivexmod.la
%exclude %{python3_sitearch}/libhivexmod.la
%files devel
%doc LICENSE
@ -183,14 +194,16 @@ popd
%{_libdir}/pkgconfig/hivex.pc
%{_libdir}/libhivex.a
%files help
%{_mandir}/man1/hivexget.1*
%{_mandir}/man1/hivexml.1*
%{_mandir}/man1/hivexsh.1*
%{_mandir}/man1/hivexregedit.1*
%{_mandir}/man3/hivex.3*
%{_mandir}/man3/Win::Hivex.3pm*
%{_mandir}/man3/Win::Hivex::Regedit.3pm*
%{_mandir}/man1/hivexregedit.1*
%if %{with ocaml}
%files -n ocaml-%{name}
@ -232,13 +245,7 @@ popd
%{ruby_vendorlibdir}/hivex.rb
%{ruby_vendorarchdir}/_hivex.so
%files -f %{name}.lang
%doc README LICENSE
%{_bindir}/hivexget
%{_bindir}/hivexml
%{_bindir}/hivexsh
%{_libdir}/libhivex.so.*
%changelog
* Sat Nov 30 2019 jiaxiya <jiaxiyajiaxiya@163.com> - 1.3.17-2
* Sat Nov 30 2019 jiaxiya <jiaxiyajiaxiya@163.com> - 1.3.15-12
- Package init