2019-05-15 16:17:20 +00:00
|
|
|
{ lib
|
2021-12-18 08:21:57 +00:00
|
|
|
, callPackage
|
|
|
|
, nixosTests
|
2019-05-15 16:17:20 +00:00
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
2021-11-28 20:52:04 +00:00
|
|
|
, autoPatchelfHook
|
tsm-client: use rpm source instead of deb/Ubuntu
IBM publishes their IBM Spectrum Protect client
for Linux in two flavors:
* "Linux x86_64 client"
* "Linux x86_64 Ubuntu client"
Up to this commit, nixpkgs used the Ubuntu
flavor to build its `tsm-client` derivation.
However, the history of published archive files in
* https://public.dhe.ibm.com/storage/tivoli-storage-management/maintenance/client/v8r1/Linux/
* https://public.dhe.ibm.com/storage/tivoli-storage-management/patches/client/v8r1/Linux/
suggests that updates in the fourth level of
the version numbers (e.g. 8.1.13.0 -> 8.1.13.1)
do not get published as Ubuntu flavor.
It order to be able to always use the latest release,
this commit switches to the non-Ubuntu flavor.
The non-Ubuntu archive contains rpm files,
so this commit switches from `ar` to `rpmextract`.
Instead of unpacking all deb files,
the build recipe now unpacks all _but one_ rpm file:
The file `TIVsm-WEBGUI.x86_64.rpm` apparently
contains a plugin that is not included
in the Ubuntu version (see note below).
Comparing the old and the new derivation's output indicates
that this choice minimizes the difference between the results:
The output of the old (Ubuntu flavor) derivation contains:
* `commons-codec-1.6.jar`
* `share/` with changelog and copyright information
for the packages `gskssl64` and `gskcrypt64`
The output of the new (non-Ubuntu flavor) derivation contains:
* `lib64`, symlink to `lib`
* `commons-codec-1.14.jar`
* `opt/tivoli/tsm/license/{api,baclient}/sm/`
with license agreement files in many languages
Besides these differences, the outputs' file names are equal.
Note: I don't know what functionality
`TIVsm-WEBGUI.x86_64.rpm` actually provides.
Unpacking it with the other rpm files makes patchelf complain
about missing X11 libraries, so in order to include it here,
one would likely need to add those to `buildInputs`.
However, as the old (Ubuntu flavor) `tsm-client` package
did not contain this functionality and as I cannot test
or use it in any way, I opted to not include it now.
If we want to include this with a later commit,
we should add another package build option (like `enableGui`)
so that the default `tsm-client` package does not pull in
X11 libraries and its closure size therefore stays small.
2021-12-18 12:49:54 +00:00
|
|
|
, rpmextract
|
2021-11-30 21:07:04 +00:00
|
|
|
, openssl
|
2021-11-28 20:52:04 +00:00
|
|
|
, zlib
|
|
|
|
, lvm2 # LVM image backup and restore functions (optional)
|
|
|
|
, acl # EXT2/EXT3/XFS ACL support (optional)
|
2021-09-18 08:08:29 +00:00
|
|
|
, gnugrep
|
2019-05-15 16:17:20 +00:00
|
|
|
, procps
|
2021-11-28 20:52:04 +00:00
|
|
|
, jdk8 # Java GUI (needed for `enableGui`)
|
|
|
|
, buildEnv
|
|
|
|
, makeWrapper
|
|
|
|
, enableGui ? false # enables Java GUI `dsmj`
|
2019-05-15 16:17:20 +00:00
|
|
|
# path to `dsm.sys` configuration files
|
|
|
|
, dsmSysCli ? "/etc/tsm-client/cli.dsm.sys"
|
|
|
|
, dsmSysApi ? "/etc/tsm-client/api.dsm.sys"
|
|
|
|
}:
|
|
|
|
|
|
|
|
|
|
|
|
# For an explanation of optional packages
|
|
|
|
# (features provided by them, version limits), see
|
2021-11-30 20:59:57 +00:00
|
|
|
# https://www.ibm.com/support/pages/node/660813#Version%208.1
|
2019-05-15 16:17:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
# IBM Tivoli Storage Manager Client uses a system-wide
|
|
|
|
# client system-options file `dsm.sys` and expects it
|
|
|
|
# to be located in a directory within the package.
|
|
|
|
# Note that the command line client and the API use
|
|
|
|
# different "dms.sys" files (located in different directories).
|
|
|
|
# Since these files contain settings to be altered by the
|
|
|
|
# admin user (e.g. TSM server name), we create symlinks
|
|
|
|
# in place of the files that the client attempts to open.
|
|
|
|
# Use the arguments `dsmSysCli` and `dsmSysApi` to
|
|
|
|
# provide the location of the configuration files for
|
|
|
|
# the command-line interface and the API, respectively.
|
|
|
|
#
|
|
|
|
# While the command-line interface contains wrappers
|
|
|
|
# that help the executables find the configuration file,
|
|
|
|
# packages that link against the API have to
|
|
|
|
# set the environment variable `DSMI_DIR` to
|
|
|
|
# point to this derivations `/dsmi_dir` directory symlink.
|
|
|
|
# Other environment variables might be necessary,
|
|
|
|
# depending on local configuration or usage; see:
|
2021-11-30 21:07:04 +00:00
|
|
|
# https://www.ibm.com/docs/en/spectrum-protect/8.1.13?topic=solaris-set-api-environment-variables
|
2019-05-15 16:17:20 +00:00
|
|
|
|
|
|
|
|
2021-11-30 20:59:57 +00:00
|
|
|
# The newest version of TSM client should be discoverable by
|
tsm-client: use rpm source instead of deb/Ubuntu
IBM publishes their IBM Spectrum Protect client
for Linux in two flavors:
* "Linux x86_64 client"
* "Linux x86_64 Ubuntu client"
Up to this commit, nixpkgs used the Ubuntu
flavor to build its `tsm-client` derivation.
However, the history of published archive files in
* https://public.dhe.ibm.com/storage/tivoli-storage-management/maintenance/client/v8r1/Linux/
* https://public.dhe.ibm.com/storage/tivoli-storage-management/patches/client/v8r1/Linux/
suggests that updates in the fourth level of
the version numbers (e.g. 8.1.13.0 -> 8.1.13.1)
do not get published as Ubuntu flavor.
It order to be able to always use the latest release,
this commit switches to the non-Ubuntu flavor.
The non-Ubuntu archive contains rpm files,
so this commit switches from `ar` to `rpmextract`.
Instead of unpacking all deb files,
the build recipe now unpacks all _but one_ rpm file:
The file `TIVsm-WEBGUI.x86_64.rpm` apparently
contains a plugin that is not included
in the Ubuntu version (see note below).
Comparing the old and the new derivation's output indicates
that this choice minimizes the difference between the results:
The output of the old (Ubuntu flavor) derivation contains:
* `commons-codec-1.6.jar`
* `share/` with changelog and copyright information
for the packages `gskssl64` and `gskcrypt64`
The output of the new (non-Ubuntu flavor) derivation contains:
* `lib64`, symlink to `lib`
* `commons-codec-1.14.jar`
* `opt/tivoli/tsm/license/{api,baclient}/sm/`
with license agreement files in many languages
Besides these differences, the outputs' file names are equal.
Note: I don't know what functionality
`TIVsm-WEBGUI.x86_64.rpm` actually provides.
Unpacking it with the other rpm files makes patchelf complain
about missing X11 libraries, so in order to include it here,
one would likely need to add those to `buildInputs`.
However, as the old (Ubuntu flavor) `tsm-client` package
did not contain this functionality and as I cannot test
or use it in any way, I opted to not include it now.
If we want to include this with a later commit,
we should add another package build option (like `enableGui`)
so that the default `tsm-client` package does not pull in
X11 libraries and its closure size therefore stays small.
2021-12-18 12:49:54 +00:00
|
|
|
# going to the `downloadPage` (see `meta` below).
|
|
|
|
# Find the "Backup-archive client" table on that page.
|
|
|
|
# Look for "Download Documents" of the latest release.
|
|
|
|
# Here, two links must be checked:
|
|
|
|
# * "IBM Spectrum Protect Client ... Downloads and READMEs":
|
|
|
|
# In the table at the page's bottom,
|
|
|
|
# check the date of the "Linux x86_64 client"
|
|
|
|
# * "IBM Spectrum Protect BA client ... interim fix downloads"
|
|
|
|
# Look for the "Linux x86_64 client" rows
|
|
|
|
# in the table # at the bottom of each page.
|
|
|
|
# Follow the "HTTPS" link of the row with the latest date stamp.
|
|
|
|
# In the directory listing to show up, pick the big `.tar` file.
|
|
|
|
#
|
|
|
|
# (as of 2021-12-18)
|
2019-05-15 16:17:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
meta = {
|
2021-11-30 20:59:57 +00:00
|
|
|
homepage = "https://www.ibm.com/products/data-protection-and-recovery";
|
|
|
|
downloadPage = "https://www.ibm.com/support/pages/ibm-spectrum-protect-downloads-latest-fix-packs-and-interim-fixes";
|
2019-05-15 16:17:20 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2021-12-04 08:00:58 +00:00
|
|
|
mainProgram = "dsmc";
|
2019-05-15 16:17:20 +00:00
|
|
|
license = lib.licenses.unfree;
|
|
|
|
maintainers = [ lib.maintainers.yarny ];
|
|
|
|
description = "IBM Spectrum Protect (Tivoli Storage Manager) CLI and API";
|
|
|
|
longDescription = ''
|
|
|
|
IBM Spectrum Protect (Tivoli Storage Manager) provides
|
|
|
|
a single point of control for backup and recovery.
|
|
|
|
This package contains the client software, that is,
|
|
|
|
a command line client and linkable libraries.
|
|
|
|
|
|
|
|
Note that the software requires a system-wide
|
|
|
|
client system-options file (commonly named "dsm.sys").
|
|
|
|
This package allows to use separate files for
|
|
|
|
the command-line interface and for the linkable API.
|
|
|
|
The location of those files can
|
|
|
|
be provided as build parameters.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2021-12-18 08:21:57 +00:00
|
|
|
passthru.tests = {
|
|
|
|
test-cli = callPackage ./test-cli.nix {};
|
|
|
|
test-gui = nixosTests.tsm-client-gui;
|
|
|
|
};
|
|
|
|
|
2021-11-30 20:59:57 +00:00
|
|
|
mkSrcUrl = version:
|
|
|
|
let
|
|
|
|
major = lib.versions.major version;
|
|
|
|
minor = lib.versions.minor version;
|
|
|
|
patch = lib.versions.patch version;
|
tsm-client: use rpm source instead of deb/Ubuntu
IBM publishes their IBM Spectrum Protect client
for Linux in two flavors:
* "Linux x86_64 client"
* "Linux x86_64 Ubuntu client"
Up to this commit, nixpkgs used the Ubuntu
flavor to build its `tsm-client` derivation.
However, the history of published archive files in
* https://public.dhe.ibm.com/storage/tivoli-storage-management/maintenance/client/v8r1/Linux/
* https://public.dhe.ibm.com/storage/tivoli-storage-management/patches/client/v8r1/Linux/
suggests that updates in the fourth level of
the version numbers (e.g. 8.1.13.0 -> 8.1.13.1)
do not get published as Ubuntu flavor.
It order to be able to always use the latest release,
this commit switches to the non-Ubuntu flavor.
The non-Ubuntu archive contains rpm files,
so this commit switches from `ar` to `rpmextract`.
Instead of unpacking all deb files,
the build recipe now unpacks all _but one_ rpm file:
The file `TIVsm-WEBGUI.x86_64.rpm` apparently
contains a plugin that is not included
in the Ubuntu version (see note below).
Comparing the old and the new derivation's output indicates
that this choice minimizes the difference between the results:
The output of the old (Ubuntu flavor) derivation contains:
* `commons-codec-1.6.jar`
* `share/` with changelog and copyright information
for the packages `gskssl64` and `gskcrypt64`
The output of the new (non-Ubuntu flavor) derivation contains:
* `lib64`, symlink to `lib`
* `commons-codec-1.14.jar`
* `opt/tivoli/tsm/license/{api,baclient}/sm/`
with license agreement files in many languages
Besides these differences, the outputs' file names are equal.
Note: I don't know what functionality
`TIVsm-WEBGUI.x86_64.rpm` actually provides.
Unpacking it with the other rpm files makes patchelf complain
about missing X11 libraries, so in order to include it here,
one would likely need to add those to `buildInputs`.
However, as the old (Ubuntu flavor) `tsm-client` package
did not contain this functionality and as I cannot test
or use it in any way, I opted to not include it now.
If we want to include this with a later commit,
we should add another package build option (like `enableGui`)
so that the default `tsm-client` package does not pull in
X11 libraries and its closure size therefore stays small.
2021-12-18 12:49:54 +00:00
|
|
|
fixup = lib.lists.elemAt (lib.versions.splitVersion version) 3;
|
2021-11-30 20:59:57 +00:00
|
|
|
in
|
tsm-client: use rpm source instead of deb/Ubuntu
IBM publishes their IBM Spectrum Protect client
for Linux in two flavors:
* "Linux x86_64 client"
* "Linux x86_64 Ubuntu client"
Up to this commit, nixpkgs used the Ubuntu
flavor to build its `tsm-client` derivation.
However, the history of published archive files in
* https://public.dhe.ibm.com/storage/tivoli-storage-management/maintenance/client/v8r1/Linux/
* https://public.dhe.ibm.com/storage/tivoli-storage-management/patches/client/v8r1/Linux/
suggests that updates in the fourth level of
the version numbers (e.g. 8.1.13.0 -> 8.1.13.1)
do not get published as Ubuntu flavor.
It order to be able to always use the latest release,
this commit switches to the non-Ubuntu flavor.
The non-Ubuntu archive contains rpm files,
so this commit switches from `ar` to `rpmextract`.
Instead of unpacking all deb files,
the build recipe now unpacks all _but one_ rpm file:
The file `TIVsm-WEBGUI.x86_64.rpm` apparently
contains a plugin that is not included
in the Ubuntu version (see note below).
Comparing the old and the new derivation's output indicates
that this choice minimizes the difference between the results:
The output of the old (Ubuntu flavor) derivation contains:
* `commons-codec-1.6.jar`
* `share/` with changelog and copyright information
for the packages `gskssl64` and `gskcrypt64`
The output of the new (non-Ubuntu flavor) derivation contains:
* `lib64`, symlink to `lib`
* `commons-codec-1.14.jar`
* `opt/tivoli/tsm/license/{api,baclient}/sm/`
with license agreement files in many languages
Besides these differences, the outputs' file names are equal.
Note: I don't know what functionality
`TIVsm-WEBGUI.x86_64.rpm` actually provides.
Unpacking it with the other rpm files makes patchelf complain
about missing X11 libraries, so in order to include it here,
one would likely need to add those to `buildInputs`.
However, as the old (Ubuntu flavor) `tsm-client` package
did not contain this functionality and as I cannot test
or use it in any way, I opted to not include it now.
If we want to include this with a later commit,
we should add another package build option (like `enableGui`)
so that the default `tsm-client` package does not pull in
X11 libraries and its closure size therefore stays small.
2021-12-18 12:49:54 +00:00
|
|
|
"https://public.dhe.ibm.com/storage/tivoli-storage-management/${if fixup=="0" then "maintenance" else "patches"}/client/v${major}r${minor}/Linux/LinuxX86/BA/v${major}${minor}${patch}/${version}-TIV-TSMBAC-LinuxX86.tar";
|
2021-11-30 20:59:57 +00:00
|
|
|
|
2019-05-15 16:17:20 +00:00
|
|
|
unwrapped = stdenv.mkDerivation rec {
|
|
|
|
name = "tsm-client-${version}-unwrapped";
|
2022-01-15 09:53:06 +00:00
|
|
|
version = "8.1.13.3";
|
2019-05-15 16:17:20 +00:00
|
|
|
src = fetchurl {
|
2021-11-30 20:59:57 +00:00
|
|
|
url = mkSrcUrl version;
|
2022-01-15 09:53:06 +00:00
|
|
|
sha256 = "1dwczf236drdaf4jcfzz5154vdwvxf5zraxhrhiddl6n80hnvbcd";
|
2019-05-15 16:17:20 +00:00
|
|
|
};
|
2021-12-18 08:21:57 +00:00
|
|
|
inherit meta passthru;
|
2019-05-15 16:17:20 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
autoPatchelfHook
|
tsm-client: use rpm source instead of deb/Ubuntu
IBM publishes their IBM Spectrum Protect client
for Linux in two flavors:
* "Linux x86_64 client"
* "Linux x86_64 Ubuntu client"
Up to this commit, nixpkgs used the Ubuntu
flavor to build its `tsm-client` derivation.
However, the history of published archive files in
* https://public.dhe.ibm.com/storage/tivoli-storage-management/maintenance/client/v8r1/Linux/
* https://public.dhe.ibm.com/storage/tivoli-storage-management/patches/client/v8r1/Linux/
suggests that updates in the fourth level of
the version numbers (e.g. 8.1.13.0 -> 8.1.13.1)
do not get published as Ubuntu flavor.
It order to be able to always use the latest release,
this commit switches to the non-Ubuntu flavor.
The non-Ubuntu archive contains rpm files,
so this commit switches from `ar` to `rpmextract`.
Instead of unpacking all deb files,
the build recipe now unpacks all _but one_ rpm file:
The file `TIVsm-WEBGUI.x86_64.rpm` apparently
contains a plugin that is not included
in the Ubuntu version (see note below).
Comparing the old and the new derivation's output indicates
that this choice minimizes the difference between the results:
The output of the old (Ubuntu flavor) derivation contains:
* `commons-codec-1.6.jar`
* `share/` with changelog and copyright information
for the packages `gskssl64` and `gskcrypt64`
The output of the new (non-Ubuntu flavor) derivation contains:
* `lib64`, symlink to `lib`
* `commons-codec-1.14.jar`
* `opt/tivoli/tsm/license/{api,baclient}/sm/`
with license agreement files in many languages
Besides these differences, the outputs' file names are equal.
Note: I don't know what functionality
`TIVsm-WEBGUI.x86_64.rpm` actually provides.
Unpacking it with the other rpm files makes patchelf complain
about missing X11 libraries, so in order to include it here,
one would likely need to add those to `buildInputs`.
However, as the old (Ubuntu flavor) `tsm-client` package
did not contain this functionality and as I cannot test
or use it in any way, I opted to not include it now.
If we want to include this with a later commit,
we should add another package build option (like `enableGui`)
so that the default `tsm-client` package does not pull in
X11 libraries and its closure size therefore stays small.
2021-12-18 12:49:54 +00:00
|
|
|
rpmextract
|
2019-05-15 16:17:20 +00:00
|
|
|
];
|
|
|
|
buildInputs = [
|
2021-11-30 21:07:04 +00:00
|
|
|
openssl
|
2019-05-15 16:17:20 +00:00
|
|
|
stdenv.cc.cc
|
|
|
|
zlib
|
|
|
|
];
|
|
|
|
runtimeDependencies = [
|
2021-09-15 13:31:49 +00:00
|
|
|
(lib.attrsets.getLib lvm2)
|
2019-05-15 16:17:20 +00:00
|
|
|
];
|
|
|
|
sourceRoot = ".";
|
|
|
|
|
|
|
|
postUnpack = ''
|
tsm-client: use rpm source instead of deb/Ubuntu
IBM publishes their IBM Spectrum Protect client
for Linux in two flavors:
* "Linux x86_64 client"
* "Linux x86_64 Ubuntu client"
Up to this commit, nixpkgs used the Ubuntu
flavor to build its `tsm-client` derivation.
However, the history of published archive files in
* https://public.dhe.ibm.com/storage/tivoli-storage-management/maintenance/client/v8r1/Linux/
* https://public.dhe.ibm.com/storage/tivoli-storage-management/patches/client/v8r1/Linux/
suggests that updates in the fourth level of
the version numbers (e.g. 8.1.13.0 -> 8.1.13.1)
do not get published as Ubuntu flavor.
It order to be able to always use the latest release,
this commit switches to the non-Ubuntu flavor.
The non-Ubuntu archive contains rpm files,
so this commit switches from `ar` to `rpmextract`.
Instead of unpacking all deb files,
the build recipe now unpacks all _but one_ rpm file:
The file `TIVsm-WEBGUI.x86_64.rpm` apparently
contains a plugin that is not included
in the Ubuntu version (see note below).
Comparing the old and the new derivation's output indicates
that this choice minimizes the difference between the results:
The output of the old (Ubuntu flavor) derivation contains:
* `commons-codec-1.6.jar`
* `share/` with changelog and copyright information
for the packages `gskssl64` and `gskcrypt64`
The output of the new (non-Ubuntu flavor) derivation contains:
* `lib64`, symlink to `lib`
* `commons-codec-1.14.jar`
* `opt/tivoli/tsm/license/{api,baclient}/sm/`
with license agreement files in many languages
Besides these differences, the outputs' file names are equal.
Note: I don't know what functionality
`TIVsm-WEBGUI.x86_64.rpm` actually provides.
Unpacking it with the other rpm files makes patchelf complain
about missing X11 libraries, so in order to include it here,
one would likely need to add those to `buildInputs`.
However, as the old (Ubuntu flavor) `tsm-client` package
did not contain this functionality and as I cannot test
or use it in any way, I opted to not include it now.
If we want to include this with a later commit,
we should add another package build option (like `enableGui`)
so that the default `tsm-client` package does not pull in
X11 libraries and its closure size therefore stays small.
2021-12-18 12:49:54 +00:00
|
|
|
rpmextract TIVsm-API64.x86_64.rpm
|
|
|
|
rpmextract TIVsm-APIcit.x86_64.rpm
|
|
|
|
rpmextract TIVsm-BA.x86_64.rpm
|
|
|
|
rpmextract TIVsm-BAcit.x86_64.rpm
|
|
|
|
rpmextract TIVsm-BAhdw.x86_64.rpm
|
|
|
|
rpmextract TIVsm-JBB.x86_64.rpm
|
|
|
|
# use globbing so that version updates don't break the build:
|
|
|
|
rpmextract gskcrypt64-*.linux.x86_64.rpm
|
|
|
|
rpmextract gskssl64-*.linux.x86_64.rpm
|
2019-05-15 16:17:20 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
mkdir --parents $out
|
|
|
|
mv --target-directory=$out usr/* opt
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Fix relative symlinks after `/usr` was moved up one level
|
|
|
|
preFixup = ''
|
tsm-client: use rpm source instead of deb/Ubuntu
IBM publishes their IBM Spectrum Protect client
for Linux in two flavors:
* "Linux x86_64 client"
* "Linux x86_64 Ubuntu client"
Up to this commit, nixpkgs used the Ubuntu
flavor to build its `tsm-client` derivation.
However, the history of published archive files in
* https://public.dhe.ibm.com/storage/tivoli-storage-management/maintenance/client/v8r1/Linux/
* https://public.dhe.ibm.com/storage/tivoli-storage-management/patches/client/v8r1/Linux/
suggests that updates in the fourth level of
the version numbers (e.g. 8.1.13.0 -> 8.1.13.1)
do not get published as Ubuntu flavor.
It order to be able to always use the latest release,
this commit switches to the non-Ubuntu flavor.
The non-Ubuntu archive contains rpm files,
so this commit switches from `ar` to `rpmextract`.
Instead of unpacking all deb files,
the build recipe now unpacks all _but one_ rpm file:
The file `TIVsm-WEBGUI.x86_64.rpm` apparently
contains a plugin that is not included
in the Ubuntu version (see note below).
Comparing the old and the new derivation's output indicates
that this choice minimizes the difference between the results:
The output of the old (Ubuntu flavor) derivation contains:
* `commons-codec-1.6.jar`
* `share/` with changelog and copyright information
for the packages `gskssl64` and `gskcrypt64`
The output of the new (non-Ubuntu flavor) derivation contains:
* `lib64`, symlink to `lib`
* `commons-codec-1.14.jar`
* `opt/tivoli/tsm/license/{api,baclient}/sm/`
with license agreement files in many languages
Besides these differences, the outputs' file names are equal.
Note: I don't know what functionality
`TIVsm-WEBGUI.x86_64.rpm` actually provides.
Unpacking it with the other rpm files makes patchelf complain
about missing X11 libraries, so in order to include it here,
one would likely need to add those to `buildInputs`.
However, as the old (Ubuntu flavor) `tsm-client` package
did not contain this functionality and as I cannot test
or use it in any way, I opted to not include it now.
If we want to include this with a later commit,
we should add another package build option (like `enableGui`)
so that the default `tsm-client` package does not pull in
X11 libraries and its closure size therefore stays small.
2021-12-18 12:49:54 +00:00
|
|
|
for link in $out/lib{,64}/* $out/bin/*
|
2019-05-15 16:17:20 +00:00
|
|
|
do
|
|
|
|
target=$(readlink "$link")
|
|
|
|
if [ "$(cut -b -6 <<< "$target")" != "../../" ]
|
|
|
|
then
|
|
|
|
echo "cannot fix this symlink: $link -> $target"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
ln --symbolic --force --no-target-directory "$out/$(cut -b 7- <<< "$target")" "$link"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2021-11-28 20:52:04 +00:00
|
|
|
binPath = lib.makeBinPath ([ acl gnugrep procps ]
|
|
|
|
++ lib.optional enableGui jdk8);
|
|
|
|
|
2019-05-15 16:17:20 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
buildEnv {
|
|
|
|
name = "tsm-client-${unwrapped.version}";
|
2021-12-04 08:00:58 +00:00
|
|
|
meta = meta // lib.attrsets.optionalAttrs enableGui {
|
|
|
|
mainProgram = "dsmj";
|
|
|
|
};
|
2021-12-18 08:21:57 +00:00
|
|
|
passthru = passthru // { inherit unwrapped; };
|
2019-05-15 16:17:20 +00:00
|
|
|
paths = [ unwrapped ];
|
2021-10-24 06:59:16 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2019-05-15 16:17:20 +00:00
|
|
|
pathsToLink = [
|
|
|
|
"/"
|
|
|
|
"/bin"
|
|
|
|
"/opt/tivoli/tsm/client/ba/bin"
|
|
|
|
"/opt/tivoli/tsm/client/api/bin64"
|
|
|
|
];
|
|
|
|
# * Provide top-level symlinks `dsm_dir` and `dsmi_dir`
|
|
|
|
# to the so-called "installation directories"
|
|
|
|
# * Add symlinks to the "installation directories"
|
|
|
|
# that point to the `dsm.sys` configuration files
|
2021-11-28 20:52:04 +00:00
|
|
|
# * Drop the Java GUI executable unless `enableGui` is set
|
2019-05-15 16:17:20 +00:00
|
|
|
# * Create wrappers for the command-line interface to
|
|
|
|
# prepare `PATH` and `DSM_DIR` environment variables
|
|
|
|
postBuild = ''
|
|
|
|
ln --symbolic --no-target-directory opt/tivoli/tsm/client/ba/bin $out/dsm_dir
|
|
|
|
ln --symbolic --no-target-directory opt/tivoli/tsm/client/api/bin64 $out/dsmi_dir
|
|
|
|
ln --symbolic --no-target-directory "${dsmSysCli}" $out/dsm_dir/dsm.sys
|
|
|
|
ln --symbolic --no-target-directory "${dsmSysApi}" $out/dsmi_dir/dsm.sys
|
2021-11-28 20:52:04 +00:00
|
|
|
${lib.optionalString (!enableGui) "rm $out/bin/dsmj"}
|
2019-05-15 16:17:20 +00:00
|
|
|
for bin in $out/bin/*
|
|
|
|
do
|
|
|
|
target=$(readlink "$bin")
|
|
|
|
rm "$bin"
|
|
|
|
makeWrapper "$target" "$bin" \
|
2021-11-28 20:52:04 +00:00
|
|
|
--prefix PATH : "$out/dsm_dir:${binPath}" \
|
2019-05-15 16:17:20 +00:00
|
|
|
--set DSM_DIR $out/dsm_dir
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
}
|