My favorite site to convert rpm’s to tar gzip files appears to have shut down. As such, I wrote my own tool. It has a web interface: Convert a RPM to a tgz and (keeping inline with my thoughts on software) can be used from the command line.

Five usage examples:

$ wget -q "http://bashcurescancer.com/rpm2tgz.ws?url=http://bashcurescancer.com/media/rpm2tgz/telnet-0.17-39.el5.i386.rpm"
$ ls -l telnet-0.17-39.el5.i386.tgz
-rw-r--r-- 1 noland noland 49804 Feb 23 17:09 telnet-0.17-39.el5.i386.tgz
$ curl -s -F "rpm=@telnet-0.17-39.el5.i386.rpm" \
"http://bashcurescancer.com/rpm2tgz.ws" >telnet-0.17-39.el5.i386.tgz.1
$ curl -s -F "url=http://bashcurescancer.com/media/rpm2tgz/telnet-0.17-39.el5.i386.rpm" \
 http://bashcurescancer.com/rpm2tgz.ws > telnet-0.17-39.el5.i386.tgz.2
$ curl -s "http://bashcurescancer.com/rpm2tgz.ws?url=ttp://bashcurescancer.com/media/rpm2tgz/telnet-0.17-39.el5.i386.rpm" \
> telnet-0.17-39.el5.i386.tgz.3
$ wget -q -O telnet-0.17-39.el5.i386.tgz.4 \
"http://bashcurescancer.com/rpm2tgz.ws?url=http://bashcurescancer.com/media/rpm2tgz/telnet-0.17-39.el5.i386.rpm"

Needless to say, if you abuse this, I will block your ip address from accessing the service. If there is an error the script will either return 404 File Not Found or 500 Internal Server Error and an empty body. As such, you should be able to the -s expression of test, [, and [[ to check the validity of the file.

5 Responses to “rpm2tgz - web interface and web service”

  1. thecubic Says:

    aw, c’mon, cpio is awesome!

    ( cd / ; rpm2cpio telnet.rpm | cpio -d -i )

    rpm2cpio telnet.rpm | ssh nonrpmhost ‘( cd / ; cpio -d -i )’

    it’s even good enough for your initrd!

    $ sudo cat /boot/initrd-2.6.23.15-137.fc8.img | gunzip > i.cpio
    $ file i.cpio
    i.cpio: ASCII cpio archive (SVR4 with no CRC)

  2. admin Says:

    I agree! I only convert an rpm to tgz when I am on a Windows host… which happens too often!

  3. Liam Says:

    If you’re not fixed on a web services for some reason, the alien command should satisfy most of your package conversion needs.

    For Debian -
    http://packages.debian.org/unstable/admin/alien

    For others - not sure :)

  4. admin Says:

    Liam,

    Thanks for the tip!

    I agree, cpio or alien is a better solution for most people. However, I often just want to see the contents of an RPM from my work windows :( laptop. As such a simple web based rpm2tgz converter makes my life easier.

  5. countd Says:

    In addition to cpio and alien, SUSE provides a nifty bash wrapper script to cpio/rpm2cpio which is about the easiest way to unpack an rpm into a current directory with the directory structures all in place. :)

Leave a Reply

If Wordpress eats your comment (shell output, loops, ex..) email the text to me.