4a93970f51fd87b7f36289704e114765c81f55ce
[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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=rrdtool
11 PKG_VERSION:=1.2.30
12 PKG_RELEASE:=1
13
14 PKG_SOURCE_URL:=http://oss.oetiker.ch/rrdtool/pub/
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_MD5SUM:=19b24f7184a8dbf7b48c1bbb565ad9fb
17
18 PKG_BUILD_DEPENDS:=python libnotimpl
19 PKG_FIXUP = libtool
20
21 include $(INCLUDE_DIR)/package.mk
22 -include $(if $(DUMP),,$(STAGING_DIR)/mk/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/python-rrd
51 $(call Package/rrdtool/Default)
52 SUBMENU:=Python
53 SECTION:=lang
54 CATEGORY:=Languages
55 TITLE+= python bindings (v1.2.x)
56 DEPENDS+= +python-mini +librrd
57 endef
58
59 CONFIGURE_ARGS += \
60 --enable-shared=yes \
61 --enable-static=yes \
62 --disable-rpath \
63 --with-gnu-ld \
64 --disable-mmap \
65 --disable-perl \
66 --disable-tcl \
67 --disable-ruby \
68 --without-x \
69 --with-rrd-default-font="/usr/share/rrdtool/fonts/DejaVuSansMono-Roman.ttf" \
70
71 CONFIGURE_VARS += \
72 LIBS="-lnotimpl" \
73 rd_cv_ieee_works=yes \
74 rd_cv_null_realloc=nope \
75 ac_cv_func_mmap_fixed_mapped=yes \
76
77 ifneq ($(SDK)$(CONFIG_PACKAGE_rrdcgi),)
78 CONFIGURE_ARGS += --enable-rrdcgi
79 else
80 CONFIGURE_ARGS += --disable-rrdcgi
81 endif
82
83 ifneq ($(SDK)$(CONFIG_PACKAGE_python-rrd),)
84 CONFIGURE_ARGS += \
85 --enable-python
86 CONFIGURE_VARS += \
87 PYTHON="$(PYTHON)"
88 else
89 CONFIGURE_ARGS += --disable-python
90 endif
91
92 define Build/Compile
93 $(if $(Build/Compile/PyMod),,@echo Python packaging code not found.; false)
94 $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" all install
95 endef
96
97 define Build/InstallDev
98 mkdir -p $(1)/usr/include
99 $(CP) $(PKG_INSTALL_DIR)/usr/include/rrd.h $(1)/usr/include/
100 mkdir -p $(1)/usr/lib
101 $(CP) $(PKG_INSTALL_DIR)/usr/lib/librrd.{a,so*} $(1)/usr/lib/
102 $(CP) $(PKG_INSTALL_DIR)/usr/lib/librrd_th.{a,so*} $(1)/usr/lib/
103 endef
104
105 define Package/librrd/install
106 $(INSTALL_DIR) $(1)/usr/lib
107 $(CP) $(PKG_INSTALL_DIR)/usr/lib/librrd.so.* $(1)/usr/lib/
108 $(CP) $(PKG_INSTALL_DIR)/usr/lib/librrd_th.so.* $(1)/usr/lib/
109 $(INSTALL_DIR) $(1)/usr/share/rrdtool/fonts
110 $(CP) $(PKG_BUILD_DIR)/src/DejaVuSansMono-Roman.ttf \
111 $(1)/usr/share/rrdtool/fonts/
112 endef
113
114 define Package/rrdcgi/install
115 $(INSTALL_DIR) $(1)/usr/bin
116 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rrdcgi $(1)/usr/bin/
117 endef
118
119 define Package/rrdtool/install
120 $(INSTALL_DIR) $(1)/usr/bin
121 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rrdtool $(1)/usr/bin/
122 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rrdupdate $(1)/usr/bin/
123 endef
124
125 define PyPackage/python-rrd/install
126 $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
127 $(CP) $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* $(1)$(PYTHON_PKG_DIR)/
128 endef
129
130 $(eval $(call BuildPackage,librrd))
131 $(eval $(call BuildPackage,rrdcgi))
132 $(eval $(call BuildPackage,rrdtool))
133
134 $(eval $(call PyPackage,python-rrd))
135 $(eval $(call BuildPackage,python-rrd))