gnu: Some cleanup based on lint checkers.
[jackhill/guix/guix.git] / gnu / packages / zip.scm
CommitLineData
b8d3511a
AE
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
809e9b52 3;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
b8d3511a
AE
4;;;
5;;; This file is part of GNU Guix.
6;;;
7;;; GNU Guix is free software; you can redistribute it and/or modify it
8;;; under the terms of the GNU General Public License as published by
9;;; the Free Software Foundation; either version 3 of the License, or (at
10;;; your option) any later version.
11;;;
12;;; GNU Guix is distributed in the hope that it will be useful, but
13;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15;;; GNU General Public License for more details.
16;;;
17;;; You should have received a copy of the GNU General Public License
18;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20(define-module (gnu packages zip)
b5b73a82 21 #:use-module ((guix licenses) #:prefix license:)
b8d3511a
AE
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix build-system gnu)
25 #:use-module (gnu packages compression)
26 #:use-module (gnu packages perl)
fddbf35b 27 #:use-module (guix build-system perl)
b8d3511a
AE
28 #:use-module (gnu packages pkg-config)
29 #:use-module (gnu packages python))
30
31(define-public zip
32 (package
33 (name "zip")
34 (version "3.0")
35 (source
36 (origin
37 (method url-fetch)
38 (uri (string-append "mirror://sourceforge/infozip/Zip%203.x%20%28latest%29/3.0/zip30.tar.gz"))
39 (sha256
40 (base32
41 "0sb3h3067pzf3a7mlxn1hikpcjrsvycjcnj9hl9b1c3ykcgvps7h"))))
42 (build-system gnu-build-system)
43 (inputs `(("bzip2" ,bzip2)))
44 (arguments
45 `(#:tests? #f ; no test target
75757789
MW
46 #:make-flags (let ((out (assoc-ref %outputs "out")))
47 (list "-f" "unix/Makefile"
48 (string-append "prefix=" out)
49 (string-append "MANDIR=" out "/share/man/man1")))
50 #:phases (alist-replace
51 'build
52 (lambda* (#:key (make-flags '()) #:allow-other-keys)
53 (zero? (apply system* "make" "generic_gcc" make-flags)))
54 (alist-delete 'configure %standard-phases))))
b8d3511a 55 (home-page "http://www.info-zip.org/Zip.html")
35b9e423 56 (synopsis "Compression and file packing utility")
b8d3511a 57 (description
35b9e423 58 "Zip is a compression and file packaging/archive utility. Zip is useful
b8d3511a
AE
59for packaging a set of files for distribution, for archiving files, and for
60saving disk space by temporarily compressing unused files or directories.
61Zip puts one or more compressed files into a single ZIP archive, along with
62information about the files (name, path, date, time of last modification,
35b9e423 63protection, and check information to verify file integrity). An entire
b8d3511a
AE
64directory structure can be packed into a ZIP archive with a single command.
65
66Zip has one compression method (deflation) and can also store files without
35b9e423 67compression. Zip automatically chooses the better of the two for each file.
b8d3511a
AE
68Compression ratios of 2:1 to 3:1 are common for text files.")
69 (license (license:bsd-style "file://LICENSE"
70 "See LICENSE in the distribution."))))
71
72(define-public unzip
73 (package (inherit zip)
74 (name "unzip")
75 (version "6.0")
76 (source
77 (origin
78 (method url-fetch)
79 (uri (string-append "mirror://sourceforge/infozip/UnZip%206.x%20%28latest%29/UnZip%206.0/unzip60.tar.gz"))
80 (sha256
81 (base32
82 "0dxx11knh3nk95p2gg2ak777dd11pr7jx5das2g49l262scrcv83"))))
83 (build-system gnu-build-system)
84 ;; no inputs; bzip2 is not supported, since not compiled with BZ_NO_STDIO
85 (arguments
86 `(#:make-flags '("generic_gcc")
87 #:phases
88 (alist-replace
89 'configure
90 (lambda* (#:key inputs outputs #:allow-other-keys)
91 (let* ((out (assoc-ref outputs "out")))
92 (copy-file "unix/Makefile" "Makefile")
809e9b52
MW
93 (substitute* "Makefile"
94 (("/usr/local") out)
95 (("/man/") "/share/man/"))))
b8d3511a
AE
96 %standard-phases)))
97 (home-page "http://www.info-zip.org/UnZip.html")
35b9e423 98 (synopsis "Decompression and file extraction utility")
b8d3511a 99 (description
35b9e423
EB
100 "UnZip is an extraction utility for archives compressed in .zip format,
101also called \"zipfiles\".
b8d3511a 102
35b9e423
EB
103UnZip lists, tests, or extracts files from a .zip archive. The default
104behaviour (with no options) is to extract into the current directory, and
105subdirectories below it, all files from the specified zipfile. UnZip
106recreates the stored directory structure by default.")
b8d3511a
AE
107 (license (license:bsd-style "file://LICENSE"
108 "See LICENSE in the distribution."))))
109
110(define-public zziplib
111 (package
112 (name "zziplib")
113 (version "0.13.62")
114 (source
115 (origin
116 (method url-fetch)
117 (uri (string-append "mirror://sourceforge/zziplib/zziplib13/"
118 version "/zziplib-"
119 version ".tar.bz2"))
120 (sha256
121 (base32
122 "0nsjqxw017hiyp524p9316283jlf5piixc1091gkimhz38zh7f51"))))
123 (build-system gnu-build-system)
c4c4cc05
JD
124 (inputs
125 `(("zlib" ,zlib)))
126 (native-inputs `(("perl" ,perl) ; for the documentation
127 ("pkg-config" ,pkg-config)
128 ("python" ,python-2) ; for the documentation; Python 3 not supported,
129 ; http://forums.gentoo.org/viewtopic-t-863161-start-0.html
130 ("zip" ,zip))) ; to create test files
b8d3511a
AE
131 (arguments
132 `(#:parallel-tests? #f)) ; since test files are created on the fly
133 (home-page "http://zziplib.sourceforge.net/")
35b9e423 134 (synopsis "Library for accessing zip files")
b8d3511a 135 (description
35b9e423 136 "ZZipLib is a library based on zlib for accessing zip files.")
b8d3511a 137 (license license:lgpl2.0+)))
fddbf35b
JD
138
139
140(define-public perl-zip
141 (package
142 (name "perl-zip")
143 (version "1.30")
144 (source
145 (origin
146 (method url-fetch)
147 (uri (string-append
148 "mirror://cpan/authors/id/A/AD/ADAMK/Archive-Zip-"
149 version ".tar.gz"))
150 (sha256
151 (base32
152 "0633zah5z9njiqnvy3vh42fjymncmil1jdfb7d18w8xpfzzp5d7q"))))
153 (build-system perl-build-system)
154 (synopsis "Provides an interface to ZIP archive files")
155 (description "The Archive::Zip module allows a Perl program to create,
156manipulate, read, and write Zip archive files.")
157 (home-page "http://search.cpan.org/~adamk/Archive-Zip-1.30/")
158 (license (package-license perl))))