summaryrefslogtreecommitdiff
path: root/package/keyutils/patches/patch-Makefile
blob: 1b44e073087b68c98b6fd1abf96dadb330d3ab99 (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
--- keyutils-1.5.3.orig/Makefile	2011-08-11 15:24:09.000000000 +0200
+++ keyutils-1.5.3/Makefile	2011-09-26 03:06:03.669381901 +0200
@@ -1,5 +1,5 @@
 CPPFLAGS	:= -I.
-CFLAGS		:= $(CPPFLAGS) -g -Wall -Werror
+CFLAGS		?= $(CPPFLAGS) -g -Wall -Werror
 INSTALL		:= install
 DESTDIR		:=
 SPECFILE	:= keyutils.spec
@@ -49,24 +49,11 @@ LIBNAME		:= libkeyutils.so.$(APIVERSION)
 # Guess at the appropriate lib directory and word size
 #
 ###############################################################################
-LIBDIR		:= $(shell ldd /usr/bin/make | grep '\(/libc\)' | sed -e 's!.*\(/.*\)/libc[.].*!\1!')
+LIBDIR		:= /usr/lib
 USRLIBDIR	:= $(patsubst /lib/%,/usr/lib/%,$(LIBDIR))
-BUILDFOR	:= $(shell file /usr/bin/make | sed -e 's!.*ELF \(32\|64\)-bit.*!\1!')-bit
 
 LNS		:= ln -sf
 
-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
-
 ###############################################################################
 #
 # This is necessary if glibc doesn't know about the key management error codes
@@ -84,7 +71,7 @@ endif
 # Normal build rule
 #
 ###############################################################################
-all: $(DEVELLIB) keyctl request-key key.dns_resolver
+all: $(DEVELLIB)
 
 ###############################################################################
 #
@@ -125,13 +112,13 @@ keyutils.os: keyutils.c keyutils.h Makef
 %.o: %.c keyutils.h Makefile
 	$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
 
-keyctl: keyctl.o -lkeyutils
+keyctl: keyctl.o
 	$(CC) -L. $(CFLAGS) $(LDFLAGS) $(RPATH) -o $@ $< -lkeyutils
 
-request-key: request-key.o -lkeyutils
+request-key: request-key.o
 	$(CC) -L. $(CFLAGS) $(LDFLAGS) $(RPATH) -o $@ $< -lkeyutils
 
-key.dns_resolver: key.dns_resolver.o -lkeyutils
+key.dns_resolver: key.dns_resolver.o
 	$(CC) -L. $(CFLAGS) $(LDFLAGS) $(RPATH) -o $@ $< -lkeyutils -lresolv
 
 ###############################################################################
@@ -139,6 +126,13 @@ key.dns_resolver: key.dns_resolver.o -lk
 # Install everything
 #
 ###############################################################################
+libinstall:
+	$(INSTALL) -d $(DESTDIR)$(LIBDIR)
+	$(INSTALL) $(LIBNAME) $(DESTDIR)$(LIBDIR)/$(LIBNAME)
+	$(LNS) $(LIBNAME) $(DESTDIR)$(LIBDIR)/$(SONAME)
+	$(INSTALL) -d $(DESTDIR)$(INCLUDEDIR)
+	$(INSTALL) -m 0644 keyutils.h $(DESTDIR)$(INCLUDEDIR)/keyutils.h
+
 install: all
 ifeq ($(NO_ARLIB),0)
 	$(INSTALL) -D -m 0644 $(ARLIB) $(DESTDIR)$(USRLIBDIR)/$(ARLIB)
@@ -205,7 +199,7 @@ distclean: clean
 TARBALL	:= keyutils-$(VERSION).tar.bz2
 SRCBALL	:= rpmbuild/SOURCES/$(TARBALL)
 
-dist	:= $(word 2,$(shell grep "%dist" /etc/rpm/macros.dist))
+dist	:= OpenADK
 release	:= $(word 2,$(shell grep ^Release: $(SPECFILE)))
 release	:= $(subst %{?dist},$(dist),$(release))
 rpmver	:= $(VERSION)-$(release)