"Linux Gazette...making Linux just a little more fun! "


InfoZIP Archive Utilities

By Robert G. "Doc" Savage, dsavage@accessus.net


I'm a big fan of utilities. When I saw that CND/RHS were distributed with older versions of the InfoZIP zip/unzip suite of archive utilities, I made upgrading them my first Linux project. It turned out to be a little bit more complicated than I thought it would be.

I especially wanted to add in the DES encryption modules to zip/unzip so they would be 100% file compatible with PKWare's archivers for MS-DOS. U.S. State Department rules make it difficult to implement this as an RPM, so I decided to do it as a classic shell script. The end user will have to ftp the source code (especially the DES code module) from the site specified in the script.


Script #1:

 
#!/bin/sh
#
# undatezip reverses updatezip and restores a Caldera Network Desktop v1.0 or
# Red Hat Software v2.1/v3.0.3 InfoZIP suite installation to its original zip
# v2.01 and unzip v5.12 configuration.  This should only be necessary if you
# need to upgrade from a pristine as-installed configuration.
#
#	original versions	>>updatezip >>>	new versions
#	without encryption	<< undatezip <<	with encryption
#
# Copyright (C) 1996 by Robert G. "Doc" Savage.  Permission is granted to
# distribute this document by electronic means and on CDs provided that it
# is kept entirely in its original format.  Permission is also granted to
# print and execute this document for personal use.  The republishing of
# this document in part or in whole without the permission of the copyright
# holder by any means other than as noted above is prohibited.
#
# First, the executables
#
cd /usr/bin
rm -f *.encrypt
rm -f funzip unzip unzipsfx zip zipcloak zipgrep zipinfo zipnote zipsplit
mv funzip383.export funzip
mv unzip512.export unzip
mv unzipsfx512.export unzipsfx
mv zip201.export zip
mv zipcloak201.export zipcloak
mv zipinfo202.export zipinfo
mv zipnote201.export zipnote
mv zipsplit201.export zipsplit
#
cd /usr/man/man1
rm -f funzip.1 funzip39.1 unzip.1 unzip52.1 unzipsfx.1 unzipsfx52.1 zip.1 \
 zip21.1 zipinfo.1 zipinfo21.1 zipgrep.1 zipgrep21.1 zipcloak.1 zipnote.1 \
 zipsplit.1
mv funzip383.1 funzip.1
mv unzip512.1 unzip.1
mv unzipsfx512.1 unzipsfx.1
mv zip201.1 zip.1
mv zipinfo202.1 zipinfo.1
#
cd
hash -r
#
# That's it...


Script #2:

 
#!/bin/sh
#
# updatezip is a shell script for Caldera Network Desktop v1.0 or Red Hat
# Software's v2.1/v3.0.3 distributions to upgrade the InfoZIP utilities unzip
# from v5.12 to v5.2, and zip from v2.01 to v2.1.  It also adds the zcrypt DES
# encryption module not provided in the RHS (or any other) distribution.
#
# To undo this upgrade and restore a CND v1.0 or RHS v2.1/v3.0.3 installation
# to its original zip/unzip configuration, run the companion file undatezip.
#
# 	original versions	>>updatezip >>>	new versions
# 	without encryption	<< undatezip <<	with encryption
#
# Copyright (C) 1996 by Robert G. "Doc" Savage.  Permission is granted to
# distribute this document by electronic means and on CDs provided that it
# is kept entirely in its original format.  Permission is also granted to
# print and execute this document for personal use.  The republishing of
# this document in part or in whole without the permission of the copyright
# holder by any means other than as noted above is prohibited.
#
# It is divided into four sections:
#
#   Section 1 create the working directory.
#   Section 2 compile the unzip and zip executables.
#   Section 3 replace the existing versions of the zip/unzip suite.
#   Section 4 clean up.
#
# Instructions
# ==========================================================
#
# Download these files from :
#
#   unzip52.zip
#   zcrypt26.zip
#   zip21.zip
#
# Copy them and updatezip to a safe directory (suggest root's home directory
# /root).  Use 'chmod 700 updatezip' to make it executable, then run it.
# Execution time is slightly over four minutes on a DX4/100 system with 28M
# of RAM, a 32-bit EISA host adapter, and an older SCSI-1(CCS) hard drive.
#
# IMPORTANT
# ---------
# Caldera Network Desktop 1.0, when first installed, is missing an important
# file required to compile certain programs.  The following lines create (or
# recreate) this missing file.  This script will fail without it.
#
cd /usr/src/linux
make include/linux/version.h
cd
#
# Section 1.  Create the working directory and extract all required files.
#
mkdir /scratch
cp unzip52.zip /scratch
cp zcrypt26.zip /scratch
cp zip21.zip /scratch
cd /scratch
#
# Section 2. Compile unzip first, then zip
#
unzip unzip52
unzip -o zcrypt26             # -o forces overwrite of stub files
cp -f ./unix/Makefile .
make generic
rm -f *.o                     # clean-up before next compile round
unzip -o zip21
unzip -o zcrypt26
cp -f ./unix/Makefile .
make generic_gcc
#
# Section 3. Install new versions of the zip/unzip suite.  Preserve the
# existing executables and man files first.  Use soft links to point
# to the new versions.
#
cd /usr/bin
mv funzip funzip383.export
mv unzip unzip512.export
mv unzipsfx unzipsfx512.export
mv zip zip201.export
mv zipcloak zipcloak201.export
mv zipinfo zipinfo202.export
mv zipnote zipnote201.export
mv zipsplit zipsplit201.export
#
cd /usr/man/man1
mv funzip.1 funzip383.1
mv unzip.1 unzip512.1
mv unzipsfx.1 unzipsfx512.1
mv zip.1 zip201.1
# note there is no zipgrep.1 in this distribution
mv zipinfo.1 zipinfo202.1
#
cd /usr/bin
mv /scratch/funzip funzip39.encrypt
mv /scratch/unzip unzip52.encrypt
mv /scratch/unzipsfx unzipsfx52.encrypt
mv /scratch/zip zip21.encrypt
mv /scratch/zipcloak zipcloak21.encrypt
mv /scratch/unix/zipgrep zipgrep21.encrypt
mv /scratch/zipnote zipnote21.encrypt
mv /scratch/zipsplit zipsplit21.encrypt
#
cd /usr/man/man1
mv /scratch/unix/funzip.1 funzip39.1
mv /scratch/unix/unzip.1 unzip52.1
mv /scratch/unix/unzipsfx.1 unzipsfx52.1
mv /scratch/man/zip.1 zip21.1
mv /scratch/man/zipgrep.1 zipgrep21.1
mv /scratch/unix/zipinfo.1 zipinfo21.1
#
# Now establish the soft links
#
ln -s funzip39.1 funzip.1
ln -s unzip52.1 unzip.1
ln -s unzipsfx52.1 unzipsfx.1
ln -s zip21.1 zip.1
ln -s zip.1 zipcloak.1        # remember, zip.1 is
ln -s zipgrep21.1 zipgrep.1
ln -s zipinfo21.1 zipinfo.1
ln -s zip.1  zipnote.1        # already soft-linked
ln -s zip.1 zipsplit.1        # to zip21.1
#
cd /usr/bin
ln -s funzip39.encrypt funzip
ln -s unzip52.encrypt unzip
ln -s unzipsfx52.encrypt unzipsfx
ln -s zip21.encrypt zip
ln -s zipcloak21.encrypt zipcloak
ln -s zipgrep21.encrypt zipgrep
ln -s unzip52.encrypt zipinfo # a special link
ln -s zipnote21.encrypt zipnote
ln -s zipsplit21.encrypt zipsplit
#
# Section 4. Clean up the leftovers.
#
cd                            # go to your home directory
rm -rf /scratch               # nothing worth saving in the scratch directory
hash -r                       # re-sync the paths
#
# That's it...


--Doc Savage, Sr. Network Engineer, I-NET, Inc.


Copyright © 1996, Robert G. Savage
Published in Issue 12 of the Linux Gazette


[ TABLE OF CONTENTS ] [ FRONT PAGE ]  Back  Next