fix up downloading in python packages
[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),,$(STAGING_DIR)/mk/python-package.mk)
23 ifneq ($(MAKECMDGOALS),download)
24 $(if $(DUMP)$(Build/Compile/PyMod),,$(error Python packaging code not found.))
25 endif
26
27 define Package/rrdtool/Default
28 SECTION:=utils
29 CATEGORY:=Utilities
30 TITLE:=Round Robin Database (RRD)
31 endef
32
33 define Package/librrd
34 $(call Package/rrdtool/Default)
35 SECTION:=libs
36 CATEGORY:=Libraries
37 TITLE+= management library (v1.2.x)
38 DEPENDS+= +libart +libfreetype +libpng +zlib
39 endef
40
41 define Package/rrdcgi
42 $(call Package/rrdtool/Default)
43 TITLE+= CGI graphing tool (v1.2.x)
44 DEPENDS+= +librrd +cgilib
45 endef
46
47 define Package/rrdtool
48 $(call Package/rrdtool/Default)
49 TITLE+= management tools (v1.2.x)
50 DEPENDS+= +librrd
51 endef
52
53 define Package/rrdpy
54 TITLE:=Round Robin Database (RRD) python bindings (v1.2.x)
55 DEPENDS+= +librrd
56 endef
57
58 CONFIGURE_ARGS += \
59 --enable-shared=yes \
60 --enable-static=yes \
61 --disable-rpath \
62 --with-gnu-ld \
63 --disable-mmap \
64 --disable-perl \
65 --disable-tcl \
66 --disable-ruby \
67 --without-x \
68 --with-rrd-default-font="/usr/share/rrdtool/fonts/DejaVuSansMono-Roman.ttf" \
69
70 CONFIGURE_VARS += \
71 CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/freetype2 -I$(STAGING_DIR)/usr/include/libart-2.0" \
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_rrdpy),)
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/Configure
93 $(call Build/Configure/Default)
94 $(call libtool_disable_rpath)
95 endef
96
97 define Build/Compile
98 $(MAKE) -C $(PKG_BUILD_DIR) all
99 $(call libtool_fixup_libdir)
100 $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" install
101 endef
102
103 define Build/InstallDev
104 mkdir -p $(1)/usr/include
105 $(CP) $(PKG_INSTALL_DIR)/usr/include/rrd.h $(1)/usr/include/
106 mkdir -p $(1)/usr/lib
107 $(CP) $(PKG_INSTALL_DIR)/usr/lib/librrd.{a,so*} $(1)/usr/lib/
108 $(CP) $(PKG_INSTALL_DIR)/usr/lib/librrd_th.{a,so*} $(1)/usr/lib/
109 endef
110
111 define Build/UninstallDev
112 rm -rf $(STAGING_DIR)/usr/include/rrd.h \
113 $(STAGING_DIR)/usr/lib/librrd.{a,so*} \
114 $(STAGING_DIR)/usr/lib/librrd_th.{a,so*}
115 endef
116
117 define Package/librrd/install
118 $(INSTALL_DIR) $(1)/usr/lib
119 $(CP) $(PKG_INSTALL_DIR)/usr/lib/librrd.so.* $(1)/usr/lib/
120 $(CP) $(PKG_INSTALL_DIR)/usr/lib/librrd_th.so.* $(1)/usr/lib/
121 $(INSTALL_DIR) $(1)/usr/share/rrdtool/fonts
122 $(CP) $(PKG_BUILD_DIR)/src/DejaVuSansMono-Roman.ttf \
123 $(1)/usr/share/rrdtool/fonts/
124 endef
125
126 define Package/rrdcgi/install
127 $(INSTALL_DIR) $(1)/usr/bin
128 $(CP) $(PKG_INSTALL_DIR)/usr/bin/rrdcgi $(1)/usr/bin/
129 endef
130
131 define PyPackage/rrdpy/install
132 $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
133 $(CP) $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* $(1)$(PYTHON_PKG_DIR)/
134 endef
135
136 define Package/rrdtool/install
137 $(INSTALL_DIR) $(1)/usr/bin
138 $(CP) $(PKG_INSTALL_DIR)/usr/bin/rrdtool $(1)/usr/bin/
139 $(CP) $(PKG_INSTALL_DIR)/usr/bin/rrdupdate $(1)/usr/bin/
140 endef
141
142 $(eval $(call BuildPackage,librrd))
143 $(eval $(call BuildPackage,rrdcgi))
144 $(eval $(call PyPackage,rrdpy))
145 $(eval $(call BuildPackage,rrdpy))
146 $(eval $(call BuildPackage,rrdtool))