get rid of $Id$ - it has never helped us and it has broken too many patches ;)
[openwrt/svn-archive/archive.git] / package / uci / Makefile
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
8 include $(TOPDIR)/rules.mk
9
10 UCI_VERSION=0.7
11 UCI_RELEASE=4
12
13 PKG_NAME:=uci
14 PKG_VERSION:=$(UCI_VERSION)$(if $(UCI_RELEASE),.$(UCI_RELEASE))
15 PKG_RELEASE:=1
16
17 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
18 PKG_SOURCE_URL:=http://downloads.openwrt.org/sources
19 PKG_MD5SUM:=39e46c24651e7e5c1759f3223bd299f9
20
21 include $(INCLUDE_DIR)/package.mk
22
23 # set to 1 to enable debugging
24 DEBUG=
25
26 define Package/libuci
27 SECTION:=libs
28 CATEGORY:=Libraries
29 TITLE:=C library for the Unified Configuration Interface (UCI)
30 endef
31
32 define Package/uci
33 SECTION:=base
34 CATEGORY:=Base system
35 DEPENDS:=+libuci
36 TITLE:=Utility for the Unified Configuration Interface (UCI)
37 endef
38
39 define Package/libuci-lua
40 SECTION=libs
41 CATEGORY=Libraries
42 DEPENDS:=+libuci +lua
43 TITLE:=Lua plugin for UCI
44 endef
45
46 define Build/Configure
47 endef
48
49 TARGET_CFLAGS += $(FPIC)
50 UCI_MAKEOPTS = \
51 $(TARGET_CONFIGURE_OPTS) \
52 COPTS="$(TARGET_CFLAGS)" \
53 DEBUG="$(DEBUG)" \
54 VERSION="$(UCI_VERSION)" \
55 CPPFLAGS="-I$(PKG_BUILD_DIR) $(TARGET_CPPFLAGS)" \
56 OS="Linux"
57
58 # work around a nasty gcc bug
59 ifneq ($(CONFIG_GCC_VERSION_4_2_4),)
60 UCI_MAKEOPTS += WOPTS=""
61 endif
62
63 define Build/Compile
64 $(MAKE) -C $(PKG_BUILD_DIR) $(UCI_MAKEOPTS)
65 $(MAKE) -C $(PKG_BUILD_DIR)/lua $(UCI_MAKEOPTS)
66 endef
67
68 define Package/libuci/install
69 $(INSTALL_DIR) $(1)/lib
70 $(CP) $(PKG_BUILD_DIR)/libuci.so* $(1)/lib/
71 endef
72
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/
76 endef
77
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/
82 $(CP) ./files/* $(1)/
83 endef
84
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
92 endef
93
94 $(eval $(call BuildPackage,uci))
95 $(eval $(call BuildPackage,libuci))
96 $(eval $(call BuildPackage,libuci-lua))