diff --git a/leap.def b/Leap.def similarity index 100% rename from leap.def rename to Leap.def diff --git a/README.SUSE b/README.SUSE index f5b363c..ea6fff7 100644 --- a/README.SUSE +++ b/README.SUSE @@ -12,15 +12,15 @@ of bootdef variables need to be specified: SLE version and service pack level: . Example: SLE-12 SP4 would be 12.4. The inital release of a major version corresponds to - 0. + 0. 3. For openSUSE the following variables need to be specified: - * MirrorURL: URL to the installation repository. Following URL + * MirrorURL: URL to the installation repository. Following URL should be work: http://download.opensuse.org/distribution/openSUSE-stable/repo/oss * UpdateURL: (optional) URI of the update repository -4. For SLE, all required settings are obtained from SCC via - suseconnect-container. If the container should be registered separately +4. For SLE, all required settings are obtained from SCC via + suseconnect-container. If the container should be registered separately the following variables are recognized: * Product: The product code: The following forms may be used: @@ -53,8 +53,11 @@ of bootdef variables need to be specified: Examples ======== -Example defintions for openSUSE leap, registration via suseconnect-container, SLE12-SP5 -and SLE15-SP5 are in the same directory as README.SUSE +Example defintions for a generic SUSE installation using the +repositories registered on the build host (SUSE.def) as well +as for the running OS version are available in +/usr/share/apptainer/templates. + ProductPGP ========== diff --git a/SLE-15SP5.def b/SLE-15SP5.def new file mode 100644 index 0000000..a91b3d8 --- /dev/null +++ b/SLE-15SP5.def @@ -0,0 +1,39 @@ +BootStrap: zypper +OSVersion: 15.5 +Include: zypper +Product: SLES/15.5/x86_64 +User: EMAIL +Regcode: REGCODE +MirrorURL: https://updates.suse.com/SUSE/Products/SLE-BCI/15-SP5/x86_64/product/ +# Just base modules here, other modules are installed in post +Modules: \n\ +sle-module-basesystem,\n\ +sle-module-server-applications + +ProductPGP:\n\ +SLEpgp: -----BEGIN PGP PUBLIC KEY BLOCK-----\n\ +Version: rpm-4.11.2 (NSS-3)\n\ +\n\ +mQENBFEKlmsBCADbpZZbbSC5Zi+HxCR/ynYsVxU5JNNiSSZabN5GMgc9Z0hxeXxp\n\ +YWvFoE/4n0+IXIsp83iKvxf06Eu8je/DXp0lMqDZu7WiT3XXAlkOPSNV4akHTDoY\n\ +91SJaZCpgUJ7K1QXOPABNbREsAMN1a7rxBowjNjBUyiTJ2YuvQRLtGdK1kExsVma\n\ +hieh/QxpoDyYd5w/aky3z23erCoEd+OPfAqEHd5tQIa6LOosa63BSCEl3milJ7J9\n\ +vDmoGPAoS6ui7S2R5X4/+PLN8Mm2kOBrFjhmL93LX0mrGCMxsNsKgP6zabYKQEb8\n\ +L028SXvl7EGoA+Vw5Vd3wIGbM73PfbgNrXjfABEBAAG0KFN1U0UgUGFja2FnZSBT\n\ +aWduaW5nIEtleSA8YnVpbGRAc3VzZS5kZT6JATwEEwECACYCGwMGCwkIBwMCBBUC\n\ +CAMEFgIDAQIeAQIXgAUCWEfrHwUJDsIitAAKCRBwr56BOdt8gpqUB/wPSSS5BcDu\n\ +Oi4n02cj4Hdt7WITKBjjo0lG1fXG1ppx1wOST+s8FertMVFY53TW6FGjcYtwVOIq\n\ +rsMYiV6kf1NxUV/jcAy7VmC5EZnO0R/D3sT4Oh5hsLtERauZolK5BZmd0S51Qa8e\n\ +TxZ5mX9PL2i3s/ShETc30drf83ugc7B4yZPNQWXNDPgGcC+hEeC5qw48RzHYIpUt\n\ +RzHmefR5Z3ioTUbDlzy+SGP2uA7mhR4Lfk/df5fYxWfCoKlyGjtrvA65cB+Pksyn\n\ +xrAeBuB+vBM+KnDrxW2Sn4AbWkzH//dfz9OJDJu4UM91hb7qxM0OkrXHQV3iNqzg\n\ +MDEhky/9NqMy\n\ +=GdP5\n\ +-----END PGP PUBLIC KEY BLOCK----- + + + +%post + update-ca-certificates + echo "Hello from post boot strap" + zypper in -y vim diff --git a/SLE.def b/SUSE.def similarity index 99% rename from SLE.def rename to SUSE.def index 8fe9cae..e017b87 100644 --- a/SLE.def +++ b/SUSE.def @@ -5,4 +5,3 @@ BootStrap: zypper update-ca-certificates echo "Hello from post boot strap" zypper in -y vim - diff --git a/apptainer.changes b/apptainer.changes index c15ac9f..b0cfcb1 100644 --- a/apptainer.changes +++ b/apptainer.changes @@ -27,6 +27,7 @@ Wed Jan 31 14:14:20 UTC 2024 - Egbert Eich instead of exiting with a fatal error. * Allow templated build arguments to definition files to have empty values. +- Package .def templates separately for different SPs. ------------------------------------------------------------------- Tue Oct 24 06:02:44 UTC 2023 - Egbert Eich diff --git a/apptainer.spec b/apptainer.spec index 488ed42..56c167b 100644 --- a/apptainer.spec +++ b/apptainer.spec @@ -35,9 +35,10 @@ Conflicts: singularity-ce Conflicts: singularity-runtime Source0: https://github.com/apptainer/apptainer/archive/v%{version}%{?vers_suffix}/apptainer-%{version}%{?vers_suffix}.tar.gz Source1: README.SUSE -Source2: SLE-15SP6.def -Source3: SLE.def -Source4: leap.def +Source2: SUSE.def +Source3: SLE-15SP5.def +Source4: SLE-15SP6.def +Source5: Leap.def Source20: %{name}-rpmlintrc Source21: vendor.tar.gz BuildRequires: cryptsetup @@ -56,6 +57,10 @@ BuildRequires: libseccomp-devel Requires: squashfs Requires: squashfuse Recommends: fuse2fs +Requires: (apptainer-leap if product(Leap) = 15.5) +Requires: (apptainer-sle15_5 if product(SUSE_SLE) = 15.5) +Requires: (apptainer-sle15_6 if product(SUSE_SLE) = 15.6) + # Needed for container decryption in userspace, upstream rpms include this # but factory should have this seperately Recommends: gocryptfs @@ -68,9 +73,36 @@ ExcludeArch: ppc64 ppc64le %ix86 s390 s390x Apptainer provides functionality to make portable containers that can be used across host environments. +%package sle15_5 +Summary: Apptainer Definition File Templates for SLE 15 SP5 +BuildArch: noarch +Requires: apptainer + +%description sle15_5 +The package provides a definition file template for Apptainer containers +based on SUSE Linux Enterprise 15 SP5. + +%package sle15_6 +Summary: Apptainer Definition File Templates for SLE 15 SP6 +BuildArch: noarch +Requires: apptainer + +%description sle15_6 +The package provides a definition file template for Apptainer containers +based on SUSE Linux Enterprise 15 SP6. + +%package leap +Summary: Apptainer Definition File Templates for current openSUSE Leap +BuildArch: noarch +Requires: apptainer + +%description leap +The package provides a definition file template for Apptainer containers +based on the latest openSUSE Leap release. + %prep %setup -q -n %{name}-%{version}%{?vers_suffix} -cp %{S:1} %{S:2} %{S:3} %{S:4} . +cp %{S:1} . %build @@ -105,6 +137,8 @@ export GOFLAGS=-mod=vendor export PATH=$GOPATH/bin:$PATH %make_install -C builddir V= +install -d -m 0755 %{buildroot}/%{_datarootdir}/apptainer/templates +install -m 0644 %{S:2} %{S:3} %{S:4} %{S:5} %{buildroot}/%{_datarootdir}/apptainer/templates %fdupes apptainer/examples %fdupes -s %buildroot @@ -116,8 +150,6 @@ export PATH=$GOPATH/bin:$PATH %doc CHANGELOG.md %doc CONTRIBUTORS.md %doc %{basename:%{S:1}} -%doc %{basename:%{S:2}} -%doc %{basename:%{S:3}} %license LICENSE.md %license LICENSE_THIRD_PARTY.md %license LICENSE_DEPENDENCIES.md @@ -126,9 +158,12 @@ export PATH=$GOPATH/bin:$PATH %dir %{_libexecdir}/apptainer/bin %dir %{_libexecdir}/apptainer/cni %dir %{_libexecdir}/apptainer/lib +%dir %{_datarootdir}/apptainer +%dir %{_datarootdir}/apptainer/templates %{_libexecdir}/apptainer/bin/starter %{_libexecdir}/apptainer/lib/offsetpreload.so %{_libexecdir}/apptainer/cni/* +%{_datarootdir}/apptainer/templates/%{basename:%{S:2}} %dir %{_sysconfdir}/apptainer %config(noreplace) %{_sysconfdir}/apptainer/capability.json %config(noreplace) %{_sysconfdir}/apptainer/cgroups @@ -147,4 +182,13 @@ export PATH=$GOPATH/bin:$PATH %dir %{_localstatedir}/lib/apptainer/mnt/session %{_mandir}/man1/* +%files sle15_5 +%{_datarootdir}/apptainer/templates/%{basename:%{S:3}} + +%files sle15_6 +%{_datarootdir}/apptainer/templates/%{basename:%{S:4}} + +%files leap +%{_datarootdir}/apptainer/templates/%{basename:%{S:5}} + %changelog