distro: Rename (distro) to (gnu packages).
[jackhill/guix/guix.git] / gnu / packages / mysql.scm
CommitLineData
39224d94
LC
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
3;;;
4;;; This file is part of GNU Guix.
5;;;
6;;; GNU Guix is free software; you can redistribute it and/or modify it
7;;; under the terms of the GNU General Public License as published by
8;;; the Free Software Foundation; either version 3 of the License, or (at
9;;; your option) any later version.
10;;;
11;;; GNU Guix is distributed in the hope that it will be useful, but
12;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;;; GNU General Public License for more details.
15;;;
16;;; You should have received a copy of the GNU General Public License
17;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
1ffa7090 19(define-module (gnu packages mysql)
59a43334 20 #:use-module (gnu packages)
1ffa7090
LC
21 #:use-module (gnu packages perl)
22 #:use-module (gnu packages linux)
23 #:use-module (gnu packages openssl)
24 #:use-module (gnu packages compression)
25 #:use-module (gnu packages ncurses)
39224d94
LC
26 #:use-module ((guix licenses) #:select (gpl2))
27 #:use-module (guix packages)
28 #:use-module (guix download)
29 #:use-module (guix build-system gnu))
30
31(define-public mysql
32 (package
33 (name "mysql")
34 (version "5.1.54")
35 (source (origin
36 (method url-fetch)
37 (uri (string-append
38 "http://downloads.mysql.com/archives/mysql-5.1/mysql-"
39 version ".tar.gz"))
40 (sha256
41 (base32
42 "07xbnwk7h1xya8s6dw34nrv7ampzag8l0l1szd2pc9zyqkzhydw4"))))
43 (build-system gnu-build-system)
44 (inputs
45 `(("procps" ,procps)
46 ("openssl" ,openssl)
47 ("perl" ,perl)
48 ("zlib" ,zlib)
49 ("ncurses" ,ncurses)))
50 (arguments
51 '(#:modules ((guix build gnu-build-system)
52 (guix build utils)
53 (ice-9 ftw)) ; for "rm -rf"
54 #:phases (alist-cons-after
55 'install 'clean-up
56 (lambda* (#:key outputs #:allow-other-keys)
57 ;; Remove the 112 MiB of tests that get installed.
58 (let ((out (assoc-ref outputs "out")))
59 (define (rm-rf dir)
60 (file-system-fold (const #t) ; enter?
61 (lambda (file stat result) ; leaf
62 (delete-file file))
63 (const #t) ; down
64 (lambda (dir stat result) ; up
65 (rmdir dir))
66 (const #t)
67 (lambda (file stat errno result)
68 (format (current-error-port)
69 "error: ~a: ~a~%"
70 file (strerror errno)))
71 #t
72 (string-append out "/" dir)))
73 (rm-rf "mysql-test")
74 (rm-rf "sql-bench")
75
76 ;; Compress the 14 MiB Info file.
77 (zero?
78 (system* "gzip" "--best"
79 (string-append out "/share/info/mysql.info")))))
80 %standard-phases)))
81 (home-page "http://www.mysql.com/")
82 (synopsis "A fast, easy to use, and popular database")
83 (description
84 "MySQL is a fast, reliable, and easy to use relational database
85management system that supports the standardized Structured Query
86Language.")
87 (license gpl2)))