Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Install bzip2 to handle some UNIX archives UNIX
Sometimes when you download UN*X/Linux stuff from the net for use with MacOSX, they files are compressed using bzip2. Unfortunately, bzip2 doesn't come standard on MacOSX (as far as I know). So to unzip in the Terminal, you have to install bzip2.

I had to do this when I downloaded the PHP manual and it was compressed as bzip2. I wanted to uncompress in the Terminal so that the long file names would be retained -- sometimes uncompressing using Stuffit Expander clips the long file names.

Anyway, if you need to install bzip2 so you can uncompress on MacOSX's Terminal, read the rest of the article for the instructions...

First get the bzip source code.

To compile on MacOSX (assuming you've installed Developer CD):
  1. Copy the bzip2-1.0.2.tar.gz file to /usr/local and uncompress:
    gzip -dc bzip2-1.0.2.tar.gz | tar xvf -
  2. Modify the Makefile and change "CC=gcc"
    to "CC=cc"

  3. Do a make: /usr/local/bzip2-1.0.2/make

  4. Do a make install: /usr/local/bzip2-1.0.2/make install; this installs bzip2 into /usr/bin

  5. delete the directory created as well as the zip file:
    % cd ..
    % rm -f -r bzip2-1.0.2.tar.gz
    % rm -f -r bzip2-1.0.2
To use bzip2, go to the directory you want to un-bzip, and then use "bunzip2" for example:
bunzip2 php_manual_en.tar.bz2
To get help of how to use bzip:
/usr/bin/bzip2 --help
[Editor's note: If you have fink installed, you can install bzip2 with a simple sudo fink install bzip2.]
    •    
  • Currently 3.33 / 5
  You rated: 2 / 5 (3 votes cast)
 
[10,492 views]  

Install bzip2 to handle some UNIX archives | 7 comments | Create New Account
Click here to return to the 'Install bzip2 to handle some UNIX archives' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Fink includes bzip2
Authored by: Anonymous on Jun 13, '02 12:43:31AM

Fink includes bzip2 as a part of the base Fink installation.

If you need command line support, I would highly recommend installing Fink. it contains many popular Unix related packages, included KDE, Gnome, and many command line utilities [1249, in total].

If you want to learn how to port stuff ot OS X, Fink is a great place to start as every package downloads the original source and patches it prior to building/packaging under Fink. Of course, you can always just install the binaries.

Fink also has full blown dependency management-- if a package requires a particular version of some random library, Fink makes sure it is installed.

Fink is some seriously cool stuff.

fink.sourceforge.net



[ Reply to This | # ]
I linked it! :-)
Authored by: robg on Jun 13, '02 12:45:36AM

It was in my editor's note, too, but it is worth repeating -- fink is very very cool!

-rob.



[ Reply to This | # ]
Stuffit Expander
Authored by: Monkey Angst on Jun 13, '02 10:44:04AM

It is worth mentioning that the .bz2 format is supported by Stuffit Expander, which is included with Mac OS X.



[ Reply to This | # ]
Stuffit Expander
Authored by: Monkey Angst on Jun 13, '02 10:46:06AM

Oops! It is clear from the original post that the author knows this already, and I was unaware of SE's problem with long names. Sorry!

BTW, anyone know what Stuffit's cutoff for filename length is?



[ Reply to This | # ]
Stuffit Expander
Authored by: a1291762 on Jun 13, '02 06:56:37PM

The limit is 31 chars I believe. It comes from the code being ported to Carbon only and not OSX-ised.



[ Reply to This | # ]
Stuffit Expander
Authored by: Cerberus on Jun 13, '02 08:19:19PM

I do not know for a fact but I do remember it mentioned that it was 31 (like Mac OS 9)



[ Reply to This | # ]
tar -j
Authored by: vlipper on Jun 13, '02 06:12:16PM

Tar can handle this format as well. Just use -j (and other options).

Vlipper



[ Reply to This | # ]