summaryrefslogtreecommitdiff
path: root/packages/unionfs/unionfs-1.0.8/make.patch
blob: ab77b527d5050afae605fe65f5630067c3feec71 (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

#
# Patch managed by http://www.holgerschurig.de/patcher.html
#

Index: unionfs-1.0.8/Makefile
===================================================================
--- unionfs-1.0.8.orig/Makefile	2005-01-19 10:03:24.000000000 -0500
+++ unionfs-1.0.8/Makefile	2005-01-19 11:30:15.372348104 -0500
@@ -3,10 +3,20 @@
 #
 
 # this should point to where your kernel headers are
-LINUXSRC = /lib/modules/`uname -r`/build
+KERNELVER := $(shell uname -r)
+KERNELMAJVER := $(shell echo ${KERNELVER} | cut -d. -f1,2)
+LINUXSRC = /lib/modules/${KERNELVER}/build
 TOPINC   = -I${LINUXSRC}/include
+
 # This is where the make install target will put stuff
-PREFIX   = /usr/local
+DESTDIR =
+prefix = /usr/local
+sbindir = ${prefix}/sbin
+mandir = ${prefix}/man
+man4dir = ${mandir}/man4
+man8dir = ${mandir}/man8
+moduledir = /lib/modules/${KERNELVER}
+
 VERSION  = 1.0.8
 TAROPTS = czvf
 UNIONFS_DEBUG_CFLAG = -g
@@ -24,8 +34,8 @@
 endif
 
 CC	= gcc
-KERNELVERSION=$(shell uname -r | cut -d. -f1,2)
-ifeq ($(KERNELVERSION),2.4)
+LD	= ld
+ifeq (${KERNELMAJVER},2.4)
 CFLAGS = -D__KERNEL__ -DMODULE -DFISTGEN -I. ${TOPINC} -Wall -Wno-unused-label -Werror ${EXTRACFLAGS} ${UNIONFS_DEBUG_CFLAG} ${UNIONFS_OPT_CFLAG} 
 endif
 EXTRA_CFLAGS += -D__KERNEL__ -DMODULE -DFISTGEN -I. ${TOPINC} -Wall -Werror ${EXTRACFLAGS} ${UNIONFS_DEBUG_CFLAG} ${UNIONFS_OPT_CFLAG}
@@ -37,7 +47,7 @@
 
 BINS	:=	unionctl uniondbg
 
-all:	readthereadme unionfs$(KERNELVERSION)
+all:	readthereadme unionfs$(KERNELMAJVER)
 
 readthereadme:
 	@echo "******************************************************************************"
@@ -45,13 +55,15 @@
 	@echo "******************************************************************************"
 	@echo ""
 
-unionfs2.6: ${BINS}
+unionfs2.6: unionfs.ko ${BINS}
+
+unionfs.ko:
 	make -C ${LINUXSRC} SUBDIRS=$(PWD) FISTDEVMK=$(PWD)/fistdev.mk modules
 
 unionfs2.4: ${obj-m} ${BINS}
 
 ${obj-m}: ${unionfs-objs}
-	ld -o ${obj-m} -r ${unionfs-objs}
+	${LD} -o ${obj-m} -r ${unionfs-objs}
 
 unionctl: unionctl.c
 	${CC} -o $@ $? ${UCFLAGS}
@@ -76,15 +88,20 @@
 ${unionfs-objs}: unionfs.h fist.h
 
 install: all
-	mkdir -p ${PREFIX}/sbin
-	cp unionctl ${PREFIX}/sbin
-	cp uniondbg ${PREFIX}/sbin
-	mkdir -p ${PREFIX}/man/man4
-	mkdir -p ${PREFIX}/man/man8
-	cp man/unionfs.4 ${PREFIX}/man/man4
-	cp man/unionctl.8 ${PREFIX}/man/man8
-	cp man/uniondbg.8 ${PREFIX}/man/man8
-	if [ -f unionfs.ko ] ; then cp unionfs.ko /lib/modules/`uname -r`/kernel/fs ; else cp unionfs.o /lib/modules/`uname -r`/kernel/fs ; fi
+	mkdir -p ${DESTDIR}${sbindir}
+	cp unionctl ${DESTDIR}${sbindir}
+	cp uniondbg ${DESTDIR}${sbindir}
+	mkdir -p ${DESTDIR}${man4dir}
+	mkdir -p ${DESTDIR}${man8dir}
+	cp man/unionfs.4 ${DESTDIR}${man4dir}
+	cp man/unionctl.8 ${DESTDIR}${man8dir}
+	cp man/uniondbg.8 ${DESTDIR}${man8dir}
+	mkdir -p ${DESTDIR}${moduledir}/kernel/fs
+ifeq (${KERNELMAJVER},2.4)
+	cp unionfs.o ${DESTDIR}${moduledir}/kernel/fs
+else
+	cp unionfs.ko ${DESTDIR}${moduledir}/kernel/fs
+endif
 
 
 release: unionfs-${VERSION}.tar.gz