-
-
Notifications
You must be signed in to change notification settings - Fork 650
Packaging guide
The preferred way of developing the packaging of cobbler is the Open Build Service - OBS in short.
For versions smaller or equal to 3.3.3 we have used debbuild
for generating .deb
packages.
Distros we want to successfully create packages for:
- CentOS (or a derivative of it)
- Fedora
- openSUSE/SUSE Linux Enterprise Server
- Debian
- Ubuntu
The offical reference setup can be found here: https://build.opensuse.org/project/show/home:cobbler-project
The setup evolved during the lifetime of Cobbler 3.x.x.
You need to have installed on your machine to build this locally:
osc
obs-service-tar
-
home:cobbler-project
- Empty project-
ci
: CI builds that are automatically submitted -
containers
: contains container images to run the applications -
github-ci
: contains container images that are aggregated from the subprojects-
main
: contains the container images that are needed to speed up the GitHub CI testing -
releaseXX
: where XX are each standing for a digit that are describing major and minor version of Cobbler
-
-
releaseXX
: where XX are each standing for a digit that are describing major and minor version of Cobbler
-
Project config:
%if 0%{?fedora_version}
Prefer: glibc-all-langpacks
%endif
The specfile is not working out of the box. You need to apply a diff that will fix the build.
Click to expand diff
diff --git a/cobbler.spec b/cobbler/cobbler.spec
index 8b920b5..89e15a4 100644
--- a/cobbler.spec
+++ b/cobbler/cobbler.spec
@@ -39,8 +39,8 @@
Summary: Boot server configurator
Name: cobbler
License: GPLv2+
-Version: v3.0.1
-Release: 0%{?dist}
+Version: 2.9.0
+Release: 1%{?dist}
Source0: https://github.com/cobbler/cobbler/releases/cobbler-%{version}.tar.gz
BuildArch: noarch
Url: https://cobbler.github.io
@@ -50,14 +50,8 @@ BuildRequires: openssl
%if 0%{?rhel}
BuildRequires: python36-devel
-BuildRequires: python36-future
-BuildRequires: python36-distro
-BuildRequires: python36-coverage
%else
BuildRequires: python3-devel
-BuildRequires: python3-future
-BuildRequires: python3-distro
-BuildRequires: python3-coverage
%endif
%if 0%{?rhel}
@@ -307,7 +301,7 @@ fi
%{_var}/log/cobbler
# documentation
-%doc COPYING README.md
+%doc AUTHORS COPYING README docs/README.suse
%{_mandir}/man1/cobbler.1.gz
@@ -348,7 +342,7 @@ sed -i -e "s/SECRET_KEY = ''/SECRET_KEY = \'$RAND_SECRET\'/" /usr/share/cobbler/
%files -n cobbler-web
-%doc COPYING README.md
+%doc AUTHORS COPYING README
%{python3_sitelib}/cobbler/web/
%exclude %{python3_sitelib}/cobbler/web/settings.py
@@ -399,7 +393,7 @@ Cobbler module providing secure dynamic dns updates
%config(noreplace) %{_sysconfdir}/cobbler/settings.d/nsupdate.settings
%{python3_sitelib}/cobbler/modules/nsupdate*
-%doc COPYING README.md
+%doc AUTHORS COPYING README
%changelog
Example _service
Click to expand _service
file
<services>
<service mode="disabled" name="obs_scm">
<param name="url">https://github.com/cobbler/cobbler.git</param>
<param name="scm">git</param>
<param name="revision">v3.0.1</param>
<param name="versionformat">@PARENT_TAG@</param>
<param name="versionrewrite-pattern">v(.*)</param>
<param name="extract">cobbler.spec</param>
</service>
<service mode="disabled" name="set_version"/>
<service name="tar" mode="disabled"/>
<service name="recompress" mode="disabled">
<param name="compression">gz</param>
<param name="file">*.tar</param>
</service>
</services>
Example project meta
Click to expand project meta
<project name="home:cobbler-project:release30">
<title>Cobbler 3.0.x release project</title>
<description/>
<person userid="cobbler-project" role="maintainer"/>
<repository name="standard">
<path project="Fedora:29" repository="standard"/>
<arch>i586</arch>
<arch>x86_64</arch>
<arch>ppc</arch>
<arch>ppc64</arch>
<arch>s390x</arch>
<arch>local</arch>
<arch>armv6l</arch>
<arch>armv7l</arch>
<arch>aarch64</arch>
<arch>ppc64le</arch>
<arch>aarch64_ilp32</arch>
<arch>riscv64</arch>
</repository>
</project>
Rewrite with debbuild
Example _service
In the following you will see the _service
-file which we recommend:
Click to expand _service
file
<services>
<service mode="disabled" name="obs_scm">
<param name="url">https://github.com/cobbler/cobbler.git</param>
<param name="scm">git</param>
<param name="revision">master</param>
<param name="extract">cobbler.spec</param>
<param name="extract">cobbler.rpmlintrc</param>
<param name="extract">patches/debian/0001-cobbler-completition-adjust-bash-shebang.patch</param>
</service>
<service mode="disabled" name="set_version"/>
<service name="tar" mode="buildtime"/>
<service name="recompress" mode="buildtime">
<param name="compression">gz</param>
<param name="file">*.tar</param>
</service>
</services>
Example project meta
Click to expand project meta
<project name="home:SchoolGuy">
<title/>
<description/>
<person userid="SchoolGuy" role="maintainer"/>
<repository name="xUbuntu_19.10">
<path project="Ubuntu:debbuild" repository="Ubuntu_19.10"/>
<path project="openSUSE:Tools" repository="xUbuntu_19.10"/>
<path project="Ubuntu:19.10" repository="universe"/>
<arch>x86_64</arch>
</repository>
<repository name="xUbuntu_19.04">
<path project="Ubuntu:debbuild" repository="Ubuntu_19.04"/>
<path project="openSUSE:Tools" repository="xUbuntu_19.04"/>
<path project="Ubuntu:19.04" repository="universe"/>
<arch>x86_64</arch>
</repository>
<repository name="xUbuntu_18.04">
<path project="Ubuntu:debbuild" repository="Ubuntu_18.04"/>
<path project="openSUSE:Tools" repository="xUbuntu_18.04"/>
<path project="Ubuntu:18.04" repository="universe"/>
<arch>x86_64</arch>
</repository>
<repository name="openSUSE_Tumbleweed">
<path project="openSUSE:Tools" repository="openSUSE_Tumbleweed"/>
<path project="openSUSE:Factory" repository="snapshot"/>
<arch>i586</arch>
<arch>x86_64</arch>
</repository>
<repository name="openSUSE_Leap_15.1">
<path project="openSUSE:Tools" repository="openSUSE_15.1"/>
<path project="openSUSE:Leap:15.1" repository="standard"/>
<arch>x86_64</arch>
</repository>
<repository name="openSUSE_Leap_15.0">
<path project="openSUSE:Tools" repository="openSUSE_15.0"/>
<path project="openSUSE:Leap:15.0" repository="standard"/>
<arch>x86_64</arch>
</repository>
<repository name="SUSE_SLE-15-SP1_GA_standard">
<path project="openSUSE:Tools" repository="SLE_15_SP1"/>
<path project="SUSE:SLE-15-SP1:GA" repository="standard"/>
<arch>i586</arch>
<arch>x86_64</arch>
<arch>ppc</arch>
<arch>ppc64</arch>
<arch>s390x</arch>
<arch>aarch64</arch>
<arch>ppc64le</arch>
</repository>
<repository name="SLE_15">
<path project="openSUSE:Tools" repository="SLE_15"/>
<arch>x86_64</arch>
</repository>
<repository name="SLE_12_SP4">
<path project="openSUSE:Tools" repository="SLE_12_SP4"/>
<path project="SUSE:SLE-12-SP4:GA" repository="standard"/>
<arch>x86_64</arch>
</repository>
<repository name="RHEL_7">
<path project="openSUSE:Tools" repository="RHEL_7"/>
<arch>x86_64</arch>
<arch>ppc64</arch>
</repository>
<repository name="Fedora_31">
<path project="openSUSE:Tools" repository="Fedora_31"/>
<arch>x86_64</arch>
<arch>armv7l</arch>
<arch>aarch64</arch>
<arch>ppc64le</arch>
</repository>
<repository name="Fedora_30">
<path project="openSUSE:Tools" repository="Fedora_30"/>
<arch>x86_64</arch>
<arch>i586</arch>
<arch>armv7l</arch>
<arch>aarch64</arch>
<arch>ppc64le</arch>
</repository>
<repository name="Fedora_29">
<path project="openSUSE:Tools" repository="Fedora_29"/>
<arch>x86_64</arch>
<arch>i586</arch>
<arch>armv7l</arch>
<arch>aarch64</arch>
<arch>ppc64le</arch>
</repository>
<repository name="Debian_10">
<path project="Debian:debbuild" repository="Debian_10"/>
<path project="openSUSE:Tools" repository="Debian_10"/>
<arch>i586</arch>
<arch>x86_64</arch>
</repository>
</project>
No changes except versions in the configuration files in comparison to 3.1.x.
Example _service
: If you are packaging version 3.3.3 or later you may commit the <param name="extract">
that
mentions the patch and rpmlintrc
. Otherwise no changes from 3.1.x.
Example project config: Please take the one from the CI configuration.
Click to expand project meta
<project name="home:cobbler-project:release33">
<title>Cobbler 3.3.x release project</title>
<description/>
<person userid="cobbler-project" role="maintainer"/>
<repository name="openSUSE_Tumbleweed">
<path project="openSUSE:Factory" repository="snapshot"/>
<arch>i586</arch>
<arch>x86_64</arch>
</repository>
<repository name="Fedora_34">
<path project="Fedora:34" repository="standard"/>
<arch>aarch64</arch>
<arch>armv7l</arch>
<arch>ppc64le</arch>
<arch>x86_64</arch>
</repository>
<repository name="CentOS_8">
<path project="CentOS:CentOS-8" repository="standard"/>
<arch>x86_64</arch>
</repository>
<repository name="15.4">
<path project="openSUSE:Leap:15.4" repository="standard"/>
<arch>x86_64</arch>
</repository>
<repository name="15.3">
<path project="openSUSE:Leap:15.3" repository="standard"/>
<arch>x86_64</arch>
</repository>
</project>
The following commands are only valid for submitting a new revision to the development project of openSUSE. This guide
doesn't apply if you work on the official home:cobbler-project
setup.
- Setup your build environment for the OBS (https://openbuildservice.org/help/manuals/obs-user-guide/art.obs.bg.html).
osc bco systemsmanagement cobbler
osc service runall
- Remove the old sources (look at the date where the files were last modified).
- Now work on whatever you want.
-
osc ar
: To apply changes. osc vc
osc ci
- Wait until the build succeeds for all distros and platforms.
- Submit the package against
systemsmanagement:cobbler
- Setup your build environment for the OBS (https://openbuildservice.org/help/manuals/obs-user-guide/art.obs.bg.html).
- Create your home project (if you haven't done this already).
- Use my project config from above and possibly adjust it to your special needs.
- Create a package (you can name it however you want) in your home project.
- Create and Check the created package out on your local system.
- Create in the empty directory a file called
_service
and put the content from above in there. (Maybe you want to use your own Github Fork, so adjust it to your needs). -
osc service runall
: This downloads the sources and unpacks the needed files. -
osc ar
: This adds and removes all files which are changed and adds them to the obs source control. -
osc vc
: Create a stub version entry for the OBS. -
osc ci
: Save the entry and exit the editor. If needed pressc)
for "Continue" if the buildservice complains that you didn't change the message. - Now the package should build on the server.
If you submit a patch your changes are considered urgent. If you changes are not urgent please submit a normal PR which just adjusts the python code. We have automated the build so pre-releases are quickly available. Stable releases are available depending on the distribution.
- Fork the Cobbler Repository
- Create a branch for your fix
- In the spec file add the line
PatchN: 000N-patchname.patch
, whereN
is the next number which is available. - Add in the setup section the patch with the snippet from below.
- Add the patch itself in the
patches/
folder and put it into one of the following foldersdebian
for deb based installations orsuse
for rpm based installations. - Submit a PR for the according release branch(es) and submit a separate PR to master for the changes if this is needed.
Snippet for patching debbuild:
# Apply debian patches
%if %{_vendor} == "debbuild"
%patch -P 0 -p1
%endif
- Make sure docker and docker-compose are installed
- Use docker-compose to build rpms for the various distros
make clean docker-compose build --parallel docker-compose up
- RPMs are in rpm-build/
This can only be performed by @brejoc and @SchoolGuy due to permissions on PyPi side.
This is as easy as executing the following three commands:
docker build -f release.dockerfile -t cobbler-release:latest .
docker run -v <PATH_TO_PROJECT>/cobbler:/build --name cobbler-release cobbler-release:latest
python3 -m twine upload dist/*
Newer versions of Cobbler don't have the mentioned Dockerfile
anymore. However one can use the development Dockerfile
.
Currently we have 2 GitHub actions for automatic releases to Pypi.
Website: https://cobbler.github.io - Dokumentation: https://cobbler.readthedocs.io