Makefile PORTNAME changed from net-snmp to snmp (so, DATADIR and DOCSDIR are are well defined) PKGNAMEPREFIX added PORTREVISION bumped DISTNAME added CONFIGURE_ENV added * WITH_TKMIB added (p5-Tk dependency added) * --with-defaults conditionnaly added to CONFIGURE_ARGS if make is run in BATCH mode * --with-dummy-values added to CONFIGURE_ARGS except if WITHOUT_DUMMY_VALUES is given at make time (this allow snmpwalk hrStorageTable to work properly in any cases, else, it gives up on the first entry which correspond to Memory Buffers which isn't implemented yet under FreeBSD 5.x) * WITHPERL changed to WITH_PERL in PLIST_SUB * --enable-ipv6 added to CONFIGURE_ARGS except if WITHOUT_IPV6 is given at make time * shlib changed to SHLIB_VERSION in PLIST_SUB * NET_SNMP_SYS_CONTACT defaulted to nobody@nowhere.invalid (see RFC, humm! don't remember about .invalid tld :) * NET_SNMP_SYS_LOCATION defaulted to somewhere instead of nothing * disman/event-mib and mibII/mta_sendmail added to NET_SNMP_MIB_MODULES * heuristic added to check the module list validity in NET_SNMP_MIB_MODULES * LIBTOOL_SUB and SCRIPTS_SUB added (based on RC_SCRIPTS_SUB) * MAN3PERL updated and sorted * BIN and SBIN changed to &_FILES * snmptrapd.sh added to STARTUP_FILES * pre-everything target added * post-patch splitted into sub-targets * post-configure added * post-build updated * pre-install deleted * post-install splitted into sub-targets * script and doc files added pkg-descr a little change pkg-message snmptrapd_* variables added plus some changes pkg-plist list sorted tkmib conditionnaly referenced etc/rc.d/snmptrapd.sh added etc/snmp directory added IPv6 headers conditionnaly referenced share/snmp -> %%DATADIR%% script and doc files added @dirrm moved to the end files/patch-configure /boot/kernel/kernel added to the list of potential kernels AC_CHECK_HEADERS updated files/patch-hr_storage.c freebsd5 test added files/patch-hr_system.c count_users now returns other things than zero files/patch-memory_freebsd2.c don't read unneeded kernel symbols under freebsd5 files/snmpd.sh.sample sig_stop=-KILL added since sometimes snmpd hangs files/extra-patch-local:Makefile.in files/patch-local::fixproc files/patch-local::ipf-mod.pl files/patch-local::mib2c files/patch-local::snmpcheck.def files/patch-local::snmpconf files/patch-local::tkmib files/patch-local::traptoemail new files files/patch-al files/patch-local:Makefile.in deleted files Fix: take care, this patch is in two parts, the first one is a diff against /dev/null and the second one a cvs diff. don't forget to delete files/patch-al and files/patch-local:Makefile.in ----------==========---------- DIFF /dev/null ----------==========---------- How-To-Repeat: $ snmpwalk -c public localhost hrStorageTable does nothing !
Responsible Changed From-To: freebsd-ports-bugs->kuriyama Over to maintainer
--- /dev/null Sat Mar 6 00:11:01 2004 +++ files/snmptrapd.sh.sample Tue Mar 2 15:26:38 2004 @@ -0,0 +1,35 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# PROVIDE: snmptrapd +# REQUIRE: DAEMON +# KEYWORD: FreeBSD +# +# Add the following line to /etc/rc.conf to enable snmptrapd: +# +# snmptrapd_enable="YES" +# + +snmptrapd_enable="NO" +snmptrapd_flags="-p /var/run/snmptrapd.pid" + +. %%RC_SUBR%% + +load_rc_config net_snmptrapd + +if [ ! -z "$net_snmptrapd_enable" ]; then + echo "Warning: \$net_snmptrapd_enable is obsoleted." + echo " Use \$snmptrapd_enable instead." + snmptrapd_enable="$net_snmptrapd_enable" + [ ! -z "$net_snmptrapd_flags" ] && snmptrapd_flags="$net_snmptrapd_flags" +fi + +name=snmptrapd +rcvar=`set_rcvar` + +command=%%PREFIX%%/sbin/${name} +pidfile=/var/run/${name}.pid + +load_rc_config ${name} +run_rc_command "$1"
Jun Kuriyama wrote: > > Thanks! Excellent work! you're welcome ;^) > At Thu, 4 Mar 2004 15:04:27 +0100, > Cyrille Lefevre wrote: > > files/patch-local::fixproc > > It looks this patch makes this script to work on *BSD only. Is it > difficult to change argument to ps(1) conditionally by OS type? see below... PS : I've only a little perl knowledge, but perl -c don't complain, so :) > > files/patch-local::tkmib > Is removing "-w" flag intentional? no, sorry ! > > Makefile > > * WITH_TKMIB added (p5-Tk dependency added) > > ... and other options. Should we try to use $OPTIONS? what do you mean by "Should we try to use $OPTIONS?" ? --- /dev/null Sat Mar 6 02:05:31 2004 +++ files/patch-local::fixproc Sat Mar 6 02:04:21 2004 @@ -0,0 +1,138 @@ +--- local/fixproc.orig Sat Apr 20 09:30:13 2002 ++++ local/fixproc Sat Mar 6 01:59:59 2004 +@@ -1,4 +1,4 @@ +-#!/usr/bin/perl ++#!%%PERL%% + # + # fixproc [-min n] [-max n] [-check | -kill | -restart | -exist | -fix] proc ... + # +@@ -129,7 +129,7 @@ + # + # Timothy Kong 3/1995 + +-$database_file = '/local/etc/fixproc.conf'; ++$database_file = '%%PREFIX%%/etc/fixproc.conf'; + + $debug = 0; # specify debug level using -dN + # currently defined: -d1 +@@ -155,6 +155,14 @@ + $shell_header = "#!/bin/sh\n"; + $shell_end_marker = 'shell_end_marker'; + ++open(command, "/bin/ps -p $$ |") || die "$0: can't run ps command\n"; ++if (split(' ', <command>) > 4) { ++ $ps_opts = 'ax'; ++} else { ++ $ps_opts = '-e'; ++} ++close command; ++ + &read_args(); + &read_database(); + # &dump_database(); # debug only +@@ -203,7 +211,9 @@ + $i++; + } + close (file); +- system "chmod +x $file"; ++ ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, ++ $atime,$mtime,$ctime,$blksize,$blocks) = stat($file); ++ chmod $mode | 0111, $file; + return file; + } + +@@ -237,8 +247,8 @@ + + # return code is number divided by 256 + $error_code = (system "$tmpfile") / 256; +- system "rm $tmpfile"; +- return ($fix_failed_error) if ($error_code != 0); ++ unlink $tmpfile; ++ return ($cannot_fix_error) if ($error_code != 0); + # sleep needed here? + return &do_exist ($proc); + } +@@ -268,7 +278,7 @@ + + # return code is number divided by 256 + $error_code = (system "$tmpfile") / 256; +- system "rm $tmpfile"; ++ unlink $tmpfile; + return ($check_failed_error) if ($error_code != 0); + + # check passed, continue +@@ -285,10 +295,12 @@ + + # do ps, check to see if min <= no. of processes <= max + $! = $fixproc_error; +- open (command, "/bin/ps -e | /bin/grep $proc | /bin/wc -l |") ++ open (command, "/bin/ps $ps_opts |") + || die "$0: can't run ps-grep-wc command\n"; +- $proc_count = <command>; +- if (($proc_count < $min{$proc}) || ($proc_count > $max{$proc})) ++ @allprocs = <command>; ++ close command; ++ @procs = grep(/$proc/, @allprocs); ++ if (($#procs < $min{$proc}) || ($#procs > $max{$proc})) + { + return $check_failed_error; + } +@@ -305,41 +317,48 @@ + + # first try kill + $! = $fixproc_error; +- open (command, "/bin/ps -e | /bin/grep $proc |") ++ open (command, "/bin/ps $ps_opts |") + || die "$0: can't run ps-grep-awk command\n"; + while (<command>) + { +- # match the first field of ps -e ++ if /$proc/ { ++ # match the first field of ps $ps_opts + $! = $fixproc_error; +- /^\s*(\d+)\s/ || die "$0: can't match ps -e output\n"; +- system "kill $1"; ++ /^\s*(\d+)\s/ || die "$0: can't match ps $ps_opts output\n"; ++ kill 15, $1; ++ } + } ++ close command; + + # if process still exist, try kill -9 + sleep 2; + $! = $fixproc_error; +- open (command, "/bin/ps -e | /bin/grep $proc |") ++ open (command, "/bin/ps $ps_opts |") + || die "$0: can't run ps-grep-awk command\n"; + $second_kill_needed = 0; + while (<command>) + { +- # match the first field of ps -e ++ if /$proc/ { ++ # match the first field of ps $ps_opts + $! = $fixproc_error; +- /^\s*(\d+)\s/ || die "$0: can't match ps -e output\n"; +- system "kill -9 $1"; ++ /^\s*(\d+)\s/ || die "$0: can't match ps $ps_opts output\n"; ++ kill 9, $1; + $second_kill_needed = 1; ++ } + } ++ close command; + return ($no_error) if ($second_kill_needed == 0); + + # see if kill -9 worked + sleep 2; + $! = $fixproc_error; +- open (command, "/bin/ps -e | /bin/grep $proc |") ++ open (command, "/bin/ps $ps_opts |") + || die "$0: can't run ps-grep-awk command\n"; + while (<command>) + { # a process still exist, return error +- return $cannot_kill_error; ++ return $cannot_kill_error if /$proc/; + } ++ close command; + return $no_error; # good, all dead + } + Cyrille Lefevre -- mailto:cyrille.lefevre@laposte.net
State Changed From-To: open->closed Committed, thanks!
I think there is a problem with the manpages: On -STABLE, with base-system perl, the manpages are installed into /usr/, not /usr/local, but the port assumes they are in /usr/local: [...] Installing /usr/lib/perl5/5.00503/man/man3/NetSNMP::default_store.3 Installing /usr/lib/perl5/5.00503/man/man3/NetSNMP::ASN.3 Installing /usr/lib/perl5/5.00503/man/man3/NetSNMP::OID.3 Installing /usr/lib/perl5/5.00503/man/man3/NetSNMP::agent::default_store.3 Installing /usr/lib/perl5/5.00503/man/man3/NetSNMP::netsnmp_request_infoPtr.3 Installing /usr/lib/perl5/5.00503/man/man3/NetSNMP::agent.3 Installing /usr/lib/perl5/5.00503/man/man3/SNMP.3 Writing /usr/local/lib/perl5/site_perl/5.005/i386-freebsd/auto/Bundle/NetSNMP/.packlist Appending installation info to /usr/libdata/perl/5.00503/mach/perllocal.pod **** This port installs snmp daemon, header files and libraries but don't invokes snmpd by default. If you want to invoke snmpd and/or snmptrapd at startup, put these lines into /etc/rc.conf. snmpd_enable="YES" snmpd_flags="-as -p /var/run/snmpd.pid" snmptrapd_enable="YES" snmptrapd_flags="-as -p /var/run/snmptrapd.pid" **** You may specify the following make variables: NET_SNMP_SYS_CONTACT="kuriyama@FreeBSD.org" NET_SNMP_SYS_LOCATION="Tokyo, Japan" DEFAULT_SNMP_VERSION=3 NET_SNMP_MIB_MODULES="host smux mibII/mta_sendmail ucd-snmp/diskio" NET_SNMP_LOGFILE=/var/log/snmpd.log NET_SNMP_PERSISTENTDIR=/var/net-snmp to define default values (or overwriting defaults). At least setting first two variables, you will not be prompted during configuration process. You may also set BATCH="yes" to avoid interactive configuration. ===> Compressing manual pages for net-snmp-5.1_3 /usr/local/lib/perl5/5.00503/man/man3/NetSNMP::ASN.3: No such file or directory /usr/local/lib/perl5/5.00503/man/man3/NetSNMP::OID.3: No such file or directory /usr/local/lib/perl5/5.00503/man/man3/NetSNMP::agent.3: No such file or directory /usr/local/lib/perl5/5.00503/man/man3/NetSNMP::agent::default_store.3: No such file or directory /usr/local/lib/perl5/5.00503/man/man3/NetSNMP::default_store.3: No such file or directory /usr/local/lib/perl5/5.00503/man/man3/NetSNMP::netsnmp_request_infoPtr.3: No such file or directory /usr/local/lib/perl5/5.00503/man/man3/SNMP.3: No such file or directory ===> Running ldconfig /sbin/ldconfig -m /usr/local/lib ===> Registering installation for net-snmp-5.1_3 awk: fatal: can't open source file "/usr/ports/Tools/scripts/security-check.awk" for reading (No such file or directory) For more information, and contact details about the security status of this software, see the following webpage: http://net-snmp.sourceforge.net/ ===> Building package for net-snmp-5.1_3 tar: lib/perl5/5.00503/man/man3/NetSNMP\:\:ASN.3.gz: Cannot stat: No such file or directory tar: lib/perl5/5.00503/man/man3/NetSNMP\:\:OID.3.gz: Cannot stat: No such file or directory tar: lib/perl5/5.00503/man/man3/NetSNMP\:\:agent.3.gz: Cannot stat: No such file or directory tar: lib/perl5/5.00503/man/man3/NetSNMP\:\:agent\:\:default_store.3.gz: Cannot stat: No such file or directory tar: lib/perl5/5.00503/man/man3/NetSNMP\:\:default_store.3.gz: Cannot stat: No such file or directory tar: lib/perl5/5.00503/man/man3/NetSNMP\:\:netsnmp_request_infoPtr.3.gz: Cannot stat: No such file or directory tar: lib/perl5/5.00503/man/man3/SNMP.3.gz: Cannot stat: No such file or directory tar: Error exit delayed from previous errors pkg_create: make_dist: tar command failed with code 512 Creating package /tmp/packages/All/net-snmp-5.1_3.tgz Registering depends: rc_subr-1.16. Creating gzip'd tar ball in '/tmp/packages/All/net-snmp-5.1_3.tgz' *** Error code 1 -- ,_, | Michael Nottebrock | lofi@freebsd.org (/^ ^\) | FreeBSD - The Power to Serve | http://www.freebsd.org \u/ | K Desktop Environment on FreeBSD | http://freebsd.kde.org
On Wednesday 10 March 2004 23:27, I wrote: > I think there is a problem with the manpages: > > On -STABLE, with base-system perl, the manpages are installed into /usr/, > not /usr/local, but the port assumes they are in /usr/local: The problem seems to be more related to systems where PREFIX = /usr, instead of being -STABLE specific. I'm still investigating. -- ,_, | Michael Nottebrock | lofi@freebsd.org (/^ ^\) | FreeBSD - The Power to Serve | http://www.freebsd.org \u/ | K Desktop Environment on FreeBSD | http://freebsd.kde.org
On Thursday 11 March 2004 12:59, Michael Nottebrock wrote: > On Wednesday 10 March 2004 23:27, I wrote: > > I think there is a problem with the manpages: > > > > On -STABLE, with base-system perl, the manpages are installed into /usr/, > > not /usr/local, but the port assumes they are in /usr/local: > > The problem seems to be more related to systems where PREFIX = /usr, > instead of being -STABLE specific. I'm still investigating. Okay, found it: On 4.x systems with base system perl, MakeMaker sets (PREFIX) in perl/Makefile to /usr, because the perl PREFIX actually _is_ /usr. The new new patch in post-build however assumes that PREFIX is always set to /usr/local - thus, in the base-perl case, nothing is replaced, and the manpages become installed into /usr. The attached patch for the net-snmp port Makefile should fix this. On a related note: The port Makefile as it is now uses ${SED}, ${PERL} and ${REINPLACE_CMD} to do in-place fixes. This is bad style, it should exclusively use ${REINPLACE_CMD}. -- ,_, | Michael Nottebrock | lofi@freebsd.org (/^ ^\) | FreeBSD - The Power to Serve | http://www.freebsd.org \u/ | K Desktop Environment on FreeBSD | http://freebsd.kde.org
At Thu, 11 Mar 2004 15:04:57 +0100, Michael Nottebrock wrote: > On 4.x systems with base system perl, MakeMaker sets (PREFIX) in perl/Makefile > to /usr, because the perl PREFIX actually _is_ /usr. The new new patch in > post-build however assumes that PREFIX is always set to /usr/local - thus, in > the base-perl case, nothing is replaced, and the manpages become installed > into /usr. The attached patch for the net-snmp port Makefile should fix this. Thanks! I'll commit it. > On a related note: The port Makefile as it is now uses ${SED}, ${PERL} and > ${REINPLACE_CMD} to do in-place fixes. This is bad style, it should > exclusively use ${REINPLACE_CMD}. ${SED} should be stay as is (not inplace replacing). -- Jun Kuriyama <kuriyama@imgsrc.co.jp> // IMG SRC, Inc. <kuriyama@FreeBSD.org> // FreeBSD Project
"Michael Nottebrock" <michaelnottebrock@gmx.net> wrote : [snip] > On 4.x systems with base system perl, MakeMaker sets (PREFIX) in perl/Makefile > to /usr, because the perl PREFIX actually _is_ /usr. The new new patch in > post-build however assumes that PREFIX is always set to /usr/local - thus, in > the base-perl case, nothing is replaced, and the manpages become installed > into /usr. The attached patch for the net-snmp port Makefile should fix this. > > On a related note: The port Makefile as it is now uses ${SED}, ${PERL} and > ${REINPLACE_CMD} to do in-place fixes. This is bad style, it should > exclusively use ${REINPLACE_CMD}. you are right, see below... > Index: Makefile > =================================================================== > RCS file: /home/pcvs/ports/net-mgmt/net-snmp/Makefile,v > retrieving revision 1.102 > diff -u -r1.102 Makefile > --- Makefile 11 Mar 2004 00:26:39 -0000 1.102 > +++ Makefile 11 Mar 2004 13:52:12 -0000 > @@ -235,7 +235,7 @@ > post-build: > ${FIND} ${WRKSRC}/perl -name Makefile | \ > ${XARGS} ${PERL} -pi -e '\ > - s!^(PREFIX) = /usr/local!$$1 = ${PREFIX}!; \ > + s!^(PREFIX) = .*!$$1 = ${PREFIX}!; \ > s!^(INSTALLMAN3DIR) = /usr/local!$$1 = \$$\(PREFIX\)!; \ also, shouldn't /usr/local be changed to .* too ? > s! doc_(perl|site|\$$\(INSTALLDIRS\))_install$$!!; \ > ' so, here is the new makefile :) --- Makefile.orig Thu Mar 11 15:52:21 2004 +++ Makefile Thu Mar 11 18:44:15 2004 @@ -2,7 +2,7 @@ # Date created: 26 June 1996 # Whom: gpalmer # -# $FreeBSD: /repoman/r/pcvs/ports/net-mgmt/net-snmp/Makefile,v 1.103 2004/03/11 14:52:21 kuriyama Exp $ +# $FreeBSD$ # PORTNAME= snmp @@ -225,14 +225,14 @@ post-configure: @${FIND} ${WRKSRC} -name Makefile | \ - ${XARGS} ${PERL} -pi -e 's|$$| -m 755| if /^INSTALL\s+=/' + ${XARGS} ${REINPLACE_CMD} -E -e '/^INSTALL[ ]+=/s|$$| -m 755|' .if !defined(WITHOUT_PERL) post-build: ${FIND} ${WRKSRC}/perl -name Makefile | \ - ${XARGS} ${REINPLACE_CMD} -e '\ - s!^(PREFIX) = .*!$$1 = ${PREFIX}!; \ - s!^(INSTALLMAN3DIR) = /usr/local!$$1 = \$$\(PREFIX\)!; \ + ${XARGS} ${REINPLACE_CMD} -E -e '\ + s!^(PREFIX) = .*!\1 = ${PREFIX}!; \ + s!^(INSTALLMAN3DIR) = .*!\1 = ${MAN3PERLPREFIX}/man/man3!; \ s! doc_(perl|site|\$$\(INSTALLDIRS\))_install$$!!; \ ' .endif PS : REINPLACE_CMD is sed, not perl, so, s!^(PREFIX) = .*!$$1 = ${PREFIX}! couldn't work as is without translating $$1 to \1 and adding the -E option. Cyrille Lefevre -- mailto:cyrille.lefevre@laposte.net
On Thursday 11 March 2004 18:48, Cyrille Lefevre wrote: > [patches] > PS : REINPLACE_CMD is sed, not perl, so, s!^(PREFIX) = .*!$$1 = ${PREFIX}! > couldn't work as is without translating $$1 to \1 and adding the -E option. Thanks. I only did the minimum amount of work necessary to get the kde-freebsd buildcluster going again, since net-snmp is a dependency of kdeutils. Your patches look good. -- ,_, | Michael Nottebrock | lofi@freebsd.org (/^ ^\) | FreeBSD - The Power to Serve | http://www.freebsd.org \u/ | K Desktop Environment on FreeBSD | http://freebsd.kde.org