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