- Fix error in SLES build: use proper --root argument with

'python genderssetup.py ...'.

OBS-URL: https://build.opensuse.org/package/show/network:cluster/genders?expand=0&rev=2
This commit is contained in:
Egbert Eich 2018-01-28 00:21:11 +00:00 committed by Git OBS Bridge
parent db94855c32
commit 74ac2a9e25
5 changed files with 192 additions and 1 deletions

View File

@ -0,0 +1,47 @@
From: Egbert Eich <eich@suse.com>
Date: Sat Jan 27 23:50:57 2018 +0100
Subject: Fix Python package installation: use --root
Patch-mainline: Not yet
Git-commit: bb0b59d44608d9d3cfe1d3373967c523055213f3
References:
Python allows the use of an alternative installation directory
using the --root option. Do not code the root directory into
the --prefix and --exec-prefix paths.
Signed-off-by: Egbert Eich <eich@suse.com>
---
src/extensions/python/Makefile.am | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/src/extensions/python/Makefile.am b/src/extensions/python/Makefile.am
index 5d62ae6..a55f5a0 100644
--- a/src/extensions/python/Makefile.am
+++ b/src/extensions/python/Makefile.am
@@ -6,24 +6,18 @@
# Use Python's distutils to make/install everything into the right place.
-# DESTDIR is usually set during make install time, not configure or
-# make time, so we work around it with the --with-extension-destdir
-# autoconf option.
-
-PYTHON_DESTDIR = @EXTENSION_DESTDIR@
-
if WITH_PYTHON_EXTENSIONS
all: genderssetup.py libgendersmodule.c genders.py
$(PYTHON) genderssetup.py build
install:
- $(PYTHON) genderssetup.py install --prefix=$(PYTHON_DESTDIR)/$(prefix) --exec-prefix=$(PYTHON_DESTDIR)/$(exec_prefix)
+ $(PYTHON) genderssetup.py install --prefix=$(prefix) --exec-prefix=$(exec_prefix) --root=$(DESTDIR)
pure_install:
- $(PYTHON) genderssetup.py install --prefix=$(PYTHON_DESTDIR)/$(prefix) --exec-prefix=$(PYTHON_DESTDIR)/$(exec_prefix)
+ $(PYTHON) genderssetup.py install --prefix=$(prefix) --exec-prefix=$(exec_prefix) --root=$(DESTDIR)
install-data-local:
- $(PYTHON) genderssetup.py install --prefix=$(PYTHON_DESTDIR)/$(prefix) --exec-prefix=$(PYTHON_DESTDIR)/$(exec_prefix)
+ $(PYTHON) genderssetup.py install --prefix=$(prefix) --exec-prefix=$(exec_prefix) --root=$(DESTDIR)
clean:
rm -rf build

View File

@ -0,0 +1,55 @@
From: Egbert Eich <eich@suse.com>
Date: Sun Jan 28 01:06:12 2018 +0100
Subject: Remove PERL_DESTDIR - use DESTDIR instead
Patch-mainline: Not yet
Git-commit: ecdfb6b2a5fac8510284e183dcbab6fce52a6e01
References:
DESTDIR is set at installation time - it should be sufficient
for our use case.
Signed-off-by: Egbert Eich <eich@suse.com>
---
configure.ac | 5 -----
src/extensions/perl/Libgenders/Makefile.am | 8 +-------
2 files changed, 1 insertion(+), 12 deletions(-)
diff --git a/configure.ac b/configure.ac
index 31cb8b4..3d4199d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -157,11 +157,6 @@ AC_CHECK_HEADERS( \
AC_GENDERS_FILE
#
-# Check for extension stuff
-#
-AC_EXTENSION_DESTDIR
-
-#
# Check for perl stuff
#
AC_PERL_EXTENSIONS
diff --git a/src/extensions/perl/Libgenders/Makefile.am b/src/extensions/perl/Libgenders/Makefile.am
index c544df2..440cc01 100644
--- a/src/extensions/perl/Libgenders/Makefile.am
+++ b/src/extensions/perl/Libgenders/Makefile.am
@@ -7,18 +7,12 @@
# Use Perl's ExtUtils::MakeMaker to get autoconf/automake to install
# into the correct location
-# DESTDIR is usually set during make install time, not configure or
-# make time, so we work around it with the --with-extension-destdir
-# autoconf option.
-
-PERL_DESTDIR = @EXTENSION_DESTDIR@
-
PERL_INC = "-I$(srcdir)/../../../../config -I$(srcdir)/../../../libgenders"
PERL_LIBS = "-L$(srcdir)/../../../libgenders/.libs -lgenders"
MAKEMAKERFLAGS = INSTALLDIRS=$(PERL_ARCH_INSTALL) \
- DESTDIR=$(PERL_DESTDIR) \
+ DESTDIR=$(DESTDIR) \
PREFIX=$(prefix) \
INC=$(PERL_INC) \
LIBS=$(PERL_LIBS) \

View File

@ -0,0 +1,73 @@
From: Egbert Eich <eich@suse.com>
Date: Sun Jan 28 01:13:37 2018 +0100
Subject: Remove all remains of EXTENSION_DESTDIR
Patch-mainline: Not yet
Git-commit: eb4fc9e5e149db4e1c8c879ab42eaee3f1685cc7
References:
Now as we use DESTDIR as specified with 'make install', remove
any autoconf and spec file bits of EXTENSION_DESTDIR.
Signed-off-by: Egbert Eich <eich@suse.com>
---
config/ac_extension_destdir.m4 | 27 ---------------------------
genders.spec | 1 -
genders.spec.in | 1 -
3 files changed, 29 deletions(-)
diff --git a/config/ac_extension_destdir.m4 b/config/ac_extension_destdir.m4
deleted file mode 100644
index 3c5a33c..0000000
--- a/config/ac_extension_destdir.m4
+++ /dev/null
@@ -1,27 +0,0 @@
-##*****************************************************************************
-## $Id: ac_destdir_destdir.m4,v 1.1 2006-07-17 22:06:43 chu11 Exp $
-##*****************************************************************************
-
-# Used almost exclusively so extensions like perl and python install works
-# with rpm builds
-AC_DEFUN([AC_EXTENSION_DESTDIR],
-[
- AC_MSG_CHECKING(for --with-extension-destdir )
- AC_ARG_WITH(extension-destdir,
- AC_HELP_STRING([--with-extension-destdir=path],
- [define extension modules install prefix]),
- [ case "$withval" in
- yes)
- withextensionldestdir=yes
- ;;
- no)
- ;;
- *)
- withextensionldestdir=yes
- EXTENSION_DESTDIR="$withval"
- ;;
- esac ]
- )
- AC_MSG_RESULT(${withextensionldestdir=no})
- AC_SUBST(EXTENSION_DESTDIR)
-])
diff --git a/genders.spec b/genders.spec
index 92d678f..9ad4b36 100644
--- a/genders.spec
+++ b/genders.spec
@@ -41,7 +41,6 @@ genders API that is compatible with earlier releases of genders
%build
%configure --program-prefix=%{?_program_prefix:%{_program_prefix}} \
- --with-extension-destdir="$RPM_BUILD_ROOT" \
%{?_with_perl_extensions} \
%{?_without_perl_extensions} \
%{?_with_perl_site_arch} \
diff --git a/genders.spec.in b/genders.spec.in
index dba2ef0..10c3df4 100644
--- a/genders.spec.in
+++ b/genders.spec.in
@@ -41,7 +41,6 @@ genders API that is compatible with earlier releases of genders
%build
%configure --program-prefix=%{?_program_prefix:%{_program_prefix}} \
- --with-extension-destdir="$RPM_BUILD_ROOT" \
%{?_with_perl_extensions} \
%{?_without_perl_extensions} \
%{?_with_perl_site_arch} \

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Sun Jan 28 00:18:51 UTC 2018 - eich@suse.com
- Fix error in SLES build: use proper --root argument with
'python genderssetup.py ...'.
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Dec 8 11:07:09 UTC 2017 - cgoll@suse.com Fri Dec 8 11:07:09 UTC 2017 - cgoll@suse.com

View File

@ -25,6 +25,9 @@ Summary: Static cluster configuration database
License: GPL-2.0 License: GPL-2.0
Group: System/Management Group: System/Management
Source: https://github.com/chaos/genders/releases/download/genders-1-22-1/%{pname}-%{version}.tar.gz Source: https://github.com/chaos/genders/releases/download/genders-1-22-1/%{pname}-%{version}.tar.gz
Patch1: Fix-Python-package-installation-use-root.patch
Patch2: Remove-PERL_DESTDIR-use-DESTDIR-instead.patch
Patch3: Remove-all-remains-of-EXTENSION_DESTDIR.patch
Requires: perl-base Requires: perl-base
Requires: python Requires: python
Url: https://github.com/chaos/genders Url: https://github.com/chaos/genders
@ -34,6 +37,7 @@ BuildRequires: gcc-c++
BuildRequires: python BuildRequires: python
BuildRequires: python-devel BuildRequires: python-devel
BuildRequires: perl(ExtUtils::MakeMaker) BuildRequires: perl(ExtUtils::MakeMaker)
BuildRequires: autoconf automake libtool
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description %description
@ -76,10 +80,16 @@ genders headers and libraries files needed for development
%endif %endif
%prep %prep
%setup -q -n %{pname}-%{version} %setup -q -n %{pname}-%{version}
%patch1 -p1
%patch2 -p1
%patch3 -p1
%build %build
aclocal --force --install -I config
libtoolize -f -i
automake -a -f
autoconf --force
%configure --program-prefix=%{?_program_prefix:%{_program_prefix}} \ %configure --program-prefix=%{?_program_prefix:%{_program_prefix}} \
--with-extension-destdir="$RPM_BUILD_ROOT" \
%{?_with_perl_extensions} \ %{?_with_perl_extensions} \
%{?_without_perl_extensions} \ %{?_without_perl_extensions} \
%{?_with_perl_site_arch} \ %{?_with_perl_site_arch} \