diff options
Diffstat (limited to 'dist')
31 files changed, 4833 insertions, 0 deletions
diff --git a/dist/Makefile b/dist/Makefile new file mode 100644 index 0000000..c771f93 --- /dev/null +++ b/dist/Makefile @@ -0,0 +1,133 @@ +# ====================================================================== +# $Source$ +# $Revision$ +# $Date$ +# $Author$ +# $Name$ +# $State$ +# ====================================================================== + +# Makefile for generating rpm package files (.rpm) for net-snmp. + +# GNU 'make'-specific features are used in this makefile. +# Other makes may or may not work with it. +# See http://www.gnu.org/manual/make/index.html for details. + +SHELL = /bin/sh + +# Define the RPM package name +NAME = net-snmp + +# Define the default RPM release number. Set by Version-Munge.pl +VERSION = 5.7.2 + +VERSION_TAG=`echo Ext-$(VERSION) | sed 's/\./-/g;'` + +WITH_PERL=1 +EMBED_PERL=1 + +# Define the RPM architecture, i.e., 'ppc', 'i386', etc. +ARCH = `uname -i` + +# Directory structure expected by 'rpm' program +RPM_BASE := $(PWD)/rpm + +RPM_TREE := \ + $(RPM_BASE)/BUILD \ + $(RPM_BASE)/RPMS \ + $(RPM_BASE)/SOURCES \ + $(RPM_BASE)/SPECS \ + $(RPM_BASE)/SRPMS + +.PHONY: all clean rpm_files binary_rpm source_rpm all_rpm + +all: all_rpm_files + +# Delete all generated files. +clean: + rm -rf $(RPM_BASE) + +# -------------------------------------------------------------------- +# Macros and rules for updating net-snmp-x.x.x.tar.gz. +# 'rpm' expects a compressed archive (.tar.gz) of the source directory +# to exist (in the rpm/SOURCES directory) before it is run. +# -------------------------------------------------------------------- +CVSROOT = :pserver:anonymous@net-snmp.cvs.sourceforge.net:/cvsroot/net-snmp + +PKG_VER := $(NAME)-$(VERSION) + +GZIP_TAR := $(RPM_BASE)/SOURCES/$(PKG_VER).tar.gz + +gzip_tar: $(GZIP_TAR) + +$(GZIP_TAR): + @echo "Creating a compressed archive of the package's source files..." + (cd $(RPM_BASE)/SOURCES; \ + cvs -d$(CVSROOT) login; \ + cvs -z3 -d$(CVSROOT) export -r$(VERSION_TAG) $(NAME); \ + mv $(NAME) $(PKG_VER); \ + tar cf $(PKG_VER).tar $(PKG_VER); \ + gzip $(PKG_VER).tar) + @echo "A compressed archive of the package's source-file tree has been created." + +# -------------------------------------------------------------------- +# Macros and rules for updating the binary and source RPM package files. +# -------------------------------------------------------------------- +# Redefine '%_topdir' to allow an RPM package file to be built anywhere, +# instead of in the /usr/src/redhat directory tree. +# +# Don't want 'rpmbuild' to strip your executable programs? +# Then add this line: +# --define='_os_install_post /usr/lib/rpm/brp-compress' \ +# to the RPM_OPTS macro definition. This will eliminate the +# stripping of binaries, but still retain the compression of +# manual pages. +# +ifeq ($(WITH_PERL),0) +PERLOPTS = --without perl_modules +endif +ifeq ($(EMBED_PERL),0) +PERLOPTS += --without embedded_perl +endif + +RPM_OPTS := \ + --define='_topdir $(RPM_BASE)' \ + --define='_includedir /usr/include/net-snmp' \ + --target $(ARCH) $(PERLOPTS) + +SPEC_FILE := $(NAME).spec +RPM_SPEC := $(RPM_BASE)/SPECS/$(SPEC_FILE) + +BINARY_RPM := $(RPM_BASE)/RPMS/$(ARCH)/$(PKG_VER)-$(RELEASE).$(ARCH).rpm +SOURCE_RPM := $(RPM_BASE)/SRPMS/$(PKG_VER)-$(RELEASE).src.rpm + +rpm_files: $(GZIP_TAR) all_rpm_files +binary_rpm: $(BINARY_RPM) +source_rpm: $(SOURCE_RPM) +rpm_tree: $(RPM_TREE) + +all_rpm_files: $(RPM_TREE) $(RPM_SPEC) + (cd $(RPM_BASE)/SPECS; \ + rpmbuild -ba $(RPM_OPTS) $(SPEC_FILE)) + +$(BINARY_RPM): $(RPM_TREE) $(RPM_SPEC) + (cd $(RPM_BASE)/SPECS; \ + rpmbuild -bb $(RPM_OPTS) $(SPEC_FILE)) + +$(SOURCE_RPM): $(RPM_TREE) $(RPM_SPEC) + (cd $(RPM_BASE)/SPECS; \ + rpmbuild -bs $(RPM_OPTS) $(SPEC_FILE)) + +$(RPM_SPEC): $(RPM_BASE)/SPECS $(SPEC_FILE) + cp $(SPEC_FILE) $@ + +$(RPM_TREE): + mkdir -p $@ + +$(SPEC_FILE): + @echo "ERROR: missing '$(SPEC_FILE)' in the current directory" + @exit 1 + +FORCE: + +# === End of Makefile === # diff --git a/dist/README.build-scripts b/dist/README.build-scripts new file mode 100644 index 0000000..9e06dfb --- /dev/null +++ b/dist/README.build-scripts @@ -0,0 +1,108 @@ +****************************************************************************** +* +* README.build-scripts +* +* Author: Robert Story <rstory@freesnmp.com> +* +* $Id$ +* +****************************************************************************** + + +Introduction +============ + +The automated build script will automatically run configure, 'make all', +'make test' and 'make install'. Log files are kept for each step, and the +scripts should abort when errors occur. + +The usage of nsb-package is: + + Usage: nsb-package [-c] [-d] [-p] [-s SRCD] [-b BUILDD] [-i INSTALLD] VERSION + + VERSION : release number (eg 5.2.2) + -s SRCDIR : soure directory [$HOME/src/net-snmp-VERSION] + -b BUILDD : build directory [$HOME/build/] + NOTE-platform will be appended to build directory + -i INSTALLD: install directory [$HOME/build/\$PLATFORM/usr/local] + + -c : skip configure + -d : dirty build (don't make distclean) + -m : skip 'make all' + -p : don't pause at prompts in between stages + -t : skip 'make test' + + +The defaults assume you have a 'src', 'build' and 'binaries' directory in +your home directory. + + + +Recommended Procedure +===================== + +1) Log into Sourceforge Compile Farm Server + +2) Update source (this will likely be automated in the future) + + For example, for release 5.0.3: + + $ cd ~/src + $ CVS_RSH=ssh cvs -d $USER@cvs.net-snmp.org:/cvsroot/net-snmp \ + -q co -r Ext-5-0-3 -d ~/src/net-snmp-Ext-5-0-3 net-snmp + +3) Run the package script. + + $ $HOME/src/net-snmp-cvs/dist/nsb-package -r \ + -s $HOME/src/net-snmp-5.0.5 5.0.5 + +4) Create tarball (assuming no errors; see next section if there are errors) + + $ cd ~/build/`nsb-platform` + $ tar cvf net-snmp-5.0.3-`nsb-platform`.tar usr + $ gzip --best *.tar + +5) Copy tarball to Sourceforge shell sever + + $ scp *.gz net-snmp.sourceforge.net:~/binaries/ + +6) Log out of compile farm server, log into shell server + +7) Upload to Sourceforge + + $ ftp upload.sourceforge.net + >bin + >put *.gz + +8) Update binaries via Sourceforge admin page + + + +Builds with errors +================== + +Should you encounter a build error, you will most likely want to skip the +'make distclean' and configure step (assuming the problem wasn't with +configure!). To do this, specify the 'dirty' and 'skip configure' options: + + $ nsb-package -p -d -c Ext-5-0-3 + + +Should the build succeed, but some tests fail during 'make test', you probably +can to skip the test step to get to the install step: + + $ nsb-package -p -d -c -t Ext-5-0-3 + + +OTHER PROBLEMS +-------------- +* "Cannot find nsb-functions" + + It's a hack, but symlink nsb-functions and nsb-package to your local + bin directory ($HOME/bin). I'm trying to think of a better solution. + +* "gcc: snmp_version.lo: No such file or directory" + + This is a good indication that you have previously build in your + source directory. 'make distclean' in your source directory, or + check out a fresh new version from CVS. diff --git a/dist/RELEASE-INSTRUCTIONS b/dist/RELEASE-INSTRUCTIONS new file mode 100644 index 0000000..56a4161 --- /dev/null +++ b/dist/RELEASE-INSTRUCTIONS @@ -0,0 +1,1001 @@ +This is a summary of the steps required to make a new release. Do not +attempt to run these manually - instead use the 'makerelease' +application and makerelease.xml file. Get 'makerelease' from the +makerelease SVN repository: + + svn co https://makerelease.svn.sourceforge.net/svnroot/makerelease/trunk/makerelease + cd makerelease + perl Makefile.PL + make + sudo make install + +Then to run it from a directory to release: + + makerelease -c NETSNMPTRUNK/dist/makerelease.xml + +It will prompt you for all needed information and tasks to be done. + +IMPORTANT NOTE: + Don't *ever* release a second tar ball under the same name as the + first. It's much much much better to release another version + instead, since you don't have to figure out from the bug reports + that a user really grabbed the first snapshot instead of the + second when they complain about version "XXX" not working. + +====== makerelease -n output showing makerelease documented steps ====== + +STEP: 1: Setup Steps + + This set of steps will do some preliminary "safety" checks to ensure the + local environment is ok and setup some important information. + + ===== Entering Step: 1 ===== + +STEP: 1.1: Setup Checck + + This should show the last version number published in this branch by + looking at the time line in the README file: + + Commands to execute: + + head -1 README + +STEP: 1.2: Pick a Version Number + + Please enter the version number to publish. Net-SNMP convention dictates + that this be a version number like 5.4 or 5.4.1. Pre-releases that occur + before a branch freezes should be appended with ".preN" like 5.4.1.pre2. + Release-candidates should be labeled ".rcN" like 5.4.1.rc1. + + Decide on a value for parameter 'VERSION' + + parameter: VERSION + + prompt: Enter the new version number: + +STEP: 1.3: Defining a second internal version string + + Internal perl code will be executed + +STEP: 1.4: Release Parameter Information + + Here is the configured information we'll be using: + + VERSION: {VERSION} + + VERSION with dashes: {VERSIONDASHES} + + Floating point VERSION: {VERSIONFLOAT} + + SVN Branch URL: {BRANCHPATH} + +STEP: 1.5: update + + We need to make sure your code is up to date and matches the latest + sources in this branch. + + Commands to execute: + + svn update + +STEP: 1.6: Check for changes + + This steps looks for outstanding files that have been modified. There + should be no outstanding modifications! If this step finds outstanding + modified files you need to check them in or revert them before + continuing! + + Commands to execute: + + svn -u status | egrep '^[^\?]' + + (Leaving Step: 1) + +STEP: 2: Source Code Setup + + This set of steps will modify various places within the source code tree + to bring it up to date with the new version number about to be published. + + ===== Entering Step: 2 ===== + +STEP: 2.1: Libtool / Library versioning setup + + These steps will modify the various files in the source tree that contain + the version number, show you the changes that will be made and then check + in the resulting changes if you approve of them. + + ===== Entering Step: 2.1 ===== + +STEP: 2.1.1: version:libtoolmanualedit + + You (may) need to edit Makefile.top to update the library version + numbering (usually just for the first pre-release of a given version). + See the comments in RELEASE-INSTRUCTIONS about LIBCURRENT, LIBAGE and + LIBREVISION. + + This script will commit the file for you after you're done. + +STEP: 2.1.2: version:commit + + We'll now commit the Makefile.top file if you've modified it. + + Commands to execute: + + svn commit -m "version update" Makefile.top + + (Leaving Step: 2.1) + +STEP: 2.2: Change The Version Number + + These steps will modify the various files in the source tree that contain + the version number, show you the changes that will be made and then check + in the resulting changes if you approve of them. + + ===== Entering Step: 2.2 ===== + +STEP: 2.2.1: Modify the source files + + We will now modify files through the code to replace the version number + with the newer one. + + Modifying files: + + replacing: 'VERSION = '(.*)'' with: 'VERSION = \'{VERSIONFLOAT}\'' + + + files: glob=ARRAY(0x8dc9064) + + perl/SNMP/SNMP.pm + + perl/agent/agent.pm + + perl/agent/Support/Support.pm + + perl/agent/default_store/default_store.pm + + perl/default_store/default_store.pm + + perl/OID/OID.pm + + perl/ASN/ASN.pm + + perl/AnyData_SNMP/Storage.pm + + perl/AnyData_SNMP/Format.pm + + perl/TrapReceiver/TrapReceiver.pm + + + + Modifying files: + + replacing: 'NetSnmpVersionInfo = "[\d\.]+"' with: 'NetSnmpVersionInfo = + "{VERSION}"' + + + files: glob=ARRAY(0x8dc8fd4) + + snmplib/snmp_version.c + + + + Modifying files: + + replacing: 'Version: [\.0-9a-zA-Z]+' with: 'Version: {VERSION}' + + + files: glob=ARRAY(0x8dc8f44) + + README + + FAQ + + dist/net-snmp.spec + + + + Modifying files: + + replacing: 'VERSION = [\.0-9a-zA-Z]+' with: 'VERSION = {VERSION}' + + + files: glob=ARRAY(0x8dc8ed4) + + dist/Makefile + + + + Modifying files: + + replacing: 'AC_INIT\(\[Net-SNMP\], \[([^\]]+)\]' with: + 'AC_INIT([Net-SNMP], [{VERSION}]' + + + files: glob=ARRAY(0x8dc8e64) + + configure.in + + + + Modifying files: + + replacing: 'NetSnmpVersionInfo = "[^"]+"' with: 'NetSnmpVersionInfo = + "{VERSION}"' + + + files: glob=ARRAY(0x8dc8df4) + + snmplib/snmp_version.c + + + +STEP: 2.2.2: Running autoconf to rebuild configure + + We modified configure.in, so we now need to run autoconf to rebuild + configure. + + XXX: in the future we should verify the correct autoconf version number + + Commands to execute: + + autoconf + +STEP: 2.2.3: Running svn diff to check changes + + Check the following changes for proper version number differences before + we commit the chances. + + Commands to execute: + + svn diff + +STEP: 2.2.4: Running svn commit to commit the changes + + Check the changes in the above diff and then we'll commit the results + here if they look ok. + + Commands to execute: + + svn commit -m "Version number update" + + (Leaving Step: 2.2) + +STEP: 2.3: docs:make + + This step will create manual pages from doxygen instrumented code files. + + Commands to execute: + + make docs + + make mancp + +STEP: 2.4: docs:update + + This will run svn status to figure out what files have changed since the + previous man page generation steps were done. After this step, we'll + commit all the modified files. + + You may find additional files (marked with a ?) that should be added to + the svn repository and you'll need to do this by hand before going on to + the next step. + + Note: based on a recent net-snmp-admin discussion, we're no longer going + to be adding the bazillions of man pages that doxygen generates by + default. Only important ones should be added. + + Commands to execute: + + svn -u status man + +STEP: 2.5: docs:manualaddnewman + + Update man/Makefile.in with details of any new man pages, and run 'svn + add' on them. + + I'll commit these changes for you after you're done. + +STEP: 2.6: docs:commit + + Commands to execute: + + svn commit -m "documentation update" man + + (Leaving Step: 2) + +STEP: 3: Testing Steps + + These steps will help you test the source code to ensure it passes some + simple "it works" tests. + + ===== Entering Step: 3 ===== + +STEP: 3.1: build:distclean + + First we need to clean the existing build tree and start from scratch. + + Commands to execute: + + make distclean + +STEP: 3.2: build:configure + + We need to run configure to set up the build tree. + + Commands to execute: + + ./configure --cache=config.cache --with-defaults + --with-mib-modules='host examples examples/example testhandler smux Rmon + disman/event-mib' --with-transports=IPX --enable-ipv6 + --enable-embedded-perl --enable-shared + +STEP: 3.3: build:make + + Then we need to build the code + + Commands to execute: + + make + +STEP: 3.4: build:test + + Now we run "make test" which should produce a perfect set up test + results. If not, this needs to be fixed or at least understood and + accepted as is for some other reason. + + Commands to execute: + + make test TESTOPTS=-n + +STEP: 3.5: code:checkcomments + + This command looks for source code oddities and policy violations. + + Commands to execute: + + make checks + + (Leaving Step: 3) + +STEP: 4: Release File Steps + + Certain files in the distribution and built on a per-release basis. + These steps will help set up these files. + + ===== Entering Step: 4 ===== + +STEP: 4.1: code:makedepend + + This step creates Makefile dependencies using the "distdepend" rule in + the top level Makefile. + + Commands to execute: + + make distdepend + +STEP: 4.2: code:commitdepend + + This step commits the dependency changes done in the previous step. + + Commands to execute: + + svn commit -m "make depend" `find . -name Makefile.depend` + +STEP: 4.3: changelog:svn2cl + + We need to extract the portions of the change logs committed to the + repository. + + Commands to execute: + + svn2cl -f ChangeLog.add --break-before-msg --stop-on-copy + + perl dist/changelogfix < ChangeLog.add > ChangeLog.reallyadd + +STEP: 4.4: changelog:manualedit + + You need to manually insert the *relevent* portions of + 'ChangeLog.reallyadd' into the ChangeLog file. I'll commit these changes + for you after you finish cutting out the proper changes. + +STEP: 4.5: changelog:commit + + Commands to execute: + + svn commit -m "version update" ChangeLog + +STEP: 4.6: docs:newnews + + Commands to execute: + + perl dist/extractnews -s ----- -e ----- ChangeLog + +STEP: 4.7: docs:newnews + + Commands to execute: + + perl dist/extractnews -c CHANGES.new2 -n NEWS.new2 ChangeLog.reallyadd + +STEP: 4.8: docs:README + + You need to manually insert the relevent portions of 'CHANGES.new' and + 'NEWS.new' into the CHANGES and NEWS file. (There are alternative + versions in 'CHANGES.new2' and 'NEWS.new2') You may wish to update the + README file as well. I'll commit these changes for you afterwards + +STEP: 4.9: docs:commit + + Commands to execute: + + svn commit -m "version update" README NEWS CHANGES + +STEP: 4.10: release:update + + One more svn update and status to make sure nothing odd exists in your + source tree. Please check the results! + + Commands to execute: + + svn -u status + + (Leaving Step: 4) + +STEP: 5: Make the Release + + This is it! After this point it's much harder to turn back. If + everything is ok until this point and you're ready to actually stamp the + release in SVN and make release files, these steps will do that for you. + + ===== Entering Step: 5 ===== + +STEP: 5.1: release:tag + + This will actually svn copy the current checked out branch to the new tag + name. Specifically: + + svn copy {BRANCHPATH} .../tags/Ext-{VERSIONDASHES} + + Commands to execute: + + svn copy -m "{VERSION} release" {BRANCHPATH} + https://net-snmp.svn.sourceforge.net/svnroot/net-snmp/tags/Ext-{VERSIONDA + SHES} + +STEP: 5.2: release:makedist + + Commands to execute: + + svn export + https://net-snmp.svn.sourceforge.net/svnroot/net-snmp/tags/Ext-{VERSIONDA + SHES}/net-snmp net-snmp-{VERSION} + +STEP: 5.3: release:removefiles + + Commands to execute: + + net-snmp-{VERSION}/remove-files net-snmp-{VERSION} + +STEP: 5.4: release:makedist + + Commands to execute: + + star artype=ustar -c -z -f net-snmp-{VERSION}.tar.gz + net-snmp-{VERSION} + +STEP: 5.5: release:makezipclean + + Commands to execute: + + rm -f net-snmp-{VERSION}.zip + +STEP: 5.6: release:makezip + + Commands to execute: + + zip -r net-snmp-{VERSION}.zip net-snmp-{VERSION} + +STEP: 5.7: release:searching-gpg-keys + + Commands to execute: + + gpg --list-secret-keys net-snmp-admin + +STEP: 5.8: release:gpg + + Commands to execute: + + gpg -u 317F8F64 -a --detach-sign net-snmp-{VERSION}.tar.gz + +STEP: 5.9: release:gpg + + Commands to execute: + + gpg -u 317F8F64 -a --detach-sign net-snmp-{VERSION}.zip + +STEP: 5.10: Release File Test + + We'll also re-build the source and retest a few things to ensure the + packaged file can actually be built. + + ===== Entering Step: 5.10 ===== + +STEP: 5.10.1: posttest:untar + + Commands to execute: + + rm -rf net-snmp-{VERSION} + +STEP: 5.10.2: posttest:untar + + Commands to execute: + + tar xzf net-snmp-{VERSION}.tar.gz + +STEP: 5.10.3: posttest:configure + + Commands to execute: + + cd net-snmp-{VERSION} && ./configure --cache=config.cache + --with-defaults --with-mib-modules='host examples examples/example + testhandler smux Rmon disman/event-mib' --with-transports=IPX + --enable-ipv6 --enable-embedded-perl --enable-shared + +STEP: 5.10.4: posttest:make + + Commands to execute: + + cd net-snmp-{VERSION} && make + +STEP: 5.10.5: posttest:test + + Commands to execute: + + cd net-snmp-{VERSION} && make test + + (Leaving Step: 5.10) + + (Leaving Step: 5) + +STEP: 6: Release the results + + Now we'll publish the results to the SF server + + ===== Entering Step: 6 ===== + +STEP: 6.1: rsync the new files + + This will copy the results to the SF uploads directory in your account on + frs.sourceforge.net + + Commands to execute: + + rsync -v net-snmp-{VERSION}.tar.gz net-snmp-{VERSION}.tar.gz.asc + net-snmp-{VERSION}.zip net-snmp-{VERSION}.zip.asc + frs.sourceforge.net:uploads/ + +STEP: 6.2: Update the SF release web page + + Commands to execute: + + firefox + 'http://sourceforge.net/project/admin/editpackages.php?group_id=12694' + + (Leaving Step: 6) + +STEP: 7: + + Binaries: build rpms, .tar.gzs, etc. + +STEP: 8: Advertise it! + + ===== Entering Step: 8 ===== + +STEP: 8.1: + + Add a note to the source forge news system: + + http://sourceforge.net/news/submit.php?group_id=12694 + + Commands to execute: + + firefox 'http://sourceforge.net/news/submit.php?group_id=12694' + +STEP: 8.2: + + Send an announcement message to one of the following mailing lists based + on it's type: + + pre: net-snmp-coders@lists.sourceforge.net + + rc: net-snmp-users@lists.sourceforge.net + + final: net-snmp-announce@lists.sourceforge.net + +STEP: 8.3: + + Update the topic on the #Net-SNMP channel if this is a trunk based + release. + +STEP: 8.4: + + Update the freshmeat listing (Wes needs to do this): + + http://freshmeat.net/projects/net-snmp/ + + Commands to execute: + + firefox http://freshmeat.net/projects/net-snmp/ + + (Leaving Step: 8) + +STEP: 9: + + Advertise: NEWS upload to sf, publish on -announce, freshmeat, and the + GNU FSF directory (http://directory.fsf.org/project/net-snmp/)... (send + mail to bug-directory@gnu.org) + + + + + +====== BEGIN OBSOLETE (pre-makerelease) DOCUMENTATION ====== + +*************************************************************************** +TESTING: + + 1) Update the source tree to catch all recent commits, + and check that all local changes have been committed. + + $ svn -u status + $ svn update + + 2) Change the libtool version information in Makefile.top. + See MANUAL - STEP 1 later in these instructions. + 'makerelease' will commit this file automatically. + + 3) Configure the suite with as many modules as possible, + build and test it. The makerelease script will use + the options: + + $ ./configure '--with-mib-modules=host examples examples/example \ + testhandler smux Rmon disman/event-mib' \ + --with-transports=IPX --enable-ipv6 \ + --enable-embedded-perl --enable-shared + + Ideally this should be repeated on as many systems as possible + (including running "make install"). However the makerelease + script will only test things on the current box, and will not + try to install the software. + + +*************************************************************************** +DOCUMENTATION: + + 4) Update the version number in the doxygen.conf file + (handled automatically by 'makerelease') and generate + the doxygen extracted manual pages. + + $ make docs + $ make mancp + + 'makerelease' will commit this file automatically. + Note that any new man pages should be added to Makefile.in. + This is *NOT* currently handled by the makerelease script. + + 5) Check the code for illegal constructs (e.g. C++ style comments + or GNU make specific constructs in Makefiles): + + $ make checks + + 6) Update Makefile dependencies: + + $ make distdepend + + 'makerelease' will commit these dependencies automatically. + + 7) Update the ChangeLog file with details of all (recent) changes + to the suite. See MANUAL - STEP 2 later in these instructions. + 'makerelease' will commit this file automatically. + + 8) Update the README, NEWS, and CHANGES files with details of + significant changes to the suite. See MANUAL - STEP 3 later + in these instructions. + 'makerelease' will commit these files automatically. + + +*************************************************************************** +RELEASE: + + 9) Make sure all changes are checked in: + + $ svn -u status + $ svn update + + [Note that this step is omitted when running "makerelease"] + + 10) Change the version number in various files + (README, FAQ, configure.in, net-snmp.spec and assorted Perl modules). + 'makerelease' will update and commit these files automatically. + + 11) Create a tag checkpoint for this release: + + $ svn copy /trunk /tags/Ext-5-x + or + $ svn copy /branches/V5-x-patches /tags/Ext-5-x-y + + 12) Construct the source packages: + + $ svn export /tags/Ext-5-x-y/net-snmp net-snmp-5.x.y + $ net-snmp-5.x.y/remove-files net-snmp-5.x.y + $ star artype=ustar -c -z -f net-snmp-5.x.y.tar.gz net-snmp-5.x.y + $ rm -f net-snmp-5.x.y.zip" + $ zip -r net-snmp-5.x.y.zip net-snmp-5.x.y" + + + 13) Sign (or checksum) the packages: + + Wes/Robert: + $ gpg -u net-snmp-admin -a --detach-sign net-snmp-5.x.y.tar.gz + $ gpg -u net-snmp-admin -a --detach-sign net-snmp-5.x.y.zip + Others: + $ md5sum net-snmp-5.x.y.tar.gz > net-snmp-5.x.y.tar.gz.md5 + $ md5sum net-snmp-5.x.y.zip > net-snmp-5.x.y.zip.md5 + + +*************************************************************************** +RELEASE TESTING: + + 14) Unpack a clean copy of the tarball, configure, build and + test the release tarball. + + 15) Double-check that there are no outstanding changes that have + been missed from the CVS checkin: + + $ svn status + +Note: This is the last stage that is handled by the "makerelease" script + Everything following will need to be done manually. + + 15) Upload the packages (and signature files) to the SourceForge server: + + $ ncftpput upload.sf.net incoming net-snmp-5.x.y.tar.gz + $ ncftpput upload.sf.net incoming net-snmp-5.x.y.zip + * SF pages: "Admin" -> "File Releases" + * net-snmp: "Add Release" (or "Edit Release") + * Create (or choose) an appropriate release name + e.g. "5.x.y source code" (or "5.x.y pre-releases") + * "Edit This Release" + * Select the tarball and/or other relevant files + + 16) Announce the release on the appropriate list. + Pre-release announcements (and a call for testing) should be + sent to net-snmp-coders, release-candidates to net-snmp-users. + + Full releases should be announced on net-snmp-users, and as a + news item on the project home page - including the NEWS snippet + of significant changes since the last release. + + 17) Update the following htdocs files (in the main SVN trunk): + htdocs/download.html + htdocs/dev/schedule.html + + [Make sure you have permissions set up properly on the web + server so that files created become group-writable!!!] + + That concludes the process for pre-releases and release-candidates. + For full releases, wait a week to ensure that there are no major + problems, before continuing with the remaining steps. + + If there are known problems and another release is planned to + fix them, don't announce the broken version - wait for the updated + one instead. + + 18) Once this week has elapsed, submit an announement of the new + release to net-snmp-announce. This message will need to be + explicitly authorized via MailMan. + + Also update the IRC topic to include mention of this release. + + 19) For a release on the most recent development line, start bugging + Wes to update the freshmeat, Free Software Directory and + Wikipedia entries. + + 20) For a release on the most recent development line, update the + 'htdocs/page-top.html' file (in the main SVN trunk) to reference + the latest version. + + Update the following files with any changes: + + htdocs/docs/readmefiles/NEWS + htdocs/docs/readmefiles/CHANGES + htdocs/docs/readmefiles/README* + htdocs/COPYING + + [Make sure you have permissions set up properly on the web + server so that files created become group-writable!!!] + + + 21) For a major new-feature release (i.e. 5.x), create the patches + branch: + + $ svn copy /tags/Ext-5-x /branches/V5-x-patches + + and update the SVN main trunk with a new version number: + + $ local/Version-Munge.pl -v 5.(x+1).dev -M -P -C + + The 1 week delay (and continued code freeze) is to to ensure that + developer effort is concentrated on immediate problems following + the release. Any major problems should hopefully come to light + during this period, so after a week it should be safe to create + the patches branch and officially end the code freeze on MAIN. + + 22) Update the official patches tracker set: + + - any patches for this new release tarball should be given + priority 9 + - all patches for the previous release on this line should + be marked at priority 5 + - all patches for earlier releases on this line should + be marked at priority 1, and closed + + If a line has been designated closed, then all official + patches for that line should be marked as closed as well. + + 23) Hide the pre-release repository from the File Releases + admin pages. + + 24) Clean up the 'dist' dir of the relevant V5-x-patches branch. + Only leave the following files: + + changelogfix cvsshow cvsup extractnews makerelease + net-snmp.spec snmpd-init.d snmptrapd-init.d + + Note that any files removed should also be deleted from + SVN repository. + + +*************************************************************************** +CREATING BINARY DISTRIBUTIONS + + 0) Always REMOVE ALL PREVIOUS INSTALLS FIRST, then do a make install + from the tar-ball extracted sources and *THEN* rebuild all + binaries again. This ensures that everything (especially perl + modules) are properly linked against the right libraries. + + 1) always build releases from a tarball, not from SVN. + + 2) Add mib modules that are common. Basically, add: + + host -- where supported. + disman/event-mib + smux + + 3) use --with-defaults --with-syscontact="Unknown" + --with-syslocation="Unknown" + + 4) when running make install, do it like: + + $ make install prefix=/some/path/to/home/ARCH/usr/local \ + exec_prefix=/some/path/to/home/ARCH/usr/local + + 5) Tar it up: + + $ cd /some/path/to/home/ARCH + $ tar czf net-snmp-5.0.3-ARCH.tar.gz usr/local + + 6) upload and release, like you did for the source code but with a + different package name for binaries (5.0.3 binaries). + + 7) RPMs [do this in main line even if its for a patch branch]: + $ cd dist + $ cp ../net-snmp-5.0.8.tar.gz rpm/SOURCES + $ make RELEASE=1 + + This should put multiple binary rpm files in: + dist/rpm/RPMS/i386/ + And one source RPM in: + dist/rpm/SRPMS/ + + *** These files need to be renamed to include the OS version. + + EG: ...i386.rpm needs to become ...fc5.i386.rpm + + 8) Remove (or hide) binaries from older releases of the same line, + where you have submitted a newer binary for the same architecture. + Once the last binary for a particular release version has been + removed, hide that repository. + + +*************************************************************************** +*************************************************************************** +MANUAL - STEP 1 + + Changing the libtool version information in Makefile.top. + + - If any interfaces/structures have been removed or changed since the + last update, increment current (+5), and set age and revision to 0. + Stop! + + - If any interfaces have been added since the last public release, + then increment current and age, and set revision to 0. + Stop! + + - If the source code has changed at all since the last update, + then increment revision (c:r:a becomes c:r+1:a). + + Note: maintenance releases (eg 5.2.x) should never have changes + that would require current to be incremented. + + The check-api-changes script in the dist directory will construct a + diff of all headers, which can be useful for determining if anything + needs bumping. + + Update these variables now, so that when you run + make in a second to test things you can spot libtool yelling + about improper numbering before you make the release and not + after you've uploaded the tar ball :-/ + + +*************************************************************************** +MANUAL - STEP 2 + + Changing the libtool version information in Makefile.top. + Updating the ChangeLog file + + - The ChangeLog entries are extracted (normally automatically) + using the command: + + $ svn2cl -f ChangeLog.add --break-before-msg --stop-on-copy + + If you don't have svn2cl installed, you can try and find a + suitable binary package for your architecture, or you can + get it directly from + http://ch.tudelft.nl/~arthur/svn2cl + You may need to rename the script from 'svn2cl.sh' to 'svn2cl' + + - In either case, they are fixed up (automatically) using: + + $ perl dist/changelogfix < ChangeLog.add > ChangeLog.reallyadd + or + $ perl dist/changelogfix V5-{N}-patches < ChangeLog.add > ChangeLog.reallyadd + + - The manual processing step is to insert the appropriate portion + of the file 'ChangeLog.reallyadd' into 'ChangeLog'. You can + usually find the point where the previous release started in + the file by searching for "version tag". + + - Please keep the line of dashes at the top of the file, as this + makes it easier to copy during the next release. + + - If using emacs, switch from changelog-mode to text-mode. + + - Check in the new ChangeLog: + + $ svn commit -m "update for release X" ChangeLog + + This is done automatically by "makerelease" + + +*************************************************************************** +MANUAL - STEP 3 + +Updating README, NEWS, and CHANGES files + + [ This information has been moved to: + + http://www.net-snmp.org/wiki/index.php/Commit_message_auto-extraction_formats + + ] + +However, leaving some examples here for quick referral: + + SVN commit messages that generate auto-NEWS and auto-CHANGES + extractions should be formatted like the following examples: + + NEWS: snmpd: I did something really cool to the agent + CHANGES: snmptrapd: fixed something minor in snmptrapd + NEWS: perl: PATCH: 123,456: Applied patches 123 and 456 to support perl6 + CHANGES: BUG: 13: Fixed bug 13 & secured the world at large against hackers + NEWS: perl: PATCH: 123: from Robert: did something + NEWS: perl: PATCH: 123: from "Robert Story": did something else diff --git a/dist/autoconf-version b/dist/autoconf-version new file mode 100644 index 0000000..264f2ce --- /dev/null +++ b/dist/autoconf-version @@ -0,0 +1 @@ +2.68 diff --git a/dist/changelogfix b/dist/changelogfix new file mode 100755 index 0000000..92ac93f --- /dev/null +++ b/dist/changelogfix @@ -0,0 +1,94 @@ +#!/usr/bin/perl +# +# Tidies up the output of svn2cl to clean it up a touch. +# It is fancier than before, but probably no better written. +# (though there are noticably more comments!) + + +my $inFileList = 0; +my $stuff = ""; +my $prefix = "trunk/net-snmp/"; + +if ( $ARGV[0] =~ /^V/ ) { + $b = shift @ARGV; + $prefix = "branches/$b/net-snmp/"; +} + +$line1 = <>; +if ( $line1 !~ /^svn/ ) { print $line1; } +while (<>) { + s/^\t/ /; + # + # Note when we're just starting to look at + # the list of files.... + # + if (/^ *\*/) { + $_ =~ s/^ *\* //; + $inFileList = 1; + $stuff = ""; + } + if ( $inFileList ) { + # + # ... and filter out just those from the branch + # that we're working with. + # + if (/$prefix/) { + # + # XXX: This code implicitly assumes that each entry + # appears on a separate line. Which is *probably* + # true given the folding done by svn2cl. + # But short paths (e.g. top-level files) may + # break this assumption, as would extending the + # folding point for svn2cl + # ToDo: Strip the prefix (or skip the entry) for + # each token individually, rather than per-line. + # + $z = $_; + $z =~ s/[ \t]*$prefix/ /; + $stuff .= $z; + } else { + $stuff .= " ".$_; + } + if ( /:/ ) { + # + # At the end of this list, we need to reformat it + # so that the lines aren't too long or too short + # + # Flatten things into a single line, + # and make sure it ends in a colon + $stuff =~ s/\n//g; + if ( $stuff =~ /,$/) { $stuff =~ s/,$/:/; } + + # + # If the line is too long, then start re-folding it + # + if ( $stuff =~ /.{70}/ ) { + @z = split /\s/, $stuff; + $line = "*"; + while ($#z >= 0) { + $z = shift @z; + if ( "$line $z" =~ /.{70}/ ) { + print " $line\n"; + $line = " $z"; + } else { + $line .= " $z"; + } + } + print " $line\n\n"; + } else { + # + # Otherwise, print the list as it stands + # + print " *$stuff\n\n"; + } + $stuff = ""; + $inFileList = 0; + } + } else { + + # + # If we're not processing the list of files, + # then just pass things through. + print $_; + } +} diff --git a/dist/check-api-change b/dist/check-api-change new file mode 100755 index 0000000..1f61e42 --- /dev/null +++ b/dist/check-api-change @@ -0,0 +1,54 @@ +#!/bin/sh +# +# simplistic script to check all header files for +# differences. Intended to help detect api changes +# between releases. +# +# it's not pretty or efficient, and inspection of +# the results must be done manually. +# +# it's also not secure (don't run as root) +# or portable. Tested on Linux. +# + +if [ "x$1" = "x" -o "x$2" = "x" ]; then + echo "Usage: $0 <old-dir> <new-dir>" + exit 1 +fi + +od=$1 +nd=$2 +DIR=/tmp +OUTPUT=$DIR/api-diff.pat +ODT=$DIR/api-od + +if [ ! -d $od ]; then + echo "old dir $od doesn't exist" + exit 1 +fi + +if [ ! -d $nd ]; then + echo "old dir $nd doesn't exist" + exit 1 +fi + +# find header in nd +rm -f $OUTPUT $ODT 2>/dev/null +(cd $od && find . -type f -name "*.h"|sort > $ODT) + +OH=`cat $ODT` +for h in $OH +do + nh=$nd/$h + oh=$od/$h + echo "* $nh" + if [ -f "$nh" ]; then + echo "* diff: $h vs $nh" >> $OUTPUT + diff -u $oh $nh >> $OUTPUT 2>&1 + else + echo "* Old header $h not found in new headers" >> $OUTPUT + fi +done + +echo "Inspect output in $OUTPUT" +echo "See Makefile.top for libtool version bumping rules." diff --git a/dist/cvsshow b/dist/cvsshow new file mode 100755 index 0000000..7539595 --- /dev/null +++ b/dist/cvsshow @@ -0,0 +1,69 @@ +#!/bin/sh +# +export CVS_RSH=ssh +TAG= + +do_cvs() +{ + DIR=$1 + if [ ! -f $DIR/CVS/Repository ]; then + echo "'$DIR' has no CVS/Repository!" + exit + fi + + if [ ! -f $DIR/CVS/Root ]; then + echo "'$DIR' has no CVS/Root!" + exit + fi + + if [ -f $DIR/CVS/Tag ]; then + TAG="-r `cat $DIR/CVS/Tag | cut -c 2-`" + fi + + REP="`cat $DIR/CVS/Repository`" + ROOT="`cat $DIR/CVS/Root`" + + echo "Directory $DIR is rooted at $ROOT, $TAG $REP..." + echo " update with cvs -z3 -d $ROOT -q co $TAG -d $DIR $REP" +} + +do_svn() +{ + DIR=$1 + if [ ! -d $DIR/.svn ]; then + echo "'$DIR' has no .svn/ subdir!" + exit + fi + + ROOT=`svn info | grep URL|cut -f2 -d " "` + if [ -z "$ROOT" ]; then + echo "Couldn't find root from $DIR/.svn/entries" + exit 1 + fi + + echo "Directory $DIR is rooted at $ROOT..." + echo " update with svn co $ROOT $DIR" +} + +if [ $# -eq 0 ]; then + DIRS=. +else + DIRS=$@ +fi + +for d in $DIRS +do + if [ ! -d $d ]; then + echo "no such directory '$d'" + exit + fi + + if [ -d $d/CVS ]; then + do_cvs $d + elif [ -d $d/.svn ]; then + do_svn $d + else + echo "'$d' has neither CVS nor SVN information!" + fi +done + diff --git a/dist/cvsup b/dist/cvsup new file mode 100755 index 0000000..ca07b0f --- /dev/null +++ b/dist/cvsup @@ -0,0 +1,118 @@ +#!/bin/sh +# +# $Id$ +# +CVS_RSH=ssh; export CVS_RSH +TAG= +WO=0 +DEST= + +if [ "x$1" = "x-u" ]; then + DEST=$2 + shift 2 + + # gnu tar (as of 1.15.1) is unable to create portable tar archives, + # especially if long file names (>100 char) are present. + # star is a better replacement. + if [ -x /usr/bin/star ]; then + TAR='/usr/bin/star -Hustar -not -pat="*/CVS/*" -c -f' + elif [ -x /bin/tar ]; then + TAR="/bin/tar --exclude=CVS -c -f" + echo "warning: star not available, using (less portable) tar..." + else + echo "neither /usr/bin/star nor /bin/tar found." + exit + fi +fi + +if [ $# -eq 0 ]; then + DIR=$PWD +else + if [ $# -ne 1 ]; then + echo "usage: $0 <working directory>" + exit + fi + DIR=$1 +fi + +if [ -z ${DIR##*/} ];then + DIR=${DIR%/*} +fi +SUBD=${DIR##*/} +PARENT=${DIR%*$SUBD} +#echo "$DIR = $PARENT + $SUBD" + +if [ ! -d $DIR ]; then + echo "no such directory '$DIR'" + exit +fi + +if [ ! -d $DIR/CVS ]; then + echo "'$DIR' has no CVS directory!" + exit +fi + +if [ ! -f $DIR/CVS/Repository ]; then + echo "'$DIR' has no CVS/Repository!" + exit +fi + +if [ ! -f $DIR/CVS/Root ]; then + echo "'$DIR' has no CVS/Root!" + exit +fi + +if [ -f $DIR/CVS/Tag ]; then + TAG=`cat $DIR/CVS/Tag | cut -c 2-` + CMDTAG="-r $TAG" +fi + +REP="`cat $DIR/CVS/Repository`" +ROOT="`cat $DIR/CVS/Root`" + +cd $DIR +#echo $PWD +# COMMAND="cvs -q -z3 -d $ROOT co $TAG -d $DIR $REP" + +COMMAND="cvs -q -z3 -d $ROOT update -P -d $CMDTAG" + +if [ ! -w $DIR/CVS ]; then + if [ -O $DIR/CVS ]; then + WO=1 + echo "Making $DIR writable" + chmod -R u+w $DIR + fi +fi + +echo "Updating directory $DIR with $TAG $REP..." +echo "$COMMAND" + +$COMMAND +rc=$? +if [ $rc -ne 0 ]; then + echo "cvs command returned $?" +fi + +if [ $WO -eq 1 ]; then + echo "Making $DIR read-only" + chmod -R a-w $DIR +fi + +if [ ! -z $DEST ]; then + if [ -z $TAG ]; then + TAG=MAIN + fi + + if [ $rc -ne 0 ]; then + echo "skipping upload" + else + cd .. +# echo $PWD + DATE=`date +%Y%m%d_%H%M` + SOURCE=$REP-cvs-$TAG"_$DATE" + $TAR /tmp/$SOURCE.tar $SUBD + gzip -f --best /tmp/$SOURCE.tar + scp /tmp/$SOURCE.tar.gz $DEST + rm -f /tmp/$SOURCE.tar.gz + fi +fi diff --git a/dist/extractnews b/dist/extractnews new file mode 100755 index 0000000..bce94c9 --- /dev/null +++ b/dist/extractnews @@ -0,0 +1,183 @@ +#!/usr/bin/perl + +use strict; +use Text::Wrap; +my %output; +my $text; +my %stash; + +use Getopt::Long; + +my %opts = ( + c => 'CHANGES.new', + n => 'NEWS.new', + ); + +LocalGetOptions(\%opts, + ['s|start-regexp=s','A regexp to look for in files to start converting at'], + ['e|end-regexp=s','A regexp to look for in files to end converting at'], + "", + ['c|changes-file=s','A file to save CHANGES entries to'], + ['n|news-file=s','A file to save NEWS entries to'], + ['d|debug-line=s', 'Debugging output for lines matching STRING'], + "", + ['GUI:otherargs_text','Input files to parse'], + ); + +my $maybecontinue = 0; +my $lasttext = ""; +my $lastfile; +my $lastcomponent; + +foreach my $argv (@ARGV) { + open(I, $argv); + if ($opts{'s'}) { + while (<I>) { + last if (/$opts{'s'}/o); + } + } + + while (<I>) { + my ($file, $component, $patbug, $nums, $text); + + last if ($opts{'e'} && /$opts{e}/o); + + print STDERR "here: $_" if ($opts{'d'} && /$opts{'d'}/o); + + # don't use this: + # FILE: BUGS: 123,456: text + ($file, $patbug, $nums, $text) = + /(NEWS|CHANGES):\s*-*\s*\[*(BUG|PATCH)(?:ES|S|):*\s*([\d,\s*]*)\]*:*\s*-*\s*(.*)/; + + print STDERR " 1:$file, $component, $patbug, $nums, $text\n" if ($opts{'d'} && /$opts{'d'}/o); + + # or this: + # FILE: component - text + ($file, $component, $text) = + /(NEWS|CHANGES):\s*(\w+)\s*-+\s*(.*)/ if (!$file); + + print STDERR " 2:$file, $component, $patbug, $nums, $text\n" if ($opts{'d'} && /$opts{'d'}/o); + + # what you should use: + # FILE: component: BUGS: 123,456: text + # + # or + # FILE: component: PATCH: 123,456: from someone text + # FILE: component: PATCH: 123,456: from "someone long" text + ($file, $component, $patbug, $nums, $text) = + /(NEWS|CHANGES):\s*([^:]+):\s*-*\s*\[*(BUG|PATCH)(?:ES|S):*\s*([\d,\s*]*)\]*:*\s*-*\s*(?:from ["'][^"]+["']|from \w+|):*\s*(.*)/ if (!$file); + + print STDERR " 3:$file, $component, $patbug, $nums, $text\n" if ($opts{'d'} && /$opts{'d'}/o); + + # or at least: + # FILE: component: text + ($file, $component, $text) = + /(NEWS|CHANGES):\s*([^:]+):\s*-*\s*(.*)/ if (!$file); + + print STDERR " 4:$file, $component, $patbug, $nums, $text\n" if ($opts{'d'} && /$opts{'d'}/o); + + # component left out + # FILE: [BUGS: 123,456]: text + ($file, $patbug, $nums, $text) = + /(NEWS|CHANGES):\s*\[*(BUG|PATCH)*(?:ES|S|):*\s*([\d,\s*]*)\]*:*\s*-*\s*(.*)/ if (!$file); + + print STDERR " 5:$file, $component, $patbug, $nums, $text\n" if ($opts{'d'} && /$opts{'d'}/o); + + if ($opts{'d'} && /$opts{'d'}/o) { + my $bogus = 1; # breakable point + } + + if (!$file && $maybecontinue) { + if (/^\s*(.+)$/) { + $text = $1; + $file = $lastfile; + $component = $lastcomponent; + + # we're going to re-add these + pop @{$output{$opts{'c'}}{$component}}; + pop @{$output{$opts{'n'}}{$component}} if ($file eq 'NEWS'); + } else { + $maybecontinue = 0; + $lasttext = ""; + next; + } + } elsif (!$file) { + next; + } + + next if (exists($stash{$text})); + $stash{$text} = 1; + + $component = "unspecified" if (!$component); + if ($patbug) { + $lasttext .= " [$patbug $nums]: $text"; + } else { + $lasttext .= " $text"; + } + $lasttext =~ s/^ //; # get rid of leading spaces + $lasttext =~ s/^([a-z])/uc($1)/e; # capitalize the first letter + $text = wrap(" - "," ","$lasttext") . "\n"; + + # + # Assist with displaying categories in a sensible order + # snmplib first + # snmpd/snmp{apps} + # various other + # O/S specific (relies on upper case) + # + $component =~ s/^snmplib/00snmplib/; + $component =~ s/^snmp/0snmp/; + $component =~ s/^agent/0snmpd/; # Merge "agent" into "snmpd" + $component =~ s/^([A-Z])/zz\1/; + print STDERR " t:$file, $component, $patbug, $nums, $text\n" if ($opts{'d'} && /$opts{'d'}/o); + push @{$output{$opts{'c'}}{$component}}, $text; + push @{$output{$opts{'n'}}{$component}}, $text if ($file eq 'NEWS'); + $lastfile = $file; + $lastcomponent = $component; + $maybecontinue = 1; + } +} + + + +# save the news and changes to appropriate files +foreach my $f ($opts{'c'}, $opts{'n'}) { + my $cat2; + open(O,">$f"); + foreach my $cat (sort (keys(%{$output{$f}}))) { + ($cat2 = $cat) =~ s/^00?|^zz//; + print O " $cat2:\n"; + print O sort @{$output{$f}{$cat}}; + print O "\n"; + } + close(O); +} + +####################################################################### +# getopt long gui portability code +# +sub LocalGetOptions { + if (eval {require Getopt::GUI::Long;}) { + import Getopt::GUI::Long; + Getopt::GUI::Long::Configure(qw(display_help no_ignore_case)); + return GetOptions(@_); + } else { + require Getopt::Long; + Getopt::Long::Configure(qw(auto_help no_ignore_case)); + import Getopt::Long; + } + GetOptions(LocalOptionsMap(@_)); +} + +sub LocalOptionsMap { + my ($st, $cb, @opts) = ((ref($_[0]) eq 'HASH') + ? (1, 1, $_[0]) : (0, 2)); + for (my $i = $st; $i <= $#_; $i += $cb) { + if ($_[$i]) { + next if (ref($_[$i]) eq 'ARRAY' && $_[$i][0] =~ /^GUI:/); + push @opts, ((ref($_[$i]) eq 'ARRAY') ? $_[$i][0] : $_[$i]); + push @opts, $_[$i+1] if ($cb == 2); + } + } + return @opts; +} diff --git a/dist/find-requires b/dist/find-requires new file mode 100755 index 0000000..4309fcc --- /dev/null +++ b/dist/find-requires @@ -0,0 +1,5 @@ +#!/bin/sh +# This is rpmbuild helper script used to filter out perl(Tk) and +# perl(Term::ReadKey) dependencies. + +/usr/lib/rpm/find-requires | grep -v "perl(Tk)\|perl(Term::ReadKey)" diff --git a/dist/generation-scripts/gen-security-headers.in b/dist/generation-scripts/gen-security-headers.in new file mode 100644 index 0000000..4e5881a --- /dev/null +++ b/dist/generation-scripts/gen-security-headers.in @@ -0,0 +1,29 @@ +#!/bin/sh + +# we should be able to do this without creating a full configure-like +# script, but we need to figure out how to call m4 directly. +AC_INIT([Net-SNMP], [5.6.pre2], [net-snmp-coders@lists.sourceforge.net]) + +AC_ARG_WITH(security-modules, +[ --with-security-modules="s1 s2 ..." Compile in the given SNMP security + modules (space or comma separated list).]) +AC_ARG_WITH(output-header, +[ --with-output-header="file" Where to store the header file]) +AC_ARG_WITH(output-init, +[ --with-output-init="file" Where to store the init file]) + +m4_include(dist/generation-scripts/gen-variables) + +AC_DEFINE_UNQUOTED(NETSNMP_SYSTEM_INCLUDE_FILE, "$NETSNMP_SYSTEM_INCLUDE_FILE") + +if test "x$with_output_header" != "x" ; then + security_incl_file="$with_output_header" +fi + +if test "x$with_output_init" != "x" ; then + security_init_file="$with_output_init" +fi + +m4_include(configure.d/config_modules_security_modules) + + diff --git a/dist/generation-scripts/gen-transport-headers.in b/dist/generation-scripts/gen-transport-headers.in new file mode 100644 index 0000000..71a7bd9 --- /dev/null +++ b/dist/generation-scripts/gen-transport-headers.in @@ -0,0 +1,27 @@ +#!/bin/sh + +# we should be able to do this without creating a full configure-like +# script, but we need to figure out how to call m4 directly. +AC_INIT([Net-SNMP], [5.6.pre2], [net-snmp-coders@lists.sourceforge.net]) + +AC_ARG_WITH(transports, +[ --with-transports="t1 t2 ..." Compile in the given SNMP transport + modules (space or comma separated list).]) +AC_ARG_WITH(out_transports, +[ --with-out-transports="t1 ..." Exclude listed SNMP transports + (space or comma separated list).]) + +AC_ARG_WITH(output, +[ --with-output="file" Where to store the header file]) + +m4_include(dist/generation-scripts/gen-variables) + +AC_DEFINE_UNQUOTED(NETSNMP_SYSTEM_INCLUDE_FILE, "$NETSNMP_SYSTEM_INCLUDE_FILE") + +if test "x$with_output" != "x" ; then + ctor_header=$with_output +fi + +m4_include(configure.d/config_modules_transports) + + diff --git a/dist/generation-scripts/gen-variables.in b/dist/generation-scripts/gen-variables.in new file mode 100644 index 0000000..4329206 --- /dev/null +++ b/dist/generation-scripts/gen-variables.in @@ -0,0 +1,10 @@ +# +# common variables used by configure scripts +# +SED="@SED@" +CPP="@CPP@" +GREP="@GREP@" +PARTIALTARGETFLAGS="@PARTIALTARGETFLAGS@" +NETSNMP_SYSTEM_INCLUDE_FILE="@ac_cv_NETSNMP_SYSTEM_INCLUDE_FILE@" + +srcdir=@srcdir@ diff --git a/dist/makerelease.xml b/dist/makerelease.xml new file mode 100644 index 0000000..b02e626 --- /dev/null +++ b/dist/makerelease.xml @@ -0,0 +1,726 @@ +<!-- this is a makerelease script: http://github.com/hardaker/makerelease --> +<makerelease> + <!-- TODO: + - make mancp below happens before configure is run, which + doesn't work if it's a complete work. + - configure options should be prompted into a variable and used + --> + <steps> + <step type="section" title="Setup Steps" mandatory="1"> + <text> + This set of steps will do some preliminary "safety" checks to + ensure the local environment is ok and setup some important + information. + </text> + <steps> + <step type="system" title="Old Code"> + <text> + This checks for old tarballs (and particularly unpacked + distributions) which might confuse the later processing. + If this step finds outstanding files you need to remove + them before continuing! + </text> + <commands> + <command expectfailure="1">find . -name 'net-snmp-5*' | egrep '^[^\?]'</command> + </commands> + </step> + <step type="system" title="Setup Check"> + <text> + This should show the last version number published in this + branch by looking at the time line in the README file: + </text> + <commands> + <command>head -1 README</command> + </commands> + </step> + <step type="prompt" prompt="Enter the new version number:" + title="Pick a Version Number" + parameter="VERSION"> + <text> + Please enter the version number to publish. Net-SNMP + convention dictates that this be a version number like 5.4 or + 5.4.1. Pre-releases that occur before a branch freezes should + be appended with ".preN" like 5.4.1.pre2. Release-candidates + should be labeled ".rcN" like 5.4.1.rc1. + </text> + </step> + <step type="prompt" prompt="Enter the last version number:" + title="Enter the last version number" + parameter="LASTVERSION"> + <text> + Please enter the last version number that the changelog should be + generated from. This should be easy for a new release on a branch, + but may be more tricky for a main release. + </text> + </step> + <step type="perl" title="Defining a second internal version string" + mandatory="1"> + <perl> + <code> + # version number with dashes instead of dots + $self->{'parameters'}{'VERSIONTAGNAME'} = + "v" . $self->{'parameters'}{'VERSION'}; + + $self->{'parameters'}{'LASTVERSIONTAGNAME'} = + "v" . $self->{'parameters'}{'LASTVERSION'}; + + # target version number (without preN/rcN) + $self->{'parameters'}{'VERSIONTARGET'} = + $self->{'parameters'}{'VERSION'}; + if ( $self->{'parameters'}{'VERSIONTARGET'} =~ /\.pre.*/ ) { + $self->{'parameters'}{'VERSIONTARGET'} =~ s/\.pre.*//; + $self->{'parameters'}{'RELEASETYPE'} = "pre"; + } elsif ( $self->{'parameters'}{'VERSIONTARGET'} =~ /\.rc.*/ ) { + $self->{'parameters'}{'VERSIONTARGET'} =~ s/\.rc.*//; + $self->{'parameters'}{'RELEASETYPE'} = "rc"; + } else { + $self->{'parameters'}{'RELEASETYPE'} = "full"; + } + + # version in floating point form for perl modules + my ($major, $minor, $patch, $opps) = + ($self->{'parameters'}{'VERSION'} =~ + /^(\d+)\.(\d+)\.?(\d*)\.?(\d*)/); + $self->{'parameters'}{'VERSIONFLOAT'} = + $major + $minor/100 + $patch/10000 + $opps/100000; + + # find out the git branch we're on. + open(GITINFO,"git branch|"); + while(<GITINFO>) { + if (/^\*\s+(.*)/) { + $self->{'parameters'}{'BRANCHPATH'} = $1; + my ($nextBranch); + $nextBranch = <GITINFO>; + $nextBranch =~ s/^\s+//; + $self->{'parameters'}{'NEXTBRANCH'} = $nextBranch; + last; + } + } + close(GITINFO); + + return 0; + </code> + </perl> + </step> + <step type="Informational" title="Release Parameter Information" pause="1"> + <text> + Here is the configured information we'll be using: + + VERSION: {VERSION} + + VERSION tag name: {VERSIONTAGNAME} + + Floating point VERSION: {VERSIONFLOAT} + + Git Branch Name: {BRANCHPATH} + </text> + </step> + <step type="system" stepname="update" title="update"> + <text>We need to make sure your code is up to date and + matches the latest sources in this branch.</text> + <commands> + <command>git pull</command> + </commands> + </step> + <step type="system" stepname="update" title="Check for changes"> + <text>This steps looks for outstanding files that have been + modified. There should be no outstanding modifications! If + this step finds outstanding modified files you need to check + them in or revert them before continuing!</text> + <commands> + <command expectfailure="1">git status --porcelain | egrep '^[^\?]'</command> + </commands> + </step> + </steps> + </step> + <step type="section" title="Source Code Setup"> + <text> + This set of steps will modify various places within the source + code tree to bring it up to date with the new version number + about to be published. + </text> + <steps> + <step type="section" title="Libtool / Library versioning setup"> + <text> + These steps will modify the various files in the source tree + that contain the version number, show you the changes that + will be made and then check in the resulting changes if you + approve of them. + </text> + <steps> + <step type="informational" pause="true" + skipunless="'{RELEASETYPE}' eq 'pre'" + stepname="version:manualedit" title="version:libtoolmanualedit"> + <text> + You may need to edit Makefile.top to update the library + version numbering - see the comments there about LIBCURRENT, + LIBAGE and LIBREVISION for details. This is usually only + needed for the first pre-release of a given version. + + This script will commit the file for you after you're done. + </text> + </step> + <step prompt="true" type="system" stepname="version:libtoolcommit" + title="version:commit"> + <text>We'll now commit the Makefile.top file if you've + modified it.</text> + <commands> + <command ignoreerror="1">git commit -m "version update for {VERSION}" Makefile.top</command> + </commands> + </step> + </steps> + </step> + <step type="section" title="Change The Version Number"> + <text> + These steps will modify the various files in the source tree + that contain the version number, show you the changes that + will be made and then check in the resulting changes if you + approve of them. + </text> + <steps> + <step type="modify" title="Modify the source files" + stepname="release:versionstamp"> + <text> + We will now modify files through the code to replace the + version number with the newer one. + </text> + <modifications> + <modify + find="VERSION = '(.*)'" + replace="VERSION = \'{VERSIONFLOAT}\'"> + <files> + <file>perl/SNMP/SNMP.pm</file> + <file>perl/agent/agent.pm</file> + <file>perl/agent/Support/Support.pm*</file> + <file>perl/agent/default_store/default_store.pm</file> + <file>perl/default_store/default_store.pm</file> + <file>perl/OID/OID.pm</file> + <file>perl/ASN/ASN.pm</file> + <file>perl/AnyData_SNMP/Storage.pm</file> + <file>perl/AnyData_SNMP/Format.pm</file> + <file>perl/TrapReceiver/TrapReceiver.pm</file> + </files> + </modify> + <!-- this will fail (ok) against future versions with + configure generated PACKAGE_VERSION usage --> + <modify + find="NetSnmpVersionInfo = "[\d\.]+"" + replace="NetSnmpVersionInfo = "{VERSION}""> + <files> + <file>snmplib/snmp_version.c</file> + </files> + </modify> + <modify + find="Version: [\.0-9a-zA-Z]+" + replace="Version: {VERSION}"> + <files> + <file>README</file> + <file>FAQ</file> + <file>dist/net-snmp.spec</file> + </files> + </modify> + <modify + find="VERSION = [\.0-9a-zA-Z]+" + replace="VERSION = {VERSION}"> + <files> + <file>dist/Makefile*</file> + </files> + </modify> + <modify + find="AC_INIT\(\[Net-SNMP\], \[([^\]]+)\]" + replace="AC_INIT([Net-SNMP], [{VERSION}]"> + <files> + <file>configure.in*</file> + <file>configure.ac*</file> + </files> + </modify> + <modify + find="NetSnmpVersionInfo = "[^"]+"" + replace="NetSnmpVersionInfo = "{VERSION}""> + <files> + <file>snmplib/snmp_version.c</file> + </files> + </modify> + </modifications> + </step> + <step type="system" stepname="release:versionautoconf" + title="Running autoconf to rebuild configure"> + <text>We modified configure.in, so we now need to run + autoconf to rebuild configure.</text> + <commands> + <command>rm -f configure</command> + <command>dist/run-autoconf</command> + </commands> + </step> + <step type="system" stepname="release:versiondiff" + title="Running svn diff to check changes"> + + <text>Check the following changes for proper version number + differences before we commit the chances.</text> + <commands> + <command>git diff</command> + </commands> + </step> + <step type="system" stepname="release:versioncommit" pause="true" + title="Running git commit to commit the changes"> + + <text>Check the changes in the above diff and then we'll + commit the results here if they look ok.</text> + <commands> + <command>git commit -a -m "Version number update: {VERSION}"</command> + </commands> + </step> + </steps> + </step> + <step type="section" title="Handle dist/release"> + <steps> + <step type="system" skipunless="'{RELEASETYPE}' eq 'rc'"> + <text>Note in 'dist/release' that this branch is in release candidate mode + </text> + <commands> + <command>git checkout V5-4-patches</command> + <command>echo {BRANCHPATH} rc >> dist/release </command> + <command ignoreerror="1">git commit -m "Release Candidate for {BRANCHPATH}" dist/release</command> + <command>git checkout {BRANCHPATH} </command> + <command>git merge V5-4-patches </command> + <command>git commit </command> + </commands> + </step> + <step type="system" skipif="'{RELEASETYPE}' eq 'rc'"> + <text>Ensure that 'dist/release' doesn't reference this branch + </text> + <commands> + <command>git checkout V5-4-patches</command> + <command>grep -v {BRANCHPATH} dist/release > dist/release.new </command> + <command>mv dist/release.new dist/release </command> + <command ignoreerror="1">git commit -m "{BRANCHPATH} out of Release Candidate" dist/release</command> + <command>git checkout {BRANCHPATH} </command> + <command>git merge V5-4-patches </command> + <command>git commit </command> + </commands> + </step> + </steps> + </step> + <step type="system" stepname="docs:make" title="docs:make"> + <text>This step will create manual pages from doxygen + instrumented code files.</text> + <commands> + <command> + if [ -f Makefile ] + then + make docs + make mancp + fi + </command> + </commands> + </step> + <step type="system" stepname="docs:update" title="docs:update"> + <text>This will run git status to figure out what files have + changed since the previous man page generation steps were + done. After this step, we'll commit all the modified files. + + You may find additional files (marked with a ?) that should + be added to the svn repository and you'll need to do this by + hand before going on to the next step. + + Note: based on a recent net-snmp-admin discussion, we're no + longer going to be adding the bazillions of man pages that + doxygen generates by default. Only important ones should be + added.</text> + <commands> + <command>git status --porcelain man</command> + </commands> + </step> + <step type="informational" pause="true" stepname="docs:manualaddnewman" title="docs:manualaddnewman"> + <text> + Update man/Makefile.in with details of any new man pages, + and run 'git add' on them. + + I'll commit these changes for you after you're done. + </text> + </step> + <step prompt="true" type="system" stepname="docs:commit" title="docs:commit"> + <commands> + <command ignoreerror="1">git commit -m "documentation update for {VERSION}" man</command> + </commands> + </step> + </steps> + </step> + <step type="section" title="Testing Steps"> + <text> + These steps will help you test the source code to ensure it + passes some simple "it works" tests. + </text> + <steps> + <step type="system" stepname="build:distclean" title="build:distclean"> + <text>First we need to clean the existing build tree and + start from scratch.</text> + <commands> + <command>NETSNMP_DONT_CHECK_VERSION=1 make distclean</command> + </commands> + </step> + <step type="system" stepname="build:configure" title="build:configure"> + <text>We need to run configure to set up the build tree.</text> + <commands> + <command>./configure --cache=config.cache --with-defaults --with-mib-modules='host examples examples/example testhandler tlstm-mib tsm-mib smux Rmon disman/event-mib' --with-transports="IPX TLSTCP DTLSUDP" --with-security-modules="tsm" --enable-ipv6 --enable-embedded-perl --enable-shared</command> + </commands> + </step> + <step type="system" stepname="build:make" title="build:make"> + <text>Then we need to build the code</text> + <commands> + <command>NETSNMP_DONT_CHECK_VERSION=1 make</command> + </commands> + </step> + <step type="system" stepname="build:test" title="testing: default tests"> + <text>Now we run "make test" which should produce a perfect + set up test results. If not, this needs to be fixed or at + least understood and accepted as is for some other reason.</text> + <commands> + <command>make test</command> + </commands> + </step> + <step type="system" stepname="build:test:unit" title="testing: unit-tests"> + <text>Now we run the unit-tests which should also produce a perfect + set up test results. If not, this needs to be fixed or at + least understood and accepted as is for some other reason.</text> + <commands> + <command>cd testing && ./RUNFULLTESTS -g unit-tests</command> + </commands> + </step> + <step type="system" stepname="build:test:transports" title="testing: transports"> + <text>Now we run the transport tests which should also + produce a perfect set up test results, if your machine + supports all the transports. If not, this needs to be fixed + or at least understood and accepted as is for some other + reason (like you can't do IPv6 on your system).</text> + <commands> + <command>cd testing && ./RUNFULLTESTS -g transports</command> + </commands> + </step> + <step type="system" stepname="code:checkcomments" title="code:checkcomments"> + <text>This command looks for source code oddities and policy + violations.</text> + <commands> + <command>make checks</command> + </commands> + </step> + </steps> + </step> + <step type="section" title="Release File Steps"> + <text>Certain files in the distribution are built on a + per-release basis. These steps will help set up these files.</text> + <steps> + <step type="system" stepname="code:makedepend" title="code:makedepend"> + <text>This step creates Makefile dependencies using the + "distdepend" rule in the top level Makefile. + + Note that if you have any additional MIB module code files in the + source tree, these will be included in the Makefile dependency list. + You may wish to remove these and re-run "make distdepend" before + committing the changes. + </text> + <commands> + <command>make distdepend</command> + </commands> + </step> + <step prompt="true" type="system" stepname="code:commitdepend" title="code:commitdepend"> + <text>This step commits the dependency changes done in the + previous step.</text> + <commands> + <command ignoreerror="1">git commit -m "make depend for {VERSION}" `find . -name Makefile.depend`</command> + </commands> + </step> + <step type="system" stepname="changelog:create" title="Creating a changelog update"> + <text>We need to extract the portions of the change logs + committed to the repository.</text> + <commands> + <command>git log --no-merges {LASTVERSIONTAGNAME}..HEAD > ChangeLog.add</command> + </commands> + </step> + <step type="informational" pause="true" stepname="changelog:manualedit" title="changelog:manualedit"> + <text> + You need to manually insert the *relevent* portions of + 'ChangeLog.add' into the ChangeLog file. + + I also suggest truncating ChangeLog.add to only contain + the *relevent* portions for this release, as this will make + CHANGES.new2 and NEWS.new2 more accurate later on. + + I'll commit these changes for you after you finish cutting + out the proper changes. + </text> + </step> + <step prompt="true" type="system" stepname="changelog:commit" title="changelog:commit"> + <commands> + <command>git commit -m "version update for {VERSION}" ChangeLog</command> + </commands> + </step> + <step type="system" stepname="docs:newnews" title="docs:newnews"> + <commands> + <command>perl dist/extractnews -s ----- -e ----- ChangeLog</command> + </commands> + </step> + <step type="system" stepname="docs:newnews" title="docs:newnews"> + <commands> + <command>perl dist/extractnews -c CHANGES.new2 -n NEWS.new2 ChangeLog.add</command> + </commands> + </step> + <step type="informational" pause="true" stepname="docs:README-and-NEWS" title="docs:README"> + <text> + You need to manually insert the relevent portions of + 'CHANGES.new' and 'NEWS.new' into the CHANGES and NEWS file. + (There are alternative versions in 'CHANGES.new2' and 'NEWS.new2') + You may wish to update the README file as well. + I'll commit these changes for you afterwards + </text> + </step> + <step prompt="true" type="system" stepname="docs:commit" title="docs:commit"> + <commands> + <command ignoreerror="1">git commit -m "version update for {VERSION}" README NEWS CHANGES</command> + </commands> + </step> + <step type="system" stepname="release:update" title="release:update"> + <text>One more git pull and status to make sure nothing + odd exists in your source tree. Please check the results!</text> + <commands> + <command>git pull</command> + <command>git status --porcelain</command> + </commands> + </step> + </steps> + </step> + + <step type="section" title="Make the Release" prompt="yes"> + <text>This is it! After this point it's much harder to turn + back. If everything is ok until this point and you're ready to + actually tag the release in git and make release files, these + steps will do that for you. + </text> + <steps> + <step prompt="true" type="system" stepname="release:tag" title="release:tag"> + <text> + This will actually svn copy the current checked out branch + to the new tag name. Specifically: + + git tag -u A77C5329 -s {VERSIONTAGNAME} -m "Tagging of version {VERSION} as {VERSIONTAGNAME}" + </text> + <commands> + <command>git tag -u A77C5329 -s {VERSIONTAGNAME} -m "Tagging of version {VERSION} as {VERSIONTAGNAME}"</command> + </commands> + </step> + <step prompt="true" type="system" stepname="release:makedist" title="release:makedist"> + <commands> + <command>git archive --prefix=net-snmp-{VERSION}/ {BRANCHPATH} | tar xf -</command> + </commands> + </step> + <step type="system" stepname="release:removefiles" title="release:removefiles"> + <commands> + <command>net-snmp-{VERSION}/remove-files net-snmp-{VERSION}</command> + </commands> + </step> + <step type="system" stepname="release:makedist" title="release:makedist"> + <commands> + <command>star artype=ustar -c -z -f net-snmp-{VERSION}.tar.gz net-snmp-{VERSION}</command> + </commands> + </step> + <step type="system" stepname="release:makezipclean" title="release:makezipclean"> + <commands> + <command>rm -f net-snmp-{VERSION}.zip</command> + </commands> + </step> + <step type="system" stepname="release:makezip" title="release:makezip"> + <commands> + <command>zip -r net-snmp-{VERSION}.zip net-snmp-{VERSION}</command> + </commands> + </step> + <step type="system" stepname="release:searching-gpg-keys" title="release:searching-gpg-keys"> + <commands> + <command>gpg --list-secret-keys net-snmp-admin</command> + </commands> + </step> + <step type="system" stepname="release:gpg" title="release:gpg"> + <commands> + <command>gpg -u A77C5329 -a --detach-sign net-snmp-{VERSION}.tar.gz</command> + </commands> + </step> + <step type="system" stepname="release:gpg" title="release:gpg"> + <commands> + <command>gpg -u A77C5329 -a --detach-sign net-snmp-{VERSION}.zip</command> + </commands> + </step> + <step type="command" name="release:nextbranch" title="Don't propagate code modifications" + pause="0" mandatory="0"> + <text> + Mark these code modifications as specific to this particular branch + </text> + <commands> + <command>git checkout {NEXTBRANCH}</command> + <command>git merge -s ours -m "Release {VERSION} specific changes" {BRANCHPATH}</command> + <command>git checkout {BRANCHPATH}</command> + </commands> + </step> + <step type="command" name="release:push" title="Push the code modifications" + pause="0" mandatory="0"> + <text> + Push the code modifications to the upstream branch + </text> + <commands> + <command>git push</command> + <command>git push --tags origin {VERSIONTAGNAME}</command> + </commands> + </step> + + <step type="section" title="Release File Test"> + <text>We'll also re-build the source and retest a few things to + ensure the packaged file can actually be built. + </text> + <steps> + <step type="system" stepname="posttest:untar" title="posttest:untar"> + <commands> + <command>rm -rf net-snmp-{VERSION}</command> + </commands> + </step> + <step type="system" stepname="posttest:untar" title="posttest:untar"> + <commands> + <command>tar xzf net-snmp-{VERSION}.tar.gz</command> + </commands> + </step> + <step type="system" stepname="posttest:configure" title="posttest:configure"> + <commands> + <command>cd net-snmp-{VERSION} && ./configure --cache=config.cache --with-defaults --with-mib-modules='host examples examples/example testhandler smux Rmon disman/event-mib' --with-transports=IPX --enable-ipv6 --enable-embedded-perl --enable-shared</command> + </commands> + </step> + <step type="system" stepname="posttest:make" title="posttest:make"> + <commands> + <command>cd net-snmp-{VERSION} && make</command> + </commands> + </step> + <step type="system" stepname="posttest:test" title="posttest:test"> + <commands> + <command>cd net-snmp-{VERSION} && make test</command> + </commands> + </step> + </steps> + </step> + </steps> + </step> + <step type="section" title="Release the results"> + <text>Now we'll publish the results to the SF server</text> + <steps> + <step pause="true" type="system" skipif="'{RELEASETYPE}' eq 'full'" + stepname="publish:rsync" title="rsync the new files"> + <text>This will copy the results to the SF uploads directory + in your account on frs.sourceforge.net. The following command + is just as an example - this script does *not* upload the + files automatically. You must do something like:</text> + <commands> + <command>echo rsync -v net-snmp-{VERSION}.tar.gz net-snmp-{VERSION}.tar.gz.asc net-snmp-{VERSION}.zip net-snmp-{VERSION}.zip.asc hardaker,net-snmp@frs.sourceforge.net:/home/frs/project/n/ne/net-snmp/net-snmp/{VERSIONTARGET}-pre-releases/</command> + </commands> + </step> + <step pause="true" type="system" skipunless="'{RELEASETYPE}' eq 'full'" + stepname="publish:rsync" title="rsync the new files"> + <text>This will copy the results to the SF uploads directory + in your account on frs.sourceforge.net. The following command + is just as an example - this script does *not* upload the + files automatically. You must do something like:</text> + <commands> + <command>echo rsync -v net-snmp-{VERSION}.tar.gz net-snmp-{VERSION}.tar.gz.asc net-snmp-{VERSION}.zip net-snmp-{VERSION}.zip.asc hardaker,net-snmp@frs.sourceforge.net:/home/frs/project/n/ne/net-snmp/net-snmp/{VERSIONTARGET}/</command> + </commands> + </step> + <step type="informational" stepname="publish:editrelease" + title="Update the SF release web page"> + <text> + Update the project download web page (http://www.net-snmp.org/download.html) to mention this new release + </text> +<!-- Doesn't work + <commands> + <command>firefox 'http://sourceforge.net/project/admin/editpackages.php?group_id=12694'</command> + </commands> + --> + </step> + <step type="system" stepname="publish:editpatches" + skipunless="'{RELEASETYPE}' eq 'full'" + title="Update the SF Official Patch tracker"> + <text> + If this the final version of this release, then: + Any official patches for the previous release should be re-prioritised to level 5. + Any official patches for the earlier releases should be re-prioritised to level 1 and closed. + </text> + <commands> + <command>firefox 'http://www.net-snmp.org/official_patches/'</command> + </commands> + </step> + </steps> + </step> + <step type="informational"> + <text> + Binaries: build rpms, .tar.gzs, etc. + </text> + </step> + <step type="Informational" name="cleanup:nsrollup" title="Run nsrollup" + pause="1" mandatory="1"> + <text> + You need to run nsrollup now to sync all the changes we've + made into any upstream branches. This will likely cause merge + conflicts because of the version number clashes and will need + to be resolved. + + Run (in bash): + + . local/gittools/shell-functions + nsrollup + nssync + + XXX: For conflicts, we can probably pick -s ours but needs to + be checked and documented. + </text> + </step> + <step type="section" title="Advertise it!"> + <steps> + <step type="system" pause="1" title="Add note to the news system"> + <text>Add a note to the source forge news system: + + http://sourceforge.net/news/submit.php?group_id=12694 + </text> + <commands> + <command>echo firefox 'http://sourceforge.net/news/submit.php?group_id=12694'</command> + </commands> + </step> + <step type="informational" pause="1"> + <text>Send an announcement message to one of the following + mailing lists based on its type: + + pre: net-snmp-coders@lists.sourceforge.net + + rc: net-snmp-users@lists.sourceforge.net + + final: net-snmp-announce@lists.sourceforge.net + (one week after the source tarball is made available) + </text> + </step> + <step type="informational" skipunless="'{RELEASETYPE}' eq 'full'" pause="1"> + <text>Update the topic on the #Net-SNMP channel if this is a + trunk based release. + </text> + </step> + <step type="system" skipunless="'{RELEASETYPE}' eq 'full'" pause="1"> + <text>Update the freshmeat listing (Wes needs to do this): + + http://freshmeat.net/projects/net-snmp/ + </text> + <commands> + <command>echo firefox http://freshmeat.net/projects/net-snmp/</command> + </commands> + </step> + </steps> + </step> + <step type="informational" skipunless="'{RELEASETYPE}' eq 'full'" pause="1"> + <text> + Advertise: NEWS upload to sf, publish on -announce, freshmeat, + and the GNU FSF directory + (http://directory.fsf.org/project/net-snmp/)... + (send mail to bug-directory@gnu.org) + </text> + </step> + </steps> +</makerelease> diff --git a/dist/net-snmp-solaris-build/DEVENV b/dist/net-snmp-solaris-build/DEVENV new file mode 100644 index 0000000..b905cae --- /dev/null +++ b/dist/net-snmp-solaris-build/DEVENV @@ -0,0 +1,44 @@ +PREFIX=/opt/OSS +export PREFIX + +PATH=$PREFIX/bin:/usr/bin:/usr/dt/bin:/usr/openwin/bin:/usr/sbin:/usr/ccs/bin:/usr/ucb +export PATH + +LD_LIBRARY_PATH=$PREFIX/lib +LD_RUN_PATH=$LD_LIBRARY_PATH +export LD_LIBRARY_PATH LD_RUN_PATH + +CC=gcc +export CC + +CPPFLAGS="-I$PREFIX/include" +CFLAGS="-mv8 -mtune=ultrasparc" +LDFLAGS="-L$PREFIX/lib -R$PREFIX/lib" +export CPPFLAGS CFLAGS LDFLAGS + +TMP=/tmp +export TMP + +TOP=/ctbto/idc/cicn/source/build/`basename $PREFIX` +export TOP + +SRC=$TOP/dist +export SRC + +WORK=$TOP/work +export WORK + + +# for superpack: + +CHECKLIST=$TOP/Checklist; export CHECKLIST +MAKE=$PREFIX/bin/make +export MAKE + +#CATEGORY=OpenSource; export CATEGORY +#VENDOR="Free Software Foundation"; export VENDOR +BASEDIR=/opt; export BASEDIR +PREFIX=$BASEDIR/`basename $TOP`; export PREFIX +RELEASE_AREA=$TOP/../packages/`/bin/uname -p`/`/bin/uname -r`; export RELEASE_AREA + +umask 022 diff --git a/dist/net-snmp-solaris-build/README b/dist/net-snmp-solaris-build/README new file mode 100644 index 0000000..53e25a6 --- /dev/null +++ b/dist/net-snmp-solaris-build/README @@ -0,0 +1,19 @@ +The "buildpackage-solaris" script does a "one-shot" build +and packaging of an untarred net-snmp distribution +on Solaris without requiring root access. + +The resulting native Solaris package can then be +(automatically) installed/removed using the Solaris +pkgadd(1)/pkgrm(1) commands. + +The script requires customization of your +development environment - see attached file +DEVENV - before it can be used. + + Basic usage: ./buildpackage-solaris distclean + +The script "elfdepend.sh" is required to +determine the dependencies of all built ELF binaries +and libraries to create a "package dependency file" - +see depend(4). + diff --git a/dist/net-snmp-solaris-build/buildpackage-solaris b/dist/net-snmp-solaris-build/buildpackage-solaris new file mode 100644 index 0000000..31f4f0c --- /dev/null +++ b/dist/net-snmp-solaris-build/buildpackage-solaris @@ -0,0 +1,182 @@ +#!/bin/ksh +# +# automatic build (configure/make/package) script +# for NET-SNMP on Solaris +# +# 2004/11 Rewrite to strictly build the package jfrank@fastrieve.com +# 2002/11 Stefan.Radman@CTBTO.ORG + + +# If you define DEBUG, the script will be verbose, and we won't remove temporary files + +#DEBUG=Y +if [ ! -z $DEBUG ]; then + set -x # be verbose +fi + +# TMP is where we are temporarily installing the package to +TMP=`pwd`/pkgroot + +# PKG is the internal and external name for the package +PKG=OSSnet-snmp + +#PREFIX is the top level architecture dependent directory. +# This should be normally determined by configure +#prefix=/opt/${PKG} +prefix=/usr/local + +# VARDIR is the persistent dir from configure +VARDIR=/var/net-snmp + +expandedprefix=${TMP}/${prefix} + +PERL=${PERL:=`which perl`} +MAKE=${MAKE:=`which make`} + +if [ -d ${TMP} ]; then + rm -rf ${TMP}; +fi + +# install to temporary package build root +cd ../.. + +$MAKE install prefix=${expandedprefix} exec_prefix=${expandedprefix} || exit 1 + +# We now have the main software installed, copy over the auxillary files +cd - + +awk /^___snmpd-init.d/,/___EOF/ $0 | grep -v ^___ | sed "s,@prefix@,$prefix,g" >|snmpd-init.d + +# create persistent directory if it does not exist +[ -d $TMP/$VARDIR ] || install -d -m 0755 $TMP/$VARDIR + +# postinstall +LD_LIBRARY_PATH=$TMP$prefix/lib:$LD_LIBRARY_PATH $TMP/$prefix/bin/snmptranslate\ + -M$TMP/$prefix/share/snmp/mibs -m SNMPv2-SMI .1 >&- || exit $? # create MIB index + +# package +version=`../../net-snmp-config --version` +os=`uname -s` +rel=`uname -r` +class=snmp +owner=$LOGNAME +groups | awk '{print $1}' | read group +cat <<== >|pkginfo +PKG="${PKG}" +NAME="net-snmp-$version" +ARCH="`uname -p`" +VERSION="$version, $os $rel, `date +%Y.%m.%d.%H.%M.%S`" +CATEGORY="OpenSource" +DESC="The NET-SNMP Tools and Library" +VENDOR="http://net-snmp.sourceforge.net" +CLASSES="$class" +BASEDIR="$prefix" +== +. ./pkginfo + +echo 'checking dependencies' +unset LD_LIBRARY_PATH # binaries and libraries should have RPATH now +./elfdepend.sh $TMP | grep -v "P *$PKG " >|depend # ignore own package + +echo 'creating prototype file' +cat <<== >|prototype +i pkginfo +i copyright=../../COPYING +#i preinstall=./preinstall-postremove +#i postinstall=./preinstall-postremove +i depend +# set default mode, owner and group +! default 0775 root sys +d snmp /etc 0755 root sys +d snmp /etc/init.d 0755 root sys +f snmp /etc/init.d/snmpd=./snmpd-init.d 0755 root sys +#l snmp /etc/rc2.d/S76snmpd=/etc/init.d/snmpd # not yet +== + +pkgproto -c snmp $TMP=/ |\ +egrep -v '^d .* / |^d .* /var |^d .* /opt |^ .*perllocal.pod=' |\ +sed -e "s/ $owner $group\$//" >> prototype || exit $? +# and ignore top level directories (must pre-exist) + +echo 'creating package' +pkgmk -od . || exit $? +pkgtrans . $PKG-$version-$ARCH-$os$rel.pkg $PKG || exit $? + +# We should really do some cleanup here +if [ -z $DEBUG ]; then + rm -rf snmpd-init.d $PKG $TMP pkginfo prototype depend +fi + +echo "build was successfull" +exit 0 + +# /etc/init/snmpd +# This is packaged inside of buildpackage-solaris because we need to substitute +# in the actual server name. + +___snmpd-init.d___ +#! /bin/sh +# +# start/stop the NET-SNMP master agent (snmpd) +# +# Location: /etc/init.d/snmpd +# /etc/rc3.d/S??snmpd +# +name="NET-SNMP agent" +daemon=@prefix@/sbin/snmpd + +case "$1" in +start) + [ ! -x $daemon ] && echo "ERROR: cannot start $name ($daemon)" && exit 1 + echo "Starting $name ... \c" + PGREP=`which pgrep` + if [ -z $PGREP ]; then + pid=`pgrep -fx $daemon` + else + pid=`ps -ef | grep $daemon | grep -v grep | awk '{print $2}'` + fi + + [ ! -z "$pid" ] && echo "already running with pid $pid." && exit 0 + $daemon && echo "done." + ;; +stop) + echo "Stopping $name ... \c" + PGREP=`which pgrep` + if [ -z $PGREP ]; then + pid=`pgrep -fx $daemon` + else + pid=`ps -ef | grep $daemon | grep -v grep | awk '{print $2}'` + fi + [ ! -z "$pid" ] && (kill $pid && echo "done" ) || echo "not running" + + ;; +status) + echo "$name is \c" + PGREP=`which pgrep` + if [ -z $PGREP ]; then + pid=`pgrep -fx $daemon` + else + pid=`ps -ef | grep $daemon | grep -v grep | awk '{print $2}'` + fi + [ -z "$pid" ] && echo "not running" || echo "running with pid $pid" + ;; +restart) + $0 stop && $0 start + ;; +reload) + echo "Re-initializing $name ...\c" + PGREP=`which pgrep` + if [ -z $PGREP ]; then + pid=`pgrep -fx $daemon` + else + pid=`ps -ef | grep $daemon | grep -v grep | awk '{print $2}'` + fi + [ ! -z "$pid" ] && (kill -HUP $pid && echo "done" ) || echo "not running" + ;; +*) + echo "Usage: $0 { start | stop | status | restart | reload }" + ;; +esac + +exit 0 +___EOF___ diff --git a/dist/net-snmp-solaris-build/elfdepend.sh b/dist/net-snmp-solaris-build/elfdepend.sh new file mode 100755 index 0000000..547c4cc --- /dev/null +++ b/dist/net-snmp-solaris-build/elfdepend.sh @@ -0,0 +1,87 @@ +#!/bin/ksh +# +# elfdepend.sh +# +# given a path, this scripts searches for ELF binaries and libraries +# and generates package dependency file entries according to ther dependencies +# +# Usage: elfdepend <ELF-binary>|<directory> +# +# 2002/11 Stefan.Radman@CTBTO.ORG +# +# /var/sadm/install/contents format: +# +# /dev d none 0775 root sys SUNWcsr SUNWcsd +# path type class mode owner group packages +# /etc/.login f renamenew 0644 root sys 516 37956 904647695 SUNWcsr +# /etc/acct/holidays e preserve 0664 bin bin 289 22090 904647603 SUNWaccr +# path type class mode owner group x x x packages +# /bin=./usr/bin s none SUNWcsr +# path=link type class packages +# /devices/pseudo/clone@0:hme c none 11 7 0600 root sys SUNWcsd +# path type class x x owner mode packages +# +# types e (sed), v (volatile) have same format like type f (file) +# type l (hardlink) has same format like type s (symlink) +# +prog=`basename $0` +LAST_CHANCE=/opt/OSS/lib + +if [ -d "$1" ] ; then + find $1 -type f -exec file {} \; +elif [ -x "$1" ] ; then + file $1 +else + echo 1>&2 "usage: $0 <directory>|<ELF executable>" + exit 1 +fi | awk '$2 == "ELF" { print }' | cut -d: -f1 |\ +while read elf +do + ldd "$elf" | while read lib x path + do + [ -z "$path" ] && continue + if [ "$path" = '(file not found)' ] + then + if [ -x $LAST_CHANCE/$lib ] + then + path="$LAST_CHANCE/$lib" + else + echo "# $prog: $lib $x $path" + continue # not found + fi + fi + echo "$path" + # need symlink handling here - see /usr/platform/SUNW,*/lib/* + done +done | sort -u | while read libpath other +do + [ "$libpath" = "#" ] && echo "$libpath $other" && continue # error message + set -- `grep "^$libpath[ =]" /var/sadm/install/contents | head -1` + path=$1; type=$2 + case $type in + f) # file + shift 9 # first package + ;; + s|l) # link + shift 3 # first package + ;; + '') # not found + echo "# $prog: $libpath is not associated with any package" + continue + ;; + *) # dubious file type + echo "# $prog: path $1 has dubious file type $2" + continue + ;; + esac + set -- `echo $1 | tr : ' '` + echo $1 # strip off classes +done | sort -u | while read pkg other +do + if [ "$pkg" = "#" ] ; then # error message + echo 1>&2 "$other" # goes to stderr + continue + fi + eval `pkgparam -v $pkg PKG NAME` + printf "P %-15s%s\n" "$PKG" "$NAME" +done diff --git a/dist/net-snmp.spec b/dist/net-snmp.spec new file mode 100644 index 0000000..490049f --- /dev/null +++ b/dist/net-snmp.spec @@ -0,0 +1,303 @@ +# +# 5.4+ enables Perl by default +# +%define netsnmp_embedded_perl 1 +%define netsnmp_perl_modules 1 +%define netsnmp_cflags "" + +# ugly RHEL detector +# SuSE build service defines rhel_version, RHEL itself defines nothing +%if 0%{?rhel_version} +%define rhel %{?rhel_version} +%else +%define is_rhel %(grep -E "Red Hat Enterprise Linux|CentOS" /etc/redhat-release &>/dev/null && echo 1 || echo 0) +%if %{is_rhel} +%define rhel %(sed </etc/redhat-release -e 's/.*release \\(.\\).*/\\1/' ) +%endif +%endif + +# because perl(Tk) is optional, automatic dependencies will never succeed: +%define _use_internal_dependency_generator 0 +%define __find_requires %{_builddir}/net-snmp-%{version}/dist/find-requires +%define __find_provides /usr/lib/rpm/find-provides + +# +# Check for -without embedded_perl +# +%{?_without_embedded_perl:%define netsnmp_embedded_perl 0} +# +# check for -without perl_modules +# +%{?_without_perl_modules:%define netsnmp_perl_modules 0} +# +# if embedded_perl or perl_modules specified, include some Perl stuff +# +%if 0%{?netsnmp_embedded_perl} || 0%{?netsnmp_perl_modules} +%define netsnmp_include_perl 1 +%endif +Summary: Tools and servers for the SNMP protocol +Name: net-snmp +Version: 5.7.2 +# update release for vendor release. (eg 1.fc6, 1.rh72, 1.ydl3, 1.ydl23) +Release: 1 +URL: http://www.net-snmp.org/ +License: BSDish +Group: System Environment/Daemons +Vendor: Net-SNMP project +Source: http://prdownloads.sourceforge.net/net-snmp/net-snmp-%{version}.tar.gz +Prereq: openssl +Obsoletes: cmu-snmp ucd-snmp ucd-snmp-utils +BuildRoot: /tmp/%{name}-root +Packager: The Net-SNMP Coders <http://sourceforge.net/projects/net-snmp/> +Requires: openssl, popt, rpm, zlib, bzip2-libs, elfutils-libelf, glibc +BuildRequires: perl, elfutils-libelf-devel, openssl-devel, bzip2-devel, rpm-devel +%if %{netsnmp_embedded_perl} +BuildRequires: perl(ExtUtils::Embed) +Requires: perl +%endif + +%if 0%{?fedora}%{?rhel} +# Fedora & RHEL specific requires/provides +Provides: net-snmp-libs, net-snmp-utils +Obsoletes: net-snmp-libs, net-snmp-utils +Epoch: 2 + +%if 0%{?fedora} >= 9 +Provides: net-snmp-gui +Obsoletes: net-snmp-gui +# newer fedoras need following macro to compile with new rpm +%define netsnmp_cflags "-D_RPM_4_4_COMPAT" +%else +BuildRequires: beecrypt-devel +%endif +%endif # RHEL or Fedora + +%description + +Net-SNMP provides tools and libraries relating to the Simple Network +Management Protocol including: An extensible agent, An SNMP library, +tools to request or set information from SNMP agents, tools to +generate and handle SNMP traps, etc. Using SNMP you can check the +status of a network of computers, routers, switches, servers, ... to +evaluate the state of your network. + +%if %{netsnmp_embedded_perl} +This package includes embedded Perl support within the agent. +%endif + +%package devel +Group: Development/Libraries +Summary: The includes and static libraries from the Net-SNMP package. +AutoReqProv: no +Requires: net-snmp = %{epoch}:%{version} +Obsoletes: cmu-snmp-devel ucd-snmp-devel + +%description devel +The net-snmp-devel package contains headers and libraries which are +useful for building SNMP applications, agents, and sub-agents. + +%if %{netsnmp_include_perl} +%package perlmods +Group: System Environment/Libraries +Summary: The Perl modules provided with Net-SNMP +AutoReqProv: no +Requires: net-snmp = %{epoch}:%{version}, perl + +%if 0%{?fedora}%{?rhel} +Provides: net-snmp-perl +Provides: perl(SNMP) perl(NetSNMP::OID) +Provides: perl(NetSNMP::ASN) +Provides: perl(NetSNMP::AnyData::Format::SNMP) perl(NetSNMP::AnyData::Storage::SNMP) +Provides: perl(NetSNMP::agent) +Provides: perl(NetSNMP::manager) perl(NetSNMP::TrapReceiver) +Provides: perl(NetSNMP::default_store) perl(NetSNMP::agent::default_store) +Obsoletes: net-snmp-perl +%endif + +%description perlmods +Net-SNMP provides a number of Perl modules useful when using the SNMP +protocol. Both client and agent support modules are provided. +%endif + +%prep +%if %{netsnmp_embedded_perl} == 1 && %{netsnmp_perl_modules} == 0 +echo "'-with embedded_perl' requires '-with perl_modules'" +exit 1 +%endif +%setup -q + +%build +%configure --with-defaults --with-sys-contact="Unknown" \ + --with-mib-modules="smux" \ + --with-sysconfdir="/etc/net-snmp" \ + --enable-shared \ + %{?netsnmp_perl_modules: --with-perl-modules="INSTALLDIRS=vendor"} \ + %{!?netsnmp_perl_modules: --without-perl-modules} \ + %{?netsnmp_embedded_perl: --enable-embedded-perl} \ + %{!?netsnmp_embedded_perl: --disable-embedded-perl} \ + --with-cflags="$RPM_OPT_FLAGS %{netsnmp_cflags}" + +make + +%install +# ---------------------------------------------------------------------- +# 'install' sets the current directory to _topdir/BUILD/{name}-{version} +# ---------------------------------------------------------------------- +rm -rf $RPM_BUILD_ROOT + +make DESTDIR=%{buildroot} install + +# Remove 'snmpinform' from the temporary directory because it is a +# symbolic link, which cannot be handled by the rpm installation process. +%__rm -f $RPM_BUILD_ROOT%{_prefix}/bin/snmpinform +# install the init script +mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d +perl -i -p -e 's@/usr/local/share/snmp/@/etc/snmp/@g;s@usr/local@%{_prefix}@g' dist/snmpd-init.d +install -m 755 dist/snmpd-init.d $RPM_BUILD_ROOT/etc/rc.d/init.d/snmpd + +%if %{netsnmp_include_perl} +# unneeded Perl stuff +find $RPM_BUILD_ROOT/%{_libdir}/perl5/ -name Bundle -type d | xargs rm -rf +find $RPM_BUILD_ROOT/%{_libdir}/perl5/ -name perllocal.pod | xargs rm -f + +# store a copy of installed Perl stuff. It's too complex to predict +(xxdir=`pwd` && cd $RPM_BUILD_ROOT && find usr/lib*/perl5 -type f | sed 's/^/\//' > $xxdir/net-snmp-perl-files) +%endif + +%post +# ---------------------------------------------------------------------- +# The 'post' script is executed just after the package is installed. +# ---------------------------------------------------------------------- +# Create the symbolic link 'snmpinform' after all other files have +# been installed. +%__rm -f $RPM_INSTALL_PREFIX/bin/snmpinform +%__ln_s $RPM_INSTALL_PREFIX/bin/snmptrap $RPM_INSTALL_PREFIX/bin/snmpinform + +# run ldconfig +PATH="$PATH:/sbin" ldconfig -n $RPM_INSTALL_PREFIX/lib + +%preun +# ---------------------------------------------------------------------- +# The 'preun' script is executed just before the package is erased. +# ---------------------------------------------------------------------- +# Remove the symbolic link 'snmpinform' before anything else, in case +# it is in a directory that rpm wants to remove (at present, it isn't). +%__rm -f $RPM_INSTALL_PREFIX/bin/snmpinform + +%postun +# ---------------------------------------------------------------------- +# The 'postun' script is executed just after the package is erased. +# ---------------------------------------------------------------------- +PATH="$PATH:/sbin" ldconfig -n $RPM_INSTALL_PREFIX/lib + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root) + +# Install the following documentation in _defaultdocdir/{name}-{version}/ +%doc AGENT.txt ChangeLog CodingStyle COPYING +%doc EXAMPLE.conf.def FAQ INSTALL NEWS PORTING TODO +%doc README README.agentx README.hpux11 README.krb5 +%doc README.snmpv3 README.solaris README.thread README.win32 +%doc README.aix README.osX README.tru64 README.irix README.agent-mibs +%doc README.Panasonic_AM3X.txt + +#%config(noreplace) /etc/net-snmp/snmpd.conf + +#%{_datadir}/snmp/snmpconf-data +%{_datadir}/snmp + +%{_bindir} +%{_sbindir} +%{_mandir}/man1/* +# don't include Perl man pages, which start with caps +%{_mandir}/man3/[^A-Z]* +%{_mandir}/man5/* +%{_mandir}/man8/* +%{_libdir}/*.so* +/etc/rc.d/init.d/snmpd + +%files devel +%defattr(-,root,root) + +%{_includedir} +%{_libdir}/*.a +%{_libdir}/*.la + +%if %{netsnmp_include_perl} +%files -f net-snmp-perl-files perlmods +%defattr(-,root,root) +%{_mandir}/man3/*::* +%{_mandir}/man3/SNMP* +%endif + +%verifyscript +echo "No additional verification is done for net-snmp" + +%changelog +* Thu Jul 26 2012 Dave Shield <D.T.Shield@liverpool.ac.uk> +- Additional "Provides:" to complete the list of perl modules + Triggered by Bug ID #3540621 + +* Thu Oct 7 2010 Peter Green <peter.green@az-tek.co.uk> +- Modified RHEL detection to include CentOS. +- Added extra "Provides:" to the perlmods package definition; + otherwise subsequent package installations that require certain + Perl modules try to re-install RHEL/CentOS stock net-snmp + +* Tue May 6 2008 Jan Safranek <jsafranek@users.sf.net> +- remove %{libcurrent} +- add openssl-devel to build requirements +- don't use Provides: unless necessary, let rpmbuild compute the provided + libraries + +* Tue Jun 19 2007 Thomas Anders <tanders@users.sf.net> +- add "BuildRequires: perl-ExtUtils-Embed", e.g. for Fedora 7 + +* Wed Nov 23 2006 Thomas Anders <tanders@users.sf.net> +- fixes for 5.4 and 64-bit platforms +- enable Perl by default, but allow for --without perl_modules|embedded_perl +- add netsnmp_ prefix for local defines + +* Fri Sep 1 2006 Thomas Anders <tanders@users.sf.net> +- Update to 5.4.dev +- introduce %{libcurrent} +- use new disman/event name +- add: README.aix README.osX README.tru64 README.irix README.agent-mibs + README.Panasonic_AM3X.txt +- add new NetSNMP::agent::Support + +* Fri Jan 13 2006 hardaker <hardaker@users.sf.net> +- Update to 5.3.0.1 + +* Wed Dec 28 2005 hardaker <hardaker@users.sf.net> +- Update to 5.3 + +* Tue Oct 28 2003 rs <rstory@users.sourceforge.net> +- fix conditional perl build after reading rpm docs + +* Sat Oct 4 2003 rs <rstory@users.sourceforge.net> - 5.0.9-4 +- fix to build without requiring arguments +- separate embedded perl and perl modules options +- fix fix for init.d script for non-/usr/local installation + +* Fri Sep 26 2003 Wes Hardaker <hardaker@users.sourceforge.net> +- fix perl's UseNumeric +- fix init.d script for non-/usr/local installation + +* Fri Sep 12 2003 Wes Hardaker <hardaker@users.sourceforge.net> +- fixes for 5.0.9's perl support + +* Mon Sep 01 2003 Wes Hardaker <hardaker@users.sourceforge.net> +- added perl support + +* Wed Oct 09 2002 Wes Hardaker <hardaker@users.sourceforge.net> +- Incorperated most of Mark Harig's better version of the rpm spec and Makefile + +* Wed Oct 09 2002 Wes Hardaker <hardaker@users.sourceforge.net> +- Made it possibly almost usable. + +* Mon Apr 22 2002 Robert Story <rstory@users.sourceforge.net> +- created diff --git a/dist/nsb-config b/dist/nsb-config new file mode 100755 index 0000000..0944fe6 --- /dev/null +++ b/dist/nsb-config @@ -0,0 +1,82 @@ +#!/bin/sh +# +# $Id$ +# Author: Robert Story <rstory@freesnmp.com> +# +######################################################################## +######################################################################## + +usage() +{ + echo "Usage: $0 [-d|-x] [-s SRCD]" + echo "" + echo " -s SRCDIR : soure directory [$HOME/src/net-snmp-VERSION]" + echo "" + echo " -x : configure extra features for pre-release testing" + echo " -d : configure for binary distribution" + exit 1 +} + +#set -x + + +# +# find nsb-platform based on the path to this script +# +EXE_PATH=`dirname $0` +if [ -f $EXE_PATH/nsb-functions ];then + . $EXE_PATH/nsb-functions +elif [ -f $HOME/bin/nsb-functions ]; then + . $HOME/bin/nsb-functions +elif [ -f nsb-functions ];then + . nsb-functions +else + echo "Cannot find nsb-functions in $EXE_PATH, $HOME/bin or $PWD" + exit 1 +fi + + +######################################################################## +######################################################################## +NSB_CONFIG_ALL=2 + +# x) x=$OPTARG ;; +while getopts ds:x opt +do + case "$opt" in + d) NSB_CONFIG_ALL=0;; + s) SRCD=$OPTARG ;; + x) NSB_CONFIG_ALL=1;; + \?)# unknown flag + usage;; + esac +done +shift `expr $OPTIND - 1` + +if [ $NSB_CONFIG_ALL -eq 2 ]; then + echo "You must specify -d or -x" + usage +fi + +if [ "x$SRCD" = "x" ]; then + for x in . $HOME/src/net-snmp + do + if [ -f $x/configure ]; then + SRCD=$x + break + fi + done + if [ "x$SRCD" = "x" ]; then + echo "Couldn't find a source directory. Please specify one for me." + usage + fi +fi + + +######################################################################## +######################################################################## +if [ $NSB_CONFIG_ALL -eq 0 ];then + nsb_config_dist $SRCD +else + nsb_config_all $SRCD +fi diff --git a/dist/nsb-functions b/dist/nsb-functions new file mode 100644 index 0000000..4865cc2 --- /dev/null +++ b/dist/nsb-functions @@ -0,0 +1,508 @@ +#!/bin/sh +#---------------------------------------------------------------------- +# $Id$ +# Author: Robert Story <rstory@freesnmp.com> + +#---------------------------------------------------------------------- +# +# source user config +if [ -f $HOME/.snmp/nsb-rc ]; then + . $HOME/.snmp/nsb-rc +fi + + +#---------------------------------------------------------------------- +# +nsb_sysname() +{ + echo `uname -mrs | tr ' /' '__'` +} + +#---------------------------------------------------------------------- +# +# Utility vars +# +NSB_VERSION=${NSB_VERSION:=""} +NSB_BUILD_DIR=${NSB_BUILD_DIR:=""} +NSB_BUILD_SUFFIX=${NSB_BUILD_SUFFIX:=""} +NSB_SRC_DIR=${NSB_SRC_DIR:=""} +NSB_INSTALL_DIR=${NSB_INSTALL_DIR:=""} +NSB_INSTALL_DIR_DEFAULT=${NSB_INSTALL_DIR_DEFAULT:="$NSB_BUILD_DIR/usr"} +NSB_PLATFORM=${NSB_PLATFORM:=`nsb_sysname`} +# sun doesn't support hostname -s +NSB_HOST=${NSB_HOST:=`hostname | cut -f1 -d.`} +NSB_QUIET=${NSB_QUIET:=0} +NSB_PROMPT=${NSB_PROMPT:=0} +NSB_CLEAN=${NSB_CLEAN:=1} +NSB_CONFIG_ALL=${NSB_CONFIG_ALL:=0} +NSB_SKIP_CONFIG=${NSB_SKIP_CONFIG:=0} +NSB_SKIP_BUILD=${NSB_SKIP_BUILD:=0} +NSB_SKIP_TEST=${NSB_SKIP_TEST:=0} +NSB_SKIP_INSTALL=${NSB_SKIP_INSTALL:=0} +NSB_ERR_CTX_LINES=${NSB_ERR_CTX_LINES:=25} +NSB_DIST_TRANSPORTS="UDP TCP Unix Callback" +NSB_EXTRA_TRANSPORTS="" +NSB_DIST_MODULES=${NSB_DIST_MODULES:="host disman/event-mib smux"} +NSB_EXTRA_MODULES=${NSB_EXTRA_MODULES:="examples examples/example smux Rmon"} +#testhandler +NSB_EXTRA_CONFIG=${NSB_EXTRA_CONFIG:=""} +NSB_PREFIX=${NSB_PREFIX:="/usr"} +NSB_EXTRA_INSTALL=${NSB_EXTRA_INSTALL:=""} +NSB_SHARED=${NSB_SHARED:="--enable-shared"} +NSB_VIEW=cat +NSB_FLOW= +NSB_DATE=${NSB_DATE:=`date +%y%m%d_%H%M`} + +## embedded perl +NSB_DIRLINK_DIRS="perl mibs include python" +NSB_PERL=${NSB_PERL:=""} +#NSB_PERL=${NSB_PERL:="--enable-embedded-perl"} +if [ "x$NSB_PERL" != "x" ]; then + NSB_SKIP_DIRLINK=${NSB_SKIP_DIRLINK:=0} +else + NSB_SKIP_DIRLINK=${NSB_SKIP_DIRLINK:=1} +fi + +# +# System specific additions +# +case `uname -s` in + + SunOS) + NSB_TAIL_ARGS="-$NSB_ERR_CTX_LINES" + ;; + + *) + NSB_TAIL_ARGS="-n $NSB_ERR_CTX_LINES" + ;; +esac + + +#---------------------------------------------------------------------- +# +# Utility functions +# + +nsb_abort() +{ + echo + echo "ABORTING: $@" >&2 + exit 255 +} + +nsb_info() +{ + if [ $NSB_QUIET -ne 1 ]; then + echo $@ + fi +} + +nsb_prompt() +{ + if [ "x$1" = "x-f" ]; then + shift 1 + tmp_nsb_prompt=1 + else + tmp_nsb_prompt=$NSB_PROMPT + fi + if [ $tmp_nsb_prompt -eq 1 ]; then + echo $@ + read nsb_prompt_dummy + else + echo "$@ (PROMPT SKIPPED)" + fi +} + +nsb_flow() +{ + NSB_FLOW=$NSB_FLOW:$@ + echo "Running $@" >&2 +} + +#---------------------------------------------------------------------- +# +nsb_config_dist() +{ + nsb_flow config_dist + if [ $# -lt 1 ]; then + nsb_abort "usage: nsb_config_dist src_dir" + fi + ngc_src=$1 + if [ ! -d $ngc_src ]; then + nsb_abort "$ngc_src does not exist!" + fi + if [ ! -d $ngc_src/agent/mibgroup ]; then + nsb_abort "agent/mibgroup directory in $ngc_src does not exist!" + fi + ngc_dest=$2 + if [ "X$ngc_dest" != "X" -a ! -d $ngc_dest ]; then + nsb_abort "$ngc_dest does not exist!" + fi + + # + # some modules might be release specific, so make sure they + # exist before we send them off to configure + # + NSB_FINAL_MODULES= + for ncd_x in $NSB_DIST_MODULES + do + if [ -r $ngc_src/agent/mibgroup/$ncd_x.h ]; then + NSB_FINAL_MODULES="$NSB_FINAL_MODULES $ncd_x" + fi + done + + # + # NOTE: for some reason, bash does not expand variables + # inside of single quotes, so use double quotes + # + echo $ngc_src/configure --with-sys-location=Unknown \ + --prefix="$NSB_PREFIX" \ + --disable-developer $NSB_EXTRA_CONFIG \ + --with-sys-contact='System Administrator' \ + --with-defaults --with-mib-modules="$NSB_FINAL_MODULES" + $ngc_src/configure --with-sys-location=Unknown \ + --prefix="$NSB_PREFIX" \ + --disable-developer $NSB_EXTRA_CONFIG \ + --with-sys-contact='System Administrator' \ + --with-defaults --with-mib-modules="$NSB_FINAL_MODULES" + # I'd like to add ' | tee nsb_config.$NSB_DATE' to save output, but then + # I'd lose the rc from configure, which I need... sigh + ngc_rc=$? + if [ $ngc_rc -ne 0 ];then + nsb_abort "Error during configure dist (rc=$ngc_rc)" + fi +} + +nsb_config_all() +{ + nsb_flow config_all + if [ $# -lt 1 ]; then + nsb_abort "usage: nsb_config_all src_dir" + fi + ngc_src=$1 + if [ ! -d $ngc_src ]; then + nsb_abort "$ngc_src does not exist!" + fi + if [ ! -d $ngc_src/agent/mibgroup ]; then + nsb_abort "agent/mibgroup directory in $ngc_src does not exist!" + fi + ngc_dest=$2 + if [ "X$ngc_dest" != "X" -a ! -d $ngc_dest ]; then + nsb_abort "$ngc_dest does not exist!" + fi + + # + # System specific additions + # + case `uname -s` in + + Linux) + NSB_IPV6=${NSB_IPV6:="--enable-ipv6"} + NSB_EXTRA_TRANSPORTS="IPX" + ;; + + #Darwin) + # ;; + + *) + NSB_IPV6=${NSB_IPV6:="--enable-ipv6"} + ;; + esac + + # + # use libwrap if we can find the header + # + if [ -f /usr/include/tcpd.h ]; then + NSB_LIBWRAP=${NSB_LIBWRAP:="--with-libwrap"} + NSB_EXTRA_CONFIG="$NSB_EXTRA_CONFIG $NSB_LIBWRAP" + fi + + # + # some modules might be release specific, so make sure they + # exist before we send them off to configure + # + NSB_FINAL_MODULES= + for ncd_x in $NSB_DIST_MODULES $NSB_EXTRA_MODULES + do + if [ -r $ngc_src/agent/mibgroup/$ncd_x.h ]; then + NSB_FINAL_MODULES="$NSB_FINAL_MODULES $ncd_x" + fi + done + + # + # configure + # + # NOTE: for some reason, bash does not expand variables + # inside of single quotes, so use double quotes + # + echo $ngc_src/configure --with-defaults \ + --prefix="$NSB_PREFIX" \ + --disable-developer $NSB_EXTRA_CONFIG \ + "--with-mib-modules=$NSB_FINAL_MODULES" \ + "--with-transports=$NSB_DIST_TRANSPORTS $NSB_EXTRA_TRANSPORTS" \ + $NSB_SHARED $NSB_IPV6 $NSB_PERL + $ngc_src/configure --with-defaults \ + --prefix="$NSB_PREFIX" \ + --disable-developer $NSB_EXTRA_CONFIG \ + "--with-mib-modules=$NSB_FINAL_MODULES" \ + "--with-transports=$NSB_DIST_TRANSPORTS $NSB_EXTRA_TRANSPORTS" \ + $NSB_SHARED $NSB_IPV6 $NSB_PERL + # I'd like to add ' | tee nsb_config.$NSB_DATE' to save output, but then + # I'd lose the rc from configure, which I need... sigh + ngc_rc=$? + if [ $ngc_rc -ne 0 ];then + nsb_abort "Error during configure all (rc=$ngc_rc)" + fi +} + +nsb_zip() +{ + if [ $# -ne 3 ]; then + nsb_abort "usage: $0 release build_directory dest_dir" + fi + + release=$1 + build_dir=$2 + dest_dir=$3 + + build=$build_dir/$NSB_PLATFORM + + if [ ! -d $build ]; then + nsb_abort "$build directory does not exist!" + fi + + if [ ! -d $build/usr ]; then + nsb_abort "install directory $build/usr directory does not exist!" + fi + + cd $build + + rm -f $dest_dir/$release-$NSB_PLATFORM.tar + nsb_info "tar cf $dest_dir/$release-$NSB_PLATFORM.tar usr" + tar cf $dest_dir/$release-$NSB_PLATFORM.tar usr + + nsb_info "gzip --best $dest_dir/$release-$NSB_PLATFORM.tar" + gzip --best $dest_dir/$release-$NSB_PLATFORM.tar + + if [ $NSB_QUIET -ne 1 ]; then + ls -lt $dest_dir + fi +} + +nsb_upload() +{ + build_dir=$1 + target=$2 + nsb_flow upload to $target: config.log configure-summary nsb_make-all.$NSB_DATE nsb_make-test.$NSB_DATE + dir=$PWD + cd $build_dir + /usr/bin/scp config.log configure-summary nsb_make-all.$NSB_DATE nsb_make-test.$NSB_DATE\ + $target + cd $dir +} + +nsb_dir_link() +{ + if [ $# -lt 2 ]; then + nsb_abort "usage: nsb_dir_link src_dir dst_dir" + fi + link_src_dir=$1 + link_dst_dir=$2 + if [ -d $link_src_dir ]; then + nsb_flow set up shadow directory $link_dst_dir + $NSB_DIRLINK $link_src_dir $link_dst_dir + rc=$? + if [ $rc -ne 0 ];then + nsb_abort "Error during nsb_dir_link (rc=$rc)" + fi + else + nsb_info "Skipping $link_src_dir" + fi + } + +nsb_make() +{ + nsb_flow make $1 + target=$1 + shift 1 + parms=$@ + + if [ "x$NSB_MAKE" = "x" ];then + #nsb_info "Searching for GNU make (set NSB_MAKE to skip this step)" + for p in `echo $PATH | tr ':' ' '` + do + #echo $p + if [ -x $p/make ];then + dummy=`$p/make --version 2>&1 | grep GNU` + if [ $? -eq 0 ];then + #nsb_info "using $p/make ($dummy)" + NSB_MAKE=$p/make + break + fi + fi + if [ -x $p/gmake ];then + dummy=`$p/gmake --version 2>&1 | grep GNU` + if [ $? -eq 0 ];then + #nsb_info "using $p/gmake ($dummy)" + NSB_MAKE=$p/gmake + break + fi + fi + done + if [ "x$NSB_MAKE" = "x" ];then + nsb_abort "GNU make not found. Set NSB_MAKE to your make executable." + fi + fi + + nsb_make_OUTPUT=nsb_make-$target.$NSB_DATE + nsb_info "Making $target... (log is $nsb_make_OUTPUT)" + # + if [ "x$target" = "xall" ]; then + $NSB_MAKE NOAUTODEPS=y touchit 2>&1 | tee $nsb_make_OUTPUT + fi + $NSB_MAKE $NSB_MAKE_EXTRA NOAUTODEPS=y start-flag $target $parms end-flag 2>&1 | tee -a $nsb_make_OUTPUT + # checking $? would only get us the rc from tee, which is useless + + nsb_info "Checking for errors..." + egrep -i "error|fail|warn|no such|exists|t find |ermission denied" $nsb_make_OUTPUT \ + > nsb_make-$target-allerrs.$NSB_DATE + # allow for a few exceptions + egrep -v -i "^ok|testing .*failure|[a-z&_](fail|error)|warn|error(mib|\.3)|(LOG|SNMP)_ERR|In function|= FAILURE|DEBUGMSG|/\*|static library .* is not portable" nsb_make-$target-allerrs.$NSB_DATE \ + > nsb_make-$target-errs.$NSB_DATE + if [ -s nsb_make-$target-errs.$NSB_DATE ]; then + nsb_prompt "press enter to view errors" +# grep ':' $nsb_make_OUTPUT > nsb_make-$target-errs2.$NSB_DATE +# tail -n $NSB_ERR_CTX_LINES nsb_make-$target-errs2.$NSB_DATE >&2 + tail $NSB_TAIL_ARGS nsb_make-$target-errs.$NSB_DATE >&2 + nsb_abort "Error(s) during make $target" + fi + + if [ -f build-in-progress-flag ];then + nsb_abort "make $target incomplete" + fi +} + +nsb_default_paths() +{ + if [ "x$NSB_VERSION" = "x" ]; then + NSB_VERSION="unknown-version" + fi + if [ "x$NSB_SRC_DIR" = "x" ]; then + NSB_SRC_DIR=$HOME/src/net-snmp-$NSB_VERSION + fi + if [ "x$NSB_BUILD_DIR" = "x" ]; then + NSB_BUILD_DIR=$HOME/build/$NSB_VERSION + if [ "x$NSB_SUFFIX" != "x" ]; then + NSB_BUILD_DIR=$NSB_BUILD_DIR/$NSB_SUFFIX + fi + fi + if [ "x$NSB_INSTALL_DIR" = "x" ]; then + NSB_INSTALL_DIR="$NSB_INSTALL_DIR_DEFAULT" + fi +} + +nsb_build() +{ + if [ $# -lt 5 ]; then + nsb_abort "usage: $0 release src_dir build_directory dest_dir config_all_flag ($@)" + fi + + nsb_config_all_flag=0 + release=$1 + src_dir=$2 + build_dir=$3 + dest_dir=$4 + nsb_config_all_flag=$5 + shift 5 + + nsb_flow build in $build_dir + nsb_flow host $NSB_HOST + nsb_flow platform $NSB_PLATFORM + + if [ ! -d $src_dir ]; then + nsb_abort "$src_dir does not exist!" + fi + + if [ ! -d $build_dir ]; then + mkdir $build_dir + if [ ! -d $build_dir ]; then + nsb_abort "$build_dir directory does not exist!" + fi + fi + + nsb_info "Changing directories to $build_dir" + cd $build_dir + + if [ $NSB_CLEAN -gt 0 ]; then + nsb_info "Cleaning up..." + if [ $NSB_CLEAN -eq 2 ];then + if [ "x$PWD" = "x/" ]; then + nsb_abort "Not running rm -fR from /" + fi + nsb_info "rm -fR * .[a-zA-Z]* > /dev/null 2>&1" + rm -fR * .[a-zA-Z]* > /dev/null 2>&1 + else + if [ "x$dest_dir" != "x" -a "x$dest_dir" != "x/" ]; then + nsb_info "rm -fR nsb_* $dest_dir > /dev/null 2>&1" + #rm -fR nsb_* $dest_dir > /dev/null 2>&1 + fi + if [ -f Makefile ]; then + nsb_make NOAUTODEPS=y distclean + nsb_build_rc=$? + if [ $nsb_build_rc -ne 0 ]; then + nsb_abort "Error during make distclean (rc=$nsb_build_rc)" + fi + fi + fi + fi + + if [ "X$dest_dir" != "X" -a ! -d $dest_dir ]; then + mkdir -p $dest_dir + if [ ! -d $dest_dir ]; then + nsb_abort "$dest_dir directory does not exist!" + fi + fi + + if [ $NSB_SKIP_DIRLINK -eq 1 ]; then + nsb_info "Skipping nsb_dir_link" + else + for d in $NSB_DIRLINK_DIRS; do + nsb_dir_link $src_dir/$d $build_dir/$d + done + fi + + if [ $NSB_SKIP_CONFIG -ne 1 ]; then + nsb_info "Configuring... (log is nsb_config.$NSB_DATE)" + if [ "x$nsb_config_all_flag" = "x0" ]; then + nsb_config_dist $src_dir "$dest_dir" + else + nsb_config_all $src_dir "$dest_dir" + fi + nsb_prompt "press enter to continue" + fi + + if [ $NSB_SKIP_BUILD -eq 1 ]; then + nsb_info "Skipping 'make all'" + else + nsb_make all + fi + + if [ $NSB_SKIP_TEST -eq 1 ]; then + nsb_info "Skipping 'make test'" + else + nsb_prompt "No errors found, press enter to run tests" + SNMP_TMPDIR_BASE=$build_dir/tests + export SNMP_TMPDIR_BASE + nsb_make test + fi + + if [ $NSB_SKIP_INSTALL -eq 1 ]; then + nsb_info "Skipping 'make install'" + else + nsb_prompt "No errors found, press enter to install" + # DESTDIR makes sure the perl stuff goes into $dest_dir, too + nsb_make install DESTDIR="$dest_dir" $NSB_EXTRA_INSTALL + fi + + return 0 +} diff --git a/dist/nsb-nightly b/dist/nsb-nightly new file mode 100755 index 0000000..3298a26 --- /dev/null +++ b/dist/nsb-nightly @@ -0,0 +1,188 @@ +#!/bin/sh +# +# $Id$ +# Author: Robert Story <rstory@freesnmp.com> +# +######################################################################## +######################################################################## + +usage() +{ + echo "Usage: $0 [optional params] VERSION" + echo "" + echo " optional params: [-x] [-s SRCD] [-b BUILDD] [-i INSTALLD]" + echo " [-h host] [-p path]" + echo " VERSION : release number (eg 5.2.2)" + echo " -s SRCDIR : soure directory [$HOME/src/net-snmp-VERSION]" + echo " -b BUILDD : build directory [$HOME/build/]" + echo " NOTE-platform will be appended to build directory" + echo " -i INSTALLD: install directory [$HOME/build/\$PLATFORM/usr]" + echo "" + echo " -x : configure extra features for pre-release testing" + echo " -C : don't source $HOME/.snmp/nsb-nightly" + echo "" + echo " -f : from address for email results" + echo " -e : address to email error results to" + echo " -o : address to email success results to" + echo " -h : host to upload results to" + echo " -p : path to upload results to" + exit 1 +} + +#set -x + +# make getopts work on Tru64 by respawning in Posix mode +if [ "`uname`" = "OSF1" -a "$BIN_SH" != "xpg4" ]; then + BIN_SH=xpg4 + export BIN_SH + exec $0 $* +fi + +# +# find nsb-platform based on the path to this script +# +EXE_PATH=`dirname $0` +if [ ! -f $EXE_PATH/nsb-functions ];then + if [ -f $HOME/bin/nsb-functions ]; then + EXE_PATH=$HOME/bin + elif [ -f nsb-functions ];then + EXE_PATH=$PWD + else + echo "Cannot find nsb-functions in $EXE_PATH, $HOME/bin or $PWD" + exit 1 + fi +fi + +if [ "x$1" = "x-C" ]; then + shift +else + if [ -f $HOME/.snmp/nsb-nightly ];then + . $HOME/.snmp/nsb-nightly + fi +fi + +######################################################################## +######################################################################## + +# -r : remove build dir before +# -R : remove build dir after +PARMS="$PARMS -r" +NIGHTLY_VERBOSE=0 +NSB_ERR_RESULTS_TO="" +NSB_OK_RESULTS_TO="" + +while getopts b:e:f:i:o:s:xh:p:v opt +do + case "$opt" in + b) NSB_BUILD_DIR=$OPTARG;; + e) NSB_ERR_RESULTS_TO=$OPTARG;; + f) NSB_FROM=$OPTARG;; + o) NSB_OK_RESULTS_TO=$OPTARG;; + i) PARMS="-i $OPTARG $PARMS";; + s) NSB_SRC_DIR=$OPTARG;; + h) NSB_SCP_HOST=$OPTARG + PARMS="-h $NSB_SCP_HOST $PARMS" + ;; + p) NSB_SCP_DEST=$OPTARG + PARMS="-p $NSB_SCP_DEST $PARMS" + ;; + x) PARMS="-x $PARMS";; + v) NIGHTLY_VERBOSE=1;; + \?)# unknown flag + usage;; + esac +done +shift `expr $OPTIND - 1` + +if [ $# -ne 1 ]; then + echo "expecting 1 argument, got $# ($@)" + usage +fi + +NSB_VERSION=$1 + +. $EXE_PATH/nsb-functions + +nsb_default_paths + +PARMS="$PARMS -b $NSB_BUILD_DIR -s $NSB_SRC_DIR" + +######################################################################## +######################################################################## +echo "Start: `date`" +echo "Running nsb-package $PARMS $NSB_VERSION" +if [ $NIGHTLY_VERBOSE = 1 ]; then + $EXE_PATH/nsb-package $PARMS $NSB_VERSION +else + $EXE_PATH/nsb-package $PARMS $NSB_VERSION > /dev/null +fi +RC=$? +echo "Finish: `date`" +cd $NSB_BUILD_DIR +case $RC in + 0) RESULT="Success" + NSB_RESULTS_TO=$NSB_OK_RESULTS_TO + FILES="" + ;; + *) RESULT="Error (rc $RC)" + NSB_RESULTS_TO=$NSB_ERR_RESULTS_TO + FILES=`ls nsb-make-*-errs.* 2>/dev/null` + if [ "x$NSB_SCP_HOST" != "x" ]; then + nsb_upload $NSB_BUILD_DIR $NSB_SCP_HOST:$NSB_SCP_DEST/$NSB_VERSION/$NSB_SUFFIX + fi + ;; +esac +echo "Result: $RESULT" + +if [ "x$NSB_RESULTS_TO" != "x" ]; then + SUBJECT="$NSB_VERSION $RESULT on $NSB_HOST ($NSB_PLATFORM)" + echo "Sending mail to $NSB_RESULTS_TO: $SUBJECT" + case `uname -s` in + OpenBSD|FreeBSD) # mail doesn't allow setting From + # seems to be in /usr/sbin, which isn't in all paths + PATH=/usr/sbin/:$PATH + echo "From: $NSB_FROM" > mail.results + echo "To: $NSB_RESULTS_TO" >> mail.results + # mail-related errors to OK address (usully buildmaster) + echo "Errors-To: $NSB_OK_RESULTS_TO" >> mail.results + echo "Subject: $SUBJECT" >> mail.results + echo "" >> mail.results + grep CONFIGURE_OPTIONS include/net-snmp/net-snmp-config.h|sed 's:/home/[^ ]*/build:$HOME:g' >> mail.results + echo "Result: $RESULT" >> mail.results + if [ "x$FILES" != "x" ]; then + cat $FILES >> mail.results + fi + sendmail -t < mail.results + ;; + SunOS) # no sendmail, no mail -s, need -t for To + echo "From: $NSB_FROM" > mail.results + # mail-related errors to OK address (usully buildmaster) + echo "Errors-To: $NSB_OK_RESULTS_TO" >> mail.results + echo "Subject: $SUBJECT" >> mail.results + echo "" >> mail.results + grep CONFIGURE_OPTIONS include/net-snmp/net-snmp-config.h|sed 's:/home/[^ ]*/build:$HOME:g' >> mail.results + echo "Result: $RESULT" >> mail.results + if [ "x$FILES" != "x" ]; then + cat $FILES >> mail.results + fi + mail -t $NSB_RESULTS_TO < mail.results + ;; + *) + echo "Result: $RESULT" >> mail.results + if [ "x$FILES" != "x" ]; then + cat $FILES >> mail.results + fi + mail -s "$SUBJECT" $NSB_RESULTS_TO < mail.results + ;; + esac +fi + +if [ $RC -eq 0 ]; then + if [ "x$NSB_BUILD_DIR" = "/" ]; then + nsb_abort "Not running rm -fR from /" + else + /bin/rm -fR $NSB_BUILD_DIR > /dev/null 2>&1 + fi +fi + +exit $RC diff --git a/dist/nsb-package b/dist/nsb-package new file mode 100755 index 0000000..f51c150 --- /dev/null +++ b/dist/nsb-package @@ -0,0 +1,137 @@ +#!/bin/sh +# +# $Id$ +# Author: Robert Story <rstory@freesnmp.com> +# +######################################################################## +######################################################################## + +usage() +{ + echo "Usage: $0 [params] VERSION" + echo "" + echo " params: [-c] [-d] [-P] [-s NSB_SRC_DIR] [-b BUILDD] [-i NSB_INSTALL_DIR]" + echo " [-h host] [-p path]" + echo "" + echo " VERSION : release number (eg 5.2.2)" + echo " -s NSB_SRC_DIR : source directory [$HOME/src/net-snmp-VERSION]" + echo " -b BUILDD : build directory [$HOME/build/]" + echo " NOTE-platform will be appended to build directory" + echo " -i NSB_INSTALL_DIR: install directory [$HOME/build/\$PLATFORM/usr]" + echo "" + echo " -x : configure extra features for pre-release testing" + echo " -c : skip configure" + echo " -d : dirty build (don't make distclean)" + echo " -m : skip 'make all'" + echo " -P : pause at prompts in between stages" + echo " -r : remove build dir (rm -fR) before build" + echo " -R : remove build dir (rm -fR) after successful build" + echo " -t : skip 'make test'" + echo " -C : don't source $HOME/.snmp/nsb-package" + echo "" + echo " -h : host to upload results to" + echo " -p : path to upload results to" + exit 1 +} + +#trap exit SIGINT + +#set -x + +# make getopts work on Tru64 by respawning in Posix mode +if [ "`uname`" = "OSF1" -a "$BIN_SH" != "xpg4" ]; then + BIN_SH=xpg4 + export BIN_SH + exec $0 $* +fi + +# +# find nsb-platform based on the path to this script +# +EXE_PATH=`dirname $0` +if [ ! -f $EXE_PATH/nsb-functions ];then + if [ -f $HOME/bin/nsb-functions ]; then + EXE_PATH=$HOME/bin + elif [ -f nsb-functions ];then + EXE_PATH=$PWD + else + echo "Cannot find nsb-functions in $EXE_PATH, $HOME/bin or $PWD" + exit 1 + fi +fi + +if [ "x$1" = "x-C" ]; then + shift +else + if [ -f $HOME/.snmp/nsb-package ];then + . $HOME/.snmp/nsb-package + fi +fi + +######################################################################## +######################################################################## + +REMOVE_SUCCESS=0 + +# x) x=$OPTARG ;; +while getopts b:cdh:i:mPp:rRs:tx opt +do + case "$opt" in + b) NSB_BUILD_DIR=$OPTARG ;; + c) NSB_SKIP_CONFIG=1 ;; + d) NSB_CLEAN=0 ;; + h) NSB_SCP_HOST=$OPTARG ;; + i) NSB_INSTALL_DIR=$OPTARG ;; + m) NSB_SKIP_BUILD=1 ;; + P) NSB_PROMPT=1 ;; + p) NSB_SCP_DEST=$OPTARG ;; + r) NSB_CLEAN=2 ;; + R) REMOVE_SUCCESS=1 ;; + s) NSB_SRC_DIR=$OPTARG ;; + t) NSB_SKIP_TEST=1 ;; + x) NSB_CONFIG_ALL=1;; + \?)# unknown flag + usage;; + esac +done +shift `expr $OPTIND - 1` + +if [ $# -ne 1 ]; then + echo "expecting 1 argument, got $# ($@)" + usage +fi + +NSB_VERSION=$1 + +. $EXE_PATH/nsb-functions + +nsb_default_paths + +if [ $NSB_CLEAN -eq 1 ]; then + if [ $NSB_SKIP_CONFIG -eq 1 ]; then + echo "A clean build also requires configuration (-d and -c" + echo "cannot both be specified)." + usage + fi +fi + + +######################################################################## +######################################################################## +nsb_prompt "press enter to build $NSB_SRC_DIR in $NSB_BUILD_DIR, and install in $NSB_INSTALL_DIR" +nsb_build $NSB_VERSION $NSB_SRC_DIR $NSB_BUILD_DIR $NSB_INSTALL_DIR $NSB_CONFIG_ALL +rc=$? +if [ "x$NSB_SCP_HOST" != "x" ]; then + nsb_upload $NSB_BUILD_DIR $NSB_SCP_HOST:$NSB_SCP_DEST/$NSB_VERSION/$NSB_HOST/ +fi +if [ $rc -eq 0 ] && [ $REMOVE_SUCCESS -eq 1 ];then + nsb_prompt "press enter to remove $NSB_BUILD_DIR" + if [ "x$NSB_BUILD_DIR" = "/" ]; then + nsb_abort "Not running rm -fR from /" + else + /bin/rm -fR $NSB_BUILD_DIR > /dev/null 2>&1 + fi +fi + +nsb_prompt "press enter to exit with rc $RC" +exit $rc diff --git a/dist/nsb-platform b/dist/nsb-platform new file mode 100755 index 0000000..a7550a3 --- /dev/null +++ b/dist/nsb-platform @@ -0,0 +1,27 @@ +#!/bin/sh +# +# $Id$ +# Author: Robert Story <rstory@freesnmp.com> +# +######################################################################## +######################################################################## + +# +# find nsb-platform based on the path to this script +# +EXE_PATH=`dirname $0` +if [ -f $EXE_PATH/nsb-functions ];then + . $EXE_PATH/nsb-functions +elif [ -f $HOME/bin/nsb-functions ]; then + . $HOME/bin/nsb-functions +elif [ -f nsb-functions ];then + . nsb-functions +else + echo "Cannot find nsb-functions in $EXE_PATH, $HOME/bin or $PWD" + exit 1 +fi + +######################################################################## +######################################################################## + +nsb_sysname diff --git a/dist/patme b/dist/patme new file mode 100755 index 0000000..0fd50ee --- /dev/null +++ b/dist/patme @@ -0,0 +1,351 @@ +#!/usr/bin/perl + +use Getopt::GUI::Long; +use QWizard; +use QWizard::API; +use Data::Dumper; +use Cwd; + +use Getopt::Std; +Getopt::GUI::Long::Configure(qw(display_help no_ignore_case)); + +use strict; + +our %opts = +( + 'd' => $ENV{'HOME'} . "/src/snmp/patme/", + 'b' => 'main,5.6,5.5,5.4,5.3', + 'p' => '-p0', +); + +# sets the order shown +our @codetrees = ('main', + '5.6', + '5.5', + '5.4', + '5.3', + '5.2', + '5.1', + '5.0', + 'UCD'); + +our %codetrees = ('5.0' => 'V5-0-patches', + '5.1' => 'V5-1-patches', + '5.2' => 'V5-2-patches', + '5.3' => 'V5-3-patches', + '5.4' => 'V5-4-patches', + '5.5' => 'V5-5-patches', + '5.6' => 'V5-6-patches', + 'main' => 'net-snmp', + 'UCD' => 'V4-2-patches'); + +our (@captures, $capfilt, $result, %captures, $capturenum); + +GetOptions(\%opts, + ['f|file=s', 'Patch file'], + ['d|base-directory=s', 'Base directory of checkouts'], + ['p|patch-args=s', 'Default patch arguments (-p1)'], + + ['GUI:separator', 'Patch application specifics;'], + ['b|braches=s', 'Branches to apply to (eg 5.1,5.2,...)'], + ['m|commit-msg=s', 'Default commit message to use'], + ['D|subdir=s', 'Apply patches to a subdirectory'], + ['u|no-update', 'Do not run svn status/update in the directory first. Only use this if it\'s known clean.'], + ); + +my %bs; +if ($opts{'b'}) { + map { $bs{$_} = 1; } split(/,\s*/,$opts{'b'}); +} +$opts{'d'} .= "/" if ($opts{'d'} !~ /\/$/); + +my $qw = new QWizard(); +my $pris = load_primaries(); +$qw->{'primaries'} = $pris; + +$qw->qwparam('svncommit',$opts{'m'}) if ($opts{'m'}); + +$qw->magic('top'); + +sub make_tops { + my @tops; + foreach my $k (@codetrees) { + push @tops, + qw_checkbox($k, "Apply to $k", 1, 0, + default => $qw->qwparam($k) || $bs{$k}, + override => 1); + } + return @tops; +} + +sub load_primaries { + my @tops = make_tops(); + return + { + top => + qw_primary('top','Select packages to apply the patch to:', '', + [@tops, + qw_text('basedir', 'Base code directory:', + default => $opts{'d'}), + qw_hidden('no_confirm',1), + qw_text('patchfile','Patch file:', default => $opts{f}, + check_value => sub { + return "patch file doesn't exist" if (! -f qwparam('patchfile')) + }), + qw_checkbox('noupdate','Don\'t run svn update/revert first:', + 1, 0, default => $opts{'u'} || 0)], + [],[],sub_modules => ['commit', 'commitmsg', 'maketest', + 'edit', 'applying', 'check', + 'patch_info']), + + patch_info => + qw_primary('check','Checking code directory status:', '', + [qw_paragraph('patch pieces:', + sub { capture("egrep '^(---|\\+\\+\\+)' " . + qwparam('patchfile'))}, + width => 80, + height => 30), + qw_text('patchargs','Patch arguments', + default => $opts{'p'}), + qw_text('subdir', 'Apply in package subdir:', + default => $opts{'D'}), + qw_paragraph('Note:','Hitting next below will first clean your local repositories which could take a bit (watch the console for deails on what it\'s doing at any moment)', doif => sub {!qwparam('noupdate')}), +]), + + + check => + qw_primary('check','Checking code directory status:', '', + [qw_paragraph('removed .rej files:', + sub { my $it = captureeachdir('find . -name \*.rej'); + captureeachdir('find . -name \*.rej | xargs rm -f'); + return $it; + }, + preformatted => 1, + width => 80, + height => 60, + ), + qw_paragraph('svn update:', + sub { + my ($res, $one); + foreach my $k (@codetrees) { + next if (!qwparam($k)); + $res .= "$k:\n"; + $one = capturedir($codetrees{$k}, + "svn update"); + $res .= $one; + $one = capturedir($codetrees{$k}, + "svn revert -R ."); + $res .= $one; + } + return $res; + }, + preformatted => 1, + width => 80, + height => 60, + doif => sub{!qwparam('noupdate')} + ) ], + ), + + applying => + qw_primary("applying", 'Applying patches to the code bases', '', + [{type => 'table', + text => 'Results:', + values => sub { + my @tab; + foreach my $k (@codetrees) { + next if (!qwparam($k)); + push @tab, [$k, + qw_paragraph("r$k","", + preformatted => 1, + width => 80, + height => 20, + values => + sub { my $cmd = "patch " . qwparam('patchargs') . " < " . qwparam('patchfile'); + my $results = "Running on $k: $cmd" . "\n" . capturedir($codetrees{$k},$cmd); + return $results})]; + } + return [\@tab]; + }}],[],[]), + + edit => + qw_primary('edit','Fix the following files:','', + [qw_paragraph('Fix these (maybe):', + sub { + $capfilt = '(.*.rej)'; + my $res = + captureeachdir('find . -name \*.rej'); + print Dumper(\%captures); + $capfilt = undef; + return $res; + }, + preformatted => 1, + width => 80, + height => 60, + ), + qw_label('failed files:', + sub { $capturenum = 0; + map { $capturenum += $#{$captures{$_}} + 1; + } (keys(%captures)); + return $capturenum; + }), + qw_checkbox('edithem','Open an editor on the failed files?', + 1, 0, doif => sub { return $capturenum > 0 }), + qw_text('editor','Editor:',default => $ENV{'EDITOR'} || 'vi', + doif => sub { return $capturenum > 0 })], + [sub { + if (qwparam('edithem')) { + foreach my $k (keys(%captures)) { + foreach my $f (@{$captures{$k}}) { + my $file = qwparam('basedir') . + $codetrees{$k} . + qwparam('subdir') . '/' . $f->[0]; + print STDERR "editing: $file\n"; + system(qwparam('editor') . " " . $file); + } + } + } + }] + ), + + maketest => + qw_primary("maketest", "Run make?",'', + [qw_checkbox('makeit','Run make?', 1, 0), + qw_checkbox('maketest', 'Run make test?', 1, 0) + ], + [sub { + if (qwparam('makeit') || qwparam('maketest')) { + $_[0]->add_todos(-early, 'domake'); + } + }] + ), + + domake => + qw_primary("domake", "Make results",'', + [qw_paragraph('Make results:', + sub { return captureeachdir('make'); }, + preformatted => 1, + width => 80, + height => 20, + doif => sub { qwparam('makeit') } + ), + qw_paragraph('Make test results:', + sub { return captureeachdir('make test'); }, + preformatted => 1, + width => 80, + height => 20, + doif => sub { qwparam('maketest') } + )] + ), + + commitmsg => + qw_primary("commitmsg", 'Commit info:', '', + [qw_text('svncommit','Commit message', + default => qwparam('svncommit') || $opts{'m'}), + {type => 'dynamic', + values => sub { my @tops = make_tops(1); return \@tops}}]), + + commit => + qw_primary("commit", 'running commit:', '', + [qw_paragraph('committing files:', + sub { my $msg = qwparam('svncommit'); + $msg =~ s/\'/\'\"\'\"\'/g; # escape 's + return capturedir($opts{'d'}, + 'svn commit -m \'' . $msg . '\' ' . get_codedirs_str()); }, + preformatted => 1, + width => 80, + height => 20, + )]), + + editing => + qw_primary("applying", 'Edit the following files:', '', + [{type => 'table', + text => 'Results:', + values => sub { return [\@captures]}, + }],[],[]) + } +} + +sub capture { + my $cmd = join(" ",@_); + my $results = "Running: $cmd\n"; + my @a; + print $results; + open(I,"$cmd 2>&1|"); + while (<I>) { + $results .= $_; + print $_; + if ($capfilt) { + print "capfilt: $capfilt\n"; + @a = /$capfilt/; + print " capfilt: @a\n"; + push @captures, [@a]; + } + } + close(I); + $result = $? >> 8; + $results .= "RESULT: " . (($result) ? "FAIL" : "SUCCESS") . "($result)\n"; + return $results; +} + +sub capturedir { + my $dir = shift; + $dir .= "/" if ($dir !~ /\/$/); + my $basedir = qwparam('basedir'); + $basedir .= "/" if ($basedir !~ /\/$/); + my $olddir = getcwd(); + my $newdir = "$basedir$dir" . qwparam('subdir'); + my $res = "changing to: $newdir\n"; + print $res; + chdir($newdir); + $res .= capture(@_); + chdir($olddir); + return $res; +} + +sub get_codedirs_str() { + my $res = ""; + foreach my $k (@codetrees) { + next if (!qwparam($k)); + $res .= " $opts{'d'}$codetrees{$k}"; + } + $res =~ s/^ //; + return $res; +} + +sub captureeachdir { + my $out; + %captures = (); + foreach my $k (@codetrees) { + next if (!qwparam($k)); + $out .= "$k:\n"; + $out .= capturedir($codetrees{$k}, @_) . "\n"; + if ($#captures > -1) { + @{$captures{$k}} = @captures; + @captures = (); + } + } + return $out; +} + +sub dodir { + my $text = shift; + return + [{type => 'table', + text => $text, + values => [[sub { + my @tab; + foreach my $k (@codetrees) { + next if (!qwparam($k)); + push @tab, [$k, + qw_paragraph("r$k","", + preformatted => 1, + width => 80, + height => 20, + values => + [[sub { $_->[0]($k)}, + @_]])]; + } + return [\@tab]; + }, @_]] + }]; +} diff --git a/dist/release b/dist/release new file mode 100644 index 0000000..6da7b93 --- /dev/null +++ b/dist/release @@ -0,0 +1,8 @@ +# +# Insert lines in this file to prevent the 'rollup' utility from +# applying patches to a given branch. Right now, the file should contain +# a branch name followed by 'rc' when the branch is in rc phase of a release. +# +V5-7-patches rc +V5-7-patches rc +V5-7-patches rc diff --git a/dist/run-autoconf b/dist/run-autoconf new file mode 100755 index 0000000..2969a59 --- /dev/null +++ b/dist/run-autoconf @@ -0,0 +1,32 @@ +#!/bin/sh + +version=`cat dist/autoconf-version` +prog='autoconf' +# TODO: accept a different tool (autoheader) from the command line + +searchprefixes="/usr/local" +for path in $searchprefixes ; do + if [ -d "$path/autoconf-$version" ]; then + prog="$path/autoconf-$version/bin/$prog" + break; + fi +done + +echo "trying $prog version" +echo "$prog --version" +toolversion=`$prog --version | head -1 | awk '{print $NF}'` + +echo "Expected: $version" +echo "Found: $toolversion" + +if [ "$version" != "$toolversion" ] ; then + echo "$prog doesn't match the expected version" + echo "" + echo "If you want this tool to auto-find versions, build the right" + echo "autoconf version using --prefix=/usr/local/autoconf-$version" + echo "and then re-run this tool ($0) once it's installed" + exit 1 +fi + +echo "Running $prog" +autoconf "$@" diff --git a/dist/schema-snmptrapd.sql b/dist/schema-snmptrapd.sql new file mode 100644 index 0000000..f496f17 --- /dev/null +++ b/dist/schema-snmptrapd.sql @@ -0,0 +1,31 @@ +USE net_snmp; +DROP TABLE IF EXISTS notifications; +CREATE TABLE IF NOT EXISTS `notifications` ( + `trap_id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `date_time` datetime NOT NULL, + `host` varchar(255) NOT NULL, + `auth` varchar(255) NOT NULL, + `type` ENUM('get','getnext','response','set','trap','getbulk','inform','trap2','report') NOT NULL, + `version` ENUM('v1','v2c', 'unsupported(v2u)','v3') NOT NULL, + `request_id` int(11) unsigned NOT NULL, + `snmpTrapOID` varchar(1024) NOT NULL, + `transport` varchar(255) NOT NULL, + `security_model` ENUM('snmpV1','snmpV2c','USM') NOT NULL, + `v3msgid` int(11) unsigned, + `v3security_level` ENUM('noAuthNoPriv','authNoPriv','authPriv'), + `v3context_name` varchar(32), + `v3context_engine` varchar(64), + `v3security_name` varchar(32), + `v3security_engine` varchar(64), + PRIMARY KEY (`trap_id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + + +DROP TABLE IF EXISTS varbinds; +CREATE TABLE IF NOT EXISTS `varbinds` ( + `trap_id` int(11) unsigned NOT NULL default '0', + `oid` varchar(1024) NOT NULL, + `type` ENUM('boolean','integer','bit','octet','null','oid','ipaddress','counter','unsigned','timeticks','opaque','unused1','counter64','unused2') NOT NULL, + `value` blob NOT NULL, + KEY `trap_id` (`trap_id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; diff --git a/dist/snmpd-init.d b/dist/snmpd-init.d new file mode 100755 index 0000000..bd15b00 --- /dev/null +++ b/dist/snmpd-init.d @@ -0,0 +1,73 @@ +#!/bin/sh +# +# snmpd This shell script takes care of starting and stopping +# the net-snmp SNMP daemon +# +# chkconfig: - 26 74 +# description: snmpd is net-snmp SNMP daemon. + +# Source function library. +. /etc/rc.d/init.d/functions + +# Source networking configuration. +. /etc/sysconfig/network + +# Check that networking is up. +[ "${NETWORKING}" = "no" ] && exit 0 + +RETVAL=0 +name="snmpd" +prog="/usr/local/sbin/snmpd" + +[ -x $prog -a -f /usr/local/share/snmp/snmpd.conf ] || exit 0 + +start() { + # Start daemons. + echo -n $"Starting $name: " + daemon $prog + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$name + return $RETVAL +} + +stop() { + # Stop daemons. + echo -n $"Shutting down $name: " + killproc $prog + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$name + return $RETVAL +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + status) + status $name + RETVAL=$? + ;; + restart|reload) + stop + start + RETVAL=$? + ;; + condrestart) + if [ -f /var/lock/subsys/$name ]; then + stop + start + RETVAL=$? + fi + ;; + *) + echo $"Usage: $0 {start|stop|restart|condrestart|status}" + exit 1 +esac + +exit $RETVAL diff --git a/dist/snmptrapd-init.d b/dist/snmptrapd-init.d new file mode 100644 index 0000000..8225242 --- /dev/null +++ b/dist/snmptrapd-init.d @@ -0,0 +1,73 @@ +#!/bin/sh +# +# snmptrapd This shell script takes care of starting and stopping +# the net-snmp SNMPTRAP daemon +# +# chkconfig: - 25 75 +# description: snmptrapd is net-snmp SNMPTRAP daemon. + +# Source function library. +. /etc/rc.d/init.d/functions + +# Source networking configuration. +. /etc/sysconfig/network + +# Check that networking is up. +[ "${NETWORKING}" = "no" ] && exit 0 + +RETVAL=0 +name="snmptrapd" +prog="/usr/local/sbin/snmptrapd" + +[ -x $prog ] || exit 0 + +start() { + # Start daemons. + echo -n $"Starting $name: " + daemon $prog + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$name + return $RETVAL +} + +stop() { + # Stop daemons. + echo -n $"Shutting down $name: " + killproc $prog + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$name + return $RETVAL +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + status) + status $name + RETVAL=$? + ;; + restart|reload) + stop + start + RETVAL=$? + ;; + condrestart) + if [ -f /var/lock/subsys/$name ]; then + stop + start + RETVAL=$? + fi + ;; + *) + echo $"Usage: $0 {start|stop|restart|condrestart|status}" + exit 1 +esac + +exit $RETVAL diff --git a/dist/svnup b/dist/svnup new file mode 100755 index 0000000..40353f0 --- /dev/null +++ b/dist/svnup @@ -0,0 +1,130 @@ +#!/bin/sh +# +# $Id: cvsup 15788 2007-01-24 13:49:38Z dts12 $ +# +TAG= +WO=0 +DEST= +TMPDIR=/tmp + +if [ "x$1" = "x-u" ]; then + DEST=$2 + shift 2 + + # gnu tar (as of 1.15.1) is unable to create portable tar archives, + # especially if long file names (>100 char) are present. + # star is a better replacement. + if [ -x /usr/bin/star ]; then + TAR='/usr/bin/star -Hustar -not -pat=*/.svn/* -c -f' + elif [ -x /bin/tar ]; then + TAR="/bin/tar --exclude=.svn -c -f" + echo "warning: star not available, using (less portable) tar..." + else + echo "neither /usr/bin/star nor /bin/tar found." + exit + fi +fi + +if [ $# -eq 0 ]; then + DIR=$PWD +else + if [ $# -ne 1 ]; then + echo "usage: $0 <working directory>" + exit + fi + DIR=$1 +fi + +if [ -z ${DIR##*/} ];then + DIR=${DIR%/*} +fi +SUBD=${DIR##*/} +PARENT=${DIR%*$SUBD} +#echo "$DIR = $PARENT + $SUBD" + +if [ ! -d $DIR ]; then + echo "no such directory '$DIR'" + exit +fi + +if [ ! -d $DIR/.svn ]; then + echo "'$DIR' has no .svn directory!" + exit +fi + +if [ ! -f $DIR/.svn/entries ]; then + echo "'$DIR' has no .svn/entries!" + exit +fi + +SVNURL=`svn info $DIR| grep URL|cut -f2 -d " "` +SVNTLD=`echo $SVNURL | sed 's:.*svnroot/net-snmp/\([^/]*\).*:\1:'` +if [ "x$SVNTLD" = "xtrunk" ]; then + TAG="main" +else + TAG=`echo $SVNURL | sed 's:.*svnroot/net-snmp/[^/]*/\([^/]*\).*:\1:'` +fi + +if [ ! -z $DEST ]; then + if [ -z $TAG ]; then + echo "no TAG found in $DIR!" + exit 1 + fi +fi + +COMMAND="svn update -q $SVNURL $DIR" + +if [ ! -w $DIR/.svn ]; then + if [ -O $DIR/.svn ]; then + WO=1 + echo "Making $DIR writable" + chmod -R u+w $DIR + fi +fi + +echo "Updating directory $DIR from $TAG..." +echo "$COMMAND" + +$COMMAND +rc=$? +if [ $rc -ne 0 ]; then + echo "svn command returned $?" +fi + +if [ $WO -eq 1 ]; then + echo "Making $DIR read-only" + chmod -R a-w $DIR +fi + +if [ ! -z $DEST ]; then + if [ $rc -ne 0 ]; then + echo "skipping upload due to rc $rc from svn command" + exit $rc + else + cd $DIR/.. + #echo $PWD + DATE=`date +%Y%m%d_%H%M` + SOURCE=net-snmp-svn-$TAG"_$DATE" + $TAR $TMPDIR/$SOURCE.tar $SUBD + rc=$? + if [ $rc -ne 0 ]; then + echo "skipping upload due to rc $rc from tar command" + rm -f $TMPDIR/$SOURCE.tar.gz + exit $rc + fi + gzip -f --best $TMPDIR/$SOURCE.tar + rc=$? + if [ $rc -ne 0 ]; then + echo "skipping upload due to rc $rc from gzip command" + rm -f $TMPDIR/$SOURCE.tar.gz + exit $rc + fi + scp $TMPDIR/$SOURCE.tar.gz $DEST + rc=$? + if [ $rc -ne 0 ]; then + echo "warning: rc $rc from scp command (tarball in $TMPDIR)" + else + rm -f $TMPDIR/$SOURCE.tar.gz + fi + fi +fi |