[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 |
|
---|
[8fdf129] | 7 | <!ENTITY unzip-download-http "http://downloads.sourceforge.net/infozip/unzip552.tar.gz">
|
---|
| 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">
|
---|
[9c90b1b] | 14 | <!ENTITY unzip-time "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>
|
---|
| 79 | </itemizedlist>
|
---|
[1d112cb] | 80 |
|
---|
[1039de3] | 81 | <para condition="html" role="usernotes">User Notes:
|
---|
| 82 | <ulink url="&blfs-wiki;/unzip"/></para>
|
---|
| 83 |
|
---|
[c88ffaa] | 84 | </sect2>
|
---|
| 85 |
|
---|
[86eaa277] | 86 | <sect2 id="unzip-locale-issues">
|
---|
| 87 | <title>UnZip Locale Issues</title>
|
---|
| 88 |
|
---|
| 89 | <note>
|
---|
| 90 | <para>Use of <application>UnZip</application> in the
|
---|
| 91 | <application>JDK</application>, <application>Mozilla</application>,
|
---|
| 92 | <application>DocBook</application> or any other BLFS package
|
---|
| 93 | installation is not a problem, as BLFS instructions never use
|
---|
| 94 | <application>UnZip</application> to extract a file with non-ASCII
|
---|
| 95 | characters in the file's name.</para>
|
---|
| 96 | </note>
|
---|
| 97 |
|
---|
| 98 | <para>The <application>UnZip</application> package assumes that filenames
|
---|
| 99 | stored in the ZIP archives created on non-Unix systems are encoded in
|
---|
| 100 | CP850, and that they should be converted to ISO-8859-1 when writing files
|
---|
| 101 | onto the filesystem. Such assumptions are not always valid. In fact,
|
---|
| 102 | inside the ZIP archive, filenames are encoded in the DOS codepage that is
|
---|
| 103 | in use in the relevant country, and the filenames on disk should be in
|
---|
| 104 | the locale encoding. In MS Windows, the OemToChar() C function (from
|
---|
| 105 | <filename>User32.DLL</filename>) does the correct conversion (which is
|
---|
| 106 | indeed the conversion from CP850 to a superset of ISO-8859-1 if MS
|
---|
| 107 | Windows is set up to use the US English language), but there is no
|
---|
| 108 | equivalent in Linux.</para>
|
---|
| 109 |
|
---|
| 110 | <para>When using <command>unzip</command> to unpack a ZIP archive
|
---|
| 111 | containing non-ASCII filenames, the filenames are damaged because
|
---|
| 112 | <command>unzip</command> uses improper conversion when any of its
|
---|
| 113 | encoding assumptions are incorrect. For example, in the ru_RU.KOI8-R
|
---|
| 114 | locale, conversion of filenames from CP866 to KOI8-R is required, but
|
---|
| 115 | conversion from CP850 to ISO-8859-1 is done, which produces filenames
|
---|
| 116 | consisting of undecipherable characters instead of words (the closest
|
---|
| 117 | equivalent understandable example for English-only users is rot13). There
|
---|
| 118 | are several ways around this limitation:</para>
|
---|
| 119 |
|
---|
| 120 | <para>1) For unpacking ZIP archives with filenames containing non-ASCII
|
---|
[8fdf129] | 121 | characters, use <ulink url="http://www.winzip.com/">WinZip</ulink> while
|
---|
| 122 | running the <ulink url="http://www.winehq.com/">Wine</ulink> Windows
|
---|
[86eaa277] | 123 | emulator.</para>
|
---|
| 124 |
|
---|
| 125 | <para>2) After running <command>unzip</command>, fix the damage made to
|
---|
| 126 | the filenames using the <command>convmv</command> tool
|
---|
| 127 | (<ulink url="http://j3e.de/linux/convmv/"/>). The following is an example
|
---|
| 128 | for the ru_RU.KOI8-R locale:</para>
|
---|
| 129 |
|
---|
| 130 | <blockquote>
|
---|
| 131 | <para>Step 1. Undo the conversion done by
|
---|
| 132 | <command>unzip</command>:</para>
|
---|
| 133 |
|
---|
| 134 | <screen><userinput>convmv -f iso-8859-1 -t cp850 -r --nosmart --notest \
|
---|
| 135 | <replaceable></path/to/unzipped/files></replaceable></userinput></screen>
|
---|
| 136 |
|
---|
| 137 | <para>Step 2. Do the correct conversion instead:</para>
|
---|
| 138 |
|
---|
| 139 | <screen><userinput>convmv -f cp866 -t koi8-r -r --nosmart --notest \
|
---|
| 140 | <replaceable></path/to/unzipped/files></replaceable></userinput></screen>
|
---|
| 141 | </blockquote>
|
---|
| 142 |
|
---|
| 143 | <para>3) Apply this patch to unzip:
|
---|
[1d112cb] | 144 | <ulink url="https://bugzilla.altlinux.ru/attachment.cgi?id=532"/>.
|
---|
| 145 | It will apply with some offsets.</para>
|
---|
[86eaa277] | 146 |
|
---|
| 147 | <para>It allows to specify the assumed filename encoding in the ZIP
|
---|
| 148 | archive using the <option>-O charset_name</option> option and the
|
---|
| 149 | on-disk filename encoding using the <option>-I charset_name</option>
|
---|
| 150 | option. Defaults: the on-disk filename encoding is the locale encoding,
|
---|
| 151 | the encoding inside the ZIP archive is guessed according to the builtin
|
---|
| 152 | table based on the locale encoding. For US English users, this still
|
---|
| 153 | means that unzip converts from CP850 to ISO-8859-1 by default.</para>
|
---|
| 154 |
|
---|
| 155 | <para>Caveat: this method works only with 8-bit locale encodings, not
|
---|
| 156 | with UTF-8. Attempting to use a patched <command>unzip</command> in UTF-8
|
---|
| 157 | locales may result in a segmentation fault and is probably a security
|
---|
| 158 | risk.</para>
|
---|
| 159 |
|
---|
| 160 | </sect2>
|
---|
| 161 |
|
---|
[c88ffaa] | 162 | <sect2 role="installation">
|
---|
| 163 | <title>Installation of UnZip</title>
|
---|
| 164 |
|
---|
[1d112cb] | 165 | <para>Note that if you applied the patch described above for locale issues,
|
---|
| 166 | the required security patch will have some offsets. Now install
|
---|
| 167 | <application>UnZip</application> by running the following commands:</para>
|
---|
[c88ffaa] | 168 |
|
---|
[864b24de] | 169 | <screen><userinput>patch -Np1 -i ../unzip-&unzip-version;-security_fix-1.patch &&
|
---|
[1d112cb] | 170 | make -f unix/Makefile LOCAL_UNZIP=-D_FILE_OFFSET_BITS=64 linux</userinput></screen>
|
---|
[c88ffaa] | 171 |
|
---|
[0573d3fc] | 172 | <para>To test the results, issue: <command>make check</command>.</para>
|
---|
[c88ffaa] | 173 |
|
---|
| 174 | <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
---|
| 175 |
|
---|
[f2dd0043] | 176 | <screen role="root"><userinput>make prefix=/usr install</userinput></screen>
|
---|
[c88ffaa] | 177 |
|
---|
| 178 | </sect2>
|
---|
| 179 |
|
---|
| 180 | <sect2 role="commands">
|
---|
| 181 | <title>Command Explanations</title>
|
---|
| 182 |
|
---|
[cdbfae1b] | 183 | <para><parameter>linux</parameter>:
|
---|
| 184 | This target in the <filename>Makefile</filename> makes assumptions
|
---|
| 185 | that are useful for a Linux system when compiling the executables.
|
---|
| 186 | To obtain alternatives to this target, use <command>make list</command></para>
|
---|
| 187 |
|
---|
| 188 | <para><parameter>LOCAL_UNZIP=...</parameter>:
|
---|
| 189 | This sets the compilation flags to allow <application>UnZip</application>
|
---|
[0573d3fc] | 190 | to handle files up to 4 GB.</para>
|
---|
[c88ffaa] | 191 |
|
---|
| 192 | </sect2>
|
---|
| 193 |
|
---|
| 194 | <sect2 role="content">
|
---|
| 195 | <title>Contents</title>
|
---|
| 196 |
|
---|
| 197 | <segmentedlist>
|
---|
| 198 | <segtitle>Installed Programs</segtitle>
|
---|
[0573d3fc] | 199 | <segtitle>Installed Libraries</segtitle>
|
---|
[c88ffaa] | 200 | <segtitle>Installed Directories</segtitle>
|
---|
| 201 |
|
---|
| 202 | <seglistitem>
|
---|
| 203 | <seg>funzip, unzip, unzipfsx, zipgrep, and zipinfo</seg>
|
---|
[0573d3fc] | 204 | <seg>None</seg>
|
---|
[c88ffaa] | 205 | <seg>None</seg>
|
---|
| 206 | </seglistitem>
|
---|
| 207 | </segmentedlist>
|
---|
| 208 |
|
---|
| 209 | <variablelist>
|
---|
| 210 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 211 | <?dbfo list-presentation="list"?>
|
---|
| 212 | <?dbhtml list-presentation="table"?>
|
---|
| 213 |
|
---|
| 214 | <varlistentry id="funzip">
|
---|
| 215 | <term><command>funzip</command></term>
|
---|
| 216 | <listitem>
|
---|
[539ace5] | 217 | <para>allows the output of <command>unzip</command> commands to be
|
---|
[c88ffaa] | 218 | redirected.</para>
|
---|
| 219 | <indexterm zone="unzip funzip">
|
---|
| 220 | <primary sortas="b-funzip">funzip</primary>
|
---|
| 221 | </indexterm>
|
---|
| 222 | </listitem>
|
---|
| 223 | </varlistentry>
|
---|
| 224 |
|
---|
| 225 | <varlistentry id="unzip-prog">
|
---|
| 226 | <term><command>unzip</command></term>
|
---|
| 227 | <listitem>
|
---|
[0619e6d] | 228 | <para>lists, tests or extracts files from a <filename>ZIP</filename>
|
---|
[c88ffaa] | 229 | archive.</para>
|
---|
| 230 | <indexterm zone="unzip unzip-prog">
|
---|
| 231 | <primary sortas="b-unzip">unzip</primary>
|
---|
| 232 | </indexterm>
|
---|
| 233 | </listitem>
|
---|
| 234 | </varlistentry>
|
---|
| 235 |
|
---|
| 236 | <varlistentry id="unzipfsx">
|
---|
| 237 | <term><command>unzipfsx</command></term>
|
---|
| 238 | <listitem>
|
---|
[539ace5] | 239 | <para>is a self-extracting stub that can be prepended to a
|
---|
[9c90b1b] | 240 | <filename>ZIP</filename> archive. Files in this format allow the
|
---|
| 241 | recipient to decompress the archive without installing
|
---|
[c88ffaa] | 242 | <application>UnZip</application>.</para>
|
---|
| 243 | <indexterm zone="unzip unzipfsx">
|
---|
| 244 | <primary sortas="b-unzipfsx">unzipfsx</primary>
|
---|
| 245 | </indexterm>
|
---|
| 246 | </listitem>
|
---|
| 247 | </varlistentry>
|
---|
| 248 |
|
---|
| 249 | <varlistentry id="zipgrep">
|
---|
| 250 | <term><command>zipgrep</command></term>
|
---|
| 251 | <listitem>
|
---|
[539ace5] | 252 | <para>searches files in a <filename>ZIP</filename> archive for
|
---|
[c88ffaa] | 253 | lines matching a pattern.</para>
|
---|
| 254 | <indexterm zone="unzip zipgrep">
|
---|
| 255 | <primary sortas="b-zipgrep">zipgrep</primary>
|
---|
| 256 | </indexterm>
|
---|
| 257 | </listitem>
|
---|
| 258 | </varlistentry>
|
---|
| 259 |
|
---|
| 260 | <varlistentry id="zipinfo">
|
---|
| 261 | <term><command>zipinfo</command></term>
|
---|
| 262 | <listitem>
|
---|
[539ace5] | 263 | <para>produces technical information about the files in a
|
---|
| 264 | <filename>ZIP</filename> archive, including file access permissions,
|
---|
[c88ffaa] | 265 | encryption status, type of compression, etc.</para>
|
---|
| 266 | <indexterm zone="unzip zipinfo">
|
---|
| 267 | <primary sortas="b-zipinfo">zipinfo</primary>
|
---|
| 268 | </indexterm>
|
---|
| 269 | </listitem>
|
---|
| 270 | </varlistentry>
|
---|
| 271 |
|
---|
| 272 | <varlistentry id="libunzip">
|
---|
| 273 | <term><filename class='libraryfile'>libunzip.so</filename></term>
|
---|
| 274 | <listitem>
|
---|
[539ace5] | 275 | <para>contains the API functions required by the
|
---|
[c88ffaa] | 276 | <application>UnZip</application> programs.</para>
|
---|
| 277 | <indexterm zone="unzip libunzip">
|
---|
| 278 | <primary sortas="c-libunzip">libunzip.so</primary>
|
---|
| 279 | </indexterm>
|
---|
| 280 | </listitem>
|
---|
| 281 | </varlistentry>
|
---|
| 282 |
|
---|
| 283 | </variablelist>
|
---|
| 284 |
|
---|
| 285 | </sect2>
|
---|
[f45b1953] | 286 |
|
---|
| 287 | </sect1>
|
---|