Makefile 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # $OpenBSD: Makefile,v 1.41 2017/05/30 21:05:44 sthen Exp $
  2. COMMENT = auto-discovering network management/monitoring system
  3. GH_ACCOUNT = librenms
  4. GH_PROJECT = librenms
  5. # used below
  6. GH_TAGNAME = 1.28
  7. EPOCH = 0
  8. CATEGORIES = net www
  9. HOMEPAGE = http://www.librenms.org/
  10. MAINTAINER = Stuart Henderson <sthen@openbsd.org>
  11. # GPLv3+
  12. PERMIT_PACKAGE_CDROM = Yes
  13. MODULES = lang/php \
  14. lang/python
  15. MODPY_BUILDDEP = No
  16. RUN_DEPENDS = databases/py-mysql \
  17. lang/php/${MODPHP_VERSION},-curl \
  18. lang/php/${MODPHP_VERSION},-gd \
  19. lang/php/${MODPHP_VERSION},-mcrypt \
  20. lang/php/${MODPHP_VERSION},-mysql \
  21. lang/php/${MODPHP_VERSION},-mysqli \
  22. lang/php/${MODPHP_VERSION},-snmp \
  23. net/fping \
  24. net/mtr \
  25. net/net-snmp \
  26. net/nmap \
  27. net/pear-Net-IPv4 \
  28. net/pear-Net-IPv6 \
  29. net/rrdtool \
  30. shells/bash \
  31. sysutils/ipmitool
  32. NO_BUILD = Yes
  33. NO_TEST = Yes
  34. PKG_ARCH = *
  35. PREFIX = /var/www
  36. INSTDIR = ${PREFIX}/librenms
  37. SUBST_VARS = INSTDIR MODPHP_BIN
  38. R = s,^\#!( )?(/usr/bin/env |/bin/)bash,\#!${LOCALBASE}/bin/bash,;
  39. R += s,^\#!( )?/usr/bin/(env )?python.*,\#!${MODPY_BIN},;
  40. R += s,^\#!( )?/usr/bin/(env )?php,\#!${MODPHP_BIN},;
  41. R += s,/opt/librenms,/var/www/librenms,g;
  42. R += s,/var/www/librenms,${TRUEPREFIX}/librenms,g;
  43. R += s,/usr/local,${LOCALBASE},g
  44. post-extract:
  45. find ${WRKSRC} -type f -print0 | xargs -r0 perl -pi -e '$R'
  46. do-install:
  47. ${INSTALL_DATA_DIR} ${INSTDIR}
  48. cd ${WRKSRC}; pax -rw . ${INSTDIR}
  49. find ${INSTDIR} -name '*.orig' -print0 | xargs -r0 rm
  50. mkdir -p ${INSTDIR}/{rrd,logs}
  51. cd ${INSTDIR}; sed -i 's,%PHP%,${MODPHP_BIN},' daily.sh poller-wrapper.py validate.php; \
  52. sed -i 's,%LNMS_VERSION%,${GH_TAGNAME},' html/pages/about.inc.php
  53. cp /usr/share/snmp/mibs/OPENBSD-* ${INSTDIR}/mibs/
  54. rm -r ${INSTDIR}/tests
  55. .include <bsd.port.mk>