8000 [BACKPORT] SPEC: Add extra guard for RPM build on Fedora by SchoolGuy · Pull Request #3585 · cobbler/cobbler · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[BACKPORT] SPEC: Add extra guard for RPM build on Fedora #3585

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 10, 2024

Conversation

SchoolGuy
Copy link
Member

Linked Items

Fixes #3584

Description

This is so that in the openSUSE Build Service (OBS) the build receives the correct metadata since the /etc/os-release file is not containing the desired information.

Behaviour changes

Old: Build for Fedora is broken

New: Build for Fedora works

Category

This is related to a:

  • Bugfix
  • Feature
  • Packaging
  • Docs
  • Code Quality
  • Refactoring
  • Miscellaneous

Tests

  • Unit-Tests were created
  • System-Tests were created
  • Code is already covered by Unit-Tests
  • Code is already covered by System-Tests
  • No tests required

This is so that in the openSUSE Build Service (OBS) the build receives the correct metadata since the /etc/os-release file is not containing the desired information.
@SchoolGuy SchoolGuy added this to the v3.3.4 milestone Feb 10, 2024
@SchoolGuy SchoolGuy requested a review from ByteOtter February 10, 2024 14:11
@SchoolGuy
Copy link
Member Author
SchoolGuy commented Feb 10, 2024

Works on my machine (TM):

Index: cobbler.spec
===================================================================
--- cobbler.spec        (revision 1)
+++ cobbler.spec        (working copy)
@@ -173,6 +173,7 @@
 
 License:        GPL-2.0-or-later
 Source:         %{name}-%{version}.tar.gz
+Patch1:         distro-build-configs-patch.diff
 BuildArch:      noarch
 
 BuildRequires:  git-core
@@ -291,7 +292,7 @@
 Dockerfiles and scripts to setup testing containers
 
 %prep
-%setup
+%autosetup -p1
 
 %if 0%{?suse_version}
 # Set tftpboot location correctly for SUSE distributions
@@ -299,7 +300,11 @@
 %endif
 
 %build
+%if 0%{?fedora} || 0%{?rhel}
+. distro_build_configs.sh FEDORA
+%else
 . distro_build_configs.sh
+%endif
 
 # Check distro specific variables for consistency
 [ "${DOCPATH}" != %{_mandir} ] && echo "ERROR: DOCPATH: ${DOCPATH} does not match %{_mandir}"
@@ -318,7 +323,11 @@
 make man
 
 %install
+%if 0%{?fedora} || 0%{?rhel}
+. distro_build_configs.sh FEDORA
+%else
 . distro_build_configs.sh
+%endif
 %py3_install
 
 # cobbler
[   24s] Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/abuild/rpmbuild/BUILDROOT/cobbler-3.3.3.82+git.a049688-0.fc36.x86_64
[   24s] Wrote: /home/abuild/rpmbuild/SRPMS/cobbler-3.3.3.82+git.a049688-0.fc36.src.rpm
[   24s] Wrote: /home/abuild/rpmbuild/RPMS/noarch/cobbler-tests-containers-3.3.3.82+git.a049688-0.fc36.noarch.rpm
[   24s] Wrote: /home/abuild/rpmbuild/RPMS/noarch/cobbler-tests-3.3.3.82+git.a049688-0.fc36.noarch.rpm
[   25s] Wrote: /home/abuild/rpmbuild/RPMS/noarch/cobbler-3.3.3.82+git.a049688-0.fc36.noarch.rpm
[   25s] Executing(%clean): /bin/bash -e /var/tmp/rpm-tmp.rwzo39
[   25s] + umask 022
[   25s] + cd /home/abuild/rpmbuild/BUILD
[   25s] + cd cobbler-3.3.3.82+git.a049688
[   25s] + /usr/bin/rm -rf /home/abuild/rpmbuild/BUILDROOT/cobbler-3.3.3.82+git.a049688-0.fc36.x86_64
[   25s] + RPM_EC=0
[   25s] ++ jobs -p
[   25s] + exit 0
[   25s] ... checking for files with abuild user/group
[   25s] 
[   25s] tower finished "build cobbler.spec" at Sat Feb 10 14:01:07 UTC 2024.
[   25s] 

/var/tmp/build-root/Fedora_36-x86_64/home/abuild/rpmbuild/SRPMS/cobbler-3.3.3.82+git.a049688-0.fc36.src.rpm

/var/tmp/build-root/Fedora_36-x86_64/home/abuild/rpmbuild/RPMS/noarch/cobbler-tests-3.3.3.82+git.a049688-0.fc36.noarch.rpm
/var/tmp/build-root/Fedora_36-x86_64/home/abuild/rpmbuild/RPMS/noarch/cobbler-tests-containers-3.3.3.82+git.a049688-0.fc36.noarch.rpm
/var/tmp/build-root/Fedora_36-x86_64/home/abuild/rpmbuild/RPMS/noarch/cobbler-3.3.3.82+git.a049688-0.fc36.noarch.rpm

@SchoolGuy SchoolGuy merged commit 3e81be5 into release33 Feb 10, 2024
@SchoolGuy SchoolGuy deleted the backport/fix-fedora-obs-build branch February 10, 2024 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Backport] Cobbler doesn't build in the OBS due to an incorrect /etc/os-release file
2 participants
0