Adding a flag to net-snmp to cut down some of the cruft for embedded use. Rationalile: On a compact flash devices I install net-snmp but only the snmpd, snmptrapd and MIB's. No perl or anything else. I'm hoping we can follow in the footsteps of vim and make use of USE=minimal to emulate this behavior. Attaching patch shortly.
Created attachment 38031 [details, diff] net-snmp-5.1.1-r2.ebuild.diff basic idea for the patch (not tested yet)
If I could spell correctly that word in comment #1 would of been 'Rationale'
First patch misses. /usr/bin/net-snmp-config /usr/bin/snmpcheck /usr/bin/fixproc /usr/bin/snmpconf /usr/bin/traptoemail I'll do another as I also don't want/need the ipvs MIB's unless we are doing ipv6.
Will these modifications work on a regular arch install rather than specifically embedded/uclibc? Also, what key things are you trying to keep in the minimal install? Just curious! :)
I'm also wondering about this dep of <sys-libs/db-2 Here local !minimal? ( <sys-libs/db-2 ) seems to do the job just fine. Also the RDEPEND of sed4 seems incorrect, but I'm not seeing an easy work aaround that does not include a rewrite of your RDEPEND=$DEPEND string. The goal here is to have nearly just the bare bones runtime minimal needed to snmp monitor a device such as a wrt54g where you have limited flash size. So the goal is SIZE. There are deeper modifcations I'd like do as well but I think that will & should be limited to another USE flag and or FEATURE= Probably a FEATURE as we really would not need the .a files and or the .h files on an embedded system.
Yeah this change would be arch agnostic.
Great, thanks for clarifying that! Looks good so far, I hope it'll all work out!
Created attachment 38055 [details, diff] net-snmp-5.1.1-r1.ebuild.diff I'm happy with this if you are. I can commit it or you can. (your call)
This is the final result by the way. [ebuild R ] net-analyzer/net-snmp-5.1.1-r2 -X -ipv6 -lm_sensors +minimal -perl -ssl -tcpd 0 kB uCpie net-snmp # epm -q -l net-snmp | grep -v /usr/include/ /usr/lib/libnetsnmp.la /usr/lib/libnetsnmp.a /usr/lib/libsnmp.la /usr/lib/libsnmp.a /usr/lib/libnetsnmpagent.la /usr/lib/libnetsnmpmibs.la /usr/lib/libnetsnmpagent.a /usr/lib/libnetsnmpmibs.a /usr/lib/libnetsnmphelpers.la /usr/lib/libnetsnmphelpers.a /usr/lib/libnetsnmptrapd.la /usr/lib/libnetsnmptrapd.a /usr/sbin/snmpd /usr/sbin/snmptrapd /usr/share/snmp/mibs/RFC1155-SMI.txt /usr/share/snmp/mibs/RFC1213-MIB.txt /usr/share/snmp/mibs/RFC-1215.txt /usr/share/snmp/mibs/SNMPv2-CONF.txt /usr/share/snmp/mibs/SNMPv2-SMI.txt /usr/share/snmp/mibs/SNMPv2-TC.txt /usr/share/snmp/mibs/SNMPv2-TM.txt /usr/share/snmp/mibs/SNMPv2-MIB.txt /usr/share/snmp/mibs/SNMP-FRAMEWORK-MIB.txt /usr/share/snmp/mibs/SNMP-MPD-MIB.txt /usr/share/snmp/mibs/SNMP-TARGET-MIB.txt /usr/share/snmp/mibs/SNMP-NOTIFICATION-MIB.txt /usr/share/snmp/mibs/SNMP-PROXY-MIB.txt /usr/share/snmp/mibs/SNMP-USER-BASED-SM-MIB.txt /usr/share/snmp/mibs/SNMP-VIEW-BASED-ACM-MIB.txt /usr/share/snmp/mibs/SNMP-COMMUNITY-MIB.txt /usr/share/snmp/mibs/IF-MIB.txt /usr/share/snmp/mibs/IF-INVERTED-STACK-MIB.txt /usr/share/snmp/mibs/EtherLike-MIB.txt /usr/share/snmp/mibs/IP-MIB.txt /usr/share/snmp/mibs/IP-FORWARD-MIB.txt /usr/share/snmp/mibs/TCP-MIB.txt /usr/share/snmp/mibs/UDP-MIB.txt /usr/share/snmp/mibs/INET-ADDRESS-MIB.txt /usr/share/snmp/mibs/HCNUM-TC.txt /usr/share/snmp/mibs/HOST-RESOURCES-MIB.txt /usr/share/snmp/mibs/HOST-RESOURCES-TYPES.txt /usr/share/snmp/mibs/RMON-MIB.txt /usr/share/snmp/mibs/DISMAN-SCRIPT-MIB.txt /usr/share/snmp/mibs/DISMAN-SCHEDULE-MIB.txt /usr/share/snmp/mibs/NOTIFICATION-LOG-MIB.txt /usr/share/snmp/mibs/AGENTX-MIB.txt /usr/share/snmp/mibs/SMUX-MIB.txt /usr/share/snmp/mibs/IANAifType-MIB.txt /usr/share/snmp/mibs/IANA-LANGUAGE-MIB.txt /usr/share/snmp/mibs/IANA-ADDRESS-FAMILY-NUMBERS-MIB.txt /usr/share/snmp/mibs/NET-SNMP-TC.txt /usr/share/snmp/mibs/NET-SNMP-MIB.txt /usr/share/snmp/mibs/NET-SNMP-AGENT-MIB.txt /usr/share/snmp/mibs/NET-SNMP-EXAMPLES-MIB.txt /usr/share/snmp/mibs/UCD-SNMP-MIB.txt /usr/share/snmp/mibs/UCD-DEMO-MIB.txt /usr/share/snmp/mibs/UCD-IPFWACC-MIB.txt /usr/share/snmp/mibs/UCD-DLMOD-MIB.txt /usr/share/snmp/mibs/UCD-DISKIO-MIB.txt /etc/init.d/snmpd /etc/conf.d/snmpd /etc/snmp/.keep /var/lib/net-snmp/.keep -- *.a, *.la and *.h files will be handled by another FEATURE= somewhere else down the line probably in ebuild.sh so it's transparent to the packages themselves.
Committed USE=minimal changes to the tree. If any bugs arise please CC: me. Please test that this package (-r1) can be marked stable if you can. Changes from net-snmp-5.1.1 -> net-snmp-5.1.1-r1 only include two USE flags 'lm_sensors' and 'minimal' Current keywords are net-snmp-5.1.1: KEYWORDS="x86 ppc sparc alpha arm ~hppa amd64 ~ia64 s390 ppc64" net-snmp-5.1.1-r1: KEYWORDS="~x86 ~ppc ~sparc ~alpha ~arm hppa ~amd64 ~ia64 ~s390 ~ppc64"
Added description to use.local.desc
reopening bug
sorry reopened the wrong bug