2dd392d9182c0e2ff98c645bfdc01e7b8f4f2530
[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 PKG_MD5SUM:=d61c5755cb77207f9ad3584b26e8bf08
15
16 PKG_SOURCE_URL:=http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub
17 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
18 PKG_CAT:=zcat
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 PKG_BUILD_DEPENDS:=libnotimpl
24
25 include $(INCLUDE_DIR)/package.mk
26
27 define Package/rrd
28 SECTION:=utils
29 CATEGORY:=Utilities
30 TITLE:=Round Robin Database (RRD) tools (v1.2.x)
31 SUBMENU:=Round Robin Database (RRD) tools (v1.2.x)
32 endef
33
34 define Package/librrd
35 $(call Package/rrd)
36 DEPENDS:=+libart +libfreetype +libpng +zlib
37 SECTION:=libs
38 CATEGORY:=Utilities
39 TITLE:=Round Robin Database (RRD) management library (v1.2.x)
40 endef
41
42 define Package/rrdcgi
43 $(call Package/rrd)
44 DEPENDS:=librrd +cgilib
45 SECTION:=utils
46 CATEGORY:=Utilities
47 TITLE:=Round Robin Database (RRD) CGI graphing tool (v1.2.x)
48 endef
49
50 define Package/rrdtool
51 $(call Package/rrd)
52 DEPENDS:=librrd
53 SECTION:=utils
54 CATEGORY:=Utilities
55 TITLE:=Round Robin Database (RRD) management tools (v1.2.x)
56 endef
57
58 define Build/Configure
59 $(call Build/Configure/Default,--enable-shared=yes \
60 --enable-static=yes \
61 --disable-rpath \
62 --with-gnu-ld \
63 --enable-rrdcgi \
64 --disable-mmap \
65 --disable-perl \
66 --disable-tcl \
67 --disable-python \
68 --without-x \
69 --with-rrd-default-font=/usr/share/rrdtool/fonts/DejaVuSansMono-Roman.ttf, CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include -I$(STAGING_DIR)/usr/include/freetype2 -I$(STAGING_DIR)/usr/include/libart-2.0" \
70 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib " \
71 LIBS="-lnotimpl" \
72 PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig" \
73 rd_cv_ieee_works=yes)
74 endef
75
76 define Build/Compile
77 rm -rf $(PKG_INSTALL_DIR)
78 mkdir -p $(PKG_INSTALL_DIR)
79 $(MAKE) -C $(PKG_BUILD_DIR) \
80 DESTDIR="$(PKG_INSTALL_DIR)" \
81 all install
82 endef
83
84 define Package/rrdtool/install
85 $(INSTALL_DIR) $(1)/usr/bin
86 $(CP) $(PKG_INSTALL_DIR)/usr/bin/rrdtool $(1)/usr/bin/
87 $(CP) $(PKG_INSTALL_DIR)/usr/bin/rrdupdate $(1)/usr/bin/
88 endef
89
90 define Package/rrdcgi/install
91 $(INSTALL_DIR) $(1)/usr/bin
92 $(CP) $(PKG_INSTALL_DIR)/usr/bin/rrdcgi $(1)/usr/bin/
93 endef
94
95 define Package/librrd/install
96 $(INSTALL_DIR) $(1)/usr/lib
97 $(CP) $(PKG_INSTALL_DIR)/usr/lib/librrd.so.* $(1)/usr/lib/
98 $(INSTALL_DIR) $(1)/usr/share/rrdtool/fonts
99 $(CP) $(PKG_BUILD_DIR)/src/DejaVuSansMono-Roman.ttf \
100 $(1)/usr/share/rrdtool/fonts/
101 endef
102
103 define Build/InstallDev
104 mkdir -p $(STAGING_DIR)/usr/include
105 $(CP) $(PKG_INSTALL_DIR)/usr/include/rrd.h $(STAGING_DIR)/usr/include/
106 mkdir -p $(STAGING_DIR)/usr/lib
107 $(CP) $(PKG_INSTALL_DIR)/usr/lib/librrd.a $(STAGING_DIR)/usr/lib/
108 $(CP) $(PKG_INSTALL_DIR)/usr/lib/librrd.so* $(STAGING_DIR)/usr/lib/
109 endef
110
111 define Build/UninstallDev
112 rm -rf \
113 $(STAGING_DIR)/usr/include/rrd.h \
114 $(STAGING_DIR)/usr/lib/librrd.a \
115 $(STAGING_DIR)/usr/lib/librrd.so*
116 endef
117
118 $(eval $(call BuildPackage,librrd))
119 $(eval $(call BuildPackage,rrdcgi))
120 $(eval $(call BuildPackage,rrdtool))