summaryrefslogtreecommitdiff
path: root/package/keyutils/patches/patch-Makefile
blob: 3d111a5f853090a6812b879ab6804777f2da01bd (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
--- keyutils-1.5.10.orig/Makefile	2017-03-15 21:57:15.000000000 +0100
+++ keyutils-1.5.10/Makefile	2017-07-30 13:08:55.000000000 +0200
@@ -1,5 +1,5 @@
-CPPFLAGS	:= -I.
-CFLAGS		:= -g -Wall -Werror
+CPPFLAGS	?= -I.
+CFLAGS		?= -g -Wall -Werror
 INSTALL		:= install
 DESTDIR		:=
 SPECFILE	:= keyutils.spec
@@ -56,27 +56,9 @@ LIBNAME		:= libkeyutils.so.$(APIVERSION)
 # Guess at the appropriate lib directory and word size
 #
 ###############################################################################
-ifeq ($(origin LIBDIR),undefined)
-LIBDIR		:= $(shell ldd /usr/bin/make | grep '\(/libc\)' | sed -e 's!.*\(/.*\)/libc[.].*!\1!')
-endif
-ifeq ($(origin USRLIBDIR),undefined)
-USRLIBDIR	:= $(patsubst /lib/%,/usr/lib/%,$(LIBDIR))
-endif
-BUILDFOR	:= $(shell file /usr/bin/make | sed -e 's!.*ELF \(32\|64\)-bit.*!\1!')-bit
 
-ifeq ($(origin CFLAGS),undefined)
-ifeq ($(BUILDFOR),32-bit)
-CFLAGS		+= -m32
 LIBDIR		:= /lib
 USRLIBDIR	:= /usr/lib
-else
-ifeq ($(BUILDFOR),64-bit)
-CFLAGS		+= -m64
-LIBDIR		:= /lib64
-USRLIBDIR	:= /usr/lib64
-endif
-endif
-endif
 
 ###############################################################################
 #
@@ -95,7 +77,7 @@ endif
 # Normal build rule
 #
 ###############################################################################
-all: keyctl request-key key.dns_resolver
+all:
 
 ###############################################################################
 #
@@ -161,41 +143,18 @@ key.dns_resolver: key.dns_resolver.o $(L
 ###############################################################################
 install: all
 ifeq ($(NO_ARLIB),0)
-	$(INSTALL) -D -m 0644 $(ARLIB) $(DESTDIR)$(USRLIBDIR)/$(ARLIB)
+	$(INSTALL) -d $(DESTDIR)$(USRLIBDIR)
+	$(INSTALL) -m 0644 $(ARLIB) $(DESTDIR)$(USRLIBDIR)/$(ARLIB)
 endif
 ifeq ($(NO_SOLIB),0)
-	$(INSTALL) -D $(LIBNAME) $(DESTDIR)$(LIBDIR)/$(LIBNAME)
+	$(INSTALL) -d $(DESTDIR)$(LIBDIR)
+	$(INSTALL) $(LIBNAME) $(DESTDIR)$(LIBDIR)/$(LIBNAME)
 	$(LNS) $(LIBNAME) $(DESTDIR)$(LIBDIR)/$(SONAME)
 	mkdir -p $(DESTDIR)$(USRLIBDIR)
 	$(LNS) $(LIBDIR)/$(SONAME) $(DESTDIR)$(USRLIBDIR)/$(DEVELLIB)
 endif
-	$(INSTALL) -D keyctl $(DESTDIR)$(BINDIR)/keyctl
-	$(INSTALL) -D request-key $(DESTDIR)$(SBINDIR)/request-key
-	$(INSTALL) -D request-key-debug.sh $(DESTDIR)$(SHAREDIR)/request-key-debug.sh
-	$(INSTALL) -D key.dns_resolver $(DESTDIR)$(SBINDIR)/key.dns_resolver
-	$(INSTALL) -D -m 0644 request-key.conf $(DESTDIR)$(ETCDIR)/request-key.conf
-	mkdir -p $(DESTDIR)$(ETCDIR)/request-key.d
-	mkdir -p $(DESTDIR)$(MAN1)
-	$(INSTALL) -m 0644 $(wildcard man/*.1) $(DESTDIR)$(MAN1)
-	mkdir -p $(DESTDIR)$(MAN3)
-	$(INSTALL) -m 0644 $(wildcard man/*.3) $(DESTDIR)$(MAN3)
-	mkdir -p $(DESTDIR)$(MAN5)
-	$(INSTALL) -m 0644 $(wildcard man/*.5) $(DESTDIR)$(MAN5)
-	mkdir -p $(DESTDIR)$(MAN7)
-	$(INSTALL) -m 0644 $(wildcard man/*.7) $(DESTDIR)$(MAN7)
-	mkdir -p $(DESTDIR)$(MAN8)
-	$(INSTALL) -m 0644 $(wildcard man/*.8) $(DESTDIR)$(MAN8)
-	$(LNS) keyctl_describe.3 $(DESTDIR)$(MAN3)/keyctl_describe_alloc.3
-	$(LNS) keyctl_get_security.3 $(DESTDIR)$(MAN3)/keyctl_get_security_alloc.3
-	$(LNS) keyctl_instantiate.3 $(DESTDIR)$(MAN3)/keyctl_instantiate_iov.3
-	$(LNS) keyctl_instantiate.3 $(DESTDIR)$(MAN3)/keyctl_reject.3
-	$(LNS) keyctl_instantiate.3 $(DESTDIR)$(MAN3)/keyctl_negate.3
-	$(LNS) keyctl_instantiate.3 $(DESTDIR)$(MAN3)/keyctl_assume_authority.3
-	$(LNS) keyctl_link.3 $(DESTDIR)$(MAN3)/keyctl_unlink.3
-	$(LNS) keyctl_read.3 $(DESTDIR)$(MAN3)/keyctl_read_alloc.3
-	$(LNS) recursive_key_scan.3 $(DESTDIR)$(MAN3)/recursive_session_key_scan.3
-	$(LNS) keyctl_dh_compute.3 $(DESTDIR)$(MAN3)/keyctl_dh_compute_alloc.3
-	$(INSTALL) -D -m 0644 keyutils.h $(DESTDIR)$(INCLUDEDIR)/keyutils.h
+	$(INSTALL) -d $(DESTDIR)$(INCLUDEDIR)
+	$(INSTALL) -m 0644 keyutils.h $(DESTDIR)$(INCLUDEDIR)/keyutils.h
 
 ###############################################################################
 #
@@ -239,14 +198,6 @@ tarball: $(ZTARBALL)
 SRCBALL	:= rpmbuild/SOURCES/$(TARBALL)
 ZSRCBALL := rpmbuild/SOURCES/$(ZTARBALL)
 
-BUILDID	:= .local
-dist	:= $(word 2,$(shell grep -r "^%dist" /etc/rpm /usr/lib/rpm))
-release	:= $(word 2,$(shell grep ^Release: $(SPECFILE)))
-release	:= $(subst %{?dist},$(dist),$(release))
-release	:= $(subst %{?buildid},$(BUILDID),$(release))
-rpmver	:= $(VERSION)-$(release)
-SRPM	:= rpmbuild/SRPMS/keyutils-$(rpmver).src.rpm
-
 RPMBUILDDIRS := \
 	--define "_srcrpmdir $(CURDIR)/rpmbuild/SRPMS" \
 	--define "_rpmdir $(CURDIR)/rpmbuild/RPMS" \