Skip to content

Commit f43ee98

Browse files
committedNov 25, 2022
ported
1 parent 58ab7b7 commit f43ee98

File tree

1 file changed

+166
-178
lines changed

1 file changed

+166
-178
lines changed
 

‎docs/packaging-support.md

+166-178
Original file line numberDiff line numberDiff line change
@@ -1,178 +1,166 @@
1-
.. _packaging_support:
2-
3-
Packaging support
4-
=================
5-
6-
.. contents::
7-
:depth: 2
8-
:backlinks: none
9-
10-
.. note::
11-
Packaging support was added as an experimental feature in EasyBuild v2.2.0
12-
(cfr. :ref:`experimental_features`). Since EasyBuild v2.5.0, it is considered stable.
13-
14-
15-
.. _packaging_prereq:
16-
17-
Prerequisites
18-
-------------
19-
20-
EasyBuild leverages `FPM <https://github.com/jordansissel/fpm>`_ to create binary packages (RPMs, Debian files, etc.).
21-
22-
Hence, FPM must be available in some way or another. One way is via EasyBuild, for example by installing a module
23-
for FPM using one of the available easyconfig files.
24-
25-
EasyBuild will also take care of installing Ruby for you (which is required for FPM itself)::
26-
27-
$ export EASYBUILD_PREFIX=/home/example
28-
29-
$ eb FPM-1.3.3-Ruby-2.1.6.eb --robot
30-
[...]
31-
== building and installing Ruby/2.1.6...
32-
[...]
33-
== COMPLETED: Installation ended successfully
34-
[...]
35-
== building and installing FPM/1.3.3-Ruby-2.1.6...
36-
[...]
37-
== COMPLETED: Installation ended successfully
38-
== Results of the build can be found in the log file /home/example/software/FPM/1.3.3-Ruby-2.1.6/easybuild/easybuild-FPM-1.3.3-20150524.181859.log
39-
== Build succeeded for 2 out of 2
40-
41-
$ module load FPM/1.3.3-Ruby-2.1.6
42-
43-
$ fpm --version
44-
1.3.3
45-
46-
47-
.. _packaging_config:
48-
49-
Configuration options
50-
---------------------
51-
52-
Several configuration options related to packaging support are available.
53-
54-
* ``--package``:
55-
56-
* enables packaging; other options will be void unless this option is enabled
57-
58-
* ``--package-tool=<tool>``:
59-
60-
* specifies which tool you wish to package with; for now, only ``fpm`` is supported (and is set as default)
61-
62-
* ``--package-type=<type>``:
63-
64-
* specifies which type of package you wish to build, which is passed through to ``fpm`` (as target type);
65-
examples include: ``rpm`` (default), ``deb``, ... (see https://github.com/jordansissel/fpm/wiki#overview)
66-
67-
* ``--package-naming-scheme=<PNS>``:
68-
69-
* specifies which package naming scheme to use; default: ``EasyBuildPNS``
70-
71-
* ``--packagepath``:
72-
73-
* specifies destination path of packages being built
74-
75-
* ``--package-release``:
76-
77-
* specifies the package release (default: ``1``); typically, this should be an integer value
78-
79-
80-
.. note:: Changing the package naming scheme should be done with caution. For example, RPM will only allow one package
81-
of a particular *name* to be installed, so if you wish multiple versions of a package to be installed
82-
at the same time you need to ensure variables like the software version are included in the package name.
83-
84-
85-
.. _packaging_usage:
86-
87-
Usage
88-
-----
89-
90-
To make EasyBuild generate packages, just use ``--package``.
91-
By default, this will make EasyBuild leverage FPM to create RPMs::
92-
93-
$ export EASYBUILD_PREFIX=/home/example
94-
$ eb --package Perl-5.20.1-GCC-4.9.2-bare.eb --robot
95-
[...]
96-
== building and installing Perl/5.20.1-GCC-4.9.2-bare...
97-
== fetching files...
98-
== creating build dir, resetting environment...
99-
== unpacking...
100-
== patching...
101-
== preparing...
102-
== configuring...
103-
== building...
104-
== testing...
105-
== installing...
106-
== taking care of extensions...
107-
== postprocessing...
108-
== sanity checking...
109-
== cleaning up...
110-
== creating module...
111-
== packaging...
112-
== COMPLETED: Installation ended successfully
113-
== Results of the build can be found in the log file /home/example/software/Perl/5.20.1-GCC-4.9.2-bare/easybuild/easybuild-Perl-5.20.1-20150527.023522.log
114-
== Build succeeded for 1 out of 1
115-
116-
117-
Packages will be located in the directory indicated by the ``--packagepath`` configuration option; by default, this
118-
corresponds to ``$prefix/packages``.
119-
120-
By defauilt, the package will have the following properties::
121-
122-
$ rpm -qip --requires --provides /home/example/packages/Perl-5.20.1-GCC-4.9.2-bare.eb2.2.0-1.x86_64.rpm
123-
Name : Perl-5.20.1-GCC-4.9.2-bare
124-
Version : eb2.2.0
125-
Release : 1
126-
Architecture: x86_64
127-
Install Date: (not installed)
128-
Group : default
129-
Size : 64539427
130-
License : unknown
131-
Signature : (none)
132-
Source RPM : Perl-5.20.1-GCC-4.9.2-bare.eb2.2.0-1.x86_64.src.rpm
133-
Build Date : Tue 07 Jul 2015 11:27:54 PM EDT
134-
Build Host : 59e46bbf1cd0
135-
Relocations : /
136-
Packager : <easybuild@59e46bbf1cd0>
137-
Vendor : easybuild@59e46bbf1cd0
138-
URL : http://example.com/no-uri-given
139-
Summary : no description given
140-
Description :
141-
no description given
142-
GCC-4.9.2-dummy-dummy
143-
rpmlib(PartialHardlinkSets) <= 4.0.4-1
144-
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
145-
rpmlib(CompressedFileNames) <= 3.0.4-1
146-
Perl-5.20.1-GCC-4.9.2-bare
147-
Perl-5.20.1-GCC-4.9.2-bare = eb2.2.0-1
148-
Perl-5.20.1-GCC-4.9.2-bare(x86-64) = eb2.2.0-1
149-
150-
.. _packaging_skip:
151-
152-
Packaging existing installations
153-
--------------------------------
154-
155-
To create packages for existing software installations (performed using EasyBuild), combine ``--package`` with
156-
``--skip --rebuild``::
157-
158-
$ eb --package Perl-5.20.1-GCC-4.9.2-bare.eb --skip --rebuild
159-
[...]
160-
== building and installing Perl/5.20.1-GCC-4.9.2-bare...
161-
== fetching files...
162-
== creating build dir, resetting environment...
163-
== unpacking [skipped]
164-
== patching [skipped]
165-
== preparing...
166-
== configuring [skipped]
167-
== building [skipped]
168-
== testing [skipped]
169-
== installing [skipped]
170-
== taking care of extensions...
171-
== postprocessing [skipped]
172-
== sanity checking...
173-
== cleaning up...
174-
== creating module...
175-
== packaging...
176-
== COMPLETED: Installation ended successfully
177-
== Results of the build can be found in the log file /home/example/software/Perl/5.20.1-GCC-4.9.2-bare/easybuild/easybuild-Perl-5.20.1-20150527.041734.log
178-
== Build succeeded for 1 out of 1
1+
# Packaging support {: #packaging_support }
2+
3+
!!! note
4+
Packaging support was added as an experimental feature in EasyBuild
5+
v2.2.0 (cfr. [Experimental features][experimental_features]).
6+
Since EasyBuild v2.5.0, it is considered stable.
7+
8+
## Prerequisites {: #packaging_prereq }
9+
10+
EasyBuild leverages [FPM](https://github.com/jordansissel/fpm) to create
11+
binary packages (RPMs, Debian files, etc.).
12+
13+
Hence, FPM must be available in some way or another. One way is via
14+
EasyBuild, for example by installing a module for FPM using one of the
15+
available easyconfig files.
16+
17+
EasyBuild will also take care of installing Ruby for you (which is
18+
required for FPM itself):
19+
20+
``` console
21+
$ export EASYBUILD_PREFIX=/home/example
22+
23+
$ eb FPM-1.3.3-Ruby-2.1.6.eb --robot
24+
[...]
25+
== building and installing Ruby/2.1.6...
26+
[...]
27+
== COMPLETED: Installation ended successfully
28+
[...]
29+
== building and installing FPM/1.3.3-Ruby-2.1.6...
30+
[...]
31+
== COMPLETED: Installation ended successfully
32+
== Results of the build can be found in the log file /home/example/software/FPM/1.3.3-Ruby-2.1.6/easybuild/easybuild-FPM-1.3.3-20150524.181859.log
33+
== Build succeeded for 2 out of 2
34+
35+
$ module load FPM/1.3.3-Ruby-2.1.6
36+
37+
$ fpm --version
38+
1.3.3
39+
```
40+
41+
## Configuration options {: #packaging_config }
42+
43+
Several configuration options related to packaging support are
44+
available.
45+
46+
- `--package`:
47+
- enables packaging; other options will be void unless this option
48+
is enabled
49+
- `--package-tool=<tool>`:
50+
- specifies which tool you wish to package with; for now, only
51+
`fpm` is supported (and is set as default)
52+
- `--package-type=<type>`:
53+
- specifies which type of package you wish to build, which is
54+
passed through to `fpm` (as target type); examples include:
55+
`rpm` (default), `deb`, ... (see
56+
<https://github.com/jordansissel/fpm/wiki#overview>)
57+
- `--package-naming-scheme=<PNS>`:
58+
- specifies which package naming scheme to use; default:
59+
`EasyBuildPNS`
60+
- `--packagepath`:
61+
- specifies destination path of packages being built
62+
- `--package-release`:
63+
- specifies the package release (default: `1`); typically, this
64+
should be an integer value
65+
66+
!!! note
67+
Changing the package naming scheme should be done with caution. For example, RPM will only allow one package
68+
of a particular *name* to be installed, so if you wish multiple
69+
versions of a package to be installed at the same time you need to
70+
ensure variables like the software version are included in the
71+
package name.
72+
73+
## Usage {: #packaging_usage }
74+
75+
To make EasyBuild generate packages, just use `--package`. By default,
76+
this will make EasyBuild leverage FPM to create RPMs:
77+
78+
``` console
79+
$ export EASYBUILD_PREFIX=/home/example
80+
$ eb --package Perl-5.20.1-GCC-4.9.2-bare.eb --robot
81+
[...]
82+
== building and installing Perl/5.20.1-GCC-4.9.2-bare...
83+
== fetching files...
84+
== creating build dir, resetting environment...
85+
== unpacking...
86+
== patching...
87+
== preparing...
88+
== configuring...
89+
== building...
90+
== testing...
91+
== installing...
92+
== taking care of extensions...
93+
== postprocessing...
94+
== sanity checking...
95+
== cleaning up...
96+
== creating module...
97+
== packaging...
98+
== COMPLETED: Installation ended successfully
99+
== Results of the build can be found in the log file /home/example/software/Perl/5.20.1-GCC-4.9.2-bare/easybuild/easybuild-Perl-5.20.1-20150527.023522.log
100+
== Build succeeded for 1 out of 1
101+
```
102+
103+
Packages will be located in the directory indicated by the
104+
`--packagepath` configuration option; by default, this corresponds to
105+
`$prefix/packages`.
106+
107+
By default, the package will have the following properties:
108+
109+
``` console
110+
$ rpm -qip --requires --provides /home/example/packages/Perl-5.20.1-GCC-4.9.2-bare.eb2.2.0-1.x86_64.rpm
111+
Name : Perl-5.20.1-GCC-4.9.2-bare
112+
Version : eb2.2.0
113+
Release : 1
114+
Architecture: x86_64
115+
Install Date: (not installed)
116+
Group : default
117+
Size : 64539427
118+
License : unknown
119+
Signature : (none)
120+
Source RPM : Perl-5.20.1-GCC-4.9.2-bare.eb2.2.0-1.x86_64.src.rpm
121+
Build Date : Tue 07 Jul 2015 11:27:54 PM EDT
122+
Build Host : 59e46bbf1cd0
123+
Relocations : /
124+
Packager : <easybuild@59e46bbf1cd0>
125+
Vendor : easybuild@59e46bbf1cd0
126+
URL : http://example.com/no-uri-given
127+
Summary : no description given
128+
Description :
129+
no description given
130+
GCC-4.9.2-dummy-dummy
131+
rpmlib(PartialHardlinkSets) <= 4.0.4-1
132+
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
133+
rpmlib(CompressedFileNames) <= 3.0.4-1
134+
Perl-5.20.1-GCC-4.9.2-bare
135+
Perl-5.20.1-GCC-4.9.2-bare = eb2.2.0-1
136+
Perl-5.20.1-GCC-4.9.2-bare(x86-64) = eb2.2.0-1
137+
```
138+
139+
## Packaging existing installations {: #packaging_skip }
140+
141+
To create packages for existing software installations (performed using
142+
EasyBuild), combine `--package` with `--skip --rebuild`:
143+
144+
``` console
145+
$ eb --package Perl-5.20.1-GCC-4.9.2-bare.eb --skip --rebuild
146+
[...]
147+
== building and installing Perl/5.20.1-GCC-4.9.2-bare...
148+
== fetching files...
149+
== creating build dir, resetting environment...
150+
== unpacking [skipped]
151+
== patching [skipped]
152+
== preparing...
153+
== configuring [skipped]
154+
== building [skipped]
155+
== testing [skipped]
156+
== installing [skipped]
157+
== taking care of extensions...
158+
== postprocessing [skipped]
159+
== sanity checking...
160+
== cleaning up...
161+
== creating module...
162+
== packaging...
163+
== COMPLETED: Installation ended successfully
164+
== Results of the build can be found in the log file /home/example/software/Perl/5.20.1-GCC-4.9.2-bare/easybuild/easybuild-Perl-5.20.1-20150527.041734.log
165+
== Build succeeded for 1 out of 1
166+
```

0 commit comments

Comments
 (0)