Fedora Account System
Red Hat Associate
Red Hat Customer
Description of problem: Running dnf builddep on at least one of Fedora own packages generates an error. Version-Release number of selected component (if applicable): dnf-plugins-core-2.1.5-4.fc27 How reproducible: Run dnf builddep on spec file from systemd-234-10.git5f8984e.fc27 Steps to Reproduce: 1. dnf download --source systemd-udev 2. rpm -U systemd-*.src.rpm 3. dnf builddep rpmbuild/SPECS/systemd.spec Actual results: Failed to open: 'rpmbuild/SPECS/systemd.spec', not a valid spec file: can't parse specfile Error: Some packages could not be found. Expected results: Dependencies are installed, or indication which dependencies are missing are reported. Additional info:
This issue is caused by the defaults that rpm has. It will spread the files in the source rpm in various directories over the file system tree (~/rpmbuild/SPECS, ~/rpmbuild/SOURCES, ~/rpmbuild/PATCHES ?), instead of just putting them in cwd. _Nobody_ does stuff like that anymore, since it's incompatible with version control, causes naming conflicts between unrelated projects, and of course, makes it unnecessarily hard to find the files that are part of the srpm. Most likely the issue is that rpm is not able find the systemd.triggers file that is %included in the spec file. You can play around with "rpm --define '_sourcedir .' --define '_specdir .'" when extracting the rpm. I'll reassign this to rpm, maybe they can provide some additional advice (or finally change the defaults to something sane ;)).
Rpm ancient defaults are one thing, but changing them is not trivial because tonnes of documentation stops working, and certainly we wont be able to change them in any existing Fedora release. Locally overriding in /etc/rpm/ is probably the best way to deal with that right now, if you are prepared to drop the old rpmbuild/ directory style (most are :) That aside, the problem here is the error message which fails to tell you what's actually wrong: [pmatilai@sopuli ~]$ rpm -i systemd-234-10.git5f8984e.fc27.src.rpm [pmatilai@sopuli ~]$ rpmspec -q --buildrequires rpmbuild/SPECS/systemd.spec | wc -l 42 [root@sopuli pmatilai]# rpmspec -q --buildrequires rpmbuild/SPECS/systemd.spec error: Unable to open /root/rpmbuild/SOURCES/triggers.systemd: No such file or directory error: query of specfile rpmbuild/SPECS/systemd.spec failed, can't parse So I'm considering this a dupe of bug 1547897. *** This bug has been marked as a duplicate of bug 1547897 ***