gnu: Use synopses from the Womb.
[jackhill/guix/guix.git] / gnu / packages / samba.scm
CommitLineData
a40f1543
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
19(define-module (gnu packages samba)
20 #:use-module (guix packages)
21 #:use-module (guix download)
22 #:use-module (guix build-system gnu)
23 #:use-module (guix licenses)
24 #:use-module (gnu packages acl)
25 #:use-module (gnu packages popt)
26 #:use-module (gnu packages openldap)
27 #:use-module (gnu packages readline)
28 #:use-module (gnu packages libunwind)
29 #:use-module (gnu packages linux)
3665b4dc 30 #:use-module (gnu packages patchelf)
a40f1543
LC
31 #:use-module (gnu packages perl)
32 #:use-module (gnu packages python))
33
34(define-public iniparser
35 (package
36 (name "iniparser")
37 (version "3.1")
38 (source (origin
39 (method url-fetch)
40 (uri (string-append "http://ndevilla.free.fr/iniparser/iniparser-"
41 version ".tar.gz"))
42 (sha256
43 (base32
44 "1igmxzcy0s25zcy9vmcw0kd13lh60r0b4qg8lnp1jic33f427pxf"))))
45 (build-system gnu-build-system)
46 (arguments
47 '(#:phases (alist-replace
48 'configure
49 (lambda* (#:key outputs #:allow-other-keys)
50 (substitute* "Makefile"
51 (("/usr/lib")
52 (string-append (assoc-ref outputs "out") "/lib"))))
53 (alist-replace
54 'build
55 (lambda _
56 (and (zero? (system* "make" "libiniparser.so"))
57 (symlink "libiniparser.so.0" "libiniparser.so")))
58 (alist-replace
59 'install
60 (lambda* (#:key outputs #:allow-other-keys)
61 (let* ((out (assoc-ref outputs "out"))
62 (lib (string-append out "/lib"))
63 (inc (string-append out "/include"))
64 (doc (string-append out "/share/doc"))
65 (html (string-append doc "/html")))
66 (define (copy dir)
67 (lambda (file)
68 (copy-file file
69 (string-append dir "/"
70 (basename file)))))
71 (mkdir-p lib)
72 (for-each (copy lib)
73 (find-files "." "^lib.*\\.(so\\.|a)"))
74 (with-directory-excursion lib
75 (symlink "libiniparser.so.0" "libiniparser.so"))
76 (mkdir-p inc)
77 (for-each (copy inc)
78 (find-files "src" "\\.h$"))
79 (mkdir-p html)
80 (for-each (copy html)
81 (find-files "html" ".*"))
82 (for-each (copy doc)
83 '("AUTHORS" "INSTALL" "LICENSE"
84 "README"))))
85 %standard-phases)))))
86 (home-page "http://ndevilla.free.fr/iniparser")
87 (synopsis "Standalone ini file parsing library")
88 (description
89 "iniparser is a free stand-alone `ini' file parsing library (Windows
90configuration files). It is written in portable ANSI C and should compile
91anywhere.")
92 (license x11)))
93
94(define-public samba
95 (package
96 (name "samba")
97 (version "3.6.8")
98 (source (origin
99 (method url-fetch)
100 (uri (string-append "http://us3.samba.org/samba/ftp/stable/samba-"
101 version ".tar.gz"))
102 (sha256
103 (base32
104 "1phl6mmrc72jyvbyrw6cv6b92cxq3v2pbn1fh97nnb4hild1fnjg"))))
105 (build-system gnu-build-system)
106 (arguments
3665b4dc
LC
107 '(#:phases (alist-cons-before
108 'configure 'chdir
109 (lambda _
110 (chdir "source3"))
111 (alist-cons-after
112 'strip 'add-lib-to-runpath
113 (lambda* (#:key outputs #:allow-other-keys)
114 (define (file-rpath file)
115 ;; Return the RPATH of FILE.
116 (let* ((p (open-pipe* OPEN_READ "patchelf"
117 "--print-rpath" file))
118 (l (read-line p)))
119 (and (zero? (close-pipe p)) l)))
120
121 (define (augment-rpath file dir)
122 ;; Add DIR to the RPATH of FILE.
123 (let* ((rpath (file-rpath file))
124 (rpath* (if rpath
125 (string-append dir ":" rpath)
126 dir)))
127 (format #t "~a: changing RPATH from `~a' to `~a'~%"
128 file (or rpath "") rpath*)
129 (zero? (system* "patchelf" "--set-rpath"
130 rpath* file))))
131
132 (let* ((out (assoc-ref outputs "out"))
133 (lib (string-append out "/lib")))
134 ;; Add LIB to the RUNPATH of all the executables.
135 (with-directory-excursion out
136 (for-each (cut augment-rpath <> lib)
137 (append (find-files "bin" ".*")
138 (find-files "sbin" ".*"))))))
139 %standard-phases))
140
141 #:modules ((guix build gnu-build-system)
142 (guix build utils)
143 (ice-9 popen)
144 (ice-9 rdelim)
145 (srfi srfi-26))
a40f1543
LC
146
147 ;; This flag is required to allow for "make test".
148 #:configure-flags '("--enable-socket-wrapper")
149
150 #:test-target "test"
151
152 ;; XXX: The test infrastructure attempts to set password with
153 ;; smbpasswd, which fails with "smbpasswd -L can only be used by root."
154 ;; So disable tests until there's a workaround.
155 #:tests? #f))
156 (inputs ; TODO: Add missing dependencies
157 `(;; ("cups" ,cups)
158 ("acl" ,acl)
159 ;; ("gamin" ,gamin)
160 ("libunwind" ,libunwind)
161 ("iniparser" ,iniparser)
162 ("popt" ,popt)
163 ("openldap" ,openldap)
164 ("linux-pam" ,linux-pam)
3665b4dc
LC
165 ("readline" ,readline)
166 ("patchelf" ,patchelf)))
a40f1543
LC
167 (native-inputs ; for the test suite
168 `(("perl" ,perl)
169 ("python" ,python)))
170 (home-page "http://www.samba.org/")
171 (synopsis
172 "The standard Windows interoperability suite of programs for GNU and Unix")
173 (description
174 "Since 1992, Samba has provided secure, stable and fast file and print
175services for all clients using the SMB/CIFS protocol, such as all versions of
176DOS and Windows, OS/2, GNU/Linux and many others.
177
178Samba is an important component to seamlessly integrate Linux/Unix Servers and
179Desktops into Active Directory environments using the winbind daemon.")
180 (license gpl3+)))