Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
91cdcf8
Additional ANSI/tty functions
DevonianTeuchter May 26, 2023
0da0948
Utility functions to:
DevonianTeuchter May 26, 2023
280b836
Implement audit logging capability
DevonianTeuchter May 26, 2023
ca8bb17
Ensure that printError causes the
DevonianTeuchter May 26, 2023
958b1e1
Add bootstrap version of curl
DevonianTeuchter May 26, 2023
3157c82
Utility functions for the merge/unlink
DevonianTeuchter May 26, 2023
41b11f1
REXX script backup for curl bootstrap
DevonianTeuchter May 26, 2023
7646e1d
Implement package management
DevonianTeuchter May 26, 2023
1d12097
Implement "alternative" functionality
DevonianTeuchter May 26, 2023
01b1150
Provide cleanup facility for
DevonianTeuchter May 26, 2023
6565bf3
Provide query facilities for packages
DevonianTeuchter May 26, 2023
63c1321
Update readme to provide basic
DevonianTeuchter May 26, 2023
d124ba7
remove assumption that "." is on the
DevonianTeuchter Jun 13, 2023
8358199
Remove progress handler noise from
DevonianTeuchter Jun 13, 2023
d03168b
Install with pagination support - and
DevonianTeuchter Jun 13, 2023
5084db1
Query using pagination support
DevonianTeuchter Jun 13, 2023
80c4cc7
Add .version and .pinned to version
DevonianTeuchter Jun 13, 2023
5fcc289
Allow default to alt
DevonianTeuchter Jun 15, 2023
c729731
Handle installing to '/'
DevonianTeuchter Jun 15, 2023
d0b8dc2
typo
DevonianTeuchter Jun 15, 2023
ee0752c
Multi-proc dangling symlink traversal,
DevonianTeuchter Jun 15, 2023
cc324dd
Fix issue if current dir removed under
DevonianTeuchter Jun 15, 2023
c53df39
Bump version
DevonianTeuchter Jun 15, 2023
f6662a1
Tweak and Improve UX for system installs
DevonianTeuchter Jun 19, 2023
5469bfd
Fix zopen-alt regression
DevonianTeuchter Jun 19, 2023
335e951
Remove tty redirct on getInput
DevonianTeuchter Jun 19, 2023
df94080
Update README.md
DevonianTeuchter Jun 21, 2023
828627d
Merge remote-tracking branch 'upstream/main'
DevonianTeuchter Jul 11, 2023
bd24a66
Fix zopen-build so that it is functional. Also embed jq
IgorTodorovskiIBM Jul 13, 2023
9ca53d9
Add help for new options in zopen-download
IgorTodorovskiIBM Jul 13, 2023
65232e3
Merge pull request #27 from IgorTodorovskiIBM/zopen-build
DevonianTeuchter Jul 15, 2023
3f49512
Query JSON cache instead of github api
IgorTodorovskiIBM Jul 17, 2023
76865bc
help updated
HarithaIBM Jul 19, 2023
338c76a
help updated
HarithaIBM Jul 19, 2023
3f57c06
Update .gitattributes
IgorTodorovskiIBM Jul 19, 2023
8c4be49
Remove oauth from skeleton code
IgorTodorovskiIBM Jul 19, 2023
455b7dc
Fix installed query when root location has hyphen
IgorTodorovskiIBM Jul 19, 2023
da30679
Merge pull request #32 from DevonianTeuchter/zopenalthelp
DevonianTeuchter Jul 19, 2023
cc692e9
Fix detailed listing
IgorTodorovskiIBM Jul 20, 2023
cdac1fe
Updates to zopen-init, query, and install
IgorTodorovskiIBM Jul 21, 2023
1e24bd8
Remove unneeded code
IgorTodorovskiIBM Jul 21, 2023
e4bb523
removed zopen-bootstrap rexx file references
HarithaIBM Jul 21, 2023
6b8b8fc
modified error text
HarithaIBM Jul 21, 2023
d75434c
Update packages and zopen-init
IgorTodorovskiIBM Jul 21, 2023
6452340
Merge pull request #34 from DevonianTeuchter/rexxFileRemoved
HarithaIBM Jul 26, 2023
451a5f2
Add upgradeable option + more fixes to query
IgorTodorovskiIBM Aug 10, 2023
5677148
Merge pull request #30 from IgorTodorovskiIBM/json_cache
IgorTodorovskiIBM Aug 10, 2023
2b3e2db
Add --all option to zopen install --help
IgorTodorovskiIBM Aug 10, 2023
237e3c4
Add a check for the expanded size and ask the user if they want to co…
IgorTodorovskiIBM Aug 10, 2023
8b8f234
Add option to append to profile rather than asking user
IgorTodorovskiIBM Aug 10, 2023
4f26456
Copy with force to avoid permission denied
IgorTodorovskiIBM Aug 11, 2023
2250ad3
Avoid .zopen-config processing
IgorTodorovskiIBM Aug 11, 2023
78cef2c
fix for print elapsed time exit issue
HarithaIBM Aug 11, 2023
7bd72d4
Update documentation to reflect new zopen commands
IgorTodorovskiIBM Aug 11, 2023
5d1b796
Merge pull request #35 from IgorTodorovskiIBM/add_all_to_help
DevonianTeuchter Aug 14, 2023
f8ee17f
Merge pull request #36 from IgorTodorovskiIBM/add_size_check
DevonianTeuchter Aug 14, 2023
420309d
Merge pull request #37 from IgorTodorovskiIBM/append_to_profile
DevonianTeuchter Aug 14, 2023
08c95cf
Fix install for tools that are substrings of other tools
IgorTodorovskiIBM Aug 14, 2023
5c29cb9
Set default umask to 0002 in common.inc
IgorTodorovskiIBM Aug 14, 2023
61b7af5
Merge pull request #43 from IgorTodorovskiIBM/fix_install_make
DevonianTeuchter Aug 14, 2023
911e0e6
Use relative zopen-download as opposed to zopen as found in .zopen-co…
IgorTodorovskiIBM Aug 14, 2023
07fbbc1
Merge pull request #45 from IgorTodorovskiIBM/fix_zopen_install_build
DevonianTeuchter Aug 14, 2023
f7256d1
Allow user to select STABLE or DEV release
IgorTodorovskiIBM Aug 14, 2023
a391698
Merge pull request #46 from IgorTodorovskiIBM/dev_or_stable
DevonianTeuchter Aug 15, 2023
7a922e5
Store zopen json cache into standard cache location. Also download it…
IgorTodorovskiIBM Aug 15, 2023
e04a250
Unset variables at end of common.inc
IgorTodorovskiIBM Aug 15, 2023
b12d1f1
Unset variables at end of common.inc
IgorTodorovskiIBM Aug 15, 2023
d57f660
removed commented lines
HarithaIBM Aug 16, 2023
9934cd6
added return in printInfo and printWarning as well
HarithaIBM Aug 16, 2023
9f6ba9b
Merge pull request #49 from IgorTodorovskiIBM/fix_json_cache
IgorTodorovskiIBM Aug 16, 2023
919fc6f
Merge pull request #40 from IgorTodorovskiIBM/docs
IgorTodorovskiIBM Aug 16, 2023
0f4b7ac
Merge pull request #39 from DevonianTeuchter/printElapsedTimeerror
IgorTodorovskiIBM Aug 16, 2023
6bd0a0d
Optimize .env processing
IgorTodorovskiIBM Aug 16, 2023
52d5411
Remove set -x
IgorTodorovskiIBM Aug 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
* text working-tree-encoding=ISO8859-1
*.pem text working-tree-encoding=UTF-8
*.png binary working-tree-encoding=UTF-8
*.png binary
*.gif binary
*.pax.Z binary
Empty file added .pinned
Empty file.
1 change: 1 addition & 0 deletions .version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.3.0-dt-stable
130 changes: 69 additions & 61 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,90 +1,98 @@
# meta
# meta-dt
A reworking of the main meta project to add additional package management facilities, similar to utilities like apt, dpkg, yum, yast2, emerge .... just written in pure shell script (and a tiny bit of REXX) to remove any pre-reqs (like python/perl/bash etc).
This fork is designed for everyday usage of the zos Open Tools ports within the USS environment or for those who wish to download the tools; users who are interested in building and/or porting packages from scratch should use the main release of meta at this time.

Meta repository to tie together the various underlying z/OS Open Source tools repositories here.
## Installation
- Download the pax to a suitable location (for example /tmp).
- Expand the pax using the command ```pax -rvf <filename>.pax```. This will expand the pax to the current directory, listing the various included files as it does so.
- From the ```meta-<ver>/bin``` directory run the following command, answering the questions appropriately:
```
>zopen init
```

View our documentation at https://zosopentools.github.io/meta/.

## Background
## Pre-config
It is advised to have the following set on the system to ensure correct operation:
```
export _BPXK_AUTOCVT=ON
export _CEE_RUNOPTS="$_CEE_RUNOPTS FILETAG(AUTOCVT,AUTOTAG) POSIX(ON)"
export _TAG_REDIR_ERR=txt
export _TAG_REDIR_IN=txt
export _TAG_REDIR_OUT=txt
```

There are some key 'foundational' Open Source technologies needed to port software. The goal of this set of repositories is to provide minimal 'port' repositories
that can be used to get a foundational software package building on z/OS.
We are starting with what we view as some 'foundational' technologies. One is the stack of technology to be able to build [zsh](https://sourceforge.net/projects/zsh/postdownload). Another is to
be able to build [protocol buffers](https://github.com/protocolbuffers/protobuf/releases).
## Sample usage
```
>./zopen init
>. $HOME/.zopen-config
>./zopen list --installed
>zopen install which
>zopen list --installed
>which which
>zopen upgrade
```

But - there is a _transitive closure_ problem to address with porting a software package, namely understanding what packages are pre-requisites
for the software package you want to port. As an example, for zsh, we see the following:
## Important usage notes
- On first run, ```zopen init``` will copy this forked version of meta into the "package" area of zopen (ie. where packages are expanded and accessed from). It will also be pinned to this release to prevent any possible updates from the "real" meta package. Removing the .pinned file from the meta-dt directory will allow for the main meta port to be installed however this will cause incompatabilities if run.

zsh requires autoconf to configure the build scripts, GNU make to run Makefiles, ncurses
zsh is easier to develop (but doesn't require) curl and git natively on z/OS, and GNU techinfo for documentation.
- Remote respositores utilise the suffix ```port``` - where required, packages should be specified **withOUT** the suffix. eg using ```zopen install which``` rather than ```zopen install whichport```

autoconf requires m4, automake, and GNU make
m4 requires a c99 compiler with c11 features, so make sure you have the latest C/C++ compilers installed on your system.
## System install
- Selecting ```'/' ``` as the root filesystem will allow the tools to be available system wide for all users who configure their usage. The install needs to be done by a sysadmin [or someone with sufficient rights using the sudo port for example] as the installer will write files to the /usr tree and configuration information to /etc. The installing sysadmin will have a `.zopen-config` generated in their ```$HOME``` directory, specific to their install properties - their GitHub Access Token for example. There will also be a "skeleton" configuration file written as ```/etc/skel/.zopen-config``` - this can be used as a template for individual users. The skeleton template does not contain the installer's GH token (if configured during install) but inserts a placeholder should the user have their own GH token. Copying the ```/etc/skel/.zopen-config``` to a user's $HOME directory will allow them to source it easily on login using ```. $HOME/.zopen-config```.
- Removing zopen and the z/OS Open Tools once installed involves: uninstalling all installed packages; removing any copies of ```.zopen-config```; removing the configured zopen root directory (by default ```/usr/local/zopen``` but is set during installation); and then running a command to find any final orphaned symlinks on the system, such as: ```/bin/find $ZOPEN_ROOTFS -type l -exec test ! -e {} \; -print``` where $ZOPEN_ROOTFS is '/' [replace `-print` with `rm -rf` to actually remove symlinks, the example command should only list what was found - care should be taken when removing any files with sysadmin authority to prevent removing critial files!]

GNU make requires GNU m4, automake, autoconf, Perl, and a C compiler that is gcc compatible.

## Order to Build _from scratch_
## Problem resolution
If the meta package does get updated to a non-dt version, then running ```./zopen alt meta -s``` from the meta-dt/bin directory within the z/OS Open Tools root filesystem should allow selection of the dt-forked meta; running any other non-forked zopen commands might break the installation or cause unexpected behaviour!
zopen commands take a ```--verbose``` parameter to produce additional messages that can be used to aid problem diagnosis.

If you want to build the tools from scratch and not use the binary pax files available, you will want
to tackle this in a particular order.
First, you need to have some tools installed on your system:
## Basic command introduction
Most commands have extended help available using the ```--help``` parameter. The following usage guidance should be sufficient to get a system running

### System Prerequisites
>zopen init

Use `zopen-setup` to download the bootstrap environment. This will provide you with the
minimum required set of tools to get started. Otherwise you can download the tools individually at the below links.
Used to initialise a z/OS Open Tools environment. By default, this will create a ```zopen``` directory in your ```$HOME``` directory as the root filesystem (rootfs). The rootfs holds the various packages, configuration and environment for z/OS Open Tools packages - removing this directory will revert the system without a trace. A z/OS Open Tools main configuration file is generated in ```$HOME/.zopen-config``` - to enable the z/OS Open Tools, this will either need to be sourced after logon to the system or the following line can be added to ```$HOME/.profile``` (or .bash_profile or...) to automatically source the z/OS Open Tools configuration file
>[ -e "$HOME/.zopen-config" ] && . $HOME/.zopen-config
It is possible to reinitialize a system using the ```re-init``` option - doing so will remove the previous configuration though the rootfs can overlap the old filesystem to reuse installed and/or cached packages for example. Initialisation on a system that has previously had a z/OS Open Tools configuration should allow some parameters to be copied across, such as Github tokens.

| Project | License | Download link |
|---------|---------|------------------------|
| [gnu make 4.1](https://www.gnu.org/software/make/) | [GPL V3](https://www.gnu.org/licenses/gpl-3.0.html) | [z/OS Open Tools release](https://github.com/ZOSOpenTools/makeport/releases/tag/boot) |
| [IBM XL C/C++ V2.4.1](https://www-40.ibm.com/servers/resourcelink/svc00100.nsf/pages/xlCC++V241ForZOsV24) | IBM [^ibm] | [ibm.com web download](https://www.ibm.com/marketing/iwm/iwm/web/dispatcher.do?source=swg-zosxlcc) |
| [git](https://git.kernel.org/pub/scm/git/git.git/) | [LGPL V2.1](https://git.kernel.org/pub/scm/git/git.git/tree/LGPL-2.1) | [z/OS Open Tools release](https://github.com/ZOSOpenTools/gitport/releases/tag/boot) |
| [curl](https://github.com/curl/curl) | [curl-license](https://github.com/curl/curl/blob/master/COPYING) | [z/OS Open Tools release](https://github.com/ZOSOpenTools/curlport/releases/tag/boot) |
| [gunzip](https://www.gnu.org/software/gzip/) | [GPL V3](https://www.gnu.org/licenses/gpl-3.0.html) | [z/OS Open Tools release](https://github.com/ZOSOpenTools/unzipport/releases/tag/boot) |
>zopen install <package>...

[^ibm]: a no-charge add-on feature for clients that have enabled the XL C/C++ compiler (an optionally priced feature) on z/OS
Used to install a z/OS Open Tools package. By default, the latest version is installed although options are available to install specific versions, tags or to pick from a selection [see ```--help``` for more]

### Recommended software
>zopen upgrade

| Project | License | Download link |
|---------|---------|------------------------|
| [bash](https://www.gnu.org/software/bash/) | [GPL V3](https://www.gnu.org/licenses/gpl-3.0.html) | [z/OS Open Tools release](https://github.com/ZOSOpenTools/bashport/releases/) |
Used to upgrade z/OS Open Tools packages. Without parameters, all installed packages will be upgraded; individual packages can be specified on the command line to upgrade only those packages. Packages can be "pinned" to prevent upgrading in case a later release is found to be broken or incompatible - creating a ```.pinned``` file in the package directory prevents the upgrade; removing the file allows upgrades to occur.

Both IBM and Rocket provide supported versions of the software above for a fee.
>zopen clean [--cache] [--unused] [--dangling] [--all]

Taking the defaults will mean there are less variables for you to configure. We recommend you structure your sandbox as follows:
Used to remove resources on the system. zopen will retain old versions of packages to allow for switching versions or quick re-installs; downloaded pax files are held in a cache while the specific version files are maintained in the directory configured during initialisation. Using the ```clean``` option removes those unused resources. In addition, zopen utilises symlinks for maintaining the appropriate file structure - should a problem occur during package installation, removal or version change, danling symlinks might be present; the ``--dangling`` option will (slowly) analyse the rootfs and prune any dangling symlinks.

- Have the root of your development file system be `$HOME/zopen` (you will want to have several gigabytes of storage for use - we recommend at least 15GB)
- Have sub-directories called _boot_, _prod_, _dev_.
- _boot_: sub-directory for each tool required to bootstrap (make, git, curl, gunzip, m4)
- _prod_: sub-directory for tools to be installed once built. These tools will be used by downstream software, e.g. make build process will use the Perl prod build
- _dev_: sub-directory for tools you are building
>zopen alt [package] [-s]

### Build Order
Used to list versions of a package if there are multiple versions present; using the ```-s``` parameter allows for the active version to be changed

The tools have dependencies on other tools, and there are also typically 2 ways the tools are packaged:
>zopen remove <package>...

- one that is pre-configured and therefore doesn't need autoconf/automake and associated tools
- one that is not pre-reconfigured and therefore does require autoconf/automake and associated tools
Removes a package from the system, leaving the version on the system for re-use later; the ```---purge`` directory will also remove the versioned directory, requiring a potential download and/or an unpax to occur to re-install that version

To build from scratch, start with the tarballs of the following tools:

| Project | License | Pre-requisites |
|---------|---------|------------------------|
| [m4](https://www.gnu.org/software/m4/m4.html) | [GPL V3 ](https://www.gnu.org/licenses/gpl-3.0.html) | m4, curl in boot and xlclang installed on the system |
| [perl](https://dev.perl.org/) | [GPL V3 ](https://www.gnu.org/licenses/gpl-3.0.html) | additionally requires make, git in boot and m4 in prod |
| [make](https://www.gnu.org/software/make/) | [GPL V3 ](https://www.gnu.org/licenses/gpl-3.0.html) | perl in prod for running test cases |
| [zlib](https://zlib.net/) | [zlib license](https://zlib.net/zlib_license.html) | make in prod |
| [autoconf](https://www.gnu.org/software/autoconf/) | [GPL V3](https://www.gnu.org/licenses/gpl-3.0.html) | libz in prod |
| [automake](https://www.gnu.org/software/automake/) | [GPL V3](https://www.gnu.org/licenses/gpl-3.0.html) | autoconf in prod |
>zopen list [--installed]

Once you either have these tools built, or have downloaded a pre-built pax file for the build, you may want to build other tools.
Each tool has a _buildenv_ file and one of the entries will describe the tools it requires to build, depending
on where the source is from (currently TARBALL or GIT clone). So for example m4 requires:
With no parameters, will list the available packages against the currently installed versions; more usefully, using the ```--installed``` parameter lists the actually locally-installed packages rather than all potential packages

`ZOPEN_TARBALL_DEPS="curl gzip make m4"`
>zopen search <package>

and:
Searches the remote repositiory for the specified package, returning appropriate meta-data about the package if found

>zopen query <option>

Queries the local z/OS Open Tools sytem. See ```---help``` for more details




### Useful resources
- View the z/OS Open Tools project home: https://github.com/ZOSOpenTools
- View the main Meta documentation at https://zosopentools.github.io/meta/

`ZOPEN_GIT_DEPS="git make m4 help2man perl makeinfo xz autoconf automake gettext"`

If you want to build from the `git` clone, you can see you will need to have more software pre-installed.
Loading