Retain symlinks. $(INSTALL_*) copys the contens of a file, so if we want to keep
[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:=3
12
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
14 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
15 PKG_MD5SUM:=4c189f64a1a6110bef19639a36c3b0e1
16
17 PKG_FIXUP = libtool
18
19 include $(INCLUDE_DIR)/package.mk
20
21
22 #
23 # templates
24 #
25
26 define Package/owfs/Default
27 TITLE:=OWFS (1-Wire File System)
28 URL:=http://owfs.sourceforge.net/
29 endef
30
31 define Package/owfs/Server
32 $(call Package/owfs/Default)
33 DEPENDS:=+owfs
34 SECTION:=net
35 CATEGORY:=Network
36 endef
37
38 define Package/owfs/Library
39 $(call Package/owfs/Default)
40 SECTION:=libs
41 CATEGORY:=Libraries
42 endef
43
44 define Package/owfs/Utility
45 $(call Package/owfs/Default)
46 SECTION:=utils
47 CATEGORY:=Utilities
48 DEPENDS:=+libow
49 endef
50
51 define Package/owfs/ServerInstall
52 $(INSTALL_DIR) $(1)/usr/bin
53 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(2) $(1)/usr/bin/
54 endef
55
56
57 #
58 # shared libraries
59 #
60
61 define Package/libow
62 $(call Package/owfs/Library)
63 DEPENDS:=+libusb +libpthread
64 TITLE:=OWFS - common shared library
65 endef
66
67 define Package/libow-capi
68 $(call Package/owfs/Library)
69 DEPENDS:=+libow
70 TITLE:=OWFS - C-API library
71 endef
72
73
74 #
75 # utilities
76 #
77
78 define Package/owshell
79 $(call Package/owfs/Utility)
80 TITLE:=OWFS - shell utilities
81 endef
82
83 define Package/owfs
84 $(call Package/owfs/Utility)
85 SECTION:=utils
86 CATEGORY:=Utilities
87 DEPENDS+=+kmod-fuse +libfuse +fuse-utils
88 TITLE:=OWFS - fuse file system
89 endef
90
91
92 #
93 # network daemons
94 #
95
96 define Package/owhttpd
97 $(call Package/owfs/Server)
98 TITLE:=OWFS - http server
99 endef
100
101 define Package/owftpd
102 $(call Package/owfs/Server)
103 TITLE:=OWFS - ftp server
104 endef
105
106 define Package/owserver
107 $(call Package/owfs/Server)
108 TITLE:=OWFS - network server
109 endef
110
111
112
113 PKG_CONFIGURE_OPTS:= \
114 --enable-zero \
115 --disable-parport \
116 --disable-ownfsd \
117 --disable-ownet \
118 --disable-owpython \
119 --disable-libow-perl \
120 --disable-owphp \
121 --disable-owtcl \
122 --disable-owside \
123 --disable-swig
124
125 CONFIGURE_ARGS += \
126 --prefix=/usr \
127 --exec-prefix=/usr \
128 --enable-owftpd \
129 --enable-owserver \
130 --enable-owhttpd \
131 --enable-owfs \
132 --with-fuseinclude="$(STAGING_DIR)/usr/include" \
133 --with-fuselib="$(STAGING_DIR)/usr/lib" \
134 $(PKG_CONFIGURE_OPTS) \
135 --enable-shared \
136 --disable-rpath
137
138 define Build/Configure
139 (cd $(PKG_BUILD_DIR); \
140 rm -rf config.{status,cache} ; \
141 ./bootstrap ; \
142 $(TARGET_CONFIGURE_OPTS) \
143 CFLAGS="$(TARGET_CFLAGS) $(CFLAGS_LARGEFILE)" \
144 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
145 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(TOOLCHAIN_DIR)/lib" \
146 lt_sys_lib_dlsearch_path_spec="$(STAGING_DIR)/lib $(STAGING_DIR)/usr/lib" \
147 lt_sys_lib_search_path_spec="$(STAGING_DIR)/lib $(STAGING_DIR)/usr/lib" \
148 shrext_cmds=".so" \
149 ./configure \
150 $(CONFIGURE_ARGS) \
151 );
152 endef
153
154 define Build/Compile
155 $(MAKE) -C $(PKG_BUILD_DIR) \
156 DESTDIR="$(PKG_INSTALL_DIR)" \
157 all install
158 endef
159
160 define Build/InstallDev
161 mkdir -p $(STAGING_DIR)/usr/include
162 $(CP) $(PKG_INSTALL_DIR)/usr/include/{owcapi,owfs_config}.h $(STAGING_DIR)/usr/include/
163 mkdir -p $(STAGING_DIR)/usr/lib
164 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libow.{a,so} $(PKG_INSTALL_DIR)/usr/lib/libowcapi.{a,so} $(STAGING_DIR)/usr/lib/
165 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libow-*.so.* $(PKG_INSTALL_DIR)/usr/lib/libowcapi-*.so.* $(STAGING_DIR)/usr/lib/
166 endef
167
168 define Build/UninstallDev
169 rm -rf $(STAGING_DIR)/usr/include/{libow-capi,owfs_config}.h \
170 $(STAGING_DIR)/usr/lib/libow-capi-*.so.* \
171 $(STAGING_DIR)/usr/lib/libow-*.so.* \
172 $(STAGING_DIR)/usr/lib/libow-capi.{a,so} \
173 $(STAGING_DIR)/usr/lib/libow.{a,so}
174 endef
175
176
177 define Package/owfs/install
178 $(INSTALL_DIR) $(1)/usr/bin
179 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owfs $(1)/usr/bin/
180 endef
181
182 define Package/owshell/install
183 $(INSTALL_DIR) $(1)/usr/bin
184 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owread $(1)/usr/bin/
185 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owwrite $(1)/usr/bin/
186 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owdir $(1)/usr/bin/
187 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owpresent $(1)/usr/bin/
188 endef
189
190
191 define Package/owserver/install
192 $(call Package/owfs/ServerInstall,$(1),owserver,70)
193 endef
194
195 define Package/owhttpd/install
196 $(call Package/owfs/ServerInstall,$(1),owhttpd,80)
197 endef
198
199 define Package/owftpd/install
200 $(call Package/owfs/ServerInstall,$(1),owftpd,80)
201 endef
202
203
204 define Package/libow/install
205 $(INSTALL_DIR) $(1)/usr/lib
206 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libow-*.so.* $(1)/usr/lib/
207 endef
208
209 define Package/libow-capi/install
210 $(INSTALL_DIR) $(1)/usr/lib
211 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libowcapi-*.so.* $(1)/usr/lib/
212 #$(INSTALL_DIR) $(1)/usr/include
213 #$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/include/{owcapi,owfs_config}.h $(1)/usr/include/
214 endef
215
216
217 $(eval $(call BuildPackage,owfs))
218 $(eval $(call BuildPackage,owshell))
219
220 $(eval $(call BuildPackage,owserver))
221 $(eval $(call BuildPackage,owhttpd))
222 $(eval $(call BuildPackage,owftpd))
223
224 $(eval $(call BuildPackage,libow))
225 $(eval $(call BuildPackage,libow-capi))