Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
10-28-2013, 05:08 AM
|
#1
|
LQ Newbie
Registered: Oct 2013
Posts: 22
Rep:
|
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
|
|
|
10-28-2013, 05:12 AM
|
#2
|
Moderator
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,311
|
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.
|
10-28-2013, 05:16 AM
|
#3
|
Senior Member
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,559
|
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
|
|
|
10-28-2013, 05:38 AM
|
#4
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519
|
@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.
|
10-28-2013, 05:47 AM
|
#5
|
LQ Newbie
Registered: Oct 2013
Posts: 22
Original Poster
Rep:
|
Dear astrogeek,
I'm trying to install "keapi-eai-src.rpm" this package related to Kontron board driver.
By
Thiru
|
|
|
10-28-2013, 05:51 AM
|
#6
|
Senior Member
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,559
|
"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.
|
|
|
10-28-2013, 06:10 AM
|
#7
|
LQ Newbie
Registered: Oct 2013
Posts: 22
Original Poster
Rep:
|
Quote:
Originally Posted by ruario
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..........?
|
|
|
10-28-2013, 06:29 AM
|
#8
|
Senior Member
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,559
|
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.
|
10-28-2013, 06:41 AM
|
#9
|
Amigo developer
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928
|
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.
|
|
|
10-28-2013, 07:32 AM
|
#10
|
MLED Founder
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453
|
Quote:
Originally Posted by thirun
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.
|
|
|
10-28-2013, 07:55 AM
|
#11
|
Senior Member
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,559
|
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!
|
|
|
10-28-2013, 09:45 AM
|
#12
|
MLED Founder
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453
|
Quote:
Originally Posted by ruario
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.
|
|
|
10-28-2013, 10:01 AM
|
#13
|
Senior Member
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,559
|
Quote:
Originally Posted by gnashley
@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.
|
|
|
10-28-2013, 01:53 PM
|
#14
|
Amigo developer
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928
|
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.
|
|
|
10-29-2013, 01:12 AM
|
#15
|
LQ Newbie
Registered: Oct 2013
Posts: 22
Original Poster
Rep:
|
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
|
|
|
All times are GMT -5. The time now is 05:03 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|