-
Notifications
You must be signed in to change notification settings - Fork 256
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
Cannot build RPM on RHEL 8 using included bareos-Release-23.0.2/core/platforms/packaging/bareos.spec file #1822
Comments
We're building with that spec-file in continous integration all the time. However, the additional install looks redundant, maybe you can just remove that section? Other than that, could you try building from the bareos-23 branch with the following steps and see if that fails for you, too?
|
@arogge Hi Andreas, sorry for the delayed response. I thought what you thought and commented out those 4 lines; unfortunately that just gave me different errors. :-( I have not had time to try your request to build from the bareos-23 branch yet. I just wanted to add that shortly after I posted this issue, I went back and did an RPM build of Bareos 22.1.4 from the source tarball and the included .spec file it came with (with 2 minor edits) and it worked fine. So something seems to have changed in the 23 release lineage that broke it. |
I can assure you that every set of Bareos RPMs we publish is built using the I tried the follwing process: [user@host ~]$ SRCDIR="$(rpm --eval '%{_sourcedir}')"
[user@host ~]$ mkdir -p "$SRCDIR"
[user@host ~]$ curl -L https://github.com/bareos/bareos/archive/refs/tags/Release/23.0.2.tar.gz >"$SRCDIR/bareos-23.0.2.tar.gz"
[user@host ~]$ tar xzfO "$SRCDIR/bareos-23.0.2.tar.gz" '**/core/platforms/packaging/bareos.spec' > bareos.spec
[user@host ~]$ rpmdev-bumpspec --new="23.0.2-1%{?dist}" bareos.spec
[user@host ~]$ rpmbuild -bb --nocheck bareos.spec And it worked just like I expected. To rule out that it just accidentially works on our CI and my machine I tried with a fresh RHEL8 container: [user@host ~]$ podman run --rm -it registry.redhat.io/ubi8/ubi
[root@container /]$ dnf install rpm-build rpmdevtools
[root@container /]$ useradd build
[root@container /]$ su - build
[build@container /]$ rpmdev-setuptree
(follow steps outlined above with the build failing due to missing buildrequires)
# disable glusterfs as devel-packages are next to unobtainable for RHEL
[build@container ~]$ sed -e '/%define glusterfs 1/d' -i bareos.spec
[build@container /]$ exit
[root@container /]$ dnf install -y <all-the-packages-rpmbuild-reported-missing>
[root@container /]$ su - build
[build@container ~]$ rpmbuild -bb --nocheck bareos.spec That errored out because it didn't build droplet while rpm wanted to package it. The problem here is missing BuildRequires for So if you want, you can open a PR to add the missing BuildRequires. Besides that I'm pretty sure the SPECfile is working fine (even though there is a lot of room for improvement left). |
If I understand correctly, the issue is solved. I'll close it. |
Hi Andreas, I had not yet had a chance to test your suggestion. Not sure why you say it is solved unless some update to the .spec file has been recently made. I apologize for the delay in responding/testing your suggestion. |
The response I got was your 👍 to my comment. Feel free to reopen if you can reproduce the issue in a clean build environment. |
Bareos component version
23.0.2
Steps to reproduce
Copy the file bareos-Release-23.0.2/core/platforms/packaging/bareos.spec from the 23.0.2.tar.gz bundle to ~/rpmbuild/SPECS/bareos.spec on a RHEL 8 system.
cd ~/rpmbuild/SPECS
Edit bareos.spec, change Version: from "0" to "23.0.2", change Release: from "0" to "1%{?dist}".
Run rpmbuild -bb bareos.spec
Expected results
Expect the RPMs to build, or at least get past this error.
Actual results
Build dies with
+ install -d -m 755 /root/rpmbuild/BUILDROOT/bareos-23.0.2-1.el8.x86_64/usr/lib/systemd/system
+ install -m 644 cmake-build/core/platforms/systemd/bareos-dir.service /root/rpmbuild/BUILDROOT/bareos-23.0.2-1.el8.x86_64/usr/lib/systemd/system
install: cannot stat 'cmake-build/core/platforms/systemd/bareos-dir.service': No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.1Cq7Ay (%install)
Environment
Relevant log output
Relevant traces output
No response
Anything else?
Earlier upstream in the build, the 3 bareos-*.service files had already been installed by something under BUILD/bareos/cmake-build:
[...]
Install the project...
/usr/bin/cmake -P cmake_install.cmake
-- Install configuration: ""
-- Installing: /root/rpmbuild/BUILDROOT/bareos-23.0.2-1.el8.x86_64/var/log/bareos
-- Installing: /root/rpmbuild/BUILDROOT/bareos-23.0.2-1.el8.x86_64/var/lib/bareos
-- Installing: /root/rpmbuild/BUILDROOT/bareos-23.0.2-1.el8.x86_64/etc/rc.d/init.d/bareos-fd
-- Installing: /root/rpmbuild/BUILDROOT/bareos-23.0.2-1.el8.x86_64/etc/rc.d/init.d/bareos-sd
-- Installing: /root/rpmbuild/BUILDROOT/bareos-23.0.2-1.el8.x86_64/etc/rc.d/init.d/bareos-dir
-- Installing: /root/rpmbuild/BUILDROOT/bareos-23.0.2-1.el8.x86_64/usr/lib/systemd/system/bareos-sd.service
-- Installing: /root/rpmbuild/BUILDROOT/bareos-23.0.2-1.el8.x86_64/usr/lib/systemd/system/bareos-fd.service
-- Installing: /root/rpmbuild/BUILDROOT/bareos-23.0.2-1.el8.x86_64/usr/lib/systemd/system/bareos-dir.service
so I don't really understand why these CMAKE_BUILDDIR lines in the .spec file are getting run (and the first fails):
[root@bareos SPECS]# sed -n '1021,1026p' bareos.spec
# install systemd service files
%if 0%{?systemd_support}
install -d -m 755 %{buildroot}%{_unitdir}
install -m 644 %{CMAKE_BUILDDIR}/core/platforms/systemd/bareos-dir.service %{buildroot}%{_unitdir}
install -m 644 %{CMAKE_BUILDDIR}/core/platforms/systemd/bareos-fd.service %{buildroot}%{_unitdir}
install -m 644 %{CMAKE_BUILDDIR}/core/platforms/systemd/bareos-sd.service %{buildroot}%{_unitdir}
The text was updated successfully, but these errors were encountered: