]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/libsemanage/0002-libsemanage-build-follow-standard-semantics-for-DESTD.patch
libpng: remove Blackfin patch
[coffee/buildroot.git] / package / libsemanage / 0002-libsemanage-build-follow-standard-semantics-for-DESTD.patch
1 libsemanage: build: follow standard semantics for DESTDIR and PREFIX
2
3 This patch solves the following issues:
4 - DESTDIR is needed during compile time to compute library and header paths which it should not.
5 - Installing with both DESTDIR and PREFIX set gives us odd paths
6 - Make usage of DESTDIR and PREFIX more standard
7
8 Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
9
10 diff -durN libsemanage.orig/include/Makefile libsemanage/include/Makefile
11 --- libsemanage.orig/include/Makefile   2018-01-12 12:42:30.915376458 +0100
12 +++ libsemanage/include/Makefile        2018-01-12 10:04:18.632144240 +0100
13 @@ -1,6 +1,6 @@
14  # Installation directories.
15 -PREFIX ?= $(DESTDIR)/usr
16 -INCDIR ?= $(PREFIX)/include/semanage
17 +PREFIX ?= /usr
18 +INCDIR ?= $(DESTDIR)$(PREFIX)/include/semanage
19  
20  all:
21  
22 diff -durN libsemanage.orig/man/Makefile libsemanage/man/Makefile
23 --- libsemanage.orig/man/Makefile       2018-01-12 12:42:30.915376458 +0100
24 +++ libsemanage/man/Makefile    2018-01-12 10:04:18.632144240 +0100
25 @@ -1,6 +1,7 @@
26  # Installation directories.
27 -MAN3DIR ?= $(DESTDIR)/usr/share/man/man3
28 -MAN5DIR ?= $(DESTDIR)/usr/share/man/man5
29 +PREFIX ?= /usr
30 +MAN3DIR ?= $(DESTDIR)$(PREFIX)/share/man/man3
31 +MAN5DIR ?= $(DESTDIR)$(PREFIX)/share/man/man5
32  
33  all:
34  
35 diff -durN libsemanage.orig/src/libsemanage.pc.in libsemanage/src/libsemanage.pc.in
36 --- libsemanage.orig/src/libsemanage.pc.in      2018-01-12 12:42:30.918709792 +0100
37 +++ libsemanage/src/libsemanage.pc.in   2018-01-12 10:04:18.632144240 +0100
38 @@ -1,6 +1,6 @@
39  prefix=@prefix@
40  exec_prefix=${prefix}
41 -libdir=${exec_prefix}/@libdir@
42 +libdir=@libdir@
43  includedir=@includedir@
44  
45  Name: libsemanage
46 diff -durN libsemanage.orig/src/Makefile libsemanage/src/Makefile
47 --- libsemanage.orig/src/Makefile       2018-01-12 12:42:30.918709792 +0100
48 +++ libsemanage/src/Makefile    2018-01-12 10:04:18.632144240 +0100
49 @@ -8,10 +8,10 @@
50  PKG_CONFIG ?= pkg-config
51  
52  # Installation directories.
53 -PREFIX ?= $(DESTDIR)/usr
54 +PREFIX ?= /usr
55  LIBDIR ?= $(PREFIX)/lib
56 -SHLIBDIR ?= $(DESTDIR)/lib
57  INCLUDEDIR ?= $(PREFIX)/include
58 +LIBINSTALL = $(DESTDIR)$(LIBDIR)
59  PYINC ?= $(shell $(PKG_CONFIG) --cflags $(PYPREFIX))
60  PYLIBS ?= $(shell $(PKG_CONFIG) --libs $(PYPREFIX))
61  PYSITEDIR ?= $(DESTDIR)$(shell $(PYTHON) -c 'import site; print(site.getsitepackages()[0])')
62 @@ -20,8 +20,6 @@
63  RUBYLIBS ?= $(shell $(RUBY) -e 'puts "-L" + RbConfig::CONFIG["libdir"] + " -L" + RbConfig::CONFIG["archlibdir"] + " " + RbConfig::CONFIG["LIBRUBYARG_SHARED"]')
64  RUBYINSTALL ?= $(DESTDIR)$(shell $(RUBY) -e 'puts RbConfig::CONFIG["vendorarchdir"]')
65  
66 -LIBBASE=$(shell basename $(LIBDIR))
67 -
68  DEFAULT_SEMANAGE_CONF_LOCATION=$(DESTDIR)/etc/selinux/semanage.conf
69  
70  ifeq ($(DEBUG),1)
71 @@ -95,7 +93,7 @@
72         ln -sf $@ $(TARGET)
73  
74  $(LIBPC): $(LIBPC).in ../VERSION
75 -       sed -e 's/@VERSION@/$(VERSION)/; s:@prefix@:$(PREFIX):; s:@libdir@:$(LIBBASE):; s:@includedir@:$(INCLUDEDIR):' < $< > $@
76 +       sed -e 's/@VERSION@/$(VERSION)/; s:@prefix@:$(PREFIX):; s:@libdir@:$(LIBDIR):; s:@includedir@:$(INCLUDEDIR):' < $< > $@
77  
78  semanageswig_python_exception.i: ../include/semanage/semanage.h
79         bash -e exception.sh > $@ || (rm -f $@ ; false)
80 @@ -136,13 +134,13 @@
81         $(SWIG) $<
82  
83  install: all 
84 -       test -d $(LIBDIR) || install -m 755 -d $(LIBDIR)
85 -       install -m 644 $(LIBA) $(LIBDIR)
86 -       install -m 755 $(LIBSO) $(LIBDIR)
87 -       test -d $(LIBDIR)/pkgconfig || install -m 755 -d $(LIBDIR)/pkgconfig
88 -       install -m 644 $(LIBPC) $(LIBDIR)/pkgconfig
89 +       test -d $(LIBINSTALL) || install -m 755 -d $(LIBINSTALL)
90 +       install -m 644 $(LIBA) $(LIBINSTALL)
91 +       install -m 755 $(LIBSO) $(LIBINSTALL)
92 +       test -d $(LIBINSTALL)/pkgconfig || install -m 755 -d $(LIBINSTALL)/pkgconfig
93 +       install -m 644 $(LIBPC) $(LIBINSTALL)/pkgconfig
94         test -f $(DEFAULT_SEMANAGE_CONF_LOCATION) || install -m 644 -D semanage.conf $(DEFAULT_SEMANAGE_CONF_LOCATION)
95 -       cd $(LIBDIR) && ln -sf $(LIBSO) $(TARGET)
96 +       cd $(LIBINSTALL) && ln -sf $(LIBSO) $(TARGET)
97  
98  install-pywrap: pywrap 
99         test -d $(PYSITEDIR) || install -m 755 -d $(PYSITEDIR)
100 @@ -155,7 +153,7 @@
101         install -m 755 $(SWIGRUBYSO) $(RUBYINSTALL)/semanage.so
102  
103  relabel:
104 -       /sbin/restorecon $(LIBDIR)/$(LIBSO)
105 +       /sbin/restorecon $(LIBINSTALL)/$(LIBSO)
106  
107  clean: 
108         -rm -f $(LIBPC) $(OBJS) $(LOBJS) $(LIBA) $(LIBSO) $(SWIGLOBJ) $(SWIGSO) $(SWIGRUBYSO) $(TARGET) conf-parse.c conf-parse.h conf-scan.c *.o *.lo *~
109 diff -durN libsemanage.orig/tests/Makefile libsemanage/tests/Makefile
110 --- libsemanage.orig/tests/Makefile     2018-01-12 12:42:30.922043125 +0100
111 +++ libsemanage/tests/Makefile  2018-01-12 10:04:18.632144240 +0100
112 @@ -1,6 +1,3 @@
113 -PREFIX ?= $(DESTDIR)/usr
114 -LIBDIR ?= $(PREFIX)/lib
115 -
116  # Add your test source files here:
117  SOURCES = $(sort $(wildcard *.c))
118