0f3260fdf8cd7f324daa277457504010f44584f0
[openwrt/svn-archive/archive.git] / utils / owfs / Makefile
1 #
2 # Copyright (C) 2008 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9 PKG_NAME:=owfs
10 PKG_VERSION:=2.7p7
11 PKG_RELEASE:=1
12
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
14 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
15 PKG_MD5SUM:=4c189f64a1a6110bef19639a36c3b0e1
16
17 include $(INCLUDE_DIR)/package.mk
18
19
20 #
21 # templates
22 #
23
24 define Package/owfs/Default
25 TITLE:=OWFS (1-Wire File System)
26 URL:=http://owfs.sourceforge.net/
27 endef
28
29 define Package/owfs/Server
30 $(call Package/owfs/Default)
31 DEPENDS:=+owfs
32 SECTION:=net
33 CATEGORY:=Network
34 endef
35
36 define Package/owfs/Library
37 $(call Package/owfs/Default)
38 SECTION:=libs
39 CATEGORY:=Libraries
40 endef
41
42 define Package/owfs/Utility
43 $(call Package/owfs/Default)
44 SECTION:=utils
45 CATEGORY:=Utilities
46 DEPENDS:=+libow
47 endef
48
49 define Package/owfs/ServerInstall
50 $(INSTALL_DIR) $(1)/usr/bin
51 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(2) $(1)/usr/bin/
52 endef
53
54
55 #
56 # shared libraries
57 #
58
59 define Package/libow
60 $(call Package/owfs/Library)
61 DEPENDS:=+libusb +libpthread
62 TITLE:=OWFS - common shared library
63 endef
64
65 define Package/libow-capi
66 $(call Package/owfs/Library)
67 DEPENDS:=+libow
68 TITLE:=OWFS - C-API library
69 endef
70
71 define Package/libow-perl
72 $(call Package/owfs/Library)
73 DEPENDS:=+libow +perlbase-autoloader +perlbase-config +perlbase-dynaloader +perlbase-essential +perlbase-io
74 TITLE:=OWFS - Perl-API library
75 endef
76
77
78 #
79 # utilities
80 #
81
82 define Package/owshell
83 $(call Package/owfs/Utility)
84 TITLE:=OWFS - shell utilities
85 endef
86
87 define Package/owfs
88 $(call Package/owfs/Utility)
89 SECTION:=utils
90 CATEGORY:=Utilities
91 DEPENDS+=+kmod-fuse +libfuse +fuse-utils
92 TITLE:=OWFS - fuse file system
93 endef
94
95
96 #
97 # network daemons
98 #
99
100 define Package/owhttpd
101 $(call Package/owfs/Server)
102 TITLE:=OWFS - http server
103 endef
104
105 define Package/owftpd
106 $(call Package/owfs/Server)
107 TITLE:=OWFS - ftp server
108 endef
109
110 define Package/owserver
111 $(call Package/owfs/Server)
112 TITLE:=OWFS - network server
113 endef
114
115
116
117 PKG_CONFIGURE_OPTS:= \
118 --enable-zero \
119 --disable-parport \
120 --disable-ownfsd \
121 --disable-ownet \
122 --disable-owpython
123
124
125 ifneq ($(CONFIG_PACKAGE_libow-perl),)
126 PKG_CONFIGURE_OPTS+= --enable-libow-perl
127 ENABLE_SWIG:=1
128 else
129 PKG_CONFIGURE_OPTS+= --disable-libow-perl
130 endif
131 ifneq ($(CONFIG_PACKAGE_owtcl),)
132 PKG_CONFIGURE_OPTS+= --enable-owtcl
133 ENABLE_SWIG:=1
134 else
135 PKG_CONFIGURE_OPTS+= --disable-owtcl
136 PKG_CONFIGURE_OPTS+= --disable-owside
137 endif
138 ifneq ($(CONFIG_PACKAGE_owphp),)
139 PKG_CONFIGURE_OPTS+= --enable-owphp
140 ENABLE_SWIG:=1
141 else
142 PKG_CONFIGURE_OPTS+= --disable-owphp
143 endif
144 ifneq ($(ENABLE_SWIG),)
145 PKG_CONFIGURE_OPTS+= --enable-swig
146 else
147 PKG_CONFIGURE_OPTS+= --disable-swig
148 endif
149
150 CONFIGURE_ARGS += \
151 --prefix=/usr \
152 --exec-prefix=/usr \
153 --enable-owftpd \
154 --enable-owserver \
155 --enable-owhttpd \
156 --enable-owfs \
157 --with-perl5=$(STAGING_DIR)/usr/bin/perl \
158 --with-fuseinclude="$(STAGING_DIR)/usr/include" \
159 --with-fuselib="$(STAGING_DIR)/usr/lib" \
160 $(PKG_CONFIGURE_OPTS) \
161 --enable-shared \
162 --disable-rpath
163
164 define Build/Configure
165 (cd $(PKG_BUILD_DIR); \
166 rm -rf config.{status,cache} ; \
167 ./bootstrap ; \
168 $(TARGET_CONFIGURE_OPTS) \
169 CFLAGS="$(TARGET_CFLAGS) $(CFLAGS_LARGEFILE)" \
170 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
171 LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
172 lt_sys_lib_dlsearch_path_spec="$(STAGING_DIR)/lib $(STAGING_DIR)/usr/lib" \
173 lt_sys_lib_search_path_spec="$(STAGING_DIR)/lib $(STAGING_DIR)/usr/lib" \
174 shrext_cmds=".so"
175 ./configure \
176 $(CONFIGURE_ARGS) \
177 );
178 endef
179
180 define Build/Compile
181 $(MAKE) -C $(PKG_BUILD_DIR) \
182 DESTDIR="$(PKG_INSTALL_DIR)" \
183 all install
184 endef
185
186 define Build/InstallDev
187 mkdir -p $(STAGING_DIR)/usr/include
188 $(CP) $(PKG_INSTALL_DIR)/usr/include/{owcapi,owfs_config}.h $(STAGING_DIR)/usr/include/
189 mkdir -p $(STAGING_DIR)/usr/lib
190 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libow.{a,so} $(PKG_INSTALL_DIR)/usr/lib/libowcapi.{a,so} $(STAGING_DIR)/usr/lib/
191 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libow-*.so.* $(PKG_INSTALL_DIR)/usr/lib/libowcapi-*.so.* $(STAGING_DIR)/usr/lib/
192 endef
193
194 define Build/UninstallDev
195 rm -rf $(STAGING_DIR)/usr/include/{libow-capi,owfs_config}.h \
196 $(STAGING_DIR)/usr/lib/libow-capi-*.so.* \
197 $(STAGING_DIR)/usr/lib/libow-*.so.* \
198 $(STAGING_DIR)/usr/lib/libow-capi.{a,so} \
199 $(STAGING_DIR)/usr/lib/libow.{a,so}
200 endef
201
202
203 define Package/owfs/install
204 $(INSTALL_DIR) $(1)/usr/bin
205 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owfs $(1)/usr/bin/
206 endef
207
208 define Package/owshell/install
209 $(INSTALL_DIR) $(1)/usr/bin
210 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owread $(1)/usr/bin/
211 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owwrite $(1)/usr/bin/
212 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owdir $(1)/usr/bin/
213 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owpresent $(1)/usr/bin/
214 endef
215
216
217 define Package/owserver/install
218 $(call Package/owfs/ServerInstall,$(1),owserver,70)
219 endef
220
221 define Package/owhttpd/install
222 $(call Package/owfs/ServerInstall,$(1),owhttpd,80)
223 endef
224
225 define Package/owftpd/install
226 $(call Package/owfs/ServerInstall,$(1),owftpd,80)
227 endef
228
229
230 define Package/libow/install
231 $(INSTALL_DIR) $(1)/usr/lib
232 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libow-*.so.* $(1)/usr/lib/
233 endef
234
235 define Package/libow-capi/install
236 $(INSTALL_DIR) $(1)/usr/lib
237 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libowcapi-*.so.* $(1)/usr/lib/
238 #$(INSTALL_DIR) $(1)/usr/include
239 #$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/include/{owcapi,owfs_config}.h $(1)/usr/include/
240 endef
241
242 define Package/libow-perl/install
243 install -d -m0755 $(1)/usr/lib/perl5
244 cp -fpR $(PKG_INSTALL_DIR)/usr/lib/perl5/* $(1)/usr/lib/perl5
245 -rm -f $(1)/usr/lib/perl5/*/perllocal.pod
246 endef
247
248
249 $(eval $(call BuildPackage,owfs))
250 $(eval $(call BuildPackage,owshell))
251
252 $(eval $(call BuildPackage,owserver))
253 $(eval $(call BuildPackage,owhttpd))
254 $(eval $(call BuildPackage,owftpd))
255
256 $(eval $(call BuildPackage,libow))
257 $(eval $(call BuildPackage,libow-capi))
258 $(eval $(call BuildPackage,libow-perl))