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.
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?"
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.