Changeset 28957


Ignore:
Timestamp:
2011-11-11T19:06:52+01:00 (6 years ago)
Author:
nico
Message:

packages/rrdcollect: fix linking against rrdtool by splitting it into 2 packages

  • rrdcollect10, linked against rrdtool-1.0.x shared library
  • rrdcollect12, linked against rrdtool-1.2.x shared library
  • use new service functions
Location:
packages/utils/rrdcollect
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • packages/utils/rrdcollect/Makefile

    r19705 r28957  
    11# 
    2 # Copyright (C) 2006-2009 OpenWrt.org 
     2# Copyright (C) 2006-2011 OpenWrt.org 
    33# 
    44# This is free software, licensed under the GNU General Public License v2. 
     
    1010PKG_NAME:=rrdcollect 
    1111PKG_VERSION:=0.2.4 
    12 PKG_RELEASE:=1 
     12PKG_RELEASE:=3 
    1313 
    1414PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 
    1515PKG_SOURCE_URL:=@SF/rrdcollect 
    1616PKG_MD5SUM:=fd7ac95195e3e5cbab0677629505d9be 
     17 
     18PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) 
    1719 
    1820PKG_INSTALL:=1 
     
    3436endef 
    3537 
    36 define Package/rrdcollect 
     38define Package/rrdcollect10 
    3739$(call Package/rrdcollect/Default) 
     40  TITLE:=Round-Robin Database (RRD) collecting daemon 
     41  PROVIDES:=rrdcollect 
    3842  DEPENDS:=+librrd1 
    39   TITLE:=Round-Robin Database (RRD) collecting daemon 
    40   MENU:=1 
     43  VARIANT:=rrdtool10 
    4144endef 
    4245 
    43 define Package/rrdcollect/description 
     46define Package/rrdcollect10/description 
    4447$(call Package/rrdcollect/Default/description) 
    45  This package contains the RRD collecting daemon. 
     48 . 
     49 This package contains the RRD collecting daemon, linked against  
     50 rrdtool-1.0.x shared library. 
    4651endef 
    4752 
    48 define Package/rrdcollect-example 
     53define Package/rrdcollect12 
    4954$(call Package/rrdcollect/Default) 
    50   DEPENDS:=rrdcollect 
    51   TITLE:=Example setup for RRD collecting daemon above 
     55  TITLE:=Round-Robin Database (RRD) collecting daemon 
     56  PROVIDES:=rrdcollect 
     57  DEPENDS:=+librrd 
     58  VARIANT:=rrdtool12 
    5259endef 
    5360 
    54 define Package/rrdcollect-example/description 
     61define Package/rrdcollect12/description 
    5562$(call Package/rrdcollect/Default/description) 
    56  This package contains examples for the RRD collecting daemon. 
     63 . 
     64 This package contains the RRD collecting daemon, linked against  
     65 rrdtool-1.2.x shared library. 
    5766endef 
    5867 
    59 define Package/rrdcollect-example/conffiles 
    60 /etc/rrd.conf 
    61 /etc/rrdcollect.conf 
     68 
     69define Package/rrdcollect10-example 
     70$(call Package/rrdcollect/Default) 
     71  TITLE:=Example setup for RRD collecting daemon above 
     72  DEPENDS:=rrdcollect +rrdtool1 
     73  VARIANT:=rrdtool12 
    6274endef 
     75 
     76define Package/rrdcollect10-example/description 
     77$(call Package/rrdcollect/Default/description) 
     78 . 
     79 This package contains examples for the RRD collecting daemon, using 
     80 rrdtool-1.0.x shared library and utilities. 
     81endef 
     82 
     83define Package/rrdcollect12-example 
     84$(call Package/rrdcollect/Default) 
     85  TITLE:=Example setup for RRD collecting daemon above 
     86  DEPENDS:=rrdcollect +rrdtool 
     87  VARIANT:=rrdtool12 
     88endef 
     89 
     90define Package/rrdcollect12-example/description 
     91$(call Package/rrdcollect/Default/description) 
     92 This package contains examples for the RRD collecting daemon, using 
     93 rrdtool-1.2.x shared library and utilities. 
     94endef 
     95 
    6396 
    6497CONFIGURE_ARGS+= \ 
     
    68101        --enable-exec \ 
    69102        --without-rrdtool \ 
    70         --with-librrd="$(STAGING_DIR)/usr/lib/rrdtool-1.0" \ 
     103        --with-librrd \ 
    71104        --without-libpcre \ 
    72105        --without-libpcap \ 
     
    75108        CFLAGS="$(TARGET_CFLAGS) -DSOCKET_COMM" \ 
    76109 
     110EXTRA_LDFLAGS+= -Wl,-rpath-link,$(STAGING_DIR)/usr/lib 
     111 
     112ifeq ($(BUILD_VARIANT),rrdtool10) 
     113 
     114  TARGET_CPPFLAGS:=-I$(STAGING_DIR)/usr/lib/rrdtool-1.0/include $(TARGET_CPPFLAGS) 
     115  TARGET_LDFLAGS:=-L$(STAGING_DIR)/usr/lib/rrdtool-1.0/lib $(TARGET_CPPFLAGS) 
     116 
     117endif 
     118 
     119ifeq ($(BUILD_VARIANT),rrdtool12) 
     120 
     121  TARGET_CPPFLAGS:=-I$(STAGING_DIR)/usr/lib/rrdtool-1.2/include $(TARGET_CPPFLAGS) 
     122  TARGET_LDFLAGS:=-L$(STAGING_DIR)/usr/lib/rrdtool-1.2/lib $(TARGET_CPPFLAGS) 
     123 
     124endif 
     125 
    77126define Package/rrdcollect/install 
    78127        $(INSTALL_DIR) $(1)/usr/sbin 
    79128        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rrdcollect $(1)/usr/sbin/ 
     129endef 
     130 
     131Package/rrdcollect10/install = $(Package/rrdcollect/install) 
     132Package/rrdcollect12/install = $(Package/rrdcollect/install) 
     133 
     134define Package/rrdcollect-example/conffiles 
     135/etc/rrd.conf 
     136/etc/rrdcollect.conf 
    80137endef 
    81138 
     
    93150endef 
    94151 
    95 $(eval $(call BuildPackage,rrdcollect)) 
    96 $(eval $(call BuildPackage,rrdcollect-example)) 
     152Package/rrdcollect10-example/install = $(Package/rrdcollect-example/install) 
     153Package/rrdcollect12-example/install = $(Package/rrdcollect-example/install) 
     154 
     155$(eval $(call BuildPackage,rrdcollect10)) 
     156$(eval $(call BuildPackage,rrdcollect10-example)) 
     157$(eval $(call BuildPackage,rrdcollect12)) 
     158$(eval $(call BuildPackage,rrdcollect12-example)) 
  • packages/utils/rrdcollect/files/rrdcollect.init

    r15247 r28957  
    11#!/bin/sh /etc/rc.common 
    2 # Copyright (C) 2006 OpenWrt.org 
     2# Copyright (C) 2006-2011 OpenWrt.org 
    33 
    44START=98 
    5 BIN=rrdcollect 
    6 DEFAULT=/etc/default/$BIN 
    7 RUN_D=/var/run 
    8 PID_F=$RUN_D/$BIN.pid 
     5 
     6SERVICE_USE_PID=1 
     7 
    98LIB_D=/var/lib/rrdcollect 
    109CGI_S=$LIB_D/rrd.cgi 
     
    1413start() { 
    1514        RRD_F=$(find $RRD_D -name "*.rrd" 2>/dev/null) 
    16         [ -f $DEFAULT ] && . $DEFAULT 
    17         mkdir -p $RUN_D 
    18         mkdir -p $IMG_D 
    19         mkdir -p $RRD_D 
     15        mkdir -m 0755 -p $IMG_D 
     16        mkdir -m 0755 -p $RRD_D 
    2017        [ -n "$RRD_F" ] || /usr/bin/rrd.sh init 
    2118        [ -x $CGI_S ] || /usr/bin/rrd.sh cgi 
    22         $BIN $OPTIONS 
     19        service_start /usr/sbin/rrdcollect 
    2320} 
    2421 
    2522stop() { 
    26         [ -f $PID_F ] && kill $(cat $PID_F) 
     23        service_stop /usr/sbin/rrdcollect 
    2724} 
    2825 
Note: See TracChangeset for help on using the changeset viewer.