adds upnp sample apps, fixes #3158 thanks bjoern riemer
[openwrt/svn-archive/archive.git] / libs / libupnp / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=libupnp
12 PKG_VERSION:=1.6.6
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=@SF/pupnp
17 PKG_MD5SUM:=8918dcf7428cd119d0c8275765ff2833
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define Package/libupnp/Default
22 SECTION:=libs
23 CATEGORY:=Libraries
24 URL:=http://upnp.sourceforge.net/
25 endef
26
27 define Package/libupnp
28 $(call Package/libupnp/Default)
29 DEPENDS:=+libpthread
30 TITLE:=UPnP SDK library
31 MENU:=1
32 endef
33
34 define Package/libupnp/description
35 The portable SDK for UPnP Devices (libupnp) provides developers with an
36 API and open source code for building control points, devices, and
37 bridges that are compliant with Version 1.0 of the Universal Plug and
38 Play Device Architecture Specification and support several operating
39 systems like Linux, *BSD, Solaris and others.
40 endef
41
42 define Package/libupnp-sample
43 $(call Package/libupnp/Default)
44 DEPENDS:=libupnp
45 TITLE:=UPnP sample applications
46 endef
47
48 define Package/libupnp-sample/description
49 TVcontrolpoint & tvdevice sample applications
50 run inside /etc/upnp-tvdevice/
51 endef
52
53 define Build/Configure
54 $(call Build/Configure/Default, \
55 --enable-shared \
56 --enable-static \
57 );
58 endef
59
60 define Build/Compile
61 $(MAKE) -C $(PKG_BUILD_DIR) \
62 CCOPT="$(TARGET_CFLAGS)" \
63 DESTDIR="$(PKG_INSTALL_DIR)" \
64 all install
65 $(MAKE) -C $(PKG_BUILD_DIR)/upnp/sample/ upnp_tv_device upnp_tv_ctrlpt
66 endef
67
68 define Build/Compile/libupnp-sample
69 $(MAKE) -C $(PKG_BUILD_DIR) \
70 CCOPT="$(TARGET_CFLAGS)" \
71 DESTDIR="$(PKG_INSTALL_DIR)" \
72 check
73 endef
74
75 define Build/InstallDev
76 mkdir -p $(1)/usr/include
77 $(CP) $(PKG_INSTALL_DIR)/usr/include/upnp $(1)/usr/include/
78 mkdir -p $(1)/usr/lib
79 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{ixml,threadutil,upnp}.{a,so*} $(1)/usr/lib/
80 mkdir -p $(1)/usr/lib/pkgconfig
81 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libupnp.pc $(1)/usr/lib/pkgconfig/
82 endef
83
84 define Package/libupnp/install
85 $(INSTALL_DIR) $(1)/usr/lib
86 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{ixml,threadutil,upnp}.so.* $(1)/usr/lib/
87 endef
88
89 define Package/libupnp-sample/install
90 $(INSTALL_DIR) $(1)/usr/bin
91 $(INSTALL_BIN) $(PKG_BUILD_DIR)/upnp/sample/upnp_tv_device $(1)/usr/bin
92 $(INSTALL_BIN) $(PKG_BUILD_DIR)/upnp/sample/upnp_tv_ctrlpt $(1)/usr/bin
93 $(INSTALL_DIR) $(1)/etc/upnp-tvdevice/web
94 $(CP) $(PKG_BUILD_DIR)/upnp/sample/web/* $(1)/etc/upnp-tvdevice
95 endef
96
97 $(eval $(call BuildPackage,libupnp))
98 $(eval $(call BuildPackage,libupnp-sample))