Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to create rpm through rpm package manager. Following is my spec file:

**# This is a spec file for openldappkg**

%define _topdir /osp/rpmBuildOpenLdap
%define name    openldap
%define release 1
%define version     2.4.30
%define buildroot   %{_topdir}/%{name}-%{version}-root

BuildRoot:  %{buildroot}
Summary:        openldap pkg
License:        GPL
Name:       %{name}
Version:        %{version}
Release:        %{release}
Source:         %{name}-%{version}.tgz
Prefix:         /usr
Group:          

%description
The openldap pkg program downloads files installs openldap for use.

%prep
%setup -q

%build
./configure
make

%install
make install prefix=$RPM_BUILD_ROOT/usr

############################################################

And below is the error I am getting:

{some part of log is skipped}

Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.60752
+ umask 022
+ cd /osp/rpmBuildOpenLdap/BUILD
+ cd openldap-2.4.30
+ LANG=C
+ export LANG
+ unset DISPLAY
+ ./configure
/var/tmp/rpm-tmp.60752: line 30: ./configure: Permission denied
error: Bad exit status from /var/tmp/rpm-tmp.60752 (%build)

RPM build errors: Bad exit status from /var/tmp/rpm-tmp.60752 (%build)

#

When I have installed the package directly by ./configure -> make -> make install It was sucessfuly installed but when I am trying to create a package through rpm then the problem is coming.

Please give your valuable suggestion.

Thanking you.

share|improve this question
add comment

2 Answers

Is it possible the temp directory is mounted noexec?

Just noticed I missed which directory configure was running out of - should be "is it possible some part of /osp/rpmBuildOpenLdap/BUILD is mounted noexec?"

share|improve this answer
    
I will check this out and let you know. –  Infotechie Apr 26 '12 at 17:05
    
No, it is not mounted noexec as below value is present in etc/fstab file: LABEL=/tmp /tmp ext3 defaults 1 2 Same for /osp/rpmBuildOpenLdap/BUILD directory. –  Infotechie Apr 27 '12 at 4:18
add comment
up vote 0 down vote accepted

Finally got the problem. Problem lies in the source.

I wanted to replace some files in the source with files modified as per my requirements and for doing so I was unzipping the original source file and putting modified files and then zipping it back.

Now, when I am creating package with this changed source the permission denied error is coming. Though my problem is not resolved but still I found the root cause. Just wanted to share with everyone.

Thanks.

share|improve this answer
    
Did you find the root reason of this? I also have such bugs. Thanks. –  user151053 Dec 27 '12 at 10:23
add comment

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.