[package] update rrdtool to 1.2.30
[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.30
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:=19b24f7184a8dbf7b48c1bbb565ad9fb
18
19 PKG_BUILD_DEPENDS:=python libnotimpl
20 PKG_FIXUP = libtool
21
22 include $(INCLUDE_DIR)/package.mk
23 -include $(if $(DUMP),,$(STAGING_DIR)/mk/python-package.mk)
24
25 define Package/rrdtool/Default
26 SECTION:=utils
27 CATEGORY:=Utilities
28 TITLE:=Round Robin Database (RRD)
29 endef
30
31 define Package/librrd
32 $(call Package/rrdtool/Default)
33 SECTION:=libs
34 CATEGORY:=Libraries
35 TITLE+= management library (v1.2.x)
36 DEPENDS+= +libart +libfreetype +libpng +zlib
37 endef
38
39 define Package/rrdcgi
40 $(call Package/rrdtool/Default)
41 TITLE+= CGI graphing tool (v1.2.x)
42 DEPENDS+= +librrd +cgilib
43 endef
44
45 define Package/rrdtool
46 $(call Package/rrdtool/Default)
47 TITLE+= management tools (v1.2.x)
48 DEPENDS+= +librrd
49 endef
50
51 define Package/python-rrd
52 $(call Package/rrdtool/Default)
53 SUBMENU:=Python
54 SECTION:=lang
55 CATEGORY:=Languages
56 TITLE+= python bindings (v1.2.x)
57 DEPENDS+= +python-mini +librrd
58 endef
59
60 CONFIGURE_ARGS += \
61 --enable-shared=yes \
62 --enable-static=yes \
63 --disable-rpath \
64 --with-gnu-ld \
65 --disable-mmap \
66 --disable-perl \
67 --disable-tcl \
68 --disable-ruby \
69 --without-x \
70 --with-rrd-default-font="/usr/share/rrdtool/fonts/DejaVuSansMono-Roman.ttf" \
71
72 CONFIGURE_VARS += \
73 LIBS="-lnotimpl" \
74 rd_cv_ieee_works=yes \
75 rd_cv_null_realloc=nope \
76 ac_cv_func_mmap_fixed_mapped=yes \
77
78 ifneq ($(SDK)$(CONFIG_PACKAGE_rrdcgi),)
79 CONFIGURE_ARGS += --enable-rrdcgi
80 else
81 CONFIGURE_ARGS += --disable-rrdcgi
82 endif
83
84 ifneq ($(SDK)$(CONFIG_PACKAGE_python-rrd),)
85 CONFIGURE_ARGS += \
86 --enable-python
87 CONFIGURE_VARS += \
88 PYTHON="$(PYTHON)"
89 else
90 CONFIGURE_ARGS += --disable-python
91 endif
92
93 define Build/Compile
94 $(if $(Build/Compile/PyMod),,@echo Python packaging code not found.; false)
95 $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" all install
96 endef
97
98 define Build/InstallDev
99 mkdir -p $(1)/usr/include
100 $(CP) $(PKG_INSTALL_DIR)/usr/include/rrd.h $(1)/usr/include/
101 mkdir -p $(1)/usr/lib
102 $(CP) $(PKG_INSTALL_DIR)/usr/lib/librrd.{a,so*} $(1)/usr/lib/
103 $(CP) $(PKG_INSTALL_DIR)/usr/lib/librrd_th.{a,so*} $(1)/usr/lib/
104 endef
105
106 define Package/librrd/install
107 $(INSTALL_DIR) $(1)/usr/lib
108 $(CP) $(PKG_INSTALL_DIR)/usr/lib/librrd.so.* $(1)/usr/lib/
109 $(CP) $(PKG_INSTALL_DIR)/usr/lib/librrd_th.so.* $(1)/usr/lib/
110 $(INSTALL_DIR) $(1)/usr/share/rrdtool/fonts
111 $(CP) $(PKG_BUILD_DIR)/src/DejaVuSansMono-Roman.ttf \
112 $(1)/usr/share/rrdtool/fonts/
113 endef
114
115 define Package/rrdcgi/install
116 $(INSTALL_DIR) $(1)/usr/bin
117 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rrdcgi $(1)/usr/bin/
118 endef
119
120 define Package/rrdtool/install
121 $(INSTALL_DIR) $(1)/usr/bin
122 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rrdtool $(1)/usr/bin/
123 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rrdupdate $(1)/usr/bin/
124 endef
125
126 define PyPackage/python-rrd/install
127 $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
128 $(CP) $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* $(1)$(PYTHON_PKG_DIR)/
129 endef
130
131 $(eval $(call BuildPackage,librrd))
132 $(eval $(call BuildPackage,rrdcgi))
133 $(eval $(call BuildPackage,rrdtool))
134
135 $(eval $(call PyPackage,python-rrd))
136 $(eval $(call BuildPackage,python-rrd))