CentOS 5 - rpmbulid installed but unpackaged file

A 5 star hangout for overworked and underpaid system admins.
Post Reply
afalanga
Posts: 96
Joined: 2013/01/31 00:29:05

CentOS 5 - rpmbulid installed but unpackaged file

Post by afalanga » 2019/09/19 23:28:21

I have a strange one. Yes, I know that CentOS 5 is EOL (perhaps meaning I'm SOL pun intended :roll:) but I'm asking anyway because these systems aren't going to be changed anytime soon and I must roll out a new package for them. So, I'm building a package to easily deploy an /sbin/ifup-local file to systems needing it.

Other than strange things like I had to manually define %{buildroot}, I've managed to get the package to build. However, when it's "Processing file(s)" I get the following error
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/eth1_network_changes/pkg/rpmbuild/BUILDROOT/eth1_network_changes-0.0.1-1.x86_64
error: Installed (but unpackaged) file(s) found:
/sbin/ifup-local


RPM build errors:
Installed (but unpackaged) file(s) found:
/sbin/ifup-local
My %install and %files sections
%install
echo %{buildroot}
mkdir -p %{buildroot}/sbin
install --mode=u+rwx,go+rx %{_builddir}/%{name}-%{version}/src/ifup-local %{buildroot}/sbin

%files
%attr(-,root,root) /sbin/ifup-local
Like I said, I had to define %{buildroot}, that's why it's echoed. I defined it according to this https://docs.fedoraproject.org/en-US/pa ... ld_process definition (which is what it is on my CentOS 6 and 7 boxes). I have tried setting _unpackaged_files_terminate_build to 0, but this did nothing for me either. What is broken in this (or what am I missing in my spec file)? Is there some sort of different magic at work in EL5? In case it matters, rpmbuild is version 4.4.2.3.

Oh, you'll notice that "root" appears in the paths above. This error occurs whether root or not. The package will not be built by root when distributed. This was my testing.

User avatar
jlehtone
Posts: 4530
Joined: 2007/12/11 08:17:33
Location: Finland

Re: CentOS 5 - rpmbulid installed but unpackaged file

Post by jlehtone » 2019/09/20 08:25:18

I can't help on the question, but how about a different approach?

Ansible. Assuming that you can access the machines over network (you would not have ifup* otherwise),
ansible can deploy (copy a file) to EL5 devices.
(Host variable ansible_python_interpreter=/usr/bin/python2.6 is required and some ansible modules do not work on EL5, but 'copy' is trivial.)

I did use to build rpms ...

Post Reply