[Scons-users] RPM build errors: File must begin with "/": target2/file1

Alejandro.Olivares-Marin at t-systems.com Alejandro.Olivares-Marin at t-systems.com
Thu Jun 30 03:55:39 EDT 2016


Hello everybody,

I am learning how to build RPMs on Read Hat using SCons but I cannot get a good generated SPECS file for rpmbuild.

My test is as simple as:
$ cat SConstruct
env = Environment(tools=['default', 'packaging'])
env.Install(directory='~/rpmRepo/tmp', source=['~/rpmRepo/source/file1', '~/source/file2'], target='~/rpmRepo/target')
env.Package( NAME           = 'foo',
             VERSION        = '1.2.3',
             PACKAGEVERSION = 0,
             PACKAGETYPE    = 'rpm',
             LICENSE        = 'gpl',
             SUMMARY        = 'balalalalal',
             DESCRIPTION    = 'this should be really really long',
             X_RPM_GROUP    = 'Application/fu',
             SOURCE_URL     = 'http://foo.org/foo-1.2.3.tar.gz'
        )

$ cd ~/rpmRepo
$ ls source target
source:
file1  file2

target:

But when I run scons, I get a build error:
RPM build errors:
    File must begin with "/": target/file1
    File must begin with "/": target/file2

I guess because rpmbuild finds a fullpath missing on %files,  from SPECS file:
$ tail -6 rpmtemp/SPECS/foo-1.2.3.spec
%files
%defattr (-,root,root)
 target/file1

 target/file2

Which information is missing on my SConstruct for fulfilling %files required information?

Thanks in advance for your support.

The full output of SCons execution below:
$ scons
scons: Reading SConscript files ...
scons: done reading SConscript files.

scons: warning: Support for pre-2.7.0 Python version (2.6.6) is deprecated.
    If this will cause hardship, contact scons-dev at scons.org
File "/home/ale1/scons/bin/scons", line 199, in <module>
scons: Building targets ...
Copy file(s): "SConstruct" to "foo-1.2.3/SConstruct"
build_specfile(["foo-1.2.3.spec"], ["source/file1", "source/file2"])
Copy file(s): "foo-1.2.3.spec" to "foo-1.2.3/foo-1.2.3.spec"
Copy file(s): "source/file1" to "foo-1.2.3/source/file1"
Copy file(s): "source/file2" to "foo-1.2.3/source/file2"
tar -zc -f foo-1.2.3.tar.gz foo-1.2.3/SConstruct foo-1.2.3/source/file1 foo-1.2.3/source/file2 foo-1.2.3/foo-1.2.3.spec
LC_ALL=C rpmbuild -ta /home/ale1/rpmRepo/foo-1.2.3.tar.gz
scons: *** [foo-1.2.3-0.src.rpm] foo-1.2.3-0.src.rpm: Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.NJiERW
+ umask 022
+ cd /home/ale1/rpmRepo/rpmtemp/BUILD
+ '[' -n /home/ale1/rpmRepo/rpmtemp/BUILDROOT/foo-1.2.3-0.x86_64 -a /home/ale1/rpmRepo/rpmtemp/BUILDROOT/foo-1.2.3-0.x86_64 '!=' / ']'
+ rm -rf /home/ale1/rpmRepo/rpmtemp/BUILDROOT/foo-1.2.3-0.x86_64
+ cd /home/ale1/rpmRepo/rpmtemp/BUILD
+ rm -rf foo-1.2.3
+ /usr/bin/gzip -dc /home/ale1/rpmRepo/foo-1.2.3.tar.gz
+ /bin/tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd foo-1.2.3
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.JrHj4h
+ umask 022
+ cd /home/ale1/rpmRepo/rpmtemp/BUILD
+ cd foo-1.2.3
+ '[' '!' -e /home/ale1/rpmRepo/rpmtemp/BUILDROOT/foo-1.2.3-0.x86_64 -a /home/ale1/rpmRepo/rpmtemp/BUILDROOT/foo-1.2.3-0.x86_64 '!=' / ']'
+ mkdir /home/ale1/rpmRepo/rpmtemp/BUILDROOT/foo-1.2.3-0.x86_64
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.yGpihD
+ umask 022
+ cd /home/ale1/rpmRepo/rpmtemp/BUILD
+ cd foo-1.2.3
+ scons --install-sandbox=/home/ale1/rpmRepo/rpmtemp/BUILDROOT/foo-1.2.3-0.x86_64 /home/ale1/rpmRepo/rpmtemp/BUILDROOT/foo-1.2.3-0.x86_64
scons: Reading SConscript files ...
scons: done reading SConscript files.

scons: warning: Support for pre-2.7.0 Python version (2.6.6) is deprecated.
    If this will cause hardship, contact scons-dev at scons.org
File "/home/ale1/scons/bin/scons", line 199, in <module>
scons: Building targets ...
Install file: "/home/ale1/rpmRepo/source/file1" as "/home/ale1/rpmRepo/rpmtemp/BUILDROOT/foo-1.2.3-0.x86_64/home/ale1/rpmRepo/target/file1"
Install file: "/home/ale1/rpmRepo/source/file2" as "/home/ale1/rpmRepo/rpmtemp/BUILDROOT/foo-1.2.3-0.x86_64/home/ale1/rpmRepo/target/file2"
scons: done building targets.
+ /usr/lib/rpm/brp-compress
+ /usr/lib/rpm/brp-strip
+ /usr/lib/rpm/brp-strip-static-archive
+ /usr/lib/rpm/brp-strip-comment-note
Processing files: foo-1.2.3-0.x86_64
error: File must begin with "/": target/file1
error: File must begin with "/": target/file2


RPM build errors:
    File must begin with "/": target/file1
    File must begin with "/": target/file2

scons: building terminated because of errors.

Regards,

Alejandro



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20160630/8174600e/attachment-0001.html>


More information about the Scons-users mailing list