summaryrefslogtreecommitdiffstats
path: root/package/systemd/0004-install-don-t-use-ln-relative.patch
blob: 2d8cf53ab9d8d04be64e05f3cd6ae61f6962e99f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From cdb52b24436f0926fd6c56e129c843f49f9b1ed0 Mon Sep 17 00:00:00 2001
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
Date: Fri, 31 Mar 2017 23:15:09 +0200
Subject: [PATCH] install: don't use ln --relative

ln --relative is too recent to be available in most distros, so it
breaks the build.

Fix that with a bit of sed magic, that turns constituents of the
destination directory each into ../ , which when appended to the
destination directory leads back straight to / .

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

---
The problem is even more visible when doing cross-compilation in
professional build farms, which are often stuck to years-to-decade-old
enterprise-grade distributions (because, IT), even if the target system
is top-notch up-to-date.
---
 Makefile.am | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index 1cc657a..ef11e93 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -314,7 +314,8 @@ install-directories-hook:
 	$(MKDIR_P) $(addprefix $(DESTDIR),$(INSTALL_DIRS))
 
 install-environment-conf-hook: install-directories-hook
-	$(AM_V_LN)$(LN_S) --relative -f $(DESTDIR)$(sysconfdir)/environment \
+	dir=$(shell echo $(environmentdir) |sed -r -e 's:/+[^/]+:../:g'); \
+	$(AM_V_LN)$(LN_S) -f $${dir}$(sysconfdir)/environment \
 		$(DESTDIR)$(environmentdir)/99-environment.conf
 
 install-aliases-hook:
-- 
2.9.3

OpenPOWER on IntegriCloud