actions.py 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. #
  4. # Licensed under the GNU General Public License, version 3.
  5. # See the file http://www.gnu.org/licenses/gpl.txt
  6. from pisi.actionsapi import autotools
  7. from pisi.actionsapi import pisitools
  8. from pisi.actionsapi import pythonmodules
  9. from pisi.actionsapi import perlmodules
  10. from pisi.actionsapi import shelltools
  11. from pisi.actionsapi import get
  12. shelltools.export("PYTHONDONTWRITEBYTECODE", "1")
  13. MIBS = "host agentx smux \
  14. ucd-snmp/diskio tcp-mib udp-mib mibII/mta_sendmail \
  15. ip-mib/ipv4InterfaceTable ip-mib/ipv6InterfaceTable \
  16. ip-mib/ipAddressPrefixTable/ipAddressPrefixTable \
  17. ip-mib/ipDefaultRouterTable/ipDefaultRouterTable \
  18. ip-mib/ipv6ScopeZoneIndexTable ip-mib/ipIfStatsTable \
  19. sctp-mib rmon-mib etherlike-mib"
  20. def setup():
  21. autotools.autoreconf("-vfi")
  22. autotools.configure('--enable-shared \
  23. --disable-static \
  24. --without-rpm \
  25. --with-sys-location=Unknown \
  26. --with-sys-contact=root@Unknown \
  27. --with-default-snmp-version=3 \
  28. --with-logfile=/var/log/snmpd.log \
  29. --with-persistent-directory=/var/lib/net-snmp \
  30. --with-mib-modules="%s" \
  31. --enable-ipv6 \
  32. --enable-ucd-snmp-compatibility \
  33. --with-openssl \
  34. --with-pic \
  35. --enable-embedded-perl \
  36. --with-libwrap \
  37. --enable-as-needed \
  38. --without-root-access \
  39. --enable-mfd-rewrites \
  40. --with-temp-file-pattern="/run/net-snmp/snmp-tmp-XXXXXX" \
  41. --enable-local-smux' % MIBS)
  42. pisitools.dosed("libtool", " -shared ", " -Wl,-O1,--as-needed -shared ")
  43. def build():
  44. autotools.make("-j1")
  45. shelltools.cd("python")
  46. pythonmodules.compile("--basedir=..")
  47. def install():
  48. autotools.rawInstall("DESTDIR=%s" % get.installDIR())
  49. shelltools.cd("python")
  50. pythonmodules.install('--skip-build --basedir=..')
  51. shelltools.cd("..")
  52. pisitools.insinto("/etc/snmp/", "EXAMPLE.conf", "snmpd.conf.example")
  53. pisitools.dodir("/var/lib/net-snmp")
  54. pisitools.dodir("/etc/snmp")
  55. pisitools.dodoc("AGENT.txt", "ChangeLog", "FAQ", "NEWS", "PORTING", "README*", "TODO")
  56. perlmodules.removePacklist()
  57. perlmodules.removePodfiles()