Changeset 4241


Ignore:
Timestamp:
2006-07-23T19:19:26+02:00 (10 years ago)
Author:
nico
Message:

port net-snmp to buildroot-ng

Location:
packages/libs/net-snmp
Files:
2 deleted
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • packages/libs/net-snmp/Makefile

    r3112 r4241  
     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# 
    17# $Id$ 
    28 
     
    612PKG_VERSION:=5.1.2 
    713PKG_RELEASE:=2.1 
     14 
     15PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) 
     16PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 
     17PKG_SOURCE_URL:=@SF/net-snmp 
    818PKG_MD5SUM:=8080555ab3f90011f25d5122042d9a8d 
    9  
    10 PKG_SOURCE_URL:=@SF/net-snmp 
    11 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 
    1219PKG_CAT:=zcat 
    1320 
    14 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) 
    1521PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install 
    1622 
     
    94100        --without-zlib \ 
    95101 
    96 include $(TOPDIR)/package/rules.mk 
    97  
    98 $(eval $(call PKG_template,LIBNETSNMP,libnetsnmp,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH))) 
    99 $(eval $(call PKG_template,SNMPD,snmpd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH))) 
    100 $(eval $(call PKG_template,SNMPD_STATIC,snmpd-static,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH))) 
    101 $(eval $(call PKG_template,SNMP_UTILS,snmp-utils,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH))) 
    102  
    103 $(PKG_BUILD_DIR)/.configured: 
    104         ( cd $(PKG_BUILD_DIR); rm -rf config.{cache,status}; \ 
     102include $(INCLUDE_DIR)/package.mk 
     103 
     104define Package/libnetsnmp 
     105  SECTION:=libs 
     106  CATEGORY:=Libraries 
     107  DEPENDS:=+libelf 
     108  TITLE:=Open source SNMP implementation (librairies) 
     109  DESCRIPTION:=Open source SNMP (Simple Network Management Protocol) implementation (libraries).\\\ 
     110    Simple Network Management Protocol (SNMP) is a widely used \\\ 
     111    protocol for monitoring the health and welfare of network \\\ 
     112    equipment (eg. routers), computer equipment and even devices \\\ 
     113    like UPSs. Net-SNMP is a suite of applications used to implement \\\ 
     114    SNMP v1, SNMP v2c and SNMP v3 using both IPv4 and IPv6.\\\ 
     115    \\\ 
     116    This package contains shared libraries, needed by other programs. 
     117  URL:=http://www.net-snmp.org/ 
     118endef 
     119 
     120define Package/snmp-utils 
     121  SECTION:=net 
     122  CATEGORY:=Network 
     123  DEPENDS:=+libnetsnmp 
     124  TITLE:=Open source SNMP implementation (utilities) 
     125  DESCRIPTION:=Open source SNMP (Simple Network Management Protocol) implementation (utilities).\\\ 
     126    Simple Network Management Protocol (SNMP) is a widely used \\\ 
     127    protocol for monitoring the health and welfare of network \\\ 
     128    equipment (eg. routers), computer equipment and even devices \\\ 
     129    like UPSs. Net-SNMP is a suite of applications used to implement \\\ 
     130    SNMP v1, SNMP v2c and SNMP v3 using both IPv4 and IPv6.\\\ 
     131    \\\ 
     132    This package contains SNMP client utilities. 
     133  URL:=http://www.net-snmp.org/ 
     134endef 
     135 
     136define Package/snmpd 
     137  SECTION:=net 
     138  CATEGORY:=Network 
     139  DEPENDS:=+libnetsnmp 
     140  TITLE:=Open source SNMP implementation (daemon) 
     141  DESCRIPTION:=Open source SNMP (Simple Network Management Protocol) implementation (daemon).\\\ 
     142    Simple Network Management Protocol (SNMP) is a widely used \\\ 
     143    protocol for monitoring the health and welfare of network \\\ 
     144    equipment (eg. routers), computer equipment and even devices \\\ 
     145    like UPSs. Net-SNMP is a suite of applications used to implement \\\ 
     146    SNMP v1, SNMP v2c and SNMP v3 using both IPv4 and IPv6.\\\ 
     147    \\\ 
     148    This package contains the SNMP agent, dynamically linked. 
     149  URL:=http://www.net-snmp.org/ 
     150endef 
     151 
     152define Package/snmpd/conffiles 
     153/etc/default/snmpd 
     154/etc/snmp/snmpd.conf 
     155endef 
     156 
     157define Package/snmpd-static 
     158  SECTION:=net 
     159  CATEGORY:=Network 
     160  TITLE:=Open source SNMP implementation (daemon) 
     161  DESCRIPTION:=Open source SNMP (Simple Network Management Protocol) implementation (daemon).\\\ 
     162    Simple Network Management Protocol (SNMP) is a widely used \\\ 
     163    protocol for monitoring the health and welfare of network \\\ 
     164    equipment (eg. routers), computer equipment and even devices \\\ 
     165    like UPSs. Net-SNMP is a suite of applications used to implement \\\ 
     166    SNMP v1, SNMP v2c and SNMP v3 using both IPv4 and IPv6.\\\ 
     167    \\\ 
     168    This package contains the SNMP agent, statically linked. 
     169  URL:=http://www.net-snmp.org/ 
     170endef 
     171 
     172define Package/snmpd-static/conffiles 
     173/etc/default/snmpd 
     174/etc/snmp/snmpd.conf 
     175endef 
     176 
     177define Build/Configure 
     178        (cd $(PKG_BUILD_DIR); rm -f config.cache; \ 
    105179                $(TARGET_CONFIGURE_OPTS) \ 
    106180                CFLAGS="$(TARGET_CFLAGS)" \ 
     
    130204                        $(PKG_CONFIGURE_OPTIONS) \ 
    131205        ); 
    132         touch $@ 
    133  
    134 $(PKG_BUILD_DIR)/.built: 
     206endef 
     207 
     208define Build/Compile 
    135209        rm -rf $(PKG_INSTALL_DIR) 
    136210        mkdir -p $(PKG_INSTALL_DIR) 
     
    139213                all install 
    140214        ( cd $(PKG_INSTALL_DIR); mv ./usr/sbin/snmpd ./usr/sbin/snmpd-shared; ) 
    141 ifneq ($(BR2_PACKAGE_SNMPD_STATIC),) 
     215ifneq ($(CONFIG_PACKAGE_snmpd-static),) 
    142216        ( cd $(PKG_BUILD_DIR); rm -f agent/snmpd; ) 
    143217        $(MAKE) -C $(PKG_BUILD_DIR) \ 
     
    147221        ( cd $(PKG_INSTALL_DIR); mv ./usr/sbin/snmpd ./usr/sbin/snmpd-static; ) 
    148222endif 
    149         touch $@ 
    150  
    151 $(IPKG_LIBNETSNMP): 
    152         install -d -m0755 $(IDIR_LIBNETSNMP)/usr/lib 
    153         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.so.* $(IDIR_LIBNETSNMP)/usr/lib/ 
    154         $(RSTRIP) $(IDIR_LIBNETSNMP) 
    155         $(IPKG_BUILD) $(IDIR_LIBNETSNMP) $(PACKAGE_DIR) 
    156  
    157 $(IPKG_SNMPD): 
    158         install -d -m0755 $(IDIR_SNMPD)/etc/snmp 
    159         install -m0644 ./files/snmpd.conf $(IDIR_SNMPD)/etc/snmp/snmpd.conf 
    160         install -d -m0755 $(IDIR_SNMPD)/etc/default 
    161         install -m0644 ./files/snmpd.default $(IDIR_SNMPD)/etc/default/snmpd 
    162         install -d -m0755 $(IDIR_SNMPD)/etc/init.d 
    163         install -m0755 ./files/snmpd.init $(IDIR_SNMPD)/etc/init.d/snmpd 
    164         install -d -m0755 $(IDIR_SNMPD)/usr/sbin 
    165         install -m0755 $(PKG_INSTALL_DIR)/usr/sbin/snmpd-shared $(IDIR_SNMPD)/usr/sbin/snmpd 
    166         $(RSTRIP) $(IDIR_SNMPD) 
    167         $(IPKG_BUILD) $(IDIR_SNMPD) $(PACKAGE_DIR) 
    168  
    169 $(IPKG_SNMPD_STATIC): 
    170         install -d -m0755 $(IDIR_SNMPD_STATIC)/etc/snmp 
    171         install -m0644 ./files/snmpd.conf $(IDIR_SNMPD_STATIC)/etc/snmp/snmpd.conf 
    172         install -d -m0755 $(IDIR_SNMPD_STATIC)/etc/default 
    173         install -m0644 ./files/snmpd.default $(IDIR_SNMPD_STATIC)/etc/default/snmpd 
    174         install -d -m0755 $(IDIR_SNMPD_STATIC)/etc/init.d 
    175         install -m0755 ./files/snmpd.init $(IDIR_SNMPD_STATIC)/etc/init.d/snmpd 
    176         install -d -m0755 $(IDIR_SNMPD_STATIC)/usr/sbin 
    177         install -m0755 $(PKG_INSTALL_DIR)/usr/sbin/snmpd-static $(IDIR_SNMPD_STATIC)/usr/sbin/snmpd 
    178         $(RSTRIP) $(IDIR_SNMPD_STATIC) 
    179         $(IPKG_BUILD) $(IDIR_SNMPD_STATIC) $(PACKAGE_DIR) 
    180  
    181 $(IPKG_SNMP_UTILS): 
    182         install -d -m0755 $(IDIR_SNMP_UTILS)/usr/bin 
    183         $(CP) $(PKG_INSTALL_DIR)/usr/bin/snmp{get,set,status,test,trap,walk} $(IDIR_SNMP_UTILS)/usr/bin/ 
    184         $(RSTRIP) $(IDIR_SNMP_UTILS) 
    185         $(IPKG_BUILD) $(IDIR_SNMP_UTILS) $(PACKAGE_DIR) 
    186  
    187 $(STAGING_DIR)/usr/lib/libnetsnmp.so: $(PKG_BUILD_DIR)/.built 
     223endef 
     224 
     225define Package/libnetsnmp/install 
     226        install -d -m0755 $(1)/usr/lib 
     227        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.so.* $(1)/usr/lib/ 
     228endef 
     229 
     230define Package/snmpd/install 
     231        install -d -m0755 $(1)/etc/snmp 
     232        install -m0644 ./files/snmpd.conf $(1)/etc/snmp/snmpd.conf 
     233        install -d -m0755 $(1)/etc/default 
     234        install -m0644 ./files/snmpd.default $(1)/etc/default/snmpd 
     235        install -d -m0755 $(1)/etc/init.d 
     236        install -m0755 ./files/snmpd.init $(1)/etc/init.d/snmpd 
     237        install -d -m0755 $(1)/usr/sbin 
     238        install -m0755 $(PKG_INSTALL_DIR)/usr/sbin/snmpd-shared $(1)/usr/sbin/snmpd 
     239endef 
     240 
     241define Package/snmpd-static/install 
     242        install -d -m0755 $(1)/etc/snmp 
     243        install -m0644 ./files/snmpd.conf $(1)/etc/snmp/snmpd.conf 
     244        install -d -m0755 $(1)/etc/default 
     245        install -m0644 ./files/snmpd.default $(1)/etc/default/snmpd 
     246        install -d -m0755 $(1)/etc/init.d 
     247        install -m0755 ./files/snmpd.init $(1)/etc/init.d/snmpd 
     248        install -d -m0755 $(1)/usr/sbin 
     249        install -m0755 $(PKG_INSTALL_DIR)/usr/sbin/snmpd-static $(1)/usr/sbin/snmpd 
     250endef 
     251 
     252define Package/snmp-utils/install 
     253        install -d -m0755 $(1)/usr/bin 
     254        $(CP) $(PKG_INSTALL_DIR)/usr/bin/snmp{get,set,status,test,trap,walk} $(1)/usr/bin/ 
     255endef 
     256 
     257define Build/InstallDev 
    188258        mkdir -p $(STAGING_DIR)/usr/bin 
    189259        $(CP) $(PKG_INSTALL_DIR)/usr/bin/net-snmp-config $(STAGING_DIR)/usr/bin/ 
     
    192262        mkdir -p $(STAGING_DIR)/usr/lib 
    193263        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.{a,so*} $(STAGING_DIR)/usr/lib/ 
    194         touch $@ 
    195  
    196 install-dev: $(STAGING_DIR)/usr/lib/libnetsnmp.so 
    197  
    198 uninstall-dev: 
     264endef 
     265 
     266define Build/UninstallDev 
    199267        rm -rf \ 
    200268                $(STAGING_DIR)/usr/bin/net-snmp-config \ 
    201269                $(STAGING_DIR)/usr/include/net-snmp \ 
    202                 $(STAGING_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.{a,so*} \ 
    203  
    204 compile-targets: install-dev 
    205 clean-targets: uninstall-dev 
     270                $(STAGING_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.{a,so*} 
     271endef 
     272 
     273$(eval $(call BuildPackage,libnetsnmp)) 
     274$(eval $(call BuildPackage,snmp-utils)) 
     275$(eval $(call BuildPackage,snmpd)) 
     276$(eval $(call BuildPackage,snmpd-static)) 
Note: See TracChangeset for help on using the changeset viewer.