Add fuse package
[openwrt/svn-archive/archive.git] / openwrt / package / fuse / ipkg / rules
1 #!/usr/bin/make -f
2
3 ifneq ($(strip ${IPKG_RULES_INC}),)
4 include $(IPKG_RULES_INC)
5 endif
6
7 ##
8
9 PKG_VERSION := $(shell cat ./ipkg/version)
10 CURRENT_DIR := $(shell pwd)
11 INSTALL_DIR ?= $(CURRENT_DIR)/ipkg-install
12
13 unexport INSTALL_DIR
14
15 I_KMOD_FUSE := ipkg/kmod-fuse
16 I_LIBFUSE := ipkg/libfuse
17 I_LIBFUSE_DEV := ipkg/libfuse-dev
18 I_FUSE_UTILS := ipkg/fuse-utils
19
20 BUILD_DEPS = \
21
22 CONFIGURE_OPTS = \
23 --enable-shared \
24 --enable-static \
25 --enable-kernel-module \
26 --enable-lib \
27 --enable-util \
28 --disable-example \
29 --disable-auto-modprobe \
30 --with-kernel=$(LINUX_DIR) \
31
32 ##
33
34 all: package
35
36
37 .stamp-configured: $(BUILD_DEPS)
38
39 touch configure.in
40 touch aclocal.m4
41 touch Makefile.in
42 touch include/config.h.in
43 touch configure
44
45 rm -rf config.cache
46 $(TARGET_CONFIGURE_OPTS) \
47 CFLAGS="$(TARGET_CFLAGS)" \
48 ./configure \
49 --target=$(GNU_TARGET_NAME) \
50 --host=$(GNU_TARGET_NAME) \
51 --build=$(GNU_HOST_NAME) \
52 --program-prefix="" \
53 --program-suffix="" \
54 --prefix=/usr \
55 --exec-prefix=/usr \
56 --bindir=/usr/bin \
57 --datadir=/usr/share \
58 --includedir=/usr/include \
59 --infodir=/usr/share/info \
60 --libdir=/usr/lib \
61 --libexecdir=/usr/lib/locate \
62 --localstatedir=/var/lib \
63 --mandir=/usr/share/man \
64 --sbindir=/usr/sbin \
65 --sysconfdir=/etc \
66 $(DISABLE_LARGEFILE) \
67 $(DISABLE_NLS) \
68 $(CONFIGURE_OPTS) \
69
70 touch .stamp-configured
71
72
73 .stamp-built: .stamp-configured
74
75 $(MAKE) \
76
77 touch .stamp-built
78
79
80 $(INSTALL_DIR)/usr/bin/fusermount: .stamp-built
81
82 mkdir -p $(INSTALL_DIR)
83
84 $(MAKE) \
85 DESTDIR="$(INSTALL_DIR)" \
86 install
87
88 rm -f $(INSTALL_DIR)/usr/lib/libfuse.la
89
90
91 configure: .stamp-configured
92
93
94 build: .stamp-built
95
96
97 install: $(INSTALL_DIR)/usr/bin/fusermount
98
99
100 package: $(INSTALL_DIR)/usr/bin/fusermount
101
102 mkdir -p $(I_KMOD_FUSE)/lib/modules/$(LINUX_VERSION)
103 cp -fpR $(INSTALL_DIR)/lib/modules/$(LINUX_VERSION)/kernel/fs/fuse/fuse.o \
104 $(I_KMOD_FUSE)/lib/modules/$(LINUX_VERSION)/
105 $(TARGET_CROSS)strip --remove-section=.comment --remove-section=.note \
106 $(I_KMOD_FUSE)/lib/modules/$(LINUX_VERSION)/*.o
107
108 mkdir -p $(I_LIBFUSE)/usr/lib
109 cp -fpR $(INSTALL_DIR)/usr/lib/libfuse.so.* $(I_LIBFUSE)/usr/lib/
110 $(STRIP) $(I_LIBFUSE)/usr/lib/*
111
112 mkdir -p $(I_LIBFUSE_DEV)/usr/include
113 cp -fpR $(INSTALL_DIR)/usr/include/fuse* $(I_LIBFUSE_DEV)/usr/include/
114 mkdir -p $(I_LIBFUSE_DEV)/usr/lib
115 cp -fpR $(INSTALL_DIR)/usr/lib/libfuse.{a,so*} $(I_LIBFUSE_DEV)/usr/lib/
116 mkdir -p $(I_LIBFUSE_DEV)/usr/lib/pkgconfig
117 cp -fpR $(INSTALL_DIR)/usr/lib/pkgconfig/fuse.pc $(I_LIBFUSE_DEV)/usr/lib/pkgconfig/
118
119 mkdir -p $(I_FUSE_UTILS)/usr/bin
120 cp -fpR $(INSTALL_DIR)/usr/bin/fusermount $(I_FUSE_UTILS)/usr/bin/
121 $(STRIP) $(I_FUSE_UTILS)/usr/bin/*
122
123 chmod 0755 ipkg/*/CONTROL/
124 chmod 0644 ipkg/*/CONTROL/control
125
126 perl -pi -e "s/^Arch.*:.*/Architecture: $(ARCH)/g" ipkg/*/CONTROL/control
127 ifneq ($(strip $(PKG_VERSION)),)
128 perl -pi -e "s/^Vers.*:.*/Version: $(PKG_VERSION)/g" ipkg/*/CONTROL/control
129 perl -pi -e "s/^Vers.*:.*/Version: $(LINUX_VERSION)+$(PKG_VERSION)/g" $(I_KMOD_FUSE)/CONTROL/control
130 endif
131
132 $(IPKG_BUILD) $(I_KMOD_FUSE) $(IPKG_TARGET_DIR)
133 $(IPKG_BUILD) $(I_LIBFUSE) $(IPKG_TARGET_DIR)
134 $(IPKG_BUILD) $(I_LIBFUSE_DEV) $(IPKG_TARGET_DIR)
135 $(IPKG_BUILD) $(I_FUSE_UTILS) $(IPKG_TARGET_DIR)
136
137
138 clean:
139
140 -$(MAKE) \
141 DESTDIR="$(INSTALL_DIR)" \
142 install clean
143
144 rm -rf .stamp-* \
145 $(I_KMOD_FUSE)/lib
146 $(I_LIBFUSE)/usr
147 $(I_LIBFUSE_DEV)/usr
148 $(I_FUSE_UTILS)/usr
149
150
151 control:
152
153 @cat $(I_KMOD_FUSE)/CONTROL/control
154 @echo
155 @cat $(I_LIBFUSE)/CONTROL/control
156 @echo
157 @cat $(I_LIBFUSE_DEV)/CONTROL/control
158 @echo
159 @cat $(I_FUSE_UTILS)/CONTROL/control
160 @echo
161
162
163 .PHONY: configure build install package clean control