Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've trying to create a Samba RPM for an old version of Fedora. There aren't any available to download on the internet so I've got the source code.

So far I have the five standard directories /BUILD, /RPMS, /SOURCES, /SPECS and /SRPMS.

In /SOURCES there is the source code in a tar ball.
In /SPEC is the samba.spec file.

When I do a rpmbuild -v -bb --clean SPECS/samba.spec it falls over after untarring the ball and attempting to build. The error is: line 29: autogen.sh : command not found.

More specifically, in my %build there is: autogen.sh, ./configure and make.

After this I install it all with make install in section %install.

Where am I going wrong?

Please note this all works fine when manually installing the source code.

With the ./autogen.sh removed, it comes up with: '/var/tmp/rpm-tmp.BEyARh: line 29: ./configure: No such file or directory.

EDIT: A-ha! I think I know the problem. It's looking in the root /samba directory for ./autogen.sh and etc, when it should be looking in `/samba/source3/ once it's extracted the tar ball and put it into /BUILD. How do I configure this?

share|improve this question
    
Check out CMake, it has the module CPac which can produce source archives, and it provides debian, red hat, nsis, and mac os x installers for everything which is uber nice. Just a suggestion! –  alexhairyman May 16 '12 at 13:41
add comment

1 Answer 1

up vote 2 down vote accepted

The first thing I would try is to replace the line

autogen.sh

in your .spec file with

./autogen.sh

since autogen.sh is probably not on your PATH. Putting the ./ in front of it will tell the shell to execute the file, provided there is a shebang (#!) at the top. If the first line of autogen.sh is not something like #! /bin/bash, instead of ./autogen.sh you could try

bash autogen.sh

which will explicitly execute the file as a bash script.

Edited in response to the changed question:

One way to hack this might be to change

./autogen.sh

to

./source3/autogen.sh

or to

pushd source3
./autogen.sh
popd

so that rpm can find the file. I'm not sure if this is considered "good" packaging, however.

There also may be some RPM settings you can change. There is an excellent book called Maximum RPM by Edward C. Bailey that talks all about creating RPMs, and this section may help you out in configuring for an odd build setup.

share|improve this answer
    
Just checked this and it doesn't make a difference :( Even when I remove ./autogen.sh and let it go straight into ./configure it trips. –  Federer May 16 '12 at 13:18
    
Does it still give the error autogen.sh : command not found or is there a new error? –  SethMMorton May 16 '12 at 13:37
    
It gives: "+ ./autogen.sh /var/tmp/rpm-tmp.r9Ax0q: line 29: ./autogen.sh: No such file or directory error: Bad exit status from /var/tmp/rpm-tmp.r9Ax0q (%build)" –  Federer May 16 '12 at 13:39
    
If the .spec file isn't too long, could you add this to the original post? Sometimes errors that appear on line B are due to something on line A. –  SethMMorton May 16 '12 at 13:46
1  
I agree with Ignacio that you should remove the autogen.sh line. What has me confused is that you said the build failed even when this line was removed, but with the same error. If there was no line referencing autogen.sh then rpm shouldn't have been looking for it, so it shouldn't have complained that it didn't exist. Are you sure that you had removed the line telling it to execute autogen.sh before? –  SethMMorton May 16 '12 at 14:21
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.