2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL"), version 1.0.
4 # You may only use this file in accordance with the terms of version
7 # A full copy of the text of the CDDL should have accompanied this
8 # source. A copy of the CDDL is also available via the Internet at
9 # http://www.illumos.org/license/CDDL.
13 # Copyright 2023 Marcel Telka
16 include ..
/..
/..
/make-rules
/shared-macros.mk
18 COMPONENT_NAME
= nagios-plugins
19 COMPONENT_VERSION
= 2.4.12
20 COMPONENT_SUMMARY
= Nagios Plugins
21 COMPONENT_PROJECT_URL
= https
://github.com
/nagios-plugins
/nagios-plugins
22 COMPONENT_FMRI
= system
/management
/nagios
/plugins
23 COMPONENT_CLASSIFICATION
= System
/Enterprise Management
24 COMPONENT_SRC
= $(COMPONENT_NAME
)-$(COMPONENT_VERSION
)
25 COMPONENT_ARCHIVE
= $(COMPONENT_SRC
).
tar.gz
26 COMPONENT_ARCHIVE_URL
= \
27 $(COMPONENT_PROJECT_URL
)/releases
/download
/release-
$(COMPONENT_VERSION
)/$(COMPONENT_ARCHIVE
)
28 COMPONENT_ARCHIVE_HASH
= \
29 sha256
:9a246245d8270f15759763160c48df5dcdc2af9632733a5238930fde6778b578
30 COMPONENT_LICENSE
= GPL-3.0
-only
31 COMPONENT_LICENSE_FILE
= COPYING
33 include $(WS_MAKE_RULES
)/common.mk
35 # This is needed to be able to run tests
36 COMPONENT_PRE_CONFIGURE_ACTION
+= ( $(CLONEY
) $(SOURCE_DIR
) $(@D
) )
39 LD_OPTIONS
+= -R
$(PG_LIBDIR
)
40 LD_OPTIONS
+= -R
$(MYSQL_LIBDIR
)
42 # specify where to find openssl
43 CFLAGS
+= -I
$(OPENSSL_INCDIR
)
44 LDFLAGS
+= -L
$(OPENSSL_LIBDIR
)
46 CONFIGURE_OPTIONS
+= --libexecdir
=$(CONFIGURE_PREFIX
)/libexec
/nagios-plugins
47 CONFIGURE_OPTIONS
+= --enable-libtap
48 CONFIGURE_OPTIONS
+= --with-pgsql
=$(PG_HOME
)
49 CONFIGURE_OPTIONS
+= --with-mysql
=$(MYSQL_HOME
)
50 CONFIGURE_OPTIONS
+= --without-dbi
51 CONFIGURE_OPTIONS
+= --without-radius
52 CONFIGURE_OPTIONS
+= --without-smbclient-command
53 CONFIGURE_OPTIONS
+= --without-qmail-qstat-command
54 CONFIGURE_OPTIONS
+= --without-smtpctl-command
56 # pst3 needs to be manually installed
57 COMPONENT_POST_INSTALL_ACTION
+= $(CP
) $(@D
)/plugins-root
/pst3
$(PROTOUSRDIR
)/libexec
/nagios-plugins
;
59 # charset.alias is provided by library/glib2/charset-alias package
60 COMPONENT_POST_INSTALL_ACTION
+= $(RM
) $(PROTOUSRLIBDIR.
$(BITS
))/charset.alias
;
63 # To run tests successfully you need to fulfil these prerequisites:
65 # 1) run tests as regular (non-root) user with the net_icmpaccess additional privileges:
66 # usermod -K defaultpriv=basic,net_icmpaccess USERNAME
67 # 2) the machine must be connected to internet
68 # 3) there should be no 10.0.0.1 host reachable
69 # 4) sshd must be running on localhost:22 (service svc:/network/ssh:default must be online)
70 # 5) you must be able to ssh to localhost using a key in ~/.ssh/id_dsa:
71 # - create the key (without password):
72 # ssh-keygen -q -t ed25519 -N "" -f ~/.ssh/id_dsa
73 # - add the key to your ~/.ssh/authorized_keys:
74 # chmod +w ~/.ssh/authorized_keys
75 # cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
76 # chmod -w ~/.ssh/authorized_keys
77 # - add the key to your authentication agent:
78 # ssh-add ~/.ssh/id_dsa
79 # - disable host authentication for localhost:
80 # echo 'NoHostAuthenticationForLocalhost yes' > ~/.ssh/config
81 # 6) prepare two filesystems with different free space (run following as root):
82 # mkdir /tmp/nagios-plugins-test
83 # cd /tmp/nagios-plugins-test
85 # lofiadm -a f1 /dev/lofi/101
86 # lofiadm -a f2 /dev/lofi/102
87 # mkfs -F ufs -onbpi=65536 /dev/rlofi/101 204600
88 # mkfs -F ufs -onbpi=65536 /dev/rlofi/102 204600
90 # mount /dev/lofi/101 1
91 # mount /dev/lofi/102 2
94 # 7) mariadb server must be running on localhost (service svc:/application/database/mariadb:version_106 must be online)
95 # 8) grant the SLAVE MONITOR rights (run following as root):
96 # mysql -e 'GRANT SLAVE MONITOR ON *.* TO ""@localhost' mysql
97 # 9) NTP service must be fully working on localhost (service svc:/network/ntp:default must be online)
98 # 10) SNMP service must be running on localhost (service svc:/application/management/net-snmp:default must be online)
100 COMPONENT_TEST_TARGETS
= test
102 # Make sure we test with the well known configuration
103 COMPONENT_TEST_ENV
+= NPTEST_CACHE
=$(COMPONENT_DIR
)/files
/NPTest.cache
105 # Normalize test results
106 COMPONENT_TEST_TRANSFORMS
+= "-e 's/, *[0-9]* wallclock.*//'" # delete timings
107 COMPONENT_TEST_TRANSFORMS
+= "-e '/^make\[/d'" # delete make logs
109 # Manually added dependencies
110 REQUIRED_PACKAGES
+= $(MYSQL_CLIENT_PKG
)
111 REQUIRED_PACKAGES
+= $(PG_DEVELOPER_PKG
)
112 REQUIRED_PACKAGES
+= diagnostic
/fping
113 TEST_REQUIRED_PACKAGES.perl
+= library
/perl-5
/crypt-x509
114 TEST_REQUIRED_PACKAGES.perl
+= library
/perl-5
/libwww-perl
115 TEST_REQUIRED_PACKAGES.perl
+= library
/perl-5
/text-glob
116 TEST_REQUIRED_PACKAGES.perl
+= library
/perl-5
/timedate
118 # Auto-generated dependencies
119 REQUIRED_PACKAGES
+= $(MYSQL_LIBRARY_PKG
)
120 REQUIRED_PACKAGES
+= $(OPENSSL_PKG
)
121 REQUIRED_PACKAGES
+= $(PG_LIBRARY_PKG
)
122 REQUIRED_PACKAGES
+= runtime
/perl
123 REQUIRED_PACKAGES
+= shell/ksh93
124 REQUIRED_PACKAGES
+= system
/library
125 REQUIRED_PACKAGES
+= system
/library
/math