source: branches/backfire/package/uci/Makefile @ 24003

Last change on this file since 24003 was 24003, checked in by jow, 5 years ago

[backfire] merge r22629

File size: 2.9 KB
Line 
1#
2# Copyright (C) 2008 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8include $(TOPDIR)/rules.mk
9
10UCI_VERSION=12012009
11UCI_RELEASE=6
12
13PKG_NAME:=uci
14PKG_VERSION:=$(UCI_VERSION)$(if $(UCI_RELEASE),.$(UCI_RELEASE))
15PKG_RELEASE:=2
16PKG_REV:=aa3ab8012bfbf793d2884c08ea924545a04e9544
17
18PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
19PKG_SOURCE_URL:=git://nbd.name/uci.git
20PKG_SOURCE_SUBDIR:=uci-$(PKG_VERSION)
21PKG_SOURCE_VERSION:=$(PKG_REV)
22PKG_SOURCE_PROTO:=git
23
24include $(INCLUDE_DIR)/package.mk
25
26# set to 1 to enable debugging
27DEBUG=
28
29define Package/libuci
30  SECTION:=libs
31  CATEGORY:=Libraries
32  TITLE:=C library for the Unified Configuration Interface (UCI)
33endef
34
35define Package/uci
36  SECTION:=base
37  CATEGORY:=Base system
38  DEPENDS:=+libuci
39  TITLE:=Utility for the Unified Configuration Interface (UCI)
40endef
41
42define Package/ucitrigger
43  SECTION:=base
44  CATEGORY:=Base system
45  DEPENDS:=+libuci-lua +lua
46  TITLE:=Automatic triggers for applying system config changes
47endef
48
49define Package/libuci-lua
50  SECTION=libs
51  CATEGORY=Libraries
52  DEPENDS:=+libuci +liblua
53  TITLE:=Lua plugin for UCI
54endef
55
56define Build/Configure
57endef
58
59UCI_MAKEOPTS = \
60                $(TARGET_CONFIGURE_OPTS) \
61                COPTS="$(TARGET_CFLAGS)" \
62                DEBUG="$(DEBUG)" \
63                VERSION="$(UCI_VERSION)" \
64                CPPFLAGS="-I$(PKG_BUILD_DIR) $(TARGET_CPPFLAGS)" \
65                FPIC="$(FPIC)" \
66                OS="Linux"
67
68# work around a nasty gcc bug
69ifneq ($(CONFIG_GCC_VERSION_4_2_4),)
70  UCI_MAKEOPTS += WOPTS=""
71endif
72
73define Build/Compile
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"
78endef
79
80define Package/libuci/install
81        $(INSTALL_DIR) $(1)/lib
82        $(CP) $(PKG_BUILD_DIR)/libuci.so* $(1)/lib/
83endef
84
85define Package/libuci-lua/install
86        $(INSTALL_DIR) $(1)/usr/lib/lua
87        $(CP) $(PKG_BUILD_DIR)/lua/uci.so $(1)/usr/lib/lua/
88endef
89
90define 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/
96endef
97
98define 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)/
103endef
104
105define Build/InstallDev
106        $(INSTALL_DIR) $(1)/usr/include
107        $(CP) $(PKG_BUILD_DIR)/uci{,_config}.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
111endef
112
113$(eval $(call BuildPackage,uci))
114$(eval $(call BuildPackage,libuci))
115$(eval $(call BuildPackage,libuci-lua))
116$(eval $(call BuildPackage,ucitrigger))
Note: See TracBrowser for help on using the repository browser.