json-c: fix package name, add UninstallDev
[openwrt/svn-archive/archive.git] / package / libjson-c / 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: Makefile 6643 2007-03-23 08:11:08Z nico $
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=json-c
12 PKG_VERSION:=0.7
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://oss.metaparadigm.com/json-c/
17 PKG_MD5SUM:=
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define Package/libjson
22 SECTION:=libs
23 CATEGORY:=Libraries
24 TITLE:=javascript object notation
25 DESCRIPTION:=library for javascript object notation backends
26 URL:=http://oss.metaparadigm.com/json-c/
27 endef
28
29 define Build/Compile
30 $(MAKE) -C $(PKG_BUILD_DIR) \
31 DESTDIR="$(PKG_INSTALL_DIR)" \
32 all install
33 endef
34
35 define Build/InstallDev
36 mkdir -p $(STAGING_DIR)/usr/include
37 $(CP) -r $(PKG_INSTALL_DIR)/usr/include/json $(STAGING_DIR)/usr/include/
38 mkdir -p $(STAGING_DIR)/usr/lib
39 $(CP) -r $(PKG_INSTALL_DIR)/usr/lib/libjson.{a,so*} $(STAGING_DIR)/usr/lib/
40 mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
41 $(CP) -r $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/json.pc $(STAGING_DIR)/usr/lib/pkgconfig/
42 $(SED) 's,-I$$$${includedir}/,-I$(STAGING_DIR)/usr/include/,g' $(STAGING_DIR)/usr/lib/pkgconfig/json.pc
43 $(SED) 's,-L$$$${libdir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/json.pc
44 endef
45
46 define Build/UninstallDev
47 rm -rf $(STAGING_DIR)/usr/include/json \
48 $(STAGING_DIR)/usr/lib/libjson.{a,so*} \
49 $(STAGING_DIR)/usr/lib/pkgconfig/json.pc
50 endef
51
52 define Package/libjson/install
53 $(INSTALL_DIR) $(1)/usr/lib
54 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libjson.so.* $(1)/usr/lib/
55 endef
56
57 $(eval $(call BuildPackage,libjson))