You are not logged in.

#1 2005-11-11 19:15:43

archtam
Member
Registered: 2005-11-11
Posts: 12

rpm2cpio

I just moved to Arch from Debian and therefore I am still learning my way out to get myself accustomed to Arch. Anyway, I am tryin to install fortran compiler and i found some helpful topics posted by generous people. I used their pkgbuilds and unfortunately i am having problems with this "rpm2cpio" dependency. And it bombs on me sayin it cant find this. Tried to look out where it is available, but as i said Im not yet fortunate on working it out the easier way.

Help is much appreciated.

Thanks,
Arch (i moved to Arch cos of the reason that my nickname is Arch too..lol. Feels great to have my desktop say ArchLinux lol)

Offline

#2 2005-11-11 19:37:17

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: rpm2cpio

Welcome to Arch! smile
PKGBUILD:

# Contributor: Andreas Schweitzer <andy@bootblock.de>
pkgname=rpm2cpio
pkgver=1.2
pkgrel=1
pkgdesc="A complete but simple rpm extractor written in perl. Taken from FreeBSD."
url="http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/archivers/rpm2cpio/"
depends=(perl gzip bzip2)
conflicts=()
backup=()
install=
source=(rpm2cpio.pl)
md5sums=('accecaa71f502f35ba973a73d12d9acd')

build() {
  install -d $startdir/pkg/usr/bin
  install $startdir/src/rpm2cpio.pl $startdir/pkg/usr/bin
}

rpm2cpio.pl:

#!/usr/bin/perl

# Copyright (C) 1997,1998,1999, Roger Espel Llima
# Copyright (C) 2000, Sergey Babkin
# 
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and any associated documentation files (the "Software"), to 
# deal in the Software without restriction, including without limitation the 
# rights to use, copy, modify, merge, publish, distribute, sublicense, 
# and/or sell copies of the Software, and to permit persons to whom the 
# Software is furnished to do so, subject to the following conditions:
# 
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# 
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
# SOFTWARE'S COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE

# (whew, that's done!)

# why does the world need another rpm2cpio?  because the existing one
# won't build unless you have half a ton of things that aren't really
# required for it, since it uses the same library used to extract RPM's.
# in particular, it won't build on the HPsUX box i'm on.


# add a path if desired
$gzip = "gzip";

sub printhelp {
  print "rpm2cpio, perl version by orabidoo <odar@pobox.com>n";
  print "use: rpm2cpio [file.rpm]n";
  print "dumps the contents to stdout as a GNU cpio archiven";
  exit 0;
}

if ($#ARGV == -1) {
  printhelp if -t STDIN;
  $f = "STDIN";
} elsif ($#ARGV == 0) {
  open(F, "< $ARGV[0]") or die "Can't read file $ARGV[0]n";
  $f = 'F';
} else {
  printhelp;
}

printhelp if -t STDOUT;

# gobble the file up
undef $/;
$|=1;
#$rpm = <$f>;
#close ($f);

read $f, $rpm, 96 ;

($magic, $major, $minor) = unpack("NCC", $rpm);

die "Not an RPMn" if $magic != 0xedabeedb;
die "Not a version 3 or 4 RPMn" if $major != 3 && $major != 4;

$filter="";

read $f, $rpm, 16 or die "No headern" ;
while(1) {
        ($magic, $crap, $sections, $bytes) = unpack("N4", $rpm);
        $smagic = unpack("n", $rpm);
        $format="unknown";
        if ($smagic eq 0x1f8b) {
                $filter="gzip -cd";
                last;
        }
        if (substr($rpm, 0, 3) eq "BZh") {
                $filter="bzip2 -cd";
                last;
        }
        #printf(STDERR "0x%x 0x%x 0x%x 0x%xn", $magic, $sections, $bytes, $smagic);
        die "Error: header not recognizedn" if $magic != 0x8eade801;
        seek $f, 16*$sections+$bytes, 1 or die "FIle is too smalln"; # skip the headers
        do {
                read $f, $rpm, 1 or die "No headern" ;
                $c = unpack("C", $rpm);
        } while($c==0);
        read $f, $rpm, 15, 1 or die "No headern" ;
}

#read $f, $rpm, 20 or die "No gzip headern"; # the gzip header
#$smagic = unpack("n", $rpm);
#printf(STDERR "0x%xn", $smagic);
die "Error: bogus RPMn" if $filter eq "";

open(ZCAT, "| $filter") || die "can't pipe to $filtern";
#print STDERR "CPIO archive found!n";

while($rpm ne '') {
        print ZCAT $rpm;
        read $f, $rpm, 10240 ; # read in blocks
}

close ZCAT;

Offline

#3 2005-11-11 19:41:50

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,436
Website

Re: rpm2cpio

you need rpmunpack smile It is in main repo - replace rmp2cpio with rpmunpack

Offline

#4 2005-11-11 20:20:24

archtam
Member
Registered: 2005-11-11
Posts: 12

Re: rpm2cpio

Thank you all. I guess I will try the "rpmunpack" first. Seems like it should be fairly easy. If it doesnt work, i will try the other one.

So far, I am glad to have this great distribution on my laptop. Its faster then others I have been using so far. However I wanna add another question here.....Everytime I reboot, I need to perform "alsaconf" to enable my sound. I dont know why, I have added alsa in my Daemons in /etc/rc.conf, but it doesnt seem to do anything when i start xmms. Its not something big which I cant do, but it would be good to know if I am missing sth here.

Thanks again !


PS - And I am used to using "/etc/init.d/whatever start", in Arch "init.d" is "rc.d" i think. So anyways, its coming slowly. smile Good to see an active forum after a long time, unlike debian smile (No offense to those who like debian) lol

Offline

#5 2005-11-11 20:25:23

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,436
Website

Re: rpm2cpio

Yeah, resist the urge to tack questions on - please make a new thread with your new question - and try searching first too - it makes life easy for everyone!  smile

Offline

#6 2005-11-11 20:31:56

archtam
Member
Registered: 2005-11-11
Posts: 12

Re: rpm2cpio

Alright, thanks anyways.

I figured it out.

Offline

#7 2005-11-11 21:05:21

archtam
Member
Registered: 2005-11-11
Posts: 12

Re: rpm2cpio

# makepkg
==> Making package: rpm2cpio 1.2-1 (Fri Nov 11 14:42:27 CST 2005)
==> Checking Runtime Dependencies...
==> Checking Buildtime Dependencies...
==> Retrieving Sources...
==>     Found rpm2cpio.pl in build dir
==> Validating source files with MD5sums
    rpm2cpio.pl ... Passed
==> Extracting Sources...
==> Starting build()...
==> Compressing man pages...
==> Stripping debugging symbols from libraries...
==> Stripping symbols from binaries...
==> Generating .PKGINFO file...
==> Generating .FILELIST file...
==> Compressing package...
==> Finished making: rpm2cpio  (Fri Nov 11 14:42:27 CST 2005)

Okay seems like I installed rpm2cpio successfully. So I proceeded to install intel fortran compiler and this is what i get :

# makepkg PKGBUILD
==> Making package: ifc9 9.0.021-1 (Fri Nov 11 14:55:00 CST 2005)
==> Checking Runtime Dependencies...
==> Checking Buildtime Dependencies...
==> Missing Dependencies:
==>
requires: rpm2cpio
==>

After this, I tried to search for "rpm2cpio" using

# find / -name rpm2cpio

but didnt display any results.

I am wondering if I did install rpm2cpio correctly, or may be i need to link something in /usr/bin ?

Offline

#8 2005-11-11 21:07:03

archtam
Member
Registered: 2005-11-11
Posts: 12

Re: rpm2cpio

my bad, i also did this after makepkg

pacman -A rpm2cpio-1.2-1.pkg.tar.gz

No luck either

Offline

Board footer

Powered by FluxBB