Accepting request 991030 from home:mslacken:pr

- remove the hard coded rpath explicitly

OBS-URL: https://build.opensuse.org/request/show/991030
OBS-URL: https://build.opensuse.org/package/show/network:cluster/genders?expand=0&rev=26
This commit is contained in:
Christian Goll 2022-07-25 12:40:34 +00:00 committed by Git OBS Bridge
parent 3eb70571e9
commit c475128949
3 changed files with 56 additions and 20 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Mon Jul 25 12:25:49 UTC 2022 - Christian Goll <cgoll@suse.com>
- remove the hard coded rpath explicitly
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Dec 19 14:19:10 UTC 2019 - Christian Goll <cgoll@suse.com> Thu Dec 19 14:19:10 UTC 2019 - Christian Goll <cgoll@suse.com>

View File

@ -1,7 +1,7 @@
# #
# spec file for package genders # spec file for package genders
# #
# Copyright (c) 2019 SUSE LLC # Copyright (c) 2022 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -40,6 +40,9 @@ BuildRequires: flex
BuildRequires: gcc-c++ BuildRequires: gcc-c++
BuildRequires: libtool BuildRequires: libtool
BuildRequires: lua-devel BuildRequires: lua-devel
BuildRequires: patchelf
BuildRequires: python
BuildRequires: python-devel
BuildRequires: python3 BuildRequires: python3
BuildRequires: python3-devel BuildRequires: python3-devel
BuildRequires: perl(ExtUtils::MakeMaker) BuildRequires: perl(ExtUtils::MakeMaker)
@ -77,13 +80,13 @@ Requires: %{name} = %{version}
%description devel %description devel
genders headers and libraries files needed for development genders headers and libraries files needed for development
%package -n python3-%{name} %package -n python-%{name}
Summary: Python bindings for genders Summary: Python bindings for genders
Group: Development/Languages/Python Group: Development/Languages/Python
Requires: %{name} = %{version} Requires: %{name} = %{version}
Requires: python Requires: python
%description -n python3-%{name} %description -n python-%{name}
Necessary files for using genders with Python. Necessary files for using genders with Python.
%package -n lua-%{name} %package -n lua-%{name}
@ -118,7 +121,7 @@ Summary: C++ library API for genders
Group: System/Libraries Group: System/Libraries
Requires: %{name}-base Requires: %{name}-base
%description -n lib%{name}plusplus%{cpp_api} %description -n lib%{name}plusplus%{cpp_api}
This package contains the library needed to run programs dynamically linked This package contains the library needed to run programs dynamically linked
with genders. This is the C++ API. with genders. This is the C++ API.
@ -135,22 +138,19 @@ with genders. This is the C++ API.
%if %{?_with_perl_vendor_arch:1}%{!?_with_perl_vendor_arch:0} %if %{?_with_perl_vendor_arch:1}%{!?_with_perl_vendor_arch:0}
%define _perldir %(perl -e 'use Config; $T=$Config{installvendorarch}; $P=$Config{vendorprefix}; $T=~/$P\\/(.*)/; print "%{_prefix}/$1\\n"') %define _perldir %(perl -e 'use Config; $T=$Config{installvendorarch}; $P=$Config{vendorprefix}; $T=~/$P\\/(.*)/; print "%{_prefix}/$1\\n"')
%endif %endif
%prep %prep
%setup -c -q -n %{name}-%{version} %setup -c -q -n %{name}-%{version}
mv genders-genders-%{slash_ver}/* . mv genders-genders-%{slash_ver}/* .
rm -r genders-genders-%{slash_ver} rm -r genders-genders-%{slash_ver}
%patch1 -p1 %autopatch -p1
%patch2 -p1
%patch4 -p1
%build %build
aclocal --force --install -I config aclocal --force --install -I config
libtoolize -f -i libtoolize -f -i
automake -a -f automake -a -f
autoconf --force autoconf --force
mkdir -p bin/ export GENDERS_LIBDIR=%{_libdir}
ln -s $(which python3) bin/python
export PATH=$(pwd)/bin/:${PATH}
%configure --program-prefix=%{?_program_prefix:%{_program_prefix}} \ %configure --program-prefix=%{?_program_prefix:%{_program_prefix}} \
%{?_with_perl_extensions} \ %{?_with_perl_extensions} \
%{?_without_perl_extensions} \ %{?_without_perl_extensions} \
@ -178,15 +178,14 @@ export NO_BRP_CHECK_RPATH=true
find "%{buildroot}" -name .packlist -exec sed -i "s#%{buildroot}##" {} + find "%{buildroot}" -name .packlist -exec sed -i "s#%{buildroot}##" {} +
find "%{buildroot}" -name .packlist -exec sed -i '/BUILDROOT/d' {} + find "%{buildroot}" -name .packlist -exec sed -i '/BUILDROOT/d' {} +
for file in %{buildroot}%{_prefix}/lib/genders/*.pl; do grep '#!/usr/bin/perl' $file || sed -i '1s,^,#!/usr/bin/perl\n,' $file ;done for file in %{buildroot}%{_prefix}/lib/genders/*.pl; do grep '#!/usr/bin/perl' $file || sed -i '1s,^,#!/usr/bin/perl\n,' $file ;done
# remove .a files # remove .a files
%if %{?_with_cplusplus_extensions:1}%{!?_with_cplusplus_extensions:0} %if %{?_with_cplusplus_extensions:1}%{!?_with_cplusplus_extensions:0}
rm -v %{buildroot}%{_libdir}/libgendersplusplus.la rm -v %{buildroot}%{_libdir}/libgendersplusplus.la
%endif %endif
rm -v %{buildroot}%{_libdir}/libgenders.la rm -v %{buildroot}%{_libdir}/libgenders.la
rm -rv %{buildroot}%{_libdir}/python*/site-packages/__pycache__ find %{buildroot}%{_libdir}/lua -name \*.la -delete
find %{buildroot}%{_libdir}/lua -name \*.la -delete
mkdir -p %{buildroot}%{_sysconfdir} mkdir -p %{buildroot}%{_sysconfdir}
# create sample config, but remove comments # create sample config, but remove comments
cat > %{buildroot}%{_sysconfdir}/genders <<EOF cat > %{buildroot}%{_sysconfdir}/genders <<EOF
@ -197,8 +196,8 @@ cat > %{buildroot}%{_sysconfdir}/genders <<EOF
# each of which can optionally have a value. The substitution string "%n" can # each of which can optionally have a value. The substitution string "%n" can
# be used in an attribute value to represent the nodename. Nodenames can be # be used in an attribute value to represent the nodename. Nodenames can be
# listed on multiple lines, so a node's attributes can be specified on multiple # listed on multiple lines, so a node's attributes can be specified on multiple
# lines. However, no single node may have duplicate attributes. Genders database # lines. However, no single node may have duplicate attributes. Genders database
# accepts ranges of nodenames in the general form: prefix[n-m,l-k,...], # accepts ranges of nodenames in the general form: prefix[n-m,l-k,...],
# where n < m and l < k, etc., as an alternative to explicit lists of nodenames. # where n < m and l < k, etc., as an alternative to explicit lists of nodenames.
# #
# Following is a sample genders configuration setup # Following is a sample genders configuration setup
@ -207,14 +206,19 @@ EOF
LD_PRELOAD=%{buildroot}%{_libdir}/libgenders.so.0 %{buildroot}%{_bindir}/nodeattr -f genders.sample --compress >> %{buildroot}%{_sysconfdir}/genders LD_PRELOAD=%{buildroot}%{_libdir}/libgenders.so.0 %{buildroot}%{_bindir}/nodeattr -f genders.sample --compress >> %{buildroot}%{_sysconfdir}/genders
sed -i -e 's/^\([^#]\)/## \1/' %{buildroot}%{_sysconfdir}/genders sed -i -e 's/^\([^#]\)/## \1/' %{buildroot}%{_sysconfdir}/genders
# remove rpath the hard way
brklib=$(find %{buildroot} -name Libgenders.so -print)
chmod 644 $brklib
patchelf --remove-rpath $brklib
chmod 444 $brklib
%post -n lib%{name}plusplus%{cpp_api} -p /sbin/ldconfig %post -n lib%{name}plusplus%{cpp_api} -p /sbin/ldconfig
%postun -n lib%{name}plusplus%{cpp_api} -p /sbin/ldconfig %postun -n lib%{name}plusplus%{cpp_api} -p /sbin/ldconfig
%post -n lib%{name}%{c_api} -p /sbin/ldconfig %post -n lib%{name}%{c_api} -p /sbin/ldconfig
%postun -n lib%{name}%{c_api} -p /sbin/ldconfig %postun -n lib%{name}%{c_api} -p /sbin/ldconfig
%files %files
%defattr(-,root,root) %defattr(-,root,root)
@ -243,7 +247,7 @@ sed -i -e 's/^\([^#]\)/## \1/' %{buildroot}%{_sysconfdir}/genders
%{_mandir}/man3/libgenders* %{_mandir}/man3/libgenders*
%if %{?_with_python_extensions:1}%{!?_with_python_extensions:0} %if %{?_with_python_extensions:1}%{!?_with_python_extensions:0}
%files -n python3-%{name} %files -n python-%{name}
%{_libdir}/python* %{_libdir}/python*
%endif %endif

View File

@ -1,3 +1,27 @@
From 93e668aa34d1315140349217cb39563c78b33fe2 Mon Sep 17 00:00:00 2001
From: Christian Goll <cgoll@suse.de>
Date: Fri, 22 Jul 2022 14:39:37 +0200
Subject: [PATCH 1/2] added lua bindings
---
config/ac_lua_extensions.m4 | 21 ++
config/x_ac_lua.m4 | 60 ++++
configure.ac | 21 ++
genders.spec | 110 ++++++
src/extensions/Makefile.am | 2 +-
.../lua/GendersTest/GendersTest.lua | 134 ++++++++
src/extensions/lua/GendersTest/testgenders | 21 ++
src/extensions/lua/Makefile.am | 21 ++
src/extensions/lua/genderslua.c | 322 ++++++++++++++++++
9 files changed, 711 insertions(+), 1 deletion(-)
create mode 100644 config/ac_lua_extensions.m4
create mode 100644 config/x_ac_lua.m4
create mode 100644 genders.spec
create mode 100755 src/extensions/lua/GendersTest/GendersTest.lua
create mode 100644 src/extensions/lua/GendersTest/testgenders
create mode 100644 src/extensions/lua/Makefile.am
create mode 100644 src/extensions/lua/genderslua.c
diff --git a/config/ac_lua_extensions.m4 b/config/ac_lua_extensions.m4 diff --git a/config/ac_lua_extensions.m4 b/config/ac_lua_extensions.m4
new file mode 100644 new file mode 100644
index 0000000..9421588 index 0000000..9421588
@ -792,3 +816,6 @@ index 0000000..f2364af
+ +
+ return 1; + return 1;
+} +}
--
2.37.1