Register a domain and help support LQ
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 07-28-2011, 03:23 AM   #1
LQ Newbie
Registered: Jun 2009
Posts: 20

Rep: Reputation: 0
Question rpmbuild : need help with spec file.


In my rpm spec file I need to put the following command in the post section.

echo "`rpm -qa --qf \"%-11{SIZE} %{NAME}\n\" | sort -k1n`" >>%{mytest_conf}

But during installation it fails . I think the part "\"%-11{SIZE}" is creating the issue. Any idea how to get rid of it?

Old 07-28-2011, 11:01 AM   #2
Registered: Mar 2010
Posts: 58

Rep: Reputation: 5
This is the first time I've seen those % constructions for use in a spec file, so I can't offer specific advice. My generic troubleshooting thought is to try doing something like

echo "%-11{SIZE}" >>%{mytest_conf}
echo "%{NAME}" >>%{mytest_conf}
echo "`rpm -qa --qf \"%-11{SIZE} %{NAME}\n\" | sort -k1n`" >>%{mytest_conf}
and see if the basic variable substitution is happening properly.
Old 07-29-2011, 10:05 AM   #3
LQ Newbie
Registered: Jun 2009
Posts: 20

Original Poster
Rep: Reputation: 0
thanks for the reply. this may not work as I found that the problem is with '-' like in the command

echo "`rpm -qa --qf \"%-11{SIZE} %{NAME}\n\" | sort -k1n`" >>%{mytest_conf}

if I change to

echo "`rpm -qa --qf \"%11{SIZE} %{NAME}\n\" | sort -k1n`" >>%{mytest_conf}

it works.



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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Rpmbuild spec file for virtual rpm - removing obsolete packages - CentOS/RHEL 5.3 DrLove73 Linux - Software 3 10-10-2009 10:22 AM
rpmbuild a spec file when a BuildRequires is not installed carltm Linux - Software 1 12-08-2008 06:45 PM
Need help with RPMBUILD .spec included wadevondoom Linux - Software 3 07-27-2006 06:59 PM
Problem with rpmbuild and template.spec file abefroman Linux - Software 0 11-27-2005 12:18 AM
rpmbuild -ba php.spec pk21 Linux - General 0 09-16-2003 09:34 AM

All times are GMT -5. The time now is 01:46 AM.

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