[52d29f7] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[ff769b8c] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
---|
[52d29f7] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
[c88ffaa] | 7 | <!ENTITY unzip-download-http "http://www.mirrorservice.org/sites/ftp.info-zip.org/pub/infozip/src/unzip552.tar.gz">
|
---|
[9c90b1b] | 8 | <!ENTITY unzip-download-ftp "ftp://ftp.info-zip.org/pub/infozip/src/unzip552.tar.gz">
|
---|
| 9 | <!ENTITY unzip-md5sum "9d23919999d6eac9217d1f41472034a9">
|
---|
| 10 | <!ENTITY unzip-size "1.1 MB">
|
---|
[0573d3fc] | 11 | <!ENTITY unzip-buildsize "6.7 MB">
|
---|
[9c90b1b] | 12 | <!ENTITY unzip-time "0.1 SBU">
|
---|
[52d29f7] | 13 | ]>
|
---|
| 14 |
|
---|
[5c5cdbc] | 15 | <sect1 id="unzip" xreflabel="UnZip-&unzip-version;">
|
---|
[c88ffaa] | 16 | <?dbhtml filename="unzip.html"?>
|
---|
| 17 |
|
---|
| 18 | <sect1info>
|
---|
| 19 | <othername>$LastChangedBy$</othername>
|
---|
| 20 | <date>$Date$</date>
|
---|
| 21 | </sect1info>
|
---|
| 22 |
|
---|
| 23 | <title>UnZip-&unzip-version;</title>
|
---|
| 24 |
|
---|
| 25 | <indexterm zone="unzip">
|
---|
| 26 | <primary sortas="a-UnZip">UnZip</primary>
|
---|
| 27 | </indexterm>
|
---|
| 28 |
|
---|
| 29 | <sect2 role="package">
|
---|
| 30 | <title>Introduction to UnZip</title>
|
---|
| 31 |
|
---|
[539ace5] | 32 | <para>The <application>UnZip</application> package contains
|
---|
[9c90b1b] | 33 | <filename>ZIP</filename> extraction utilities. These are useful for
|
---|
| 34 | extracting files from <filename>ZIP</filename> archives.
|
---|
| 35 | <filename>ZIP</filename> archives are created with
|
---|
| 36 | <application>PKZIP</application> or <application>Info-ZIP</application>
|
---|
| 37 | utilities, primarily in a DOS environment.</para>
|
---|
| 38 |
|
---|
| 39 | <caution>
|
---|
| 40 | <para>The <application>UnZip</application> package has some locale
|
---|
[86eaa277] | 41 | related issues. See the discussion below in the
|
---|
| 42 | <xref linkend="unzip-locale-issues"/> section. A more general
|
---|
| 43 | discussion of these problems can be found on the
|
---|
| 44 | <xref linkend="locale-issues"/> page.</para>
|
---|
[9c90b1b] | 45 | </caution>
|
---|
[c88ffaa] | 46 |
|
---|
| 47 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 48 | <itemizedlist spacing="compact">
|
---|
| 49 | <listitem>
|
---|
| 50 | <para>Download (HTTP): <ulink url="&unzip-download-http;"/></para>
|
---|
| 51 | </listitem>
|
---|
| 52 | <listitem>
|
---|
| 53 | <para>Download (FTP): <ulink url="&unzip-download-ftp;"/></para>
|
---|
| 54 | </listitem>
|
---|
| 55 | <listitem>
|
---|
| 56 | <para>Download MD5 sum: &unzip-md5sum;</para>
|
---|
| 57 | </listitem>
|
---|
| 58 | <listitem>
|
---|
| 59 | <para>Download size: &unzip-size;</para>
|
---|
| 60 | </listitem>
|
---|
| 61 | <listitem>
|
---|
| 62 | <para>Estimated disk space required: &unzip-buildsize;</para>
|
---|
| 63 | </listitem>
|
---|
| 64 | <listitem>
|
---|
| 65 | <para>Estimated build time: &unzip-time;</para>
|
---|
| 66 | </listitem>
|
---|
| 67 | </itemizedlist>
|
---|
| 68 |
|
---|
[1d112cb] | 69 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
| 70 | <itemizedlist spacing='compact'>
|
---|
| 71 | <listitem>
|
---|
| 72 | <para>Required patch: <ulink
|
---|
| 73 | url="&patch-root;/unzip-&unzip-version;-security_fix-1.patch"/></para>
|
---|
| 74 | </listitem>
|
---|
| 75 | </itemizedlist>
|
---|
| 76 |
|
---|
[1039de3] | 77 | <para condition="html" role="usernotes">User Notes:
|
---|
| 78 | <ulink url="&blfs-wiki;/unzip"/></para>
|
---|
| 79 |
|
---|
[c88ffaa] | 80 | </sect2>
|
---|
| 81 |
|
---|
[86eaa277] | 82 | <sect2 id="unzip-locale-issues">
|
---|
| 83 | <title>UnZip Locale Issues</title>
|
---|
| 84 |
|
---|
| 85 | <note>
|
---|
| 86 | <para>Use of <application>UnZip</application> in the
|
---|
| 87 | <application>JDK</application>, <application>Mozilla</application>,
|
---|
| 88 | <application>DocBook</application> or any other BLFS package
|
---|
| 89 | installation is not a problem, as BLFS instructions never use
|
---|
| 90 | <application>UnZip</application> to extract a file with non-ASCII
|
---|
| 91 | characters in the file's name.</para>
|
---|
| 92 | </note>
|
---|
| 93 |
|
---|
| 94 | <para>The <application>UnZip</application> package assumes that filenames
|
---|
| 95 | stored in the ZIP archives created on non-Unix systems are encoded in
|
---|
| 96 | CP850, and that they should be converted to ISO-8859-1 when writing files
|
---|
| 97 | onto the filesystem. Such assumptions are not always valid. In fact,
|
---|
| 98 | inside the ZIP archive, filenames are encoded in the DOS codepage that is
|
---|
| 99 | in use in the relevant country, and the filenames on disk should be in
|
---|
| 100 | the locale encoding. In MS Windows, the OemToChar() C function (from
|
---|
| 101 | <filename>User32.DLL</filename>) does the correct conversion (which is
|
---|
| 102 | indeed the conversion from CP850 to a superset of ISO-8859-1 if MS
|
---|
| 103 | Windows is set up to use the US English language), but there is no
|
---|
| 104 | equivalent in Linux.</para>
|
---|
| 105 |
|
---|
| 106 | <para>When using <command>unzip</command> to unpack a ZIP archive
|
---|
| 107 | containing non-ASCII filenames, the filenames are damaged because
|
---|
| 108 | <command>unzip</command> uses improper conversion when any of its
|
---|
| 109 | encoding assumptions are incorrect. For example, in the ru_RU.KOI8-R
|
---|
| 110 | locale, conversion of filenames from CP866 to KOI8-R is required, but
|
---|
| 111 | conversion from CP850 to ISO-8859-1 is done, which produces filenames
|
---|
| 112 | consisting of undecipherable characters instead of words (the closest
|
---|
| 113 | equivalent understandable example for English-only users is rot13). There
|
---|
| 114 | are several ways around this limitation:</para>
|
---|
| 115 |
|
---|
| 116 | <para>1) For unpacking ZIP archives with filenames containing non-ASCII
|
---|
| 117 | characters, use <ulink url="http://www.winzip.com/">WinZip</ulink> while- running the <ulink url="http://www.winehq.com/">Wine</ulink> Windows
|
---|
| 118 | emulator.</para>
|
---|
| 119 |
|
---|
| 120 | <para>2) After running <command>unzip</command>, fix the damage made to
|
---|
| 121 | the filenames using the <command>convmv</command> tool
|
---|
| 122 | (<ulink url="http://j3e.de/linux/convmv/"/>). The following is an example
|
---|
| 123 | for the ru_RU.KOI8-R locale:</para>
|
---|
| 124 |
|
---|
| 125 | <blockquote>
|
---|
| 126 | <para>Step 1. Undo the conversion done by
|
---|
| 127 | <command>unzip</command>:</para>
|
---|
| 128 |
|
---|
| 129 | <screen><userinput>convmv -f iso-8859-1 -t cp850 -r --nosmart --notest \
|
---|
| 130 | <replaceable></path/to/unzipped/files></replaceable></userinput></screen>
|
---|
| 131 |
|
---|
| 132 | <para>Step 2. Do the correct conversion instead:</para>
|
---|
| 133 |
|
---|
| 134 | <screen><userinput>convmv -f cp866 -t koi8-r -r --nosmart --notest \
|
---|
| 135 | <replaceable></path/to/unzipped/files></replaceable></userinput></screen>
|
---|
| 136 | </blockquote>
|
---|
| 137 |
|
---|
| 138 | <para>3) Apply this patch to unzip:
|
---|
[1d112cb] | 139 | <ulink url="https://bugzilla.altlinux.ru/attachment.cgi?id=532"/>.
|
---|
| 140 | It will apply with some offsets.</para>
|
---|
[86eaa277] | 141 |
|
---|
| 142 | <para>It allows to specify the assumed filename encoding in the ZIP
|
---|
| 143 | archive using the <option>-O charset_name</option> option and the
|
---|
| 144 | on-disk filename encoding using the <option>-I charset_name</option>
|
---|
| 145 | option. Defaults: the on-disk filename encoding is the locale encoding,
|
---|
| 146 | the encoding inside the ZIP archive is guessed according to the builtin
|
---|
| 147 | table based on the locale encoding. For US English users, this still
|
---|
| 148 | means that unzip converts from CP850 to ISO-8859-1 by default.</para>
|
---|
| 149 |
|
---|
| 150 | <para>Caveat: this method works only with 8-bit locale encodings, not
|
---|
| 151 | with UTF-8. Attempting to use a patched <command>unzip</command> in UTF-8
|
---|
| 152 | locales may result in a segmentation fault and is probably a security
|
---|
| 153 | risk.</para>
|
---|
| 154 |
|
---|
| 155 | </sect2>
|
---|
| 156 |
|
---|
[c88ffaa] | 157 | <sect2 role="installation">
|
---|
| 158 | <title>Installation of UnZip</title>
|
---|
| 159 |
|
---|
[1d112cb] | 160 | <para>Note that if you applied the patch described above for locale issues,
|
---|
| 161 | the required security patch will have some offsets. Now install
|
---|
| 162 | <application>UnZip</application> by running the following commands:</para>
|
---|
[c88ffaa] | 163 |
|
---|
[1d112cb] | 164 | <screen><userinput>patch -Np1 -i ../unzip-&unzip-version;-security_fix-1.patch &&
|
---|
| 165 | make -f unix/Makefile LOCAL_UNZIP=-D_FILE_OFFSET_BITS=64 linux</userinput></screen>
|
---|
[c88ffaa] | 166 |
|
---|
[0573d3fc] | 167 | <para>To test the results, issue: <command>make check</command>.</para>
|
---|
[c88ffaa] | 168 |
|
---|
| 169 | <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
---|
| 170 |
|
---|
[f2dd0043] | 171 | <screen role="root"><userinput>make prefix=/usr install</userinput></screen>
|
---|
[c88ffaa] | 172 |
|
---|
| 173 | </sect2>
|
---|
| 174 |
|
---|
| 175 | <sect2 role="commands">
|
---|
| 176 | <title>Command Explanations</title>
|
---|
| 177 |
|
---|
[cdbfae1b] | 178 | <para><parameter>linux</parameter>:
|
---|
| 179 | This target in the <filename>Makefile</filename> makes assumptions
|
---|
| 180 | that are useful for a Linux system when compiling the executables.
|
---|
| 181 | To obtain alternatives to this target, use <command>make list</command></para>
|
---|
| 182 |
|
---|
| 183 | <para><parameter>LOCAL_UNZIP=...</parameter>:
|
---|
| 184 | This sets the compilation flags to allow <application>UnZip</application>
|
---|
[0573d3fc] | 185 | to handle files up to 4 GB.</para>
|
---|
[c88ffaa] | 186 |
|
---|
| 187 | </sect2>
|
---|
| 188 |
|
---|
| 189 | <sect2 role="content">
|
---|
| 190 | <title>Contents</title>
|
---|
| 191 |
|
---|
| 192 | <segmentedlist>
|
---|
| 193 | <segtitle>Installed Programs</segtitle>
|
---|
[0573d3fc] | 194 | <segtitle>Installed Libraries</segtitle>
|
---|
[c88ffaa] | 195 | <segtitle>Installed Directories</segtitle>
|
---|
| 196 |
|
---|
| 197 | <seglistitem>
|
---|
| 198 | <seg>funzip, unzip, unzipfsx, zipgrep, and zipinfo</seg>
|
---|
[0573d3fc] | 199 | <seg>None</seg>
|
---|
[c88ffaa] | 200 | <seg>None</seg>
|
---|
| 201 | </seglistitem>
|
---|
| 202 | </segmentedlist>
|
---|
| 203 |
|
---|
| 204 | <variablelist>
|
---|
| 205 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 206 | <?dbfo list-presentation="list"?>
|
---|
| 207 | <?dbhtml list-presentation="table"?>
|
---|
| 208 |
|
---|
| 209 | <varlistentry id="funzip">
|
---|
| 210 | <term><command>funzip</command></term>
|
---|
| 211 | <listitem>
|
---|
[539ace5] | 212 | <para>allows the output of <command>unzip</command> commands to be
|
---|
[c88ffaa] | 213 | redirected.</para>
|
---|
| 214 | <indexterm zone="unzip funzip">
|
---|
| 215 | <primary sortas="b-funzip">funzip</primary>
|
---|
| 216 | </indexterm>
|
---|
| 217 | </listitem>
|
---|
| 218 | </varlistentry>
|
---|
| 219 |
|
---|
| 220 | <varlistentry id="unzip-prog">
|
---|
| 221 | <term><command>unzip</command></term>
|
---|
| 222 | <listitem>
|
---|
[0619e6d] | 223 | <para>lists, tests or extracts files from a <filename>ZIP</filename>
|
---|
[c88ffaa] | 224 | archive.</para>
|
---|
| 225 | <indexterm zone="unzip unzip-prog">
|
---|
| 226 | <primary sortas="b-unzip">unzip</primary>
|
---|
| 227 | </indexterm>
|
---|
| 228 | </listitem>
|
---|
| 229 | </varlistentry>
|
---|
| 230 |
|
---|
| 231 | <varlistentry id="unzipfsx">
|
---|
| 232 | <term><command>unzipfsx</command></term>
|
---|
| 233 | <listitem>
|
---|
[539ace5] | 234 | <para>is a self-extracting stub that can be prepended to a
|
---|
[9c90b1b] | 235 | <filename>ZIP</filename> archive. Files in this format allow the
|
---|
| 236 | recipient to decompress the archive without installing
|
---|
[c88ffaa] | 237 | <application>UnZip</application>.</para>
|
---|
| 238 | <indexterm zone="unzip unzipfsx">
|
---|
| 239 | <primary sortas="b-unzipfsx">unzipfsx</primary>
|
---|
| 240 | </indexterm>
|
---|
| 241 | </listitem>
|
---|
| 242 | </varlistentry>
|
---|
| 243 |
|
---|
| 244 | <varlistentry id="zipgrep">
|
---|
| 245 | <term><command>zipgrep</command></term>
|
---|
| 246 | <listitem>
|
---|
[539ace5] | 247 | <para>searches files in a <filename>ZIP</filename> archive for
|
---|
[c88ffaa] | 248 | lines matching a pattern.</para>
|
---|
| 249 | <indexterm zone="unzip zipgrep">
|
---|
| 250 | <primary sortas="b-zipgrep">zipgrep</primary>
|
---|
| 251 | </indexterm>
|
---|
| 252 | </listitem>
|
---|
| 253 | </varlistentry>
|
---|
| 254 |
|
---|
| 255 | <varlistentry id="zipinfo">
|
---|
| 256 | <term><command>zipinfo</command></term>
|
---|
| 257 | <listitem>
|
---|
[539ace5] | 258 | <para>produces technical information about the files in a
|
---|
| 259 | <filename>ZIP</filename> archive, including file access permissions,
|
---|
[c88ffaa] | 260 | encryption status, type of compression, etc.</para>
|
---|
| 261 | <indexterm zone="unzip zipinfo">
|
---|
| 262 | <primary sortas="b-zipinfo">zipinfo</primary>
|
---|
| 263 | </indexterm>
|
---|
| 264 | </listitem>
|
---|
| 265 | </varlistentry>
|
---|
| 266 |
|
---|
| 267 | <varlistentry id="libunzip">
|
---|
| 268 | <term><filename class='libraryfile'>libunzip.so</filename></term>
|
---|
| 269 | <listitem>
|
---|
[539ace5] | 270 | <para>contains the API functions required by the
|
---|
[c88ffaa] | 271 | <application>UnZip</application> programs.</para>
|
---|
| 272 | <indexterm zone="unzip libunzip">
|
---|
| 273 | <primary sortas="c-libunzip">libunzip.so</primary>
|
---|
| 274 | </indexterm>
|
---|
| 275 | </listitem>
|
---|
| 276 | </varlistentry>
|
---|
| 277 |
|
---|
| 278 | </variablelist>
|
---|
| 279 |
|
---|
| 280 | </sect2>
|
---|
[f45b1953] | 281 |
|
---|
| 282 | </sect1>
|
---|