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
/ucitrigger
42 DEPENDS
:=+libuci-lua
+lua
43 TITLE
:=Automatic triggers for applying system config changes
46 define Package
/libuci-lua
49 DEPENDS
:=+libuci
+liblua
50 TITLE
:=Lua plugin for UCI
53 define Build
/Configure
56 TARGET_CFLAGS
+= $(FPIC
)
58 $(TARGET_CONFIGURE_OPTS
) \
59 COPTS
="$(TARGET_CFLAGS)" \
61 VERSION
="$(UCI_VERSION)" \
62 CPPFLAGS
="-I$(PKG_BUILD_DIR) $(TARGET_CPPFLAGS)" \
65 # work around a nasty gcc bug
66 ifneq ($(CONFIG_GCC_VERSION_4_2_4
),)
67 UCI_MAKEOPTS
+= WOPTS
=""
71 $(MAKE
) -C
$(PKG_BUILD_DIR
) $(UCI_MAKEOPTS
)
72 $(MAKE
) -C
$(PKG_BUILD_DIR
)/lua
$(UCI_MAKEOPTS
)
73 $(MAKE
) -C
$(PKG_BUILD_DIR
)/trigger
$(UCI_MAKEOPTS
) \
74 LIBS
="$(TARGET_LDFLAGS) -L$(PKG_BUILD_DIR) -luci -llua -lcrypt -lm"
77 define Package
/libuci
/install
78 $(INSTALL_DIR
) $(1)/lib
79 $(CP
) $(PKG_BUILD_DIR
)/libuci.so
* $(1)/lib
/
82 define Package
/libuci-lua
/install
83 $(INSTALL_DIR
) $(1)/usr
/lib
/lua
84 $(CP
) $(PKG_BUILD_DIR
)/lua
/uci.so
$(1)/usr
/lib
/lua
/
87 define Package
/ucitrigger
/install
88 $(INSTALL_DIR
) $(1)/usr
/lib
/lua
/uci
$(1)/lib
/config
/trigger
$(1)/usr
/sbin
89 $(INSTALL_DATA
) .
/trigger
/lib
/trigger.lua
$(1)/usr
/lib
/lua
/uci
/
90 $(INSTALL_DATA
) .
/trigger
/modules
/*.lua
$(1)/lib
/config
/trigger
/
91 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/trigger
/uci_trigger.so
$(1)/usr
/lib
/
92 $(INSTALL_BIN
) .
/trigger
/apply_config
$(1)/usr
/sbin
/
95 define Package
/uci
/install
96 $(INSTALL_DIR
) $(1)/etc
/uci-defaults
97 $(INSTALL_DIR
) $(1)/sbin
98 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/uci
$(1)/sbin
/
102 define Build
/InstallDev
103 $(INSTALL_DIR
) $(1)/usr
/include
104 $(CP
) $(PKG_BUILD_DIR
)/uci
{,_config
}.h
$(1)/usr
/include
105 $(INSTALL_DIR
) $(1)/usr
/lib
106 $(CP
) $(PKG_BUILD_DIR
)/libuci.so
* $(1)/usr
/lib
107 $(CP
) $(PKG_BUILD_DIR
)/libuci.a
$(1)/usr
/lib
108 $(CP
) $(PKG_BUILD_DIR
)/libucimap.a
$(1)/usr
/lib
111 $(eval
$(call BuildPackage
,uci
))
112 $(eval
$(call BuildPackage
,libuci
))
113 $(eval
$(call BuildPackage
,libuci-lua
))
114 $(eval
$(call BuildPackage
,ucitrigger
))