Author Topic: Only .spec file out of archiv?  (Read 832 times)

Offline daniel

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3739
  • God knows, i'm not an Angel!
    • Tipps und Tricks
Only .spec file out of archiv?
« on: October 07, 2009, 03:12:26 PM »
Hello,
How i can store only a specfile out of a srpm archiv?
I create a skript, for the right click menu, that open a srpm archiv and display it with dolphin. After a click on "OK" by <remove the archiv>, it delete the created folder. But i would like it simple, if it other ways?

Here the script

Code: [Select]
#!/bin/bash
#
#Script to extract specfile.
#Leiche for PCLinuxOS 2010
#License GPL
#
if [ $# -eq 0 ];
then
exit
fi
rpm="$1"
konsole -e unp -u "$1" | sleep 2 && dolphin $HOME/*.src
kdialog --msgbox "remove the archiv" && rm -rf $HOME/*.src 
exit 0

I think, for us translator a simple way, to add our language in synaptic...

Offline kjpetrie

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3996
Re: Only .spec file out of archiv?
« Reply #1 on: October 07, 2009, 05:08:38 PM »
If you create a build environment as described in the stickies, rpm will extract the source and spec to the appropriate places within it. Then you can save what you like.
-----------
KJP
-----------------------------------------------------------
PClos64 RC1 on Intel D945GCLF2 motherboard (Atom 330), 2GB DDR2 RAM, Maxtor STM325031, HL-DT-ST DVDRAM GSA-H42N, Amilo LSL 3220T monitor. Also Acer 5810TG (with custom kernel) and Asus eeePC 2G surf

Offline travisN000

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1758
Re: Only .spec file out of archiv?
« Reply #2 on: October 07, 2009, 05:32:22 PM »
Its been awhile, but there is a way to directly extract it from the srpm..  if I recall, it is done using cpio

try this: http://www.mail-archive.com/redhat-list@redhat.com/msg59573.html

Offline daniel

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3739
  • God knows, i'm not an Angel!
    • Tipps und Tricks
Re: Only .spec file out of archiv?
« Reply #3 on: October 08, 2009, 03:53:59 AM »
If you create a build environment as described in the stickies, rpm will extract the source and spec to the appropriate places within it. Then you can save what you like.


I know it, but for the moment i need only the specfile.
By the way for extract the srpm right click menu
Code: [Select]
#!/bin/bash
#
if [ $# -eq 0 ];
then
usage
fi
srpm="$1"
xterm -hold -e rpm -i "$1"
exit 0

Quote from: travisn000
Its been awhile, but there is a way to directly extract it from the srpm..  if I recall, it is done using cpio

try this: http://www.mail-archive.com/redhat-list@redhat.com/msg59573.html

Thanks for the link...