LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-28-2013, 05:08 AM   #1
thirun
LQ Newbie
 
Registered: Oct 2013
Posts: 22

Rep: Reputation: Disabled
Post How to install rpm source in Slackware Linux


Hi All,
I'm working with Slackware Linux and trying to install some SRPMs, i get surprised that there is no rpm command in slackware.
I googled a lot and tried many possible ways(using rpmbuild), but not able to install the packages successfully.
Also I tried with rpm2targz, but not able to install the SRPMs
Please suggest the proper way to install SRPM in Slackware.. thanks for you help in advance
 
Old 10-28-2013, 05:12 AM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,311
Blog Entries: 24

Rep: Reputation: 4263Reputation: 4263Reputation: 4263Reputation: 4263Reputation: 4263Reputation: 4263Reputation: 4263Reputation: 4263Reputation: 4263Reputation: 4263Reputation: 4263
RPM is included in Slackware. Did you do a full install?

It might be a better idea to see if there is a Slackbuild at SBo for the program you want to install, that way you could build a native Slackware package.

May I ask what you are trying to install?

And Welcome to LQ!
 
1 members found this post helpful.
Old 10-28-2013, 05:16 AM   #3
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,559

Rep: Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772
By install I presume you mean extract? If yes, then either of the following would do:

Code:
bsdtar xf filename.rpm
Or

Code:
rpm2cpio filename.rpm | cpio -id
Note: You should have rpm2cpio installed already as it is included in a full install of Slackware. At a push you can knock up an rpm2cpio in less than 10 lines of shell script:

Code:
#!/bin/bash
RPMHDRLGTH=$(LANG=C grep -abom1 '.7zXZ\|]'$'\000\000''....'$'\377\377\377\377\377\377''\|BZh9\|'$'\037\213\b' "$1")
case "$RPMHDRLGTH" in
  *7zXZ) COMPRESSOR=xz ;;
  *]*)   COMPRESSOR=lzma ;;
  *BZh9) COMPRESSOR=bzip2 ;;
  *)     COMPRESSOR=gzip ;;
esac
tail -c+$[${RPMHDRLGTH%:*}+1] "$1" | $COMPRESSOR -d
 
Old 10-28-2013, 05:38 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
@thirun : Welcome to LQ.

An SRC RPM is not "installed", like a binary package.
But is unpacked to your rpmbuild environment,
preferable /home/<user-name>/rpms/ :
#13 http://www.linuxquestions.org/questi...1-a-766486/#13

Checking that the 'rpm' package is installed OK :
$ which rpm
$ which rpmbuild
$ which rpm2cpio
... should reply /usr/bin/rpm , /usr/bin/rpmbuild , /usr/bin/rpm2cpio

-
 
1 members found this post helpful.
Old 10-28-2013, 05:47 AM   #5
thirun
LQ Newbie
 
Registered: Oct 2013
Posts: 22

Original Poster
Rep: Reputation: Disabled
Dear astrogeek,

I'm trying to install "keapi-eai-src.rpm" this package related to Kontron board driver.

By
Thiru
 
Old 10-28-2013, 05:51 AM   #6
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,559

Rep: Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772
"Installing" it won't make it work if it is a true source rpm. You will just get the source from which to build the driver.
 
Old 10-28-2013, 06:10 AM   #7
thirun
LQ Newbie
 
Registered: Oct 2013
Posts: 22

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ruario View Post
By install I presume you mean extract? If yes, then either of the following would do:

Code:
bsdtar xf filename.rpm
Or

Code:
rpm2cpio filename.rpm | cpio -id
Note: You should have rpm2cpio installed already as it is included in a full install of Slackware. At a push you can knock up an rpm2cpio in less than 10 lines of shell script:

Code:
#!/bin/bash
RPMHDRLGTH=$(LANG=C grep -abom1 '.7zXZ\|]'$'\000\000''....'$'\377\377\377\377\377\377''\|BZh9\|'$'\037\213\b' "$1")
case "$RPMHDRLGTH" in
  *7zXZ) COMPRESSOR=xz ;;
  *]*)   COMPRESSOR=lzma ;;
  *BZh9) COMPRESSOR=bzip2 ;;
  *)     COMPRESSOR=gzip ;;
esac
tail -c+$[${RPMHDRLGTH%:*}+1] "$1" | $COMPRESSOR -d

Thanks bsdtar is extracting the rpm source and creating the files like file.spec and file.tar.gz, Then how to install the source
I have tried
# bstar etxeai-custom-1.0-1.src.rpm

etxeai-custom.spec
etxai-custom-1.0-1.tar.gz

Then how to install..........?
 
Old 10-28-2013, 06:29 AM   #8
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,559

Rep: Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772
Personally, I would read the spec file and see what it does to construct an rpm package, though if you are not familiar with spec files and package creation this may not help you.

If the license allows it (you would need to to check that with Kontron first), you could post the contents of the spec file here for others to assist you. Alternatively or in addition extract the contents of etxai-custom-1.0-1.tar.gz and see if it contains an INSTALL or README file, which may tell you what to do.
 
1 members found this post helpful.
Old 10-28-2013, 06:41 AM   #9
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 613Reputation: 613Reputation: 613Reputation: 613Reputation: 613Reputation: 613
You could try this:
src2pkg -VV -I etxeai-custom-1.0-1.src.rpm

@ruario, I like this:
Code:
#!/bin/bash
RPMHDRLGTH=$(LANG=C grep -abom1 '.7zXZ\|]'$'\000\000''....'$'\377\377\377\377\377\377''\|BZh9\|'$'\037\213\b' "$1")
case "$RPMHDRLGTH" in
  *7zXZ) COMPRESSOR=xz ;;
  *]*)   COMPRESSOR=lzma ;;
  *BZh9) COMPRESSOR=bzip2 ;;
  *)     COMPRESSOR=gzip ;;
esac
tail -c+$[${RPMHDRLGTH%:*}+1] "$1" | $COMPRESSOR -d

Last edited by gnashley; 10-28-2013 at 06:46 AM.
 
Old 10-28-2013, 07:32 AM   #10
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453

Rep: Reputation: 2156Reputation: 2156Reputation: 2156Reputation: 2156Reputation: 2156Reputation: 2156Reputation: 2156Reputation: 2156Reputation: 2156Reputation: 2156Reputation: 2156
Quote:
Originally Posted by thirun View Post
Please suggest the proper way to install SRPM in Slackware.. thanks for you help in advance
The proper way is probably to read the documentation available on docs.slackware.com, at least the most basic tutorials, and understand that Slackware is not Red Hat Enterprise Linux or CentOS. And then go over to SlackBuilds.org to build what's not included in the basic installation.
 
Old 10-28-2013, 07:55 AM   #11
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,559

Rep: Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772
To be fair kikinovak, whilst he should read these he won't be able to get this particular driver from SlackBuilds.org, so he is going to need to do the packaging himself.

P.S. I'm sure I read a thread recently where another user installed an rpm directly on Slackware, even though he knew full well that Slackware isn't Fedora, Red Hat Enterprise Linux, CentOS, etc. Hmmm ... who was that again!
 
Old 10-28-2013, 09:45 AM   #12
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453

Rep: Reputation: 2156Reputation: 2156Reputation: 2156Reputation: 2156Reputation: 2156Reputation: 2156Reputation: 2156Reputation: 2156Reputation: 2156Reputation: 2156Reputation: 2156
Quote:
Originally Posted by ruario View Post
To be fair kikinovak, whilst he should read these he won't be able to get this particular driver from SlackBuilds.org, so he is going to need to do the packaging himself.

P.S. I'm sure I read a thread recently where another user installed an rpm directly on Slackware, even though he knew full well that Slackware isn't Fedora, Red Hat Enterprise Linux, CentOS, etc. Hmmm ... who was that again!
LOL. Right. But reading the inital post, it sounded more like "How comes I can't find the Ubuntu Software Center in Slackware?" Usually similar posts explicitly state the lack of a specific package/source in any other format than RPM or DEB.
 
Old 10-28-2013, 10:01 AM   #13
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,559

Rep: Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772
Quote:
Originally Posted by gnashley View Post
@ruario, I like this
Yeah it is a neat little hack isn't it? I came up with a simplified version of this on the fly (initially I only supported XZ compression), when I was stuck on a machine without rpm and needed to get files out of an rpm. I then expanded on it and put it up on my blog. I use it from time to time, rather than installing rpm utils.
 
Old 10-28-2013, 01:53 PM   #14
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 613Reputation: 613Reputation: 613Reputation: 613Reputation: 613Reputation: 613
It looks similar to this:
Code:
explode_rpm() {
  local pkg o sigsize gz
  pkg=$1
  o=104
  set -- $(od -j $o -N 8 -t u1 -- "$pkg")
  sigsize=$((8 + 16 *
      (256 * (256 * (256 * $2 + $3) + $4) + $5) +
      (256 * (256 * (256 * $6 + $7) + $8) + $9)))
  o=$((o + sigsize + (8 - (sigsize % 8)) % 8 + 8))
  set -- $(od -j $o -N 8 -t u1 -- "$pkg")
  o=$((o + 8 + 16 *
      (256 * (256 * (256 * $2 + $3) + $4) + $5) +
      (256 * (256 * (256 * $6 + $7) + $8) + $9)))
  comp=$(dd if="$pkg" ibs=$o skip=1 count=1 2>/dev/null \
      | dd bs=3 count=1 2> /dev/null)
  gz="$(echo -en '\037\0213')"
  #xz="$(echo -en '\0fd\037\07a\058\05a\000')"
  case $OPT in
	'-x')
		case "$comp" in
			BZh)      dd if="$pkg" ibs=$o skip=1 2>/dev/null | bunzip2 | cpio --quiet -ivdm ;;
			"$gz"*)   dd if="$pkg" ibs=$o skip=1 2>/dev/null | gunzip | cpio --quiet -ivdm ;;
			"]"*)     dd if="$pkg" ibs=$o skip=1 2>/dev/null | unxz | cpio --quiet -ivdm ;;
			*)        echo "Unrecognized rpm file: $pkg"; return 1 ;;
		esac
	;;
	'-l')
		case "$comp" in
			BZh)      dd if="$pkg" ibs=$o skip=1 2>/dev/null | bunzip2 | cpio --quiet -t$VERBOSE ;;
			"$gz"*)   dd if="$pkg" ibs=$o skip=1 2>/dev/null | gunzip | cpio --quiet -t$VERBOSE ;;
			"]"*)     dd if="$pkg" ibs=$o skip=1 2>/dev/null | unxz | cpio --quiet -t$VERBOSE ;;
			*)        echo "Unrecognized rpm file: $pkg"; return 1 ;;
		esac
	;;
  esac
  [ $? != 0 ] && return 1
}
which is code I use in exploderpm and other places -I modified that slightly from original code by Jeff Johnson
and Lasse Collin. Just lately I saw another similar, but more concise, form on AUR, I think. It'd be interesting to see which is fastest. At times in the past, the method above worked when some versions of the 'real' rpm2cpio did not.
 
Old 10-29-2013, 01:12 AM   #15
thirun
LQ Newbie
 
Registered: Oct 2013
Posts: 22

Original Poster
Rep: Reputation: Disabled
hi All,

I'm tried to extract etxeai-custom-1.0-1.src.rpm and i got these files.

# bstar etxeai-custom-1.0-1.src.rpm
etxeai-custom.spec
etxai-custom-1.0-1.tar.gz

Now i'm trying to compile these files using rpmbuild -bi etxeai-custom.spec

All goes well and finally i got error like

error: Coudn't exec /usr/lib/rpm/elfdeps: no such file or directory

but the compilation completes, is it effect any thing at run time ....?

Please suggest if anything i need to do before compile this package

Thank & Regards
Thiru
 
  


Reply


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
[SOLVED] why cannot I install jdk-6u26-linux-i586-rpm.bin on slackware? yangzhichina Slackware 13 07-05-2011 10:07 AM
install rpm or source Abdalla Linux - Newbie 1 12-10-2010 07:25 AM
contents of /testing/source/linux-2.6.x on slackware install cd 2 [LAG] Prude Slackware 3 03-30-2005 10:26 PM
Upgrading OpenSSL rpm install to a source install userini Linux - Software 3 06-05-2004 11:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:03 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
Open Source Consulting | Domain Registration