4
0

rules 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. #!/usr/bin/make -f
  2. # -*- makefile -*-
  3. # Sample debian/rules that uses debhelper.
  4. # GNU copyright 1997 to 1999 by Joey Hess.
  5. # Uncomment this to turn on verbose mode.
  6. export DH_VERBOSE=1
  7. # for hardening
  8. DPKG_EXPORT_BUILDFLAGS = 1
  9. include /usr/share/dpkg/buildflags.mk
  10. PACKAGE = nagios-plugins
  11. # These are used for cross-compiling and for saving the configure script
  12. # from having to guess our platform (since we know it already)
  13. include /usr/share/dpkg/architecture.mk
  14. DEBIANDIR=$(CURDIR)/debian
  15. NP_LIBEXEC:=/usr/local/nagios/libexec
  16. NP_DIR:=$(DEBIANDIR)/nagios-plugins
  17. PATH = /bin:/sbin:/usr/bin:/usr/sbin
  18. ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
  19. CFLAGS += -O0
  20. else
  21. CFLAGS += -O2
  22. endif
  23. ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
  24. INSTALL_PROGRAM += -s
  25. endif
  26. ifeq ($(DEB_HOST_ARCH_OS),linux)
  27. PING_CONFIGURE_ARGS = --with-ping-command="/bin/ping -4 -n -U -w %d -c %d %s" \
  28. --with-ping6-command="/bin/ping -6 -n -U -w %d -c %d %s"
  29. else
  30. PING_CONFIGURE_ARGS = --with-ping-command="/bin/ping -n -w %d -c %d %s" \
  31. --with-ping6-command="/bin/ping6 -n -w %d -c %d %s"
  32. endif
  33. config.status: configure
  34. export PATH=$(PATH)
  35. dh_testdir
  36. # if /proc is not mounted, check_nagios and check_procs are
  37. # silently omitted from build.
  38. @if ! [ -d /proc/$$$$ ]; then \
  39. echo "nagios-plugins needs a mounted /proc to correctly build"; \
  40. exit 1; \
  41. fi
  42. ln -sf /usr/share/misc/config.sub build-aux
  43. ln -sf /usr/share/misc/config.guess build-aux
  44. rm -f config.cache
  45. # Add here commands to configure the package.
  46. # Append 'All warnings', 'Immediate binding' and dpkg-buildflags flags
  47. CFLAGS="$$(DEB_CFLAGS_MAINT_APPEND='-Wall -Wl,-z,now' dpkg-buildflags --get CFLAGS)" \
  48. PATH_TO_APTGET=/usr/bin/apt-get \
  49. PGINCLUDE="-I`pg_config --includedir`" PGLIBS="-lpq -lcrypt" \
  50. ./configure \
  51. --disable-maintainer-mode \
  52. --host=$(DEB_HOST_GNU_TYPE) \
  53. --build=$(DEB_BUILD_GNU_TYPE) \
  54. --prefix=/usr \
  55. --mandir=/usr/share/man \
  56. --infodir=/usr/share/info \
  57. --libexecdir=${NP_LIBEXEC} \
  58. --with-perl=/usr/bin/perl \
  59. --with-openssl=/usr \
  60. --with-pgsql=/usr \
  61. --with-mysql=/usr \
  62. --with-proc-loadavg=/proc/loadavg \
  63. --with-ps-command="/bin/ps axwwo 'stat uid pid ppid vsz rss pcpu etime comm args'" \
  64. --with-ps-format="%s %d %d %d %d %d %f %s %s %n" \
  65. --with-ps-cols=10 \
  66. --with-ps-varlist="procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procetime,procprog,&pos" \
  67. $(PING_CONFIGURE_ARGS) \
  68. --with-nslookup-command="/usr/bin/nslookup -sil" \
  69. --with-uptime-command="/usr/bin/uptime" \
  70. --with-rpcinfo-command="/usr/sbin/rpcinfo" \
  71. --with-smbclient-command="/usr/bin/smbclient" \
  72. --with-snmpget-command="/usr/bin/snmpget" \
  73. --with-snmpgetnext-command="/usr/bin/snmpgetnext" \
  74. --with-qstat-command="/usr/bin/quakestat" \
  75. --with-fping-command="/usr/bin/fping" \
  76. --with-fping6-command="/usr/bin/fping6" \
  77. --with-ssh-command="/usr/bin/ssh" \
  78. --with-sudo-command="/usr/bin/sudo" \
  79. --with-mailq-command="/usr/bin/mailq" \
  80. --with-proc-meminfo="/proc/meminfo" \
  81. --with-dig-command="/usr/bin/dig" \
  82. --with-apt-get-command="/usr/bin/apt-get" \
  83. --enable-extra-opts \
  84. --disable-rpath
  85. build: build-arch build-indep
  86. build-arch: build-stamp
  87. build-indep: build-stamp
  88. build-stamp: config.status
  89. dh_testdir
  90. $(MAKE)
  91. touch build-stamp
  92. clean: really-clean
  93. really-clean:
  94. dh_testdir
  95. dh_testroot
  96. # Add here commands to clean up after the build process.
  97. [ ! -f Makefile ] || $(MAKE) distclean
  98. find -type d -name autom4te.cache -print0 | xargs -0 -r rm -rf \;
  99. -rm -f platform.h auto-include.h
  100. find -type d -name build -print0 | xargs -0 -r rm -rf \;
  101. find \( -name config.sub -o -name config.guess \) -print0 | xargs -0 -r rm -f \;
  102. -rm -f $(DEBIANDIR)/nagios-plugins-basic.postrm $(DEBIANDIR)/nagios-plugins-standard.postrm
  103. dh_clean
  104. install: build
  105. dh_testdir
  106. dh_testroot
  107. dh_prep
  108. dh_installdirs
  109. # Add here commands to install the package into debian/nagios-plugins.
  110. $(MAKE) install DESTDIR=${NP_DIR}
  111. $(MAKE) install-root DESTDIR=${NP_DIR}
  112. chmod 644 ${NP_DIR}${NP_LIBEXEC}/utils.pm
  113. # Build architecture-independent files here.
  114. binary-indep: build install
  115. dh_testdir -i
  116. dh_testroot -i
  117. dh_installchangelogs -i NEWS
  118. dh_installdocs -i
  119. dh_link -i
  120. dh_installexamples -i
  121. dh_installman -i
  122. dh_compress -i
  123. dh_fixperms -i
  124. dh_installdeb -i
  125. dh_gencontrol -i
  126. dh_md5sums -i
  127. dh_builddeb -i
  128. # Build architecture-dependent files here.
  129. binary-arch: build install
  130. dh_testdir -a
  131. dh_testroot -a
  132. dh_installchangelogs -a NEWS
  133. dh_installdocs -a
  134. dh_link -a
  135. dh_installexamples -a
  136. dh_installman -a
  137. dh_strip -a
  138. dh_compress -a
  139. dh_fixperms -a -X utils.pm
  140. dh_installdeb -a
  141. dh_shlibdeps -a
  142. dh_gencontrol -a
  143. dh_md5sums -a
  144. dh_builddeb -a
  145. binary: binary-indep binary-arch
  146. .PHONY: build clean binary-indep binary-arch binary install