./configure Permission Denied

Ok, another permission denied error.

I get this on two packages. You can see one log here

https://build.opensuse.org/package/live_build_log?arch=i586&package=sipxregistry&project=home%3Asipfoundry%3Atest&repository=SLE_11

It dies on the ./configure command.

It builds fine for centos and fedora so it must be something specific to suse builds.

Any ideas? Builds fine by hand.

Well, your own buildlog for Fedora 11 begs to differ:

https://build.opensuse.org/package/live_build_log?arch=x86_64&package=sipxregistry&project=home%3Asipfoundry%3Atest&repository=Fedora_11

+ export FFLAGS
+ ./configure --host=x86_64-unknown-linux-gnu --build=x86_64-unknown-linux-gnu --target=x86_64-redhat-linux --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-distdir=/home/sipxbuild/src/main/RPMBUILD/../dist
/var/tmp/rpm-tmp.8hJZqv: line 29: ./configure: Permission denied
error: Bad exit status from /var/tmp/rpm-tmp.8hJZqv (%build)

a) Check if configure-script is executable after unpacking

b)

**-with-distdir=/home/sipxbuild/src/main/RPMBUILD/../dist**

What on earth is this?

Do you really think this directory exists on the server? I doubt it.

That directory does exist as its created during the make.
The spec file does execute /bin/chmod -Rf a+rX,u+w,g-w,o-w

But if I go to /var/tmp/build-root/usr/src/packages/BUILD/sipxregistry the configure file is not executable. Permissions on the file are 644

If chmod to give excute rights then configure goes to town.

Isn’t %setup default to grant execute rights on the files after it extracts the tar file?

Read man chmod.

(Hint: X != x)

Ahh yes, reading to quickly I guess.

I though %setup granted execute in the default macro but I guess not.

Well, as you did in your last thread here

Permission denied creating file - openSUSE Forums

you will again have to fix a problem by fixing the package (as the person making the tarball created configure without sane permissions) and not the build process.

The macro %setup will hopefully never use a+rx instead of a+rX, that would be quite insane, especially as the error is in the tarball here.

I will indeed need to fix this via the tarball.

Even though the OBS was not at fault, the community here has been very helpful…so thanks even though the issue was not OBS.

Contacting the upstream authors is the best way to go, they will normally fix this very quickly, especially if it is that trivial.

In the meantime you will have to add a one-line “hack” to chmod the necessary files in the %prep section or in %build before %configure gets executed.

There are quite a few examples of “file permissions insanity” when trying to build rpm packages, although in most cases it is “the other way around”, meaning all files have 777 or something like that, which is -again, in most cases- a good sign the sources were packed under another OS, so this happens quite frequently when building vendor drivers.

I did simply add the chmod to the spec file for now.

Another question, but not related to this exact error.

I have one more package that is failing with

Bad exit status from /var/tmp/rpm-tmp.90058 (%install)

But I can’t see what exactly the problem is. When I build it locally with osc it does end with some minor warning but does build.

Is there a way to see what its failing on?
Log is here https://build.opensuse.org/package/live_build_log?arch=i586&package=sipx-freeswitch&project=home%3Asipfoundry%3Atest&repository=SLE_11

TBH, this spec is plain horrible.

The first line turns my stomach already:

%define _prefix   /usr/**local**/freeswitch

NOTHING should be installed into /usr/local by a sane RPM, /usr/local is not for distribution packages.

Although I only had a quick look (and no motivation of going any deeper into that piece of junk), I think

export DESTDIR=$RPM_BUILD_ROOT/

this might be the cause for trouble, setting this is not needed

%{__make} DESTDIR=$RPM_BUILD_ROOT install 

as it will be set on install, but it might get into paths for files while they are being built and that’s what rpmbuild is complaining about.

The only reason the build for Fedora does not fail is the missing checks and they fail on openSUSE for a very good reason.

Thanks, I tried that and it did not make a difference. I’ll keep looking.

I’ll be sure to pass your thoughts along to the sipx team. But to be fair, they are strictly focused on the Centos Appliance builds. Which must not be as nearly strict as Suse

Well, no matter what distribution, I don’t know any “bigger” one that installs stuff to /usr/local by RPMs, /usr/local is for local, self built stuff but not for files installed by the package manager.

However, setting the default prefix to /usr/local in a configure file is a sane thing to do, exactly for the reason above, that’s why the packager has to define correct --prefix in his build (i.e. the SPEC file, which is often done by macros automatically, if you just use them).