| 1 | # $FreeWRT$
|
|---|
| 2 | #-
|
|---|
| 3 | # This file is part of the FreeWRT project. FreeWRT is copyrighted
|
|---|
| 4 | # material, please see the LICENCE file in the top-level directory
|
|---|
| 5 | # or at http://www.freewrt.org/licence for details.
|
|---|
| 6 |
|
|---|
| 7 | include $(TOPDIR)/rules.mk
|
|---|
| 8 |
|
|---|
| 9 | PKG_NAME:= rrdcollect
|
|---|
| 10 | PKG_VERSION:= 0.2.3
|
|---|
| 11 | PKG_RELEASE:= 2
|
|---|
| 12 | PKG_MD5SUM:= 5e4305c612bc3cccbaf802c275c81a11
|
|---|
| 13 | PKG_INIT:= 90
|
|---|
| 14 |
|
|---|
| 15 | PKG_SOURCE_URL:= @SF/rrdcollect
|
|---|
| 16 |
|
|---|
| 17 | ifneq ($(FWRT_PACKAGE_LIBRRD),)
|
|---|
| 18 | RRDTOOL_LIBS:=-lart_lgpl_2 -lfreetype -lpng
|
|---|
| 19 | endif
|
|---|
| 20 |
|
|---|
| 21 | include $(TOPDIR)/mk/package.mk
|
|---|
| 22 |
|
|---|
| 23 | $(eval $(call PKG_template,RRDCOLLECT,rrdcollect,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 24 | $(eval $(call PKG_template,RRDCOLLECT_EXAMPLE,rrdcollect-example,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 25 |
|
|---|
| 26 | $(WRKBUILD)/.configured:
|
|---|
| 27 | (cd $(WRKBUILD); rm -rf config.{cache,status} ; \
|
|---|
| 28 | $(TARGET_CONFIGURE_OPTS) \
|
|---|
| 29 | CFLAGS="$(TARGET_CFLAGS) -DSOCKET_COMM" \
|
|---|
| 30 | CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
|
|---|
| 31 | LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
|
|---|
| 32 | LIBS="$(RRDTOOL_LIBS) -lz" \
|
|---|
| 33 | PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig" \
|
|---|
| 34 | ac_cv_func_malloc_0_nonnull=yes \
|
|---|
| 35 | ./configure \
|
|---|
| 36 | --target=$(GNU_TARGET_NAME) \
|
|---|
| 37 | --host=$(GNU_TARGET_NAME) \
|
|---|
| 38 | --build=$(GNU_HOST_NAME) \
|
|---|
| 39 | --program-prefix="" \
|
|---|
| 40 | --program-suffix="" \
|
|---|
| 41 | --prefix=/usr \
|
|---|
| 42 | --exec-prefix=/usr \
|
|---|
| 43 | --bindir=/usr/bin \
|
|---|
| 44 | --sbindir=/usr/sbin \
|
|---|
| 45 | --libexecdir=/usr/lib \
|
|---|
| 46 | --sysconfdir=/etc \
|
|---|
| 47 | --datadir=/usr/share \
|
|---|
| 48 | --localstatedir=/var \
|
|---|
| 49 | --mandir=/usr/man \
|
|---|
| 50 | --infodir=/usr/info \
|
|---|
| 51 | --disable-nls \
|
|---|
| 52 | --enable-shared \
|
|---|
| 53 | --disable-static \
|
|---|
| 54 | --disable-rpath \
|
|---|
| 55 | --with-gnu-ld \
|
|---|
| 56 | --enable-exec \
|
|---|
| 57 | --without-rrdtool \
|
|---|
| 58 | --with-librrd \
|
|---|
| 59 | --without-libpcre \
|
|---|
| 60 | --without-libpcap \
|
|---|
| 61 | );
|
|---|
| 62 | touch $@
|
|---|
| 63 |
|
|---|
| 64 | $(WRKBUILD)/.built:
|
|---|
| 65 | rm -rf $(WRKINST)
|
|---|
| 66 | mkdir -p $(WRKINST)
|
|---|
| 67 | $(MAKE) -C $(WRKBUILD) \
|
|---|
| 68 | DESTDIR="$(WRKINST)" \
|
|---|
| 69 | all install
|
|---|
| 70 | touch $@
|
|---|
| 71 |
|
|---|
| 72 | $(IPKG_RRDCOLLECT):
|
|---|
| 73 | install -d -m0755 $(IDIR_RRDCOLLECT)/usr/sbin
|
|---|
| 74 | $(CP) $(WRKINST)/usr/sbin/rrdcollect $(IDIR_RRDCOLLECT)/usr/sbin/
|
|---|
| 75 | $(RSTRIP) $(IDIR_RRDCOLLECT)
|
|---|
| 76 | $(IPKG_BUILD) $(IDIR_RRDCOLLECT) $(PACKAGE_DIR)
|
|---|
| 77 |
|
|---|
| 78 | $(IPKG_RRDCOLLECT_EXAMPLE):
|
|---|
| 79 | install -d -m0755 $(IDIR_RRDCOLLECT_EXAMPLE)/etc
|
|---|
| 80 | install -m0644 ./files/rrd.conf $(IDIR_RRDCOLLECT_EXAMPLE)/etc/
|
|---|
| 81 | install -m0644 ./files/rrdcollect.conf $(IDIR_RRDCOLLECT_EXAMPLE)/etc/
|
|---|
| 82 | install -d -m0755 $(IDIR_RRDCOLLECT_EXAMPLE)/etc/init.d
|
|---|
| 83 | install -m0755 ./files/rrdcollect.init \
|
|---|
| 84 | $(IDIR_RRDCOLLECT_EXAMPLE)/etc/init.d/S$(PKG_INIT)rrdcollect
|
|---|
| 85 | install -d -m0755 $(IDIR_RRDCOLLECT_EXAMPLE)/usr/bin
|
|---|
| 86 | install -m0755 ./files/rrd.sh $(IDIR_RRDCOLLECT_EXAMPLE)/usr/bin/
|
|---|
| 87 | install -d -m0755 $(IDIR_RRDCOLLECT_EXAMPLE)/www/cgi-bin
|
|---|
| 88 | ln -sf /var/lib/rrdcollect/rrd.cgi $(IDIR_RRDCOLLECT_EXAMPLE)/www/cgi-bin/rrd.cgi
|
|---|
| 89 | ln -sf /var/lib/rrdcollect/img $(IDIR_RRDCOLLECT_EXAMPLE)/www/img
|
|---|
| 90 | $(RSTRIP) $(IDIR_RRDCOLLECT_EXAMPLE)
|
|---|
| 91 | $(IPKG_BUILD) $(IDIR_RRDCOLLECT_EXAMPLE) $(PACKAGE_DIR)
|
|---|