Commit Graph

47 Commits

Author SHA1 Message Date
Jeffery To 53e1692ae9 treewide: Use default PKG_BUILD_DIR when possible
This removes lines that set PKG_BUILD_DIR when the set value is no
different from the default value.

Specifically, the line is removed if the assigned value is:

* $(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)

  The default PKG_BUILD_DIR was updated[1] to incorporate BUILD_VARIANT
  if it is set, so now this is identical to the default value.

* $(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_SOURCE_SUBDIR)

  if PKG_SOURCE_SUBDIR is set to $(PKG_NAME)-$(PKG_VERSION), making it
  the same as the previous case

* $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)

  This is the same as the default PKG_BUILD_DIR when there is no
  BUILD_VARIANT.

* $(BUILD_DIR)/[name]-$(PKG_VERSION)

  where [name] is a string that is identical to PKG_NAME

[1]: https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=e545fac8d968864a965edb9e50c6f90940b0a6c9

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2019-10-13 02:01:34 +08:00
Rosen Penev 81e6bb77cf
nut: Switch to pkgconfig for finding libgd
nut uses gdlib-config to find libgd, which happens to be deprecated. This
switches it to use pkgconfig and allows a fallback to gdlib-config, same
as the libusb check.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-09-13 12:56:43 -07:00
Sven Eckelmann bbb1ea7345 treewide: Change .*GPL.*+ licenses to SPDX compatible identifier
The CONTRIBUTING.md requests an (or multiple) SPDX identifier for GPL
licenses. But a lot of packages did use a different, non-SPDX style with a
"+" at the end instead of "-or-later".

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-09-10 07:45:15 +02:00
Daniel F. Dickinson c25b751041 nut: Actually do FSD when required
The code was all there but the call do the function containing it was missing,
so call the function so that forced (UPS) shutdown occurs on a battery critical
or manually requested FSD situation.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2019-04-28 20:44:15 +00:00
Daniel F. Dickinson d7db15459f nut: initscripts hotplug: Fix many small semantic issues
Small but important tweaks to fix the operation of the nut initscripts
and hotplug scripts.  All hail shellcheck and proofreading and
dogfooding.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2019-01-20 12:16:28 -05:00
Daniel F. Dickinson c8cc504efe nut: Fix procd crashloop no interfaces
Fix a crashloop under procd when attempting to bind
to any address when no interfaces are yet available.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2019-01-07 02:03:31 -05:00
Daniel F. Dickinson 89effa4a84 nut: Bump PKG_RELEASE
Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2018-12-23 00:26:03 -05:00
Daniel F. Dickinson a5d06ce110 nut: Optionally set serial USB to NUT user
When using serial-port based UPSes with NUT, it is handy to be able to
configure a USB serial port to have be set tot the NUT runas user, so
that NUT can access the serial port automagically.
Closes #6997

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2018-12-06 03:31:47 -05:00
Daniel F. Dickinson f48b060fa7 nut: Fix upsd runs as root
Closes #6997 - Allows upsd to runas a non-privileged user.
If any driver is running as non-privileged user, the last driver's
user will be used as the server non-privileged user, otherwise the
user specified in config upsd, otherwise nut. Previously the
localisation of RUNAS variable was in the wrong locations.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2018-12-06 03:02:29 -05:00
Daniel F. Dickinson 192b0f1646 nut: Fix a typo in setting a driver parameter
synchronous would not get set due to typo.  Fixed.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2018-12-06 00:06:53 -05:00
Daniel F. Dickinson 3aa67b3ca3 nut: Bump PKG_RELEASE
Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2018-11-19 16:41:53 -05:00
Daniel F. Dickinson daa974cff0 nut: Fix undetected UPS hardware
Leading zeroes left in ProductId results in some UPS hardware not being matched
by the hotplug script lead to bad permissions and driver not starting.

Closes: #6966
Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2018-11-19 16:39:39 -05:00
Daniel F. Dickinson 2e624f9833 nut: bump PKG_RELEASE
Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2018-08-29 00:35:05 -04:00
Daniel F. Dickinson 1b6dbe7a7b nut: Remove duplicate/extraneous lines
Removes a duplicate directory creation and a stray newline.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2018-08-29 00:35:05 -04:00
Daniel F. Dickinson df6beaa2ea nut: Makefile: Fix typo in description
Cosmetic edit.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2018-08-29 00:35:05 -04:00
Daniel F. Dickinson 01b7ea91a1 nut: Fix license information
The source code has multiple licenses so update SPD-X header.

NB: The previously unlisted licenses are not applicable to parts
actually built in any configuration for OpenWrt, but rather to
unused (by us) source code.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2018-08-29 00:17:23 -04:00
Daniel F. Dickinson b72c739e9e nut: Avoid building docs
Reduce compilation time and complexity by not building documentation
we don't use.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2018-08-29 00:17:23 -04:00
Daniel F. Dickinson 39250c08db nut: Drop unnecessary dependency on libwrap
We're using --without-wrap unconditionally anyway, so this legacy
dependency needs to be removed.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2018-08-29 00:17:23 -04:00
Daniel F. Dickinson cf446c7c47 nut: Use diff non-privileged user for upsmon
By default use a non-privileged user that is different than
the server or driver (when they are running non-privileged).
This is recommended by upstream.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2018-08-29 00:16:34 -04:00
Daniel F. Dickinson 2fca922cf0 nut: nut-cgi: Add support for upsset
This allows config for setting variables and/or running
commands from the CGI.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2018-08-29 00:15:18 -04:00
Daniel F. Dickinson 918a62f919 nut: Make FSD really work
Forced shutdown of the UPS was not actually happening before
due to lack of specific commands doing the shutdown.  This
(and the nut-driver initscript) fix that.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2018-08-29 00:15:14 -04:00
Daniel F. Dickinson 1cd4dcfa99 nut: Add USB hotplug support
usbhid-ups has the necessary information in the source, so
let's support USB hotplugging out of the box.  Takes advantage of
the procd support now in nut-server initscript.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2018-08-29 00:12:53 -04:00
Daniel F. Dickinson ceff68837d nut: Reorganize nut-server to clarify nut-driver
Clarify the different between the common nut-driver portions of
nut-server and the nut-server (upsd) proper.  nut-driver can't
be used without nut-server so there is no compelling reason
to split into a separate package, but the reorganization makes
such a move easier and makes it clear what each bit is for.

While we continue to use a single initscript, it's a properly
procdified one which handles the upsd daemon as a different
instance than the driver instances.  This resolves a race
condition in which upsd and drivers fail to start do to
a degree of interdepedence.

Also properly 'procd'ifies the nut-server initscript.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2018-08-29 00:12:53 -04:00
Daniel F. Dickinson 5790053eba nut: Add missing conffiles
We want to include the symlinks to the generated configurations
in conffiles so that if the user replaces them symlinks with
traditional NUT configuration it is preserved across sysupgrade.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2018-08-28 15:19:39 -04:00
Daniel F. Dickinson 98fdf16ecb nut: Fix for nut-upsmon without nut-server
nut-monitor failed to create required dir /var/etc/nut, as
well as failing to set appropriate user on the directory and
conf files.  Fixing this closes
https://github.com/openwrt/packages/issues/6644

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2018-08-02 08:40:12 -04:00
Daniel F. Dickinson b4fe49d2b2 nut: Update my email
Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2018-07-04 23:51:28 -04:00
Eneas U de Queiroz 6543859dab nut: Add PKG_FIXUP:=autoreconf
We need to force this since a *.m4 file is patched.

Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
2018-06-13 16:33:47 -03:00
Eneas U de Queiroz 1a9a7cc280 nut: added compatibility with openssl-1.1
Also added a fix in a check for empty string.

Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
2018-06-01 12:04:32 -03:00
Karl Palsson 66921d1226 net/nut: Fix typo is serial config option
Fixes: 5503dac806 "Add back serial support"
Reported-by: Znevna on irc
Signed-off-by: Karl Palsson <karlp@tweak.net.au>
2017-09-11 17:19:10 +00:00
Etienne Champetier 4006865ae8 treewide: run "make check FIXUP=1"
fix Makefile chmod (644)
replace MD5SUM with HASH
add PKG_MIRROR_HASH when PKG_SOURCE_PROTO:=git

(PKG_SOURCE_PROTO:=svn tarballs are not reproducible for now)

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
2017-08-29 21:41:14 -07:00
Daniel Dickinson 604f22ee69 net/nut: Ship upsset.conf for nut-cgi
Per user request ship the sample upsset.conf file so that
upsset functionality can be used with nut-cgi

Signed-off-by: Daniel Dickinson <lede@cshore.thecshore.com>
2017-01-11 18:59:15 -05:00
Daniel Dickinson a69c25d5e3 net/nut: Avoid building with libwrap when present
We don't want non-deterministic builds do turn off
libwrap in configure options.

Signed-off-by: Daniel Dickinson <lede@cshore.thecshore.com>
2017-01-11 18:55:32 -05:00
Daniel Dickinson b27c7fd64b net/nut: Make myself maintainer per private mail
Current maintainer (Martin Rowe) offered to hand over
maintership because I'm interested in doing more with
the package than he requires for his own use, so he
felt it made sense for me to maintain the package.
I accepted, hence this commit.

Signed-off-by: Daniel Dickinson <lede@cshore.thecshore.com>
2017-01-11 18:55:19 -05:00
Daniel Dickinson c00d89593e net/nut: Fix '/var/run' world readable warning
Use /var/run/nut as statepath and set appropriate owner
and permissions on /var/run/nut in order to avoid pidfile
for nut being world-readable.

Signed-off-by: Daniel Dickinson <lede@cshore.thecshore.com>
2017-01-11 18:54:51 -05:00
Daniel Dickinson c94e334c4e net-nut: Add UPS notifications via sendmail
Add option to send email notification via sendmail
(or replacement).

Signed-off-by: Daniel Dickinson <lede@cshore.thecshore.com>
2017-01-11 18:54:40 -05:00
Daniel Dickinson 5503dac806 net/nut: Add back serial support
It looks like serial support was accidentally dropped due to missing
pieces on Config.in and Makefile.  Add back serial support by fixing
that.

Signed-off-by: Daniel Dickinson <lede@cshore.thecshore.com>
2017-01-11 18:54:29 -05:00
Daniel Dickinson c1d26bacdf net/nut: Protect CGI via HTTP Basic Auth
When using uhttpd (the default), protect NUT CGI
via HTTP Basic Auth.

Signed-off-by: Daniel Dickinson <lede@cshore.thecshore.com>
2017-01-11 18:54:16 -05:00
Daniel Dickinson a23c4e85c5 net/nut: Build optional separate packages and ucify
With a LuCI app (of which I have one written) ucification makes
sense (and is in fact needed), so ucify the initscripts.

Also, rather than making selection of things to include an image
a matter of selecting compile-time config options, make optional
things into seperate packages that are built in default builds,
and leave selection of what to include or not up to the user
(e.g. using ImageBuilder, or adding packages via opkg).

Signed-off-by: Daniel Dickinson <lede@cshore.thecshore.com>
2017-01-11 18:53:58 -05:00
Marty R 35c2fa24d8 net/nut: Remove whitespace before conffiles
Closes #2652

Signed-off-by: Martin Rowe <martin.p.rowe@gmail.com>
2016-05-03 11:20:10 +09:00
Marty R a72cb6c955 nut: upstream version bump
Version bump package to latest v2.7.4 code from upstream. No changes needed for packaging.
2016-03-18 22:41:47 -07:00
Marty R 064d84ab90 nut: add dev headers, nut-web-cgi and nut-avahi-service, bugfix
Headers are required by collectd as mentioned in #1801. This is the nut portion based on dwmw2@d636841cd1d1dfab04cb509520c082738ddfb2ea
Happy to merge with 15.05 as per #1803.
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
[martin.p.rowe@gmail.com: condensed InstallDev lines]

Added package nut-web-cgi based on demorfi@7e340f47944ff4a9c49d3b1dc6c1d9d965cd344c. Closes #1614.
Pending signoff by @demorfi
[martin.p.rowe@gmail.com: simplified implementation, no changes to Config.in]

Added package nut-avahi-service similar to other implementations in #618
Bugfix to remove redundant NUT_DRIVER_SERIAL config
Bugfix to make UPSLOG config actually install (requires PKG_RELEASE bump)
Some code tidy-ups
Signed-off-by: Martin Rowe <martin.p.rowe@gmail.com>
2015-10-03 18:11:28 -07:00
Hanson Wong 9fa55147c4 nut: Fix required dependencies. 2015-09-20 22:48:29 +10:00
Marty R b195c1c367 nut: Update to 2.7.3
Updated the package to the latest upstream version.
Removed a patch that was merged upstream.
Bumped copyright notice to 2015.

Signed-off-by: Martin Rowe <martin.p.rowe@gmail.com>
2015-04-28 14:19:38 -07:00
Nicolas Thill 0d93cb8973 nut: force rebuild when config changes
Signed-off-by: Nicolas Thill <nico@openwrt.org>
2014-10-25 09:40:56 +02:00
Marty R 0ecfc499ce nut: Updated (c) notice
Signed-off-by: Martin Rowe <martin.p.rowe@gmail.com>
2014-10-19 09:40:02 -07:00
cyanidium d2e5a9896c Remove placeholder maintainer email address 2014-10-15 22:09:29 -07:00
Marty R d8258c35d5 nut: New package for Network UPS Tools
An older version of nut is in oldpackages. This commit is based on that
package and bumps the version to the latest release along with unifying
the server and client packages. More build options are provided for any
custom configuration but the defaults provide a working client and
server install which only needs a UPS driver. Drivers still build as
individual packages to minimise bloat. SSL support has also been added.

Signed-off-by: Martin Rowe <cyanidium@users.noreply.github.com>
2014-10-15 21:30:25 -07:00