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 2016-2023 Jim Klimov
16 # NUT 2.8.0+ is diligently tested to benefit from parallel builds and succeed
17 USE_PARALLEL_BUILD
= yes
19 include ..
/..
/..
/make-rules
/shared-macros.mk
22 COMPONENT_VERSION
= 2.8.1
24 COMPONENT_SUMMARY
= Network UPS Tools
(NUT
)
25 COMPONENT_DESCRIPTION
= Network UPS Tools
(NUT
) is a versatile power-device monitoring toolkit to facilitate safe shutdowns
26 COMPONENT_SRC
= $(COMPONENT_NAME
)-$(COMPONENT_VERSION
)
27 COMPONENT_ARCHIVE
= $(COMPONENT_SRC
).
tar.gz
28 COMPONENT_ARCHIVE_HASH
= \
29 sha256
:7da48ee23b1f0d8d72560bb0af84f5c5ae4dbe35452b84cb49840132e47f099c
30 COMPONENT_ARCHIVE_URL
= \
31 https
://github.com
/networkupstools
/$(COMPONENT_NAME
)/releases
/download
/v
$(COMPONENT_VERSION
)/$(COMPONENT_SRC
).
tar.gz
32 COMPONENT_PROJECT_URL
= https
://networkupstools.org
33 COMPONENT_FMRI
= system
/management
/$(COMPONENT_NAME
)
34 COMPONENT_CLASSIFICATION
= System
/Administration and Configuration
35 COMPONENT_LICENSE
= GPLv2
+
36 COMPONENT_LICENSE_FILE
= COPYING
38 include $(WS_MAKE_RULES
)/common.mk
40 CXXFLAGS
+= $(CXXFLAGS.
$(BITS
))
41 CFLAGS
+= $(CFLAGS.
$(BITS
))
43 # Drop *.8 man pages (we patch to regenerate them into *.1m - see patches/07-man.patch)
44 # Fix up upsmon.txt encoding that might have gone wrong into the 2.8.1 release tarball
45 COMPONENT_PREP_ACTION
= ( cd
$(SOURCE_DIR
) && PATH
="$(PATH)" .
/autogen.sh
&& cd docs
/man
&& rm -f
*.8 && { dos2unix upsmon.txt
> upsmon.txt.tmp
&& mv
-f upsmon.txt.tmp upsmon.txt
; } )
47 COMPONENT_PRE_CONFIGURE_ACTION
= ( $(CLONEY
) $(SOURCE_DIR
) $(@D
) )
49 # We deliver only 64-bit binaries
50 CONFIGURE_BINDIR
.64 = $(USRBINDIR
)
51 CONFIGURE_SBINDIR
.64 = $(USRSBINDIR
)
53 CONFIGURE_ENV
+= LDFLAGS
="$(LDFLAGS.64)"
55 CONFIGURE_OPTIONS
+= LDFLAGS
="$(LDFLAGS.64)"
57 CONFIGURE_OPTIONS
+= --disable-static
58 CONFIGURE_OPTIONS
+= --enable-shared
60 CONFIGURE_OPTIONS
+= --with-solaris-smf
=yes
61 CONFIGURE_OPTIONS
+= --with-solaris-init
=no
62 CONFIGURE_OPTIONS
+= --with-solaris-pkg-svr4
=no
63 CONFIGURE_OPTIONS
+= --with-solaris-pkg-ips
=no
65 CONFIGURE_OPTIONS
+= --with-systemdsystemunitdir
=no
66 CONFIGURE_OPTIONS
+= --with-systemdshutdowndir
=no
67 CONFIGURE_OPTIONS
+= --with-systemdtmpfilesdir
=no
69 CONFIGURE_OPTIONS
+= --with-user
=nut
70 CONFIGURE_OPTIONS
+= --with-group
=nut
71 CONFIGURE_OPTIONS
+= --sysconfdir
=/etc
/nut
72 CONFIGURE_OPTIONS
+= --sharedstatedir
=/usr
/share
/nut
73 CONFIGURE_OPTIONS
+= --datarootdir
=/usr
/share
/nut
74 CONFIGURE_OPTIONS
+= --with-hotplug-dir
=no
75 CONFIGURE_OPTIONS
+= --with-udev-dir
=no
77 # --with-statepath=PATH path for ups state files (${STATEPATH}, typically
79 # --with-altpidpath=PATH path for NUT driver/upsd .pid files not running as
81 # --with-pidpath=PATH Path for root-owned .pid files (${PIDPATH},
83 # --with-powerdownflag=PATH
84 # default path for upsmon POWERDOWNFLAG file
85 # (${POWERDOWNFLAG}, typically /etc/killpower)
86 CONFIGURE_OPTIONS
+= --with-pidpath
=/var
/run
/nut
87 CONFIGURE_OPTIONS
+= --with-altpidpath
=/var
/run
/nut
88 CONFIGURE_OPTIONS
+= --with-powerdownflag
=/var
/run
/nut
/killpower
89 CONFIGURE_OPTIONS
+= --with-statepath
=/var
/db
/nut
91 CONFIGURE_OPTIONS
+= --with-dev
92 CONFIGURE_OPTIONS
+= --with-libltdl
93 CONFIGURE_OPTIONS
+= --with-ssl
94 CONFIGURE_OPTIONS
+= --with-openssl
95 CONFIGURE_OPTIONS
+= --with-gd-includes
=-I
/usr
/include/gd2
97 CONFIGURE_OPTIONS
+= --libexecdir
=/usr
/lib
/nut
/bin
98 CONFIGURE_OPTIONS
+= --with-drvpath
=/usr
/lib
/nut
/bin
99 CONFIGURE_OPTIONS
+= --with-cgipath
=/usr
/lib
/nut
/cgi-bin
100 CONFIGURE_OPTIONS
+= --with-gd-libs
=-L
/usr
/lib
/$(MACH64
)
102 CONFIGURE_OPTIONS
+= --with-nut-scanner
=yes
104 # Minimize guesswork: these are features we can and do build and deliver in
105 # package manifest, so the build host must have relevant packages installed
106 CONFIGURE_OPTIONS
+= --with-serial
=yes
107 #CONFIGURE_OPTIONS += --with-usb=yes
108 CONFIGURE_OPTIONS
+= --with-usb
=libusb-1.0
109 CONFIGURE_OPTIONS
+= --with-modbus
=yes
110 CONFIGURE_OPTIONS
+= --with-neon
=yes
111 CONFIGURE_OPTIONS
+= --with-avahi
=yes
112 CONFIGURE_OPTIONS
+= --with-powerman
=yes
113 CONFIGURE_OPTIONS
+= --with-cgi
=yes
114 CONFIGURE_OPTIONS
+= --with-ipmi
=yes
115 CONFIGURE_OPTIONS
+= --with-freeipmi
=yes
117 # Likely we'll not have this backend working any time soon
118 CONFIGURE_OPTIONS
+= --with-linux_i2c
=no
119 CONFIGURE_OPTIONS
+= --with-macosx_ups
=no
121 # Note: Link with the correct ISA of net-snmp (for drivers) and gdlib (for cgi)
122 CONFIGURE_OPTIONS
+= --with-snmp
123 CONFIGURE_OPTIONS
+= --with-net-snmp-config
=$(USRBINDIR
)/net-snmp-config-
$(BITS
)
125 # Note: building the numerous documents of this projects is time-consuming
126 # and we only need one copy. Also, we don't ship "dblatex" (needed here for
127 # compiling PDFs) and probably don't require "html-chunked" chapters.
128 CONFIGURE_OPTIONS
+= --with-doc
="man=yes"
130 # NUT-Monitor GUI client
131 CONFIGURE_OPTIONS
+= --with-nut-monitor
=yes
132 CONFIGURE_OPTIONS
+= --with-pynut
=no
# we use PyNUTClient from PyPI
133 CONFIGURE_OPTIONS
+= --with-python2
=no
134 CONFIGURE_OPTIONS
+= --with-python
=python
$(PYTHON_VERSION
)
136 # Be sure package is squeaky clean
137 CONFIGURE_OPTIONS
+= --enable-Werror
--enable-warnings
--enable-Wcolor
138 CONFIGURE_OPTIONS
+= --enable-keep_nut_report_feature
139 CONFIGURE_OPTIONS
+= --enable-silent-rules
141 # What do we run in case of `make check`?
142 CONFIGURE_OPTIONS
+= --enable-spellcheck
143 # NUT Integration Test suite, can take time and might fail due
144 # to environment (busy ports, congested hsots and timeouts):
145 #CONFIGURE_OPTIONS += --enable-check-NIT
146 # No CPPCHECK here yet:
147 CONFIGURE_OPTIONS
+= --disable-cppcheck
149 CONFIGURE_OPTIONS
+= $(CONFIGURE_OPTIONS.
$(BITS
))
151 # Fiddle with packaging:
152 # * move man1m pages to target directory (see also patches/07-man.patch)
153 COMPONENT_POST_INSTALL_ACTION
+= \
154 $(MKDIR
) $(PROTOUSRSHAREMANDIR
)/man1m \
155 && $(MV
) $(PROTOUSRSHAREMANDIR
)/man1
/*.1m
$(PROTOUSRSHAREMANDIR
)/man1m
/ \
156 ||
{ echo
"FAILED to fix up man1m" >&2 ; exit
1; } ; \
158 # Manually added dependencies:
159 REQUIRED_PACKAGES
+= text
/asciidoc
160 REQUIRED_PACKAGES
+= library
/augeas-tools
162 # Auto-generated dependencies
163 PYTHON_REQUIRED_PACKAGES
+= library
/python
/pynutclient
164 PYTHON_REQUIRED_PACKAGES
+= library
/python
/pyqt5
165 PYTHON_REQUIRED_PACKAGES
+= runtime
/python
166 REQUIRED_PACKAGES
+= $(GCC_RUNTIME_PKG
)
167 REQUIRED_PACKAGES
+= $(GXX_RUNTIME_PKG
)
168 REQUIRED_PACKAGES
+= library
/gd
169 REQUIRED_PACKAGES
+= library
/libmodbus
170 REQUIRED_PACKAGES
+= library
/libtool
/libltdl
171 REQUIRED_PACKAGES
+= library
/libusb-1
172 REQUIRED_PACKAGES
+= library
/neon
173 REQUIRED_PACKAGES
+= library
/security
/openssl-31
174 REQUIRED_PACKAGES
+= shell/ksh93
175 REQUIRED_PACKAGES
+= system
/library
176 REQUIRED_PACKAGES
+= system
/library
/math
177 REQUIRED_PACKAGES
+= system
/management
/freeipmi
178 REQUIRED_PACKAGES
+= system
/management
/powerman
179 REQUIRED_PACKAGES
+= system
/management
/snmp
/net-snmp