From 056d00886fa712dd0557e579b420b577ff6d983d Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 19 Mar 2024 12:39:10 +0000 Subject: [PATCH 1/3] scripts/installer: avoid SCM-tracking a symlink to NUT source root Signed-off-by: Jim Klimov --- scripts/installer/Makefile.am | 8 ++++++++ scripts/installer/README.adoc | 12 ++++++------ scripts/installer/nut | 1 - 3 files changed, 14 insertions(+), 7 deletions(-) delete mode 120000 scripts/installer/nut diff --git a/scripts/installer/Makefile.am b/scripts/installer/Makefile.am index 10a67121cb..27da718516 100644 --- a/scripts/installer/Makefile.am +++ b/scripts/installer/Makefile.am @@ -32,6 +32,10 @@ EXTRA_DIST = \ SPELLCHECK_SRC = README.adoc common/README_ipp-os-shutdown.adoc +nut: + rm -f "$@" + $(LN_S) $(top_srcdir) "$@" + # NOTE: Due to portability, we do not use a GNU percent-wildcard extension. # We also have to export some variables that may be tainted by relative # paths when parsing the other makefile (e.g. MKDIR_P that may be defined @@ -54,4 +58,8 @@ spellcheck spellcheck-interactive spellcheck-sortdict: CLEANFILES = *-spellchecked +# Remove "nut" if it is a symlink to the source tree +clean-local: + if test -L nut || test -h nut ; then rm -f nut ; fi + MAINTAINERCLEANFILES = Makefile.in .dirstamp diff --git a/scripts/installer/README.adoc b/scripts/installer/README.adoc index 7c94a8be24..1cda6d7b32 100644 --- a/scripts/installer/README.adoc +++ b/scripts/installer/README.adoc @@ -8,13 +8,13 @@ of Eaton by Frederic Bohe, Vaclav Krpec, Arnaud Quette and Jim Klimov. This includes the package (tarball) creation script which relies on presence of third-party library binaries in a `$ARCH/libs` directory, -and init-scripts from NUT source tree (originally expected as a "nut" -subdirectory), as well as an interactive installer script to set up -the package on a target deployment covering package (re-)installation, -initial device discovery, password setup, etc., and helper scripts -for status overview and shutdown handling. +and init-scripts from NUT source tree (originally expected as a `nut` +subdirectory, can be a symlink to `../..`), as well as an interactive +installer script to set up the package on a target deployment covering +package (re-)installation, initial device discovery, password setup, +etc., and helper scripts for status overview and shutdown handling. -The installer relies on "nutconf" tool (emulating dummy script for +The installer relies on `nutconf` tool (emulating dummy script for tests provided here), which is part of NUT sources. Note that heavy use of `LD_LIBRARY_PATH` in these scripts may become diff --git a/scripts/installer/nut b/scripts/installer/nut deleted file mode 120000 index c25bddb6dd..0000000000 --- a/scripts/installer/nut +++ /dev/null @@ -1 +0,0 @@ -../.. \ No newline at end of file From 346071653adaad3ff5cbbd4848535773bbb5f56d Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 19 Mar 2024 13:10:16 +0000 Subject: [PATCH 2/3] scripts/installer/README.adoc, docs/nut.dict: update about directory layout and contents expected by make_package.sh Signed-off-by: Jim Klimov --- docs/nut.dict | 9 +++++++- scripts/installer/README.adoc | 43 ++++++++++++++++++++++++++++++++++- 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/docs/nut.dict b/docs/nut.dict index 9695f1816e..c79045136b 100644 --- a/docs/nut.dict +++ b/docs/nut.dict @@ -1,4 +1,4 @@ -personal_ws-1.1 en 3470 utf-8 +personal_ws-1.1 en 3478 utf-8 AAC AAS ABI @@ -1570,6 +1570,7 @@ aec af aggregator ai +aix al ala alarmcenables @@ -2198,6 +2199,7 @@ hotplug hotplugging hovercharge hpe +hpux href htaccess html @@ -2365,6 +2367,7 @@ libdir libdummy libexec libexecdir +libexpat libfreeipmi libgd libgpgme @@ -3023,6 +3026,7 @@ sitop sizeof ske skel +sl slackpkg slaveid slavesync @@ -3045,8 +3049,11 @@ socat sockdebug socketname socomec +solari solaris +solcmn solibs +solint solis somename somepass diff --git a/scripts/installer/README.adoc b/scripts/installer/README.adoc index 1cda6d7b32..e6656b736d 100644 --- a/scripts/installer/README.adoc +++ b/scripts/installer/README.adoc @@ -8,12 +8,53 @@ of Eaton by Frederic Bohe, Vaclav Krpec, Arnaud Quette and Jim Klimov. This includes the package (tarball) creation script which relies on presence of third-party library binaries in a `$ARCH/libs` directory, +pre-built package files (courtesy of NUT `make package` recipes), and init-scripts from NUT source tree (originally expected as a `nut` -subdirectory, can be a symlink to `../..`), as well as an interactive +subdirectory, can be a symlink to `../..`; currently copies stored in +the `$ARCH` subdirectories; eventually should be taken from NUT sources +during build, or from packages), as well as an interactive text-mode installer script to set up the package on a target deployment covering package (re-)installation, initial device discovery, password setup, etc., and helper scripts for status overview and shutdown handling. +Example `$ARCH` related directory layout in original posting (binary +files mentioned below are not provided into NUT Git source code base); +these are the contents `make_package.sh` script expects to work with +(you can see the names mentioned in `find ... | grep -v ...` filters): + +* `aix/` example for AIX 6 and 7 based IPSS Unix releases: + * `libs/`: `libcrypto.a`, `libcrypto.so`, etc... + * `nut-2.6.5-1.aix6.1.ppc.rpm` and `nut-client-2.6.5-1.aix6.1.ppc.rpm` + package files + * `nutconf` binary for the platform + * `aix_init` script + * `ipp-os-shutdown.conf.sample` + +* `hpux/` for PA-RISC: + * `libs/`: `libcrypto.sl`, `libexpat.sl`, `libiconv.sl`, `libintl.sl`, + `libltdl.sl`, `libneon.sl`, `libnetsnmp.sl.30`, `libssl.sl`, `libz.sl` + * Notably, `libnutscan.sl.1` (other platforms did not carry a copy) + * `nut.depot.tar.gz` package file + * `nutconf` binary for the platform + * `ipp-os-shutdown.conf.sample` + +* Solaris (SPARC and X86) spread across 3 directories: + * `solcmn/` with common platform-independent files: + * `ipp-os-shutdown.conf.sample` + * `solaris_init` script + + * `solari` with SPARC binaries: + * `libs/`: `libcrypto.so.0.9.8`, `libz.so`, etc. + * `NUT_solaris_sparc_package2.6.5.local` package file + * `nutconf` binary for the platform + + * `solint` with X86 binaries: + * `libs/`: `libcrypto.so.1.0.0`, `libgcc_s.so.1`, `libltdl.so.7`, + `libneon.so.27`, `libnetsnmp.so.15`, `libproxy.so.0`, + `libssl.so.1.0.0`, `libstdc++.so.6`, `libwrap.so.1` + * `NUT_solaris_i386_package2.6.5.local` package file + * `nutconf` binary for the platform + The installer relies on `nutconf` tool (emulating dummy script for tests provided here), which is part of NUT sources. From 9005cde004ddeb48cab30e86a4b45e8fcb6c80f2 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 19 Mar 2024 13:14:46 +0000 Subject: [PATCH 3/3] scripts/installer/make_package.sh: update comments Signed-off-by: Jim Klimov --- scripts/installer/make_package.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/installer/make_package.sh b/scripts/installer/make_package.sh index 2ebc08bf77..6c3aa66e81 100755 --- a/scripts/installer/make_package.sh +++ b/scripts/installer/make_package.sh @@ -12,9 +12,14 @@ rm -Rf package mkdir package -git pull --all +# NOTE: Originally this pulled installer sources (separate from NUT code base) +# If this script were to be modernized, it could be prudent to `make package` +# in NUT sources for each platform, to create the package file(s) tarballed +# below for end-user along with the interactive installer delivery. +#git pull --all # [ $? = 0 ] && git merge upstream/master || exit $? +# NOTE: See README.adoc about expected subdirectory contents with binary files NAME="ipp-solaris-$IPP_VERSION.sparc" mkdir "package/$NAME" FILE_LIST="`find . -type f -name '*' | egrep -v '.svn|.git|./nutconf-dummy|./make_package.sh|nut/|(un|)install.log|package/|aix|hpux|solint'`"