Skip to content

Commit

Permalink
[aarch64] Use macros, not hardcoded paths. Contributes to JB#49681
Browse files Browse the repository at this point in the history
  • Loading branch information
xfade committed May 26, 2020
1 parent 51a75c8 commit cf18d2b
Show file tree
Hide file tree
Showing 2 changed files with 124 additions and 5 deletions.
121 changes: 121 additions & 0 deletions rpm/libdir.patch
@@ -0,0 +1,121 @@
From 69711944745af0078da77e108d30f89fd7e06108 Mon Sep 17 00:00:00 2001
From: Michal Sekletar <msekleta@redhat.com>
Date: Fri, 4 Apr 2014 12:01:33 +0200
Subject: [PATCH 05/27] build-sys: don't hardcode LIBDIR, but set it according
to the target platform

---
pppd/Makefile.linux | 3 ++-
pppd/pathnames.h | 2 +-
pppd/plugins/Makefile.linux | 2 +-
pppd/plugins/pppoatm/Makefile.linux | 2 +-
pppd/plugins/pppol2tp/Makefile.linux | 4 ++--
pppd/plugins/radius/Makefile.linux | 2 +-
pppd/plugins/rp-pppoe/Makefile.linux | 2 +-
7 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/pppd/Makefile.linux b/pppd/Makefile.linux
index 63872eb..8ed56c1 100644
--- a/pppd/Makefile.linux
+++ b/pppd/Makefile.linux
@@ -8,6 +8,7 @@ DESTDIR = $(INSTROOT)@DESTDIR@
BINDIR = $(DESTDIR)/sbin
MANDIR = $(DESTDIR)/share/man/man8
INCDIR = $(DESTDIR)/include
+LIBDIR = $(DESTDIR)/lib/$(shell gcc -print-multi-os-directory 2> /dev/null)

TARGETS = pppd

@@ -32,7 +33,7 @@ endif

CC = gcc
#
-COPTS = -Wall $(RPM_OPT_FLAGS)
+COPTS = -Wall $(RPM_OPT_FLAGS) -DLIBDIR=\""$(LIBDIR)"\"

# Uncomment the next line to include support for Microsoft's
# MS-CHAP authentication protocol. Also, edit plugins/radius/Makefile.linux.
diff --git a/pppd/pathnames.h b/pppd/pathnames.h
index a33f046..a427cb8 100644
--- a/pppd/pathnames.h
+++ b/pppd/pathnames.h
@@ -57,7 +57,7 @@

#ifdef PLUGIN
#ifdef __STDC__
-#define _PATH_PLUGIN DESTDIR "/lib/pppd/" VERSION
+#define _PATH_PLUGIN LIBDIR "/pppd/" VERSION
#else /* __STDC__ */
#define _PATH_PLUGIN "/usr/lib/pppd"
#endif /* __STDC__ */
diff --git a/pppd/plugins/Makefile.linux b/pppd/plugins/Makefile.linux
index e09a369..b474a19 100644
--- a/pppd/plugins/Makefile.linux
+++ b/pppd/plugins/Makefile.linux
@@ -7,7 +7,7 @@ INSTALL = install
DESTDIR = $(INSTROOT)@DESTDIR@
BINDIR = $(DESTDIR)/sbin
MANDIR = $(DESTDIR)/share/man/man8
-LIBDIR = $(DESTDIR)/lib/pppd/$(VERSION)
+LIBDIR = $(DESTDIR)/lib/$(shell $(CC) -print-multi-os-directory 2> /dev/null)/pppd/$(VERSION)

SUBDIRS := rp-pppoe pppoatm pppol2tp
# Uncomment the next line to include the radius authentication plugin
diff --git a/pppd/plugins/pppoatm/Makefile.linux b/pppd/plugins/pppoatm/Makefile.linux
index 5a81447..769794b 100644
--- a/pppd/plugins/pppoatm/Makefile.linux
+++ b/pppd/plugins/pppoatm/Makefile.linux
@@ -7,7 +7,7 @@ INSTALL = install
#***********************************************************************

DESTDIR = $(INSTROOT)@DESTDIR@
-LIBDIR = $(DESTDIR)/lib/pppd/$(VERSION)
+LIBDIR = $(DESTDIR)/lib/$(shell gcc -print-multi-os-directory 2> /dev/null)/pppd/$(VERSION)

VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../../patchlevel.h)

diff --git a/pppd/plugins/pppol2tp/Makefile.linux b/pppd/plugins/pppol2tp/Makefile.linux
index ea3538e..4339566 100644
--- a/pppd/plugins/pppol2tp/Makefile.linux
+++ b/pppd/plugins/pppol2tp/Makefile.linux
@@ -6,8 +6,8 @@ INSTALL = install

#***********************************************************************

-DESTDIR = @DESTDIR@
-LIBDIR = $(DESTDIR)/lib/pppd/$(VERSION)
+DESTDIR = $(INSTROOT)@DESTDIR@
+LIBDIR = $(DESTDIR)/lib/$(shell gcc -print-multi-os-directory 2> /dev/null)/pppd/$(VERSION)

VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../../patchlevel.h)

diff --git a/pppd/plugins/radius/Makefile.linux b/pppd/plugins/radius/Makefile.linux
index 45b3b8d..179d0b7 100644
--- a/pppd/plugins/radius/Makefile.linux
+++ b/pppd/plugins/radius/Makefile.linux
@@ -5,7 +5,7 @@

DESTDIR = $(INSTROOT)@DESTDIR@
MANDIR = $(DESTDIR)/share/man/man8
-LIBDIR = $(DESTDIR)/lib/pppd/$(VERSION)
+LIBDIR = $(DESTDIR)/lib/$(shell gcc -print-multi-os-directory 2> /dev/null)/pppd/$(VERSION)

VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../../patchlevel.h)

diff --git a/pppd/plugins/rp-pppoe/Makefile.linux b/pppd/plugins/rp-pppoe/Makefile.linux
index 352991a..1305ed8 100644
--- a/pppd/plugins/rp-pppoe/Makefile.linux
+++ b/pppd/plugins/rp-pppoe/Makefile.linux
@@ -16,7 +16,7 @@

DESTDIR = $(INSTROOT)@DESTDIR@
BINDIR = $(DESTDIR)/sbin
-LIBDIR = $(DESTDIR)/lib/pppd/$(PPPDVERSION)
+LIBDIR = $(DESTDIR)/lib/$(shell gcc -print-multi-os-directory 2> /dev/null)/pppd/$(PPPDVERSION)

PPPDVERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../../patchlevel.h)

--
1.8.3.1


8 changes: 3 additions & 5 deletions rpm/ppp.spec
Expand Up @@ -2,12 +2,12 @@ Name: ppp
Summary: Point-to-Point
Version: 2.4.7
Release: 1
Group: Applications/Internet
License: BSD and GPLv2+ and LGPLv2+ and Public Domain
URL: https://ppp.samba.org/
Source0: https://download.samba.org/pub/%{name}/%{name}-%{version}.tar.gz
Patch0: ppp-destdir.patch
Patch1: use-openssl.patch
Patch2: libdir.patch
Requires: openssl-libs
BuildRequires: coreutils
BuildRequires: sed
Expand Down Expand Up @@ -37,12 +37,10 @@ PPP libraries.


%prep
%setup -q -n %{name}-%{version}/%{name}
%patch0 -p1
%patch1 -p1
%autosetup -p1 -n %{name}-%{version}/%{name}

%build
%configure --prefix=/usr
%configure --prefix=%{_prefix}
make %{?jobs:-j%jobs}

%install
Expand Down

0 comments on commit cf18d2b

Please sign in to comment.