a89395aa5bd6763900633b842668b3f580795dbc
[openwrt/svn-archive/archive.git] / utils / rrdtool / Makefile
1 #
2 # Copyright (C) 2006 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.11
13 PKG_RELEASE:=1
14
15 PKG_SOURCE_URL:=http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_MD5SUM:=d61c5755cb77207f9ad3584b26e8bf08
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
71 ifneq ($(SDK)$(CONFIG_PACKAGE_rrdcgi),)
72 CONFIGURE_ARGS += --enable-rrdcgi
73 else
74 CONFIGURE_ARGS += --disable-rrdcgi
75 endif
76
77 ifneq ($(SDK)$(CONFIG_PACKAGE_rrdpy),)
78 CONFIGURE_ARGS += \
79 --enable-python
80 CONFIGURE_VARS += \
81 PYTHON="$(PYTHON)"
82 else
83 CONFIGURE_ARGS += --disable-python
84 endif
85
86 define Build/Configure
87 $(call Build/Configure/Default)
88 $(call libtool_disable_rpath)
89 endef
90
91 define Build/Compile
92 $(MAKE) -C $(PKG_BUILD_DIR) all
93 $(call libtool_fixup_libdir)
94 $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" install
95 endef
96
97 define Build/InstallDev
98 mkdir -p $(STAGING_DIR)/usr/include
99 $(CP) $(PKG_INSTALL_DIR)/usr/include/rrd.h $(STAGING_DIR)/usr/include/
100 mkdir -p $(STAGING_DIR)/usr/lib
101 $(CP) $(PKG_INSTALL_DIR)/usr/lib/librrd.{a,so*} $(STAGING_DIR)/usr/lib/
102 endef
103
104 define Build/UninstallDev
105 rm -rf $(STAGING_DIR)/usr/include/rrd.h \
106 $(STAGING_DIR)/usr/lib/librrd.{a,so*}
107 endef
108
109 define Package/librrd/install
110 $(INSTALL_DIR) $(1)/usr/lib
111 $(CP) $(PKG_INSTALL_DIR)/usr/lib/librrd.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 $(CP) $(PKG_INSTALL_DIR)/usr/bin/rrdcgi $(1)/usr/bin/
120 endef
121
122 define PyPackage/rrdpy/install
123 $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
124 $(CP) $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* $(1)$(PYTHON_PKG_DIR)/
125 endef
126
127 define Package/rrdtool/install
128 $(INSTALL_DIR) $(1)/usr/bin
129 $(CP) $(PKG_INSTALL_DIR)/usr/bin/rrdtool $(1)/usr/bin/
130 $(CP) $(PKG_INSTALL_DIR)/usr/bin/rrdupdate $(1)/usr/bin/
131 endef
132
133 $(eval $(call BuildPackage,librrd))
134 $(eval $(call BuildPackage,rrdcgi))
135 $(eval $(call PyPackage,rrdpy))
136 $(eval $(call BuildPackage,rrdtool))