LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 08-23-2012, 04:11 PM   #1
rubanek
LQ Newbie
 
Registered: Apr 2008
Location: MD
Distribution: CentOS, Fedora
Posts: 23
Blog Entries: 1

Rep: Reputation: 1
Building Perl 5.16.2 RPM for CentOS 6


I've been a linux sys admin for years and have managed to avoid having to build my own rpms. That all changes today. I'm trying to teach myself rpm building through google, but the documentation is falling short. Extremely short. How is it that documentation for such a fundamental part of the packaging system (being able to build packages) of one of the more popular distros (Redhat) be so difficult to find? Am I not looking in the right places?

Anyway, I've been able to discern what is happening to my spec file when I type rpmbuild -ba perl.spec. A shell script gets built in a tmp directory. Right now that shell script is getting created and then executed and is failing at the ./configure command. And for good reason... Perl's configure command is ./Configure (with a capital C).

Where the hell is the ./configure options being determined? I thought it was apart of the %configure macro so I commented that out. That didn't work. Then I thought it was a part of the %build macro. That didn't work either. What the hell?

The following code block contains the configure options that are somehow getting magically added to my that tmp shell script. I mean, geez, those are a lot of options to assume.

Code:
./configure --host=x86_64-unknown-linux-gnu --build=x86_64-unknown-linux-gnu \
        --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
I simply want it to be
Code:
./Configure -de
Is that so much to ask?
 
Old 08-23-2012, 04:44 PM   #2
abrinister
Member
 
Registered: Dec 2010
Location: /home
Distribution: RL: Arch x64 VM: Debian
Posts: 460

Rep: Reputation: 38
Can you post the spec file?

Alex Brinister
 
Old 08-23-2012, 04:53 PM   #3
rubanek
LQ Newbie
 
Registered: Apr 2008
Location: MD
Distribution: CentOS, Fedora
Posts: 23
Blog Entries: 1

Original Poster
Rep: Reputation: 1
Here is the contents of the spec file:
Code:
[makerpm@centos-ami SPECS]$ cat perl.spec
Name:           perl
Version:        5.16.1
Release:        1%{?dist}
Summary:        Practical Extraction and Report Language
License:        GPLv1+
URL:            http://www.perl.org/
Source0:        %{name}-%{version}.tar.gz
BuildArch:      x86_64

%description


%prep
%setup -q


%build
#%configure
#make %{?_smp_mflags}

./Configure -de
make


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT


%files
%doc



%changelog
Here is the output of rpmbuild:
Code:
[makerpm@centos-ami SPECS]$ rpmbuild -ba perl.spec
Executing(%prep): /bin/sh -e /home/makerpm/rpmbuild/tmp/rpm-tmp.SBPPPS
+ umask 022
+ cd /home/makerpm/rpmbuild/BUILD
+ cd /home/makerpm/rpmbuild/BUILD
+ rm -rf perl-5.16.1
+ /bin/tar -xf -
+ /usr/bin/gzip -dc /home/makerpm/rpmbuild/SOURCES/perl-5.16.1.tar.gz
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd perl-5.16.1
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /home/makerpm/rpmbuild/tmp/rpm-tmp.X76VHk
+ umask 022
+ cd /home/makerpm/rpmbuild/BUILD
+ cd perl-5.16.1
+ CFLAGS='-O2 -g'
+ export CFLAGS
+ CXXFLAGS='-O2 -g'
+ export CXXFLAGS
+ FFLAGS='-O2 -g'
+ export FFLAGS
+ ./configure --host=x86_64-unknown-linux-gnu --build=x86_64-unknown-linux-gnu --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
/home/makerpm/rpmbuild/tmp/rpm-tmp.X76VHk: line 32: ./configure: No such file or directory
error: Bad exit status from /home/makerpm/rpmbuild/tmp/rpm-tmp.X76VHk (%build)


RPM build errors:
    Bad exit status from /home/makerpm/rpmbuild/tmp/rpm-tmp.X76VHk (%build)
And here is the contents of tmp/rpm-tmp.X76VHk:
Code:
[makerpm@centos-ami SPECS]$ cat /home/makerpm/rpmbuild/tmp/rpm-tmp.X76VHk 
#!/bin/sh

  RPM_SOURCE_DIR="/home/makerpm/rpmbuild/SOURCES"
  RPM_BUILD_DIR="/home/makerpm/rpmbuild/BUILD"
  RPM_OPT_FLAGS="-O2 -g"
  RPM_ARCH="x86_64"
  RPM_OS="linux"
  export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS
  RPM_DOC_DIR="/usr/share/doc"
  export RPM_DOC_DIR
  RPM_PACKAGE_NAME="perl"
  RPM_PACKAGE_VERSION="5.16.1"
  RPM_PACKAGE_RELEASE="1.el6"
  export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE
  LANG=C
  export LANG
  unset CDPATH DISPLAY ||:
  RPM_BUILD_ROOT="/home/makerpm/rpmbuild/BUILDROOT/perl-5.16.1-1.el6.x86_64"
  export RPM_BUILD_ROOT
  
  PKG_CONFIG_PATH="/usr/lib64/pkgconfig:/usr/share/pkgconfig"
  export PKG_CONFIG_PATH
  
  set -x
  umask 022
  cd "/home/makerpm/rpmbuild/BUILD"
cd 'perl-5.16.1'
#
  CFLAGS="${CFLAGS:--O2 -g}" ; export CFLAGS ; 
  CXXFLAGS="${CXXFLAGS:--O2 -g}" ; export CXXFLAGS ; 
  FFLAGS="${FFLAGS:--O2 -g}" ; export FFLAGS ; 
  ./configure --host=x86_64-unknown-linux-gnu --build=x86_64-unknown-linux-gnu \
        --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
#make 

./Configure -de
make
 
Old 08-23-2012, 05:03 PM   #4
abrinister
Member
 
Registered: Dec 2010
Location: /home
Distribution: RL: Arch x64 VM: Debian
Posts: 460

Rep: Reputation: 38
According to here, you can change RPM macros by editing your ~/.rpmmacros file.

Alex Brinister
 
1 members found this post helpful.
Old 08-23-2012, 06:23 PM   #5
rubanek
LQ Newbie
 
Registered: Apr 2008
Location: MD
Distribution: CentOS, Fedora
Posts: 23
Blog Entries: 1

Original Poster
Rep: Reputation: 1
Thanks abrinister. Your link to that page is what I needed to get unstuck. That page referenced an rpm command:

Code:
rpm --showrc
Which I executed and got me thinking on a different tangent. I did a new google search and found that the configure options I was looking at were being defined here: /usr/lib/rpm/macros. I then created my own user specific version of %configure in my .rpmmacros that takes precedence.

Code:
[makerpm@centos-ami SPECS]$ cat ~/.rpmmacros
%_topdir               /home/makerpm/rpmbuild
%_tmppath              /home/makerpm/rpmbuild/tmp


%_configure ./Configure
%configure \
  CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
  CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
  FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \
  %{_configure} -de
FTW!!!

Thanks!
 
  


Reply

Tags
centos6 mumble rpm, macros, perl, rpmbuild, spec


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
error in building rpm of open ldap from source using rpm package manager Infotechie Linux - Software 2 05-02-2012 02:10 AM
Perl problem building NVU Musikolo Linux - Software 4 11-26-2006 11:13 AM
Problem building packge perl-Tk Musikolo Linux - Software 8 08-28-2006 03:07 PM
Help building an .rpm from a .src.rpm ssenuta Linux - Software 6 04-10-2006 11:36 PM
Building RPM via src.Rpm ivanatora Linux - Newbie 2 02-20-2006 05:29 PM


All times are GMT -5. The time now is 02:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration