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