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