With older releases, the following used to work fine (even without including a file in the package). $ rpmbuild -bb opera-qtdep.spec Processing files: opera-qtdep-1.0-1 Provides: libqt.so.3 Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 Requires: qt Checking for unpackaged file(s): /usr/lib/rpm/check-files %{buildroot} getOutputFrom(): Broken pipe Version-Release number of selected component (if applicable): 4.2-0.69 How reproducible: Always
Created attachment 90883 [details] sample spec file
Created attachment 90884 [details] sample spec file #2
Just encountered this one myself yesterday. The problem is that you don't have a buildroot specified and rpmbuild seems to require one now. If you add: BuildRoot: /tmp/somepackage to your spec preamble, everything should work fine.
Then it would still be a bug, because it doesn't print a comprehensible error message or doesn't do a sanity check. But even if a BuildRoot definition might be required, there is still something that doesn't work correctly: Observation #1: In my example spec files, in the %files section, replace the existing entries with just /bin/sh, and the packages build fine _without_ a BuildRoot definiton. Observation #2: 'error: BuildRoot can not be "/": -- means, I could not package files from my installation.
As an addition to observation #1 above, if the %files section is changed to %files %defattr(-,root,root) /etc/services /bin/sh it fails again. If the default attributes definition is taken out, it builds fine again. Since this is a non-root build environment, if I enter files from my home directory, it fails, too. For example, if I use this: %files /home/ms/.rpmrc
I have similar problems. Below you can find my spec file. Just a few comments: Adding BuildRoot doesn't not allow package my files, it only allow create appropriate directory. Observation 2, if I leave in my source only one file everything works fine (my source file only contains scripts and nothing else). I think something wrong with string buffer. My spec is very trivial. It's only copy necessary files and doesn't not build anything. I use RedHat 8.0. Here my spec file: # # cleo - CLEO III software # %define version 1.0.0 %define name cleo3-scripts # Standard CLEO root is /nfs, for time being I'm testing it in # /mnt/disk1/vk/TEST/ %define cleo_root /mnt/disk1/vk/TEST/topdir %define cleo_linux %{cleo_root}/linux # Summary: CLEO III offline reconstruction software Vendor: Cornell University Name: %{name} Version: %{version} Release: 1 Copyright: GPL Group: CLEO/Software Packager: Valentine Kouznetsov <vk.cornell.edu> Source: %{name}-%{version}.tar.gz URL: http://www.lns.cornell.edu/public/CLEO/ #BuildRoot: /tmp/%{name} Provides: Cleo III offline scripts Prefix: %{cleo_root} %changelog * Wed Apr 16 2003 Valentine Kouznetsov <vk.cornell.edu> - First attempt to build cleo RPMs %description CLEO III Offline reconstruction software is designed to reconstruct CLEO data. This package contains neccessary scripts to set up CLEO environment. %prep # check & create cleo directory structure if [ -d $RPM_BUILD_ROOT/%{cleo_linux} ] ; then ln -sf $RPM_BUILD_ROOT/%{cleo_linux}/cleo3 $RPM_BUILD_ROOT/%{cleo_root}/cleo3 else mkdir -p $RPM_BUILD_ROOT/%{cleo_linux}/cleo3 ln -sf $RPM_BUILD_ROOT/%{cleo_linux}/cleo3 $RPM_BUILD_ROOT/%{cleo_root}/cleo3 fi export C3_=$RPM_BUILD_ROOT/%{cleo_root}/cleo3 export C3DIST=$C3_/Offline if [ ! -d $C3DIST/scripts ] ; then mkdir -p $C3DIST/scripts fi %setup echo setup %build echo build %install # check & create cleo directory structure if [ ! -d %{cleo_root} ] ; then mkdir -p %{cleo_root} fi if [ ! -d %{cleo_linux} ] ; then mkdir -p %{cleo_linux} fi if [ ! -d %{cleo_linux}/cleo3 ] ; then mkdir -p %{cleo_linux}/cleo3 fi if [ ! -h %{cleo_root}/cleo3 ] ; then ln -sf %{cleo_linux}/cleo3 %{cleo_root}/cleo3 fi if [ ! -d %{cleo_root}/cleo3/Offline/scripts ] ; then mkdir -p %{cleo_root}/cleo3/Offline/scripts fi cp -a * %{cleo_linux}/cleo3/Offline/scripts %files %defattr(-,root,root) %{cleo_root}/cleo3/Offline/scripts/ %clean rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_DIR/%{name}-%{version}
I found solution (?) to the problem. To be clear here the way how I make install: %install cp * <my_install_dir> %files <my_install_dir> Without BuildRoot this approach doesn' work. And job ended with the following message: Checking for unpackaged file(s): /usr/lib/rpm/check-files %{buildroot} With BuildRoot it works partially, my final RPM contains only this directory with its contents. But if I'll add to %install the following: cp * %{buildroot}/<my_install_dir> I'll get correctly my RPM with additional warning message, like: Checking for unpackaged file(s): /usr/lib/rpm/check-files <my_buildroot_dir> warning: Installed (but unpackaged) file(s) found: <my_install_dir>/<my_file> Hope it helps find problem. If you need my source file as well I can send tar ball. See my spec file in previous bug message. Valentine.
Just another observation. If you prepend %{buildroot} into file list, like %files %{buildroot}/<my_path>/<my_file> The you'll get immeadiately message Processing files: <my_package> error: File not found: <my_buildroot_dir>/<my_buildroot_dir>/<my_path>/<my_file> It seems to me that there is a bug with buildroot, since by default it prepending to file list and that cause the problem when you don't use buildroot.
Yes, BuildRoot: is needed, or, equivalently, disabling the checkfiles script by adding %define __check_files %{nil} The check_files helper script is going to be internalized to rpm eventually, deferred until then. BTW, BuildRoot: should be used if at all possible. You should also have ($RPM_BUILD_ROOT and %buildroot are interchangeable in scriptlets): # XXX Change to taste, but following is common BuildRoot: %{_tmppath}/%{name}-root %install # XXX always install into empty BuildRoot: rm -rf $RPM_BUILD_ROOT ... %clean # XXX clean up if successful. Dunno if you really want to erase # the build directory automagically. rm -rf $RPM_BUILD_ROOT %files # XXX make sure your package can be built as non-root with sane defaults %defattr(-,root,root)
The packager does not need to prepend %{buildroot}, rpm does that automagically, so there is no file with two %{buildroot} components at the start.
Created attachment 91394 [details] Spec file
Created attachment 91395 [details] Output from rpmbuild
Created attachment 91396 [details] source
Ok, fixed. But then I don't understand the warning message, see attachments above.
I fix the problem, see new attachment. Just look at rpm.spec and make my spec similar. Anyway thanks for feedback.
Created attachment 91397 [details] new log
Created attachment 91398 [details] new spec