• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/libsepol/0001-libsepol-build-follow-standard-semantics-for-DESTD.patch
Marcus FolkessonMarcus Folkesson committed 65de266c23e16 Jan 2018
Raw file
Source viewDiff to previous
xxxxxxxxxx
 
1
libsepol: build: follow standard semantics for DESTDIR and PREFIX
2
​
3
This patch solves the following issues:
4
- The pkg-config files generates odd paths when using DESTDIR without PREFIX
5
- DESTDIR is needed during compile time to compute library and header paths which it should not.
6
- Installing with both DESTDIR and PREFIX set gives us odd paths
7
- Make usage of DESTDIR and PREFIX more standard
8
​
9
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
10
​
11
diff -durN libsepol.orig/include/Makefile libsepol/include/Makefile
12
--- libsepol.orig/include/Makefile  2018-01-12 12:42:30.908709792 +0100
13
+++ libsepol/include/Makefile   2018-01-12 09:58:04.322148228 +0100
14
@@ -1,6 +1,6 @@
15
 # Installation directories.
16
-PREFIX ?= $(DESTDIR)/usr
17
-INCDIR ?= $(PREFIX)/include/sepol
18
+PREFIX ?= /usr
19
+INCDIR = $(DESTDIR)$(PREFIX)/include/sepol
20
 CILDIR ?= ../cil
21
 
22
 all:
23
diff -durN libsepol.orig/man/Makefile libsepol/man/Makefile
24
--- libsepol.orig/man/Makefile  2018-01-12 12:42:30.912043126 +0100
25
+++ libsepol/man/Makefile   2018-01-12 09:58:04.322148228 +0100
26
@@ -1,6 +1,7 @@
27
 # Installation directories.
28
-MAN8DIR ?= $(DESTDIR)/usr/share/man/man8
29
-MAN3DIR ?= $(DESTDIR)/usr/share/man/man3
30
+PREFIX ?= /usr
31
+MAN8DIR ?= $(DESTDIR)$(PREFIX)/share/man/man8
32
+MAN3DIR ?= $(DESTDIR)$(PREFIX)/share/man/man3
33
 
34
 all:
35
 
36
diff -durN libsepol.orig/src/libsepol.pc.in libsepol/src/libsepol.pc.in
37
--- libsepol.orig/src/libsepol.pc.in    2018-01-12 12:42:30.912043126 +0100
38
+++ libsepol/src/libsepol.pc.in 2018-01-12 09:58:04.322148228 +0100
39
@@ -1,6 +1,6 @@
40
 prefix=@prefix@
41
 exec_prefix=${prefix}
42
-libdir=${exec_prefix}/@libdir@
43
+libdir=@libdir@
44
 includedir=@includedir@
45
 
46
 Name: libsepol
47
diff -durN libsepol.orig/src/Makefile libsepol/src/Makefile
48
--- libsepol.orig/src/Makefile  2018-01-12 12:42:30.912043126 +0100
49
+++ libsepol/src/Makefile   2018-01-12 09:58:04.322148228 +0100
50
@@ -1,11 +1,10 @@
51
 # Installation directories.
52
-PREFIX ?= $(DESTDIR)/usr
53
+PREFIX ?= /usr
54
 INCLUDEDIR ?= $(PREFIX)/include
55
 LIBDIR ?= $(PREFIX)/lib
56
-SHLIBDIR ?= $(DESTDIR)/lib
57
 RANLIB ?= ranlib
58
-LIBBASE ?= $(shell basename $(LIBDIR))
59
 CILDIR ?= ../cil
60
+LIBINSTALL = $(DESTDIR)$(LIBDIR)
61
 
62
 VERSION = $(shell cat ../VERSION)
63
 LIBVERSION = 1
64
@@ -52,7 +51,7 @@
65
    ln -sf $@ $(TARGET) 
66
 
67
 $(LIBPC): $(LIBPC).in ../VERSION
68
-   sed -e 's/@VERSION@/$(VERSION)/; s:@prefix@:$(PREFIX):; s:@libdir@:$(LIBBASE):; s:@includedir@:$(INCLUDEDIR):' < $< > $@
69
+   sed -e 's/@VERSION@/$(VERSION)/; s:@prefix@:$(PREFIX):; s:@libdir@:$(LIBDIR):; s:@includedir@:$(INCLUDEDIR):' < $< > $@
70
 
71
 $(LIBMAP): $(LIBMAP).in
72
 ifneq ($(DISABLE_CIL),y)
73
@@ -80,16 +79,16 @@
74
    $(CC) $(CFLAGS) -fPIC -DSHARED -c -o $@ $<
75
 
76
 install: all
77
-   test -d $(LIBDIR) || install -m 755 -d $(LIBDIR)
78
-   install -m 644 $(LIBA) $(LIBDIR)
79
-   test -d $(SHLIBDIR) || install -m 755 -d $(SHLIBDIR)
80
-   install -m 755 $(LIBSO) $(SHLIBDIR)
81
-   test -d $(LIBDIR)/pkgconfig || install -m 755 -d $(LIBDIR)/pkgconfig
82
-   install -m 644 $(LIBPC) $(LIBDIR)/pkgconfig
83
-   $(LN) -sf --relative $(SHLIBDIR)/$(LIBSO) $(LIBDIR)/$(TARGET)
84
+   test -d $(LIBINSTALL) || install -m 755 -d $(LIBINSTALL)
85
+   install -m 644 $(LIBA) $(LIBINSTALL)
86
+   test -d $(LIBINSTALL) || install -m 755 -d $(LIBINSTALL)
87
+   install -m 755 $(LIBSO) $(LIBINSTALL)
88
+   test -d $(LIBINSTALL)/pkgconfig || install -m 755 -d $(LIBINSTALL)/pkgconfig
89
+   install -m 644 $(LIBPC) $(LIBINSTALL)/pkgconfig
90
+   $(LN) -sf --relative $(LIBINSTALL)/$(LIBSO) $(LIBINSTALL)/$(TARGET)
91
 
92
 relabel:
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.