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
10 UCI_VERSION
=2011-01-19
14 PKG_VERSION
:=$(UCI_VERSION
)$(if
$(UCI_RELEASE
),.
$(UCI_RELEASE
))
16 PKG_REV
:=a5eb996e0f04d911ff61479508bbc3e17b16ff0c
18 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
19 PKG_SOURCE_URL
:=git
://nbd.name
/uci.git
20 PKG_SOURCE_SUBDIR
:=uci-
$(PKG_VERSION
)
21 PKG_SOURCE_VERSION
:=$(PKG_REV
)
24 include $(INCLUDE_DIR
)/package.mk
26 # set to 1 to enable debugging
32 TITLE
:=C library for the Unified Configuration Interface
(UCI
)
39 TITLE
:=Utility for the Unified Configuration Interface
(UCI
)
42 define Package
/ucitrigger
45 DEPENDS
:=+libuci-lua
+lua
46 TITLE
:=Automatic triggers for applying system config changes
49 define Package
/libuci-lua
52 DEPENDS
:=+libuci
+liblua
53 TITLE
:=Lua plugin for UCI
56 define Build
/Configure
60 $(TARGET_CONFIGURE_OPTS
) \
61 COPTS
="$(TARGET_CFLAGS)" \
63 VERSION
="$(UCI_VERSION)" \
64 CPPFLAGS
="-I$(PKG_BUILD_DIR) $(TARGET_CPPFLAGS)" \
68 # work around a nasty gcc bug
69 ifneq ($(CONFIG_GCC_VERSION_4_2_4
),)
70 UCI_MAKEOPTS
+= WOPTS
=""
74 $(MAKE
) -C
$(PKG_BUILD_DIR
) $(UCI_MAKEOPTS
)
75 $(MAKE
) -C
$(PKG_BUILD_DIR
)/lua
$(UCI_MAKEOPTS
)
76 $(MAKE
) -C
$(PKG_BUILD_DIR
)/trigger
$(UCI_MAKEOPTS
) \
77 LIBS
="$(TARGET_LDFLAGS) -L$(PKG_BUILD_DIR) -luci -llua -lcrypt -lm"
80 define Package
/libuci
/install
81 $(INSTALL_DIR
) $(1)/lib
82 $(CP
) $(PKG_BUILD_DIR
)/libuci.so
* $(1)/lib
/
85 define Package
/libuci-lua
/install
86 $(INSTALL_DIR
) $(1)/usr
/lib
/lua
87 $(CP
) $(PKG_BUILD_DIR
)/lua
/uci.so
$(1)/usr
/lib
/lua
/
90 define Package
/ucitrigger
/install
91 $(INSTALL_DIR
) $(1)/usr
/lib
/lua
/uci
$(1)/lib
/config
/trigger
$(1)/usr
/sbin
92 $(INSTALL_DATA
) .
/trigger
/lib
/trigger.lua
$(1)/usr
/lib
/lua
/uci
/
93 $(INSTALL_DATA
) .
/trigger
/modules
/*.lua
$(1)/lib
/config
/trigger
/
94 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/trigger
/uci_trigger.so
$(1)/usr
/lib
/
95 $(INSTALL_BIN
) .
/trigger
/apply_config
$(1)/usr
/sbin
/
98 define Package
/uci
/install
99 $(INSTALL_DIR
) $(1)/etc
/uci-defaults
100 $(INSTALL_DIR
) $(1)/sbin
101 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/uci
$(1)/sbin
/
102 $(CP
) .
/files
/* $(1)/
105 define Build
/InstallDev
106 $(INSTALL_DIR
) $(1)/usr
/include
107 $(CP
) $(PKG_BUILD_DIR
)/uci
{,_config
,map
}.h
$(1)/usr
/include
108 $(INSTALL_DIR
) $(1)/usr
/lib
109 $(CP
) $(PKG_BUILD_DIR
)/libuci.so
* $(1)/usr
/lib
110 $(CP
) $(PKG_BUILD_DIR
)/libuci.a
$(1)/usr
/lib
113 $(eval
$(call BuildPackage
,uci
))
114 $(eval
$(call BuildPackage
,libuci
))
115 $(eval
$(call BuildPackage
,libuci-lua
))
116 $(eval
$(call BuildPackage
,ucitrigger
))