UnZip-6.0

#### Beyond Linux® From Scratch - Version 2019-02-27

### Chapter 12. System Utilities

- Prev

  UnRar-5.7.2

- Next

  UPower-0.99.9

- Up
- Home

# UnZip-6.0

## Introduction to UnZip

The UnZip package contains `ZIP` extraction utilities. These are useful for extracting files from `ZIP` archives. `ZIP` archives are created with PKZIP or Info-ZIP utilities, primarily in a DOS environment.

This package is known to build and work properly using an LFS-8.4 platform.

### Caution

The previous version of the UnZip package had some locale related issues. Currently there are no BLFS editors capable of testing these locale issues. Therefore, the locale related information is left on this page, but has not been tested. A more general discussion of these problems can be found in the Program Assumes Encoding section of the Locale Related Issues page.

### Package Information

- Download (HTTP): https://downloads.sourceforge.net/infozip/unzip60.tar.gz

- Download (FTP): ftp://ftp.info-zip.org/pub/infozip/src/unzip60.tgz

- Download MD5 sum: 62b490407489521db863b523a7f86375

- Download size: 1.3 MB

- Estimated disk space required: 9 MB

- Estimated build time: less than 0.1 SBU

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/unzip

## UnZip Locale Issues

### Note

Use of UnZip in the JDK, Mozilla, DocBook or any other BLFS package installation is not a problem, as BLFS instructions never use UnZip to extract a file with non-ASCII characters in the file's name.

The UnZip package assumes that filenames stored in the ZIP archives created on non-Unix systems are encoded in CP850, and that they should be converted to ISO-8859-1 when writing files onto the filesystem. Such assumptions are not always valid. In fact, inside the ZIP archive, filenames are encoded in the DOS codepage that is in use in the relevant country, and the filenames on disk should be in the locale encoding. In MS Windows, the OemToChar() C function (from `User32.DLL`) does the correct conversion (which is indeed the conversion from CP850 to a superset of ISO-8859-1 if MS Windows is set up to use the US English language), but there is no equivalent in Linux.

When using unzip to unpack a ZIP archive containing non-ASCII filenames, the filenames are damaged because unzip uses improper conversion when any of its encoding assumptions are incorrect. For example, in the ru_RU.KOI8-R locale, conversion of filenames from CP866 to KOI8-R is required, but conversion from CP850 to ISO-8859-1 is done, which produces filenames consisting of undecipherable characters instead of words (the closest equivalent understandable example for English-only users is rot13). There are several ways around this limitation:

1) For unpacking ZIP archives with filenames containing non-ASCII characters, use WinZip while running the Wine Windows emulator.

2) After running unzip, fix the damage made to the filenames using the convmv tool (http://j3e.de/linux/convmv/). The following is an example for the ru_RU.KOI8-R locale:

> Step 1. Undo the conversion done by unzip:

>     convmv -f iso-8859-1 -t cp850 -r --nosmart --notest \
>         </path/to/unzipped/files>

> Step 2. Do the correct conversion instead:

>     convmv -f cp866 -t koi8-r -r --nosmart --notest \
>         </path/to/unzipped/files>

## Installation of UnZip

    make -f unix/Makefile generic

The test suite does not work for present target “generic”.

Now, as the `root` user:

    make prefix=/usr MANDIR=/usr/share/man/man1 \
     -f unix/Makefile install

## Command Explanations

make -f unix/Makefile generic: This target begins by running a configure script (unlike the older targets such as linux and linux_noasm) which creates a flags file that is then used in the build. This ensures that the 32-bit x86 build receives the right flags to unzip files which which are larger than 2GB when extracted.

## Contents

Installed Programs: funzip, unzip, unzipfsx, zipgrep, and zipinfo
Installed Libraries: None
Installed Directories: None

### Short Descriptions

funzip | allows the output of unzip commands to be redirected.
unzip | lists, tests or extracts files from a `ZIP` archive.
unzipfsx | is a self-extracting stub that can be prepended to a `ZIP` archive. Files in this format allow the recipient to decompress the archive without installing UnZip.
zipgrep | searches files in a `ZIP` archive for lines matching a pattern.
zipinfo | produces technical information about the files in a `ZIP` archive, including file access permissions, encryption status, type of compression, etc.

Last updated on 2019-02-15 13:28:28 -0600

- Prev

  UnRar-5.7.2

- Next

  UPower-0.99.9

- Up
- Home