update libupnp to 1.3.1 (partially closes: #1180)
[openwrt/svn-archive/archive.git] / libs / libupnp / Makefile
index 8f544c4f800421ebc0dcec95f12a62e011b8e8ff..03798d7148919a997d1a266ca23b9397f4ba7bab 100644 (file)
@@ -9,15 +9,16 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libupnp
-PKG_VERSION:=1.2.1a
+PKG_VERSION:=1.3.1
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/upnp
-PKG_MD5SUM:=e72b3550bf064eedf080f16f09688891
+PKG_MD5SUM:=6646be5e31e58188e8f47c6ce64faa4c
 PKG_CAT:=zcat
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -34,31 +35,39 @@ define Package/libupnp
 endef
 
 define Build/Configure
+       $(call Build/Configure/Default, \
+               --enable-shared \
+               --enable-static \
+       );
 endef
 
 define Build/Compile
-       $(MAKE) -C $(PKG_BUILD_DIR)/upnp \
-               $(TARGET_CONFIGURE_OPTS) \
-               OPT_FLAGS="$(TARGET_CFLAGS)" \
-               STRIP=/bin/true
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               CCOPT="$(TARGET_CFLAGS)" \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               all install
 endef
 
 define Build/InstallDev
-       mkdir -p $(STAGING_DIR)/usr/include/upnp
-       $(CP) $(PKG_BUILD_DIR)/upnp/inc/*.h $(STAGING_DIR)/usr/include/upnp/
+       mkdir -p $(STAGING_DIR)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/upnp $(STAGING_DIR)/usr/include/
        mkdir -p $(STAGING_DIR)/usr/lib
-       $(CP) $(PKG_BUILD_DIR)/upnp/bin/lib{ixml,threadutil,upnp}.so $(STAGING_DIR)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{ixml,threadutil,upnp}.{a,so*} $(STAGING_DIR)/usr/lib/
+       mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libupnp.pc $(STAGING_DIR)/usr/lib/pkgconfig/
+       $(SED) 's,-I$$$${includedir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/libupnp.pc
+       $(SED) 's,-L$$$${libdir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/libupnp.pc
 endef
 
 define Build/UninstallDev
        rm -rf \
                $(STAGING_DIR)/usr/include/upnp \
-               $(STAGING_DIR)/usr/lib/lib{ixml,threadutil,upnp}.so
+               $(STAGING_DIR)/usr/lib/lib{ixml,threadutil,upnp}.{a,so*}
 endef
 
 define Package/libupnp/install
        $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_BUILD_DIR)/upnp/bin/lib{ixml,threadutil,upnp}.so $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{ixml,threadutil,upnp}.so.* $(1)/usr/lib/
 endef
 
 $(eval $(call BuildPackage,libupnp))