add packages_10.03.2 in preparation for the 10.03.2 interim release
[10.03/packages.git] / utils / cwiid / Makefile
1
2 # Copyright (C) 2010 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
10 PKG_NAME:=cwiid
11 PKG_VERSION:=0.6.00
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
15 PKG_SOURCE_URL:=http://abstrakraft.org/cwiid/downloads/
16 PKG_SOURCE_VERSION:=2100f14c612471084434b364501e3818c7f4144e
17
18 PKG_BUILD_DEPENDS:=python
19
20 include $(INCLUDE_DIR)/package.mk
21 $(call include_mk, python-package.mk)
22
23 define Package/cwiid/Default
24   TITLE:=Linux Nintendo Wiimote interface
25   URL:=http://abstrakraft.org/cwiid/
26   DEPENDS:= @!LINUX_2_4
27 endef
28
29 define Package/libcwiid
30 $(call Package/cwiid/Default)
31   SECTION:=libs
32   CATEGORY:=Libraries
33   TITLE+= (library)
34   DEPENDS+= +bluez-libs
35 endef
36
37 define Package/wminput
38 $(call Package/cwiid/Default)
39   SECTION:=utils
40   CATEGORY:=Utilities
41   TITLE+= (utility)
42   DEPENDS+= +libcwiid
43 endef
44
45 define Package/python-cwiid
46 $(call Package/cwiid/Default)
47   SUBMENU:=Python
48   SECTION:=lang
49   CATEGORY:=Languages
50   TITLE:=Python bindings for the cwiid libs
51   DEPENDS:= +python-mini +libcwiid
52 endef
53
54 CONFIGURE_ARGS += \
55         --without-python \
56         --disable-ldconfig \
57         --enable-shared \
58         --enable-static \
59
60 TARGET_CFLAGS += $(FPIC)
61 TARGET_CPPFLAGS += -I$(PKG_BUILD_DIR)/libcwiid/
62
63 define Build/Prepare
64         $(call Build/Prepare/Default)
65         ( cd $(PKG_BUILD_DIR) ; \
66                 autoconf ; \
67         )
68 endef
69
70 define Build/Compile
71         $(MAKE) -C "$(PKG_BUILD_DIR)" \
72                 CC="$(TARGET_CC)" \
73                 OFLAGS="$(TARGET_CFLAGS)" \
74                 CPPFLAGS="$(TARGET_CPPFLAGS)" \
75                 LDFLAGS="$(TARGET_LDFLAGS) -L../libcwiid/" \
76                 all
77         $(if $(Build/Compile/PyMod),,@echo Python packaging code not found.; false)
78         $(call Build/Compile/PyMod,./python/, \
79                 install --prefix="$(PKG_INSTALL_DIR)/usr", \
80         )
81 endef
82
83 define Build/InstallDev
84         $(INSTALL_DIR) $(1)/usr/include
85         $(CP) $(PKG_BUILD_DIR)/libcwiid/*.h $(1)/usr/include/
86         $(INSTALL_DIR) $(1)/usr/lib
87         $(CP) $(PKG_BUILD_DIR)/libcwiid/*.so $(1)/usr/lib/
88 endef
89
90 define Package/libcwiid/install
91         $(INSTALL_DIR) $(1)/usr/lib
92         $(CP) $(PKG_BUILD_DIR)/libcwiid/libcwiid.so.1.0 $(1)/usr/lib/
93 endef
94
95 define Package/wminput/install
96         $(INSTALL_DIR) $(1)/usr/bin
97         $(CP) $(PKG_BUILD_DIR)/wminput/wminput $(1)/usr/bin/
98         $(CP) $(PKG_BUILD_DIR)/lswm/lswm $(1)/usr/bin/
99 endef
100
101 define PyPackage/python-cwiid/filespec
102 +|$(PYTHON_PKG_DIR)/cwiid.so
103 endef
104
105 $(eval $(call BuildPackage,libcwiid))
106 $(eval $(call BuildPackage,wminput))
107 $(eval $(call PyPackage,python-cwiid))
108 $(eval $(call BuildPackage,python-cwiid))