add wxBase framework library
[openwrt/svn-archive/archive.git] / utils / rrdtool / Makefile
1 #
2 # Copyright (C) 2007 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=rrdtool
12 PKG_VERSION:=1.2.23
13 PKG_RELEASE:=1
14
15 PKG_SOURCE_URL:=http://oss.oetiker.ch/rrdtool/pub/
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_MD5SUM:=dafa161bc9c61e57636a6085c87c1fe8
18
19 PKG_BUILD_DEPENDS:=libnotimpl
20
21 include $(INCLUDE_DIR)/package.mk
22 -include $(TOPDIR)/package/python/python-package.mk
23
24 define Package/rrdtool/Default
25 SECTION:=utils
26 CATEGORY:=Utilities
27 TITLE:=Round Robin Database (RRD)
28 endef
29
30 define Package/librrd
31 $(call Package/rrdtool/Default)
32 SECTION:=libs
33 CATEGORY:=Libraries
34 TITLE+= management library (v1.2.x)
35 DEPENDS+= +libart +libfreetype +libpng +zlib
36 endef
37
38 define Package/rrdcgi
39 $(call Package/rrdtool/Default)
40 TITLE+= CGI graphing tool (v1.2.x)
41 DEPENDS+= +librrd +cgilib
42 endef
43
44 define Package/rrdtool
45 $(call Package/rrdtool/Default)
46 TITLE+= management tools (v1.2.x)
47 DEPENDS+= +librrd
48 endef
49
50 define PyPackage/rrdpy
51 TITLE:=Round Robin Database (RRD) python bindings (v1.2.x)
52 DEPENDS+= +librrd
53 endef
54
55 CONFIGURE_ARGS += \
56 --enable-shared=yes \
57 --enable-static=yes \
58 --disable-rpath \
59 --with-gnu-ld \
60 --disable-mmap \
61 --disable-perl \
62 --disable-tcl \
63 --without-x \
64 --with-rrd-default-font="/usr/share/rrdtool/fonts/DejaVuSansMono-Roman.ttf" \
65
66 CONFIGURE_VARS += \
67 CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/freetype2 -I$(STAGING_DIR)/usr/include/libart-2.0" \
68 LIBS="-lnotimpl" \
69 rd_cv_ieee_works=yes \
70 rd_cv_null_realloc=nope \
71 ac_cv_func_mmap_fixed_mapped=yes \
72
73 ifneq ($(SDK)$(CONFIG_PACKAGE_rrdcgi),)
74 CONFIGURE_ARGS += --enable-rrdcgi
75 else
76 CONFIGURE_ARGS += --disable-rrdcgi
77 endif
78
79 ifneq ($(SDK)$(CONFIG_PACKAGE_rrdpy),)
80 CONFIGURE_ARGS += \
81 --enable-python
82 CONFIGURE_VARS += \
83 PYTHON="$(PYTHON)"
84 else
85 CONFIGURE_ARGS += --disable-python
86 endif
87
88 define Build/Configure
89 $(call Build/Configure/Default)
90 $(call libtool_disable_rpath)
91 endef
92
93 define Build/Compile
94 $(MAKE) -C $(PKG_BUILD_DIR) all
95 $(call libtool_fixup_libdir)
96 $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" install
97 endef
98
99 define Build/InstallDev
100 mkdir -p $(STAGING_DIR)/usr/include
101 $(CP) $(PKG_INSTALL_DIR)/usr/include/rrd.h $(STAGING_DIR)/usr/include/
102 mkdir -p $(STAGING_DIR)/usr/lib
103 $(CP) $(PKG_INSTALL_DIR)/usr/lib/librrd.{a,so*} $(STAGING_DIR)/usr/lib/
104 endef
105
106 define Build/UninstallDev
107 rm -rf $(STAGING_DIR)/usr/include/rrd.h \
108 $(STAGING_DIR)/usr/lib/librrd.{a,so*}
109 endef
110
111 define Package/librrd/install
112 $(INSTALL_DIR) $(1)/usr/lib
113 $(CP) $(PKG_INSTALL_DIR)/usr/lib/librrd.so.* $(1)/usr/lib/
114 $(INSTALL_DIR) $(1)/usr/share/rrdtool/fonts
115 $(CP) $(PKG_BUILD_DIR)/src/DejaVuSansMono-Roman.ttf \
116 $(1)/usr/share/rrdtool/fonts/
117 endef
118
119 define Package/rrdcgi/install
120 $(INSTALL_DIR) $(1)/usr/bin
121 $(CP) $(PKG_INSTALL_DIR)/usr/bin/rrdcgi $(1)/usr/bin/
122 endef
123
124 define PyPackage/rrdpy/install
125 $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
126 $(CP) $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* $(1)$(PYTHON_PKG_DIR)/
127 endef
128
129 define Package/rrdtool/install
130 $(INSTALL_DIR) $(1)/usr/bin
131 $(CP) $(PKG_INSTALL_DIR)/usr/bin/rrdtool $(1)/usr/bin/
132 $(CP) $(PKG_INSTALL_DIR)/usr/bin/rrdupdate $(1)/usr/bin/
133 endef
134
135 $(eval $(call BuildPackage,librrd))
136 $(eval $(call BuildPackage,rrdcgi))
137 $(eval $(call PyPackage,rrdpy))
138 $(eval $(call BuildPackage,rrdtool))