add librrd_th installation, needed for ntop
[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 python-core
20
21 include $(INCLUDE_DIR)/package.mk
22 -include $(if $(DUMP),,./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 Package/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 --disable-ruby \
64 --without-x \
65 --with-rrd-default-font="/usr/share/rrdtool/fonts/DejaVuSansMono-Roman.ttf" \
66
67 CONFIGURE_VARS += \
68 CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/freetype2 -I$(STAGING_DIR)/usr/include/libart-2.0" \
69 LIBS="-lnotimpl" \
70 rd_cv_ieee_works=yes \
71 rd_cv_null_realloc=nope \
72 ac_cv_func_mmap_fixed_mapped=yes \
73
74 ifneq ($(SDK)$(CONFIG_PACKAGE_rrdcgi),)
75 CONFIGURE_ARGS += --enable-rrdcgi
76 else
77 CONFIGURE_ARGS += --disable-rrdcgi
78 endif
79
80 ifneq ($(SDK)$(CONFIG_PACKAGE_rrdpy),)
81 CONFIGURE_ARGS += \
82 --enable-python
83 CONFIGURE_VARS += \
84 PYTHON="$(PYTHON)"
85 else
86 CONFIGURE_ARGS += --disable-python
87 endif
88
89 define Build/Configure
90 $(call Build/Configure/Default)
91 $(call libtool_disable_rpath)
92 endef
93
94 define Build/Compile
95 $(MAKE) -C $(PKG_BUILD_DIR) all
96 $(call libtool_fixup_libdir)
97 $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" install
98 endef
99
100 define Build/InstallDev
101 mkdir -p $(1)/usr/include
102 $(CP) $(PKG_INSTALL_DIR)/usr/include/rrd.h $(1)/usr/include/
103 mkdir -p $(1)/usr/lib
104 $(CP) $(PKG_INSTALL_DIR)/usr/lib/librrd.{a,so*} $(1)/usr/lib/
105 $(CP) $(PKG_INSTALL_DIR)/usr/lib/librrd_th.{a,so*} $(1)/usr/lib/
106 endef
107
108 define Build/UninstallDev
109 rm -rf $(STAGING_DIR)/usr/include/rrd.h \
110 $(STAGING_DIR)/usr/lib/librrd.{a,so*} \
111 $(STAGING_DIR)/usr/lib/librrd_th.{a,so*}
112 endef
113
114 define Package/librrd/install
115 $(INSTALL_DIR) $(1)/usr/lib
116 $(CP) $(PKG_INSTALL_DIR)/usr/lib/librrd.so.* $(1)/usr/lib/
117 $(CP) $(PKG_INSTALL_DIR)/usr/lib/librrd_th.so.* $(1)/usr/lib/
118 $(INSTALL_DIR) $(1)/usr/share/rrdtool/fonts
119 $(CP) $(PKG_BUILD_DIR)/src/DejaVuSansMono-Roman.ttf \
120 $(1)/usr/share/rrdtool/fonts/
121 endef
122
123 define Package/rrdcgi/install
124 $(INSTALL_DIR) $(1)/usr/bin
125 $(CP) $(PKG_INSTALL_DIR)/usr/bin/rrdcgi $(1)/usr/bin/
126 endef
127
128 define PyPackage/rrdpy/install
129 $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
130 $(CP) $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* $(1)$(PYTHON_PKG_DIR)/
131 endef
132
133 define Package/rrdtool/install
134 $(INSTALL_DIR) $(1)/usr/bin
135 $(CP) $(PKG_INSTALL_DIR)/usr/bin/rrdtool $(1)/usr/bin/
136 $(CP) $(PKG_INSTALL_DIR)/usr/bin/rrdupdate $(1)/usr/bin/
137 endef
138
139 $(eval $(call BuildPackage,librrd))
140 $(eval $(call BuildPackage,rrdcgi))
141 $(eval $(call PyPackage,rrdpy))
142 $(eval $(call BuildPackage,rrdpy))
143 $(eval $(call BuildPackage,rrdtool))