Fedora Linux Support Community & Resources Center
  #1  
Old 7th October 2011, 04:56 PM
PatMcDonagh Offline
Registered User
 
Join Date: Oct 2011
Posts: 8
windows_vistaie
Good design habits for SPEC files for rpm

hi folks,

Please excuse me if I have posted in the wroing area but i hope not.

I am reviewing some of the build manage files in a section i have taken over.

rpm is being used to build the packages and I am going through a .spec file

I have some doubts as to how it has been laid out (based on what i have picked up from the various sites that explain the layout of .spec files). I was wondering if there was a definitive list of tips and do's and don'ts re how to define sa spec file.

Any help directing me would be appreciated.
Reply With Quote
  #2  
Old 7th October 2011, 05:04 PM
PabloTwo Offline
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 6,160
linuxfirefox
Re: Good design habits for SPEC files for rpm

Hello Pat, and welcome to the forum.

If you are building rpm packages specifically for Fedora, then there is a packaging guide to help you with that.
Reply With Quote
  #3  
Old 7th October 2011, 05:06 PM
leigh123linux
Guest
 
Posts: n/a
linuxfirefox
Re: Good design habits for SPEC files for rpm

Heres another link

http://fedoraproject.org/wiki/How_to...an_RPM_package
Reply With Quote
  #4  
Old 7th October 2011, 05:21 PM
PatMcDonagh Offline
Registered User
 
Join Date: Oct 2011
Posts: 8
windows_vistaie
Re: Good design habits for SPEC files for rpm

Leigh, Pablo,

thanks for the quick reply. It is much appreciated.

Can i just ask if its normal for a spec file to trigger a ./configure & gmake while still in the %prep area and before the %build area has even been declared.

I have noticed that the folloeing command is being issued after All source files have been established

./prod-configure.sh
gmake > make.out 2>&1

thereafter the resultant binaries are copied then the %build line is declared followed directly by %files and the files to be included in the package.

My understanding is that the make is defined and executed within %build and the the file i have inherited has gone outside of what is good practice.
Reply With Quote
  #5  
Old 7th October 2011, 05:42 PM
leigh123linux
Guest
 
Posts: n/a
linuxfirefox
Re: Good design habits for SPEC files for rpm

%prep is used for unpacking and patching the source


Heres a sample spec

Code:
Name:           
Version:        
Release:        1%{?dist}
Summary:        

Group:          
License:        
URL:            
Source0:        
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  
Requires:       

%description


%prep
%setup -q


%build
%configure
make %{?_smp_mflags}


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


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%doc



%changelog

./configure shouldn't be used directly, use %configure instead


the %configure macro expands to

Code:
[leigh@main_pc Desktop]$ rpm -qf %configure
error: file /home/leigh/Desktop/
  CFLAGS="${CFLAGS:--O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic}" ; export CFLAGS ; 
  CXXFLAGS="${CXXFLAGS:--O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic}" ; export CXXFLAGS ; 
  FFLAGS="${FFLAGS:--O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/lib64/gfortran/modules}" ; export FFLAGS ; 
  ./configure --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu \
    --target=x86_64-redhat-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
Reply With Quote
Reply

Tags
design, files, good, habits, rpm, spec

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
rawhide spec files sanjay_ankur Using Fedora 1 20th January 2009 12:09 PM
.spec files nucleo Using Fedora 2 3rd February 2008 03:05 PM
Whats a good web design software package boyd98 Using Fedora 13 23rd March 2006 08:56 PM
What are .spec files for?? odiseo77 Using Fedora 2 24th April 2005 08:53 PM


Current GMT-time: 12:16 (Wednesday, 01-10-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat