2 # Copyright (C) 2008 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
14 PKG_VERSION:=$(UCI_VERSION)$(if $(UCI_RELEASE),.$(UCI_RELEASE))
17 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
18 PKG_SOURCE_URL:=http://downloads.openwrt.org/sources
19 PKG_MD5SUM:=ed34c5ef606a90da4aba03ce6d22eeb9
21 include $(INCLUDE_DIR)/package.mk
23 # set to 1 to enable debugging
29 TITLE:=C library for the Unified Configuration Interface (UCI)
36 TITLE:=Utility for the Unified Configuration Interface (UCI)
39 define Package/libuci-lua
43 TITLE:=Lua plugin for UCI
46 define Build/Configure
49 TARGET_CFLAGS += $(FPIC)
51 $(TARGET_CONFIGURE_OPTS) \
52 COPTS="$(TARGET_CFLAGS)" \
54 VERSION="$(UCI_VERSION)" \
55 CPPFLAGS="-I$(PKG_BUILD_DIR) $(TARGET_CPPFLAGS)" \
58 # work around a nasty gcc bug
59 ifneq ($(CONFIG_GCC_VERSION_4_2_4),)
60 UCI_MAKEOPTS += WOPTS=""
64 $(MAKE) -C $(PKG_BUILD_DIR) $(UCI_MAKEOPTS)
65 $(MAKE) -C $(PKG_BUILD_DIR)/lua $(UCI_MAKEOPTS)
68 define Package/libuci/install
69 $(INSTALL_DIR) $(1)/lib
70 $(CP) $(PKG_BUILD_DIR)/libuci.so* $(1)/lib/
73 define Package/libuci-lua/install
74 $(INSTALL_DIR) $(1)/usr/lib/lua
75 $(CP) $(PKG_BUILD_DIR)/lua/uci.so $(1)/usr/lib/lua/
78 define Package/uci/install
79 $(INSTALL_DIR) $(1)/etc/uci-defaults
80 $(INSTALL_DIR) $(1)/sbin
81 $(INSTALL_BIN) $(PKG_BUILD_DIR)/uci $(1)/sbin/
85 define Build/InstallDev
86 $(INSTALL_DIR) $(1)/usr/include
87 $(CP) $(PKG_BUILD_DIR)/uci{,_config}.h $(1)/usr/include
88 $(INSTALL_DIR) $(1)/usr/lib
89 $(CP) $(PKG_BUILD_DIR)/libuci.so* $(1)/usr/lib
90 $(CP) $(PKG_BUILD_DIR)/libuci.a $(1)/usr/lib
91 $(CP) $(PKG_BUILD_DIR)/libucimap.a $(1)/usr/lib
94 $(eval $(call BuildPackage,uci))
95 $(eval $(call BuildPackage,libuci))
96 $(eval $(call BuildPackage,libuci-lua))