gnu: samba: Update to 4.3.3.
[jackhill/guix/guix.git] / gnu / packages / samba.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2015 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
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 samba)
21 #:use-module (guix packages)
22 #:use-module (guix download)
23 #:use-module (guix build-system gnu)
24 #:use-module (guix licenses)
25 #:use-module (gnu packages acl)
26 #:use-module (gnu packages admin)
27 #:use-module (gnu packages cups)
28 #:use-module (gnu packages databases)
29 #:use-module (gnu packages tls)
30 #:use-module (gnu packages popt)
31 #:use-module (gnu packages pkg-config)
32 #:use-module (gnu packages openldap)
33 #:use-module (gnu packages readline)
34 #:use-module (gnu packages linux)
35 #:use-module (gnu packages perl)
36 #:use-module (gnu packages python))
37
38 (define-public iniparser
39 (package
40 (name "iniparser")
41 (version "3.1")
42 (source (origin
43 (method url-fetch)
44 (uri (string-append "http://ndevilla.free.fr/iniparser/iniparser-"
45 version ".tar.gz"))
46 (sha256
47 (base32
48 "1igmxzcy0s25zcy9vmcw0kd13lh60r0b4qg8lnp1jic33f427pxf"))))
49 (build-system gnu-build-system)
50 (arguments
51 '(#:phases (alist-replace
52 'configure
53 (lambda* (#:key outputs #:allow-other-keys)
54 (substitute* "Makefile"
55 (("/usr/lib")
56 (string-append (assoc-ref outputs "out") "/lib"))))
57 (alist-replace
58 'build
59 (lambda _
60 (and (zero? (system* "make" "libiniparser.so"))
61 (symlink "libiniparser.so.0" "libiniparser.so")))
62 (alist-replace
63 'install
64 (lambda* (#:key outputs #:allow-other-keys)
65 (let* ((out (assoc-ref outputs "out"))
66 (lib (string-append out "/lib"))
67 (inc (string-append out "/include"))
68 (doc (string-append out "/share/doc"))
69 (html (string-append doc "/html")))
70 (define (copy dir)
71 (lambda (file)
72 (copy-file file
73 (string-append dir "/"
74 (basename file)))))
75 (mkdir-p lib)
76 (for-each (copy lib)
77 (find-files "." "^lib.*\\.(so\\.|a)"))
78 (with-directory-excursion lib
79 (symlink "libiniparser.so.0" "libiniparser.so"))
80 (mkdir-p inc)
81 (for-each (copy inc)
82 (find-files "src" "\\.h$"))
83 (mkdir-p html)
84 (for-each (copy html)
85 (find-files "html" ".*"))
86 (for-each (copy doc)
87 '("AUTHORS" "INSTALL" "LICENSE"
88 "README"))))
89 %standard-phases)))))
90 (home-page "http://ndevilla.free.fr/iniparser")
91 (synopsis "Standalone ini file parsing library")
92 (description
93 "iniparser is a free stand-alone `ini' file parsing library (Windows
94 configuration files). It is written in portable ANSI C and should compile
95 anywhere.")
96 (license x11)))
97
98 (define-public samba
99 (package
100 (name "samba")
101 (version "4.3.3")
102 (source (origin
103 (method url-fetch)
104 (uri (string-append "https://www.samba.org/samba/ftp/stable/samba-"
105 version ".tar.gz"))
106 (sha256
107 (base32
108 "1pvh78d5magc7lriyx7v9k7crlgxccmsy2mqn0j9xcnb78qj2bg6"))))
109 (build-system gnu-build-system)
110 (arguments
111 '(#:phases
112 (modify-phases %standard-phases
113 (replace 'configure
114 ;; samba uses a custom configuration script that runs waf.
115 (lambda* (#:key outputs #:allow-other-keys)
116 (let* ((out (assoc-ref outputs "out"))
117 (libdir (string-append out "/lib")))
118 (zero? (system*
119 "./configure"
120 "--enable-fhs"
121 ;; XXX: heimdal not packaged.
122 "--bundled-libraries=com_err"
123 (string-append "--prefix=" out)
124 ;; Install public and private libraries into
125 ;; a single directory to avoid RPATH issues.
126 (string-append "--libdir=" libdir)
127 (string-append "--with-privatelibdir=" libdir)))))))
128
129 ;; XXX: The test infrastructure attempts to set password with
130 ;; smbpasswd, which fails with "smbpasswd -L can only be used by root."
131 ;; So disable tests until there's a workaround.
132 #:tests? #f))
133 (inputs ; TODO: Add missing dependencies
134 `(("acl" ,acl)
135 ("cups" ,cups)
136 ;; ("gamin" ,gamin)
137 ("gnutls" ,gnutls)
138 ("iniparser" ,iniparser)
139 ("libaio" ,libaio)
140 ("ldb" ,ldb)
141 ("linux-pam" ,linux-pam)
142 ("openldap" ,openldap)
143 ("popt" ,popt)
144 ("readline" ,readline)
145 ("talloc" ,talloc)
146 ("tevent" ,tevent)
147 ("tdb" ,tdb)))
148 (native-inputs
149 `(("perl" ,perl)
150 ("pkg-config" ,pkg-config)
151 ("python" ,python-2))) ; incompatible with Python 3
152 (home-page "http://www.samba.org/")
153 (synopsis
154 "The standard Windows interoperability suite of programs for GNU and Unix")
155 (description
156 "Since 1992, Samba has provided secure, stable and fast file and print
157 services for all clients using the SMB/CIFS protocol, such as all versions of
158 DOS and Windows, OS/2, GNU/Linux and many others.
159
160 Samba is an important component to seamlessly integrate Linux/Unix Servers and
161 Desktops into Active Directory environments using the winbind daemon.")
162 (license gpl3+)))
163
164 (define-public talloc
165 (package
166 (name "talloc")
167 (version "2.1.5")
168 (source (origin
169 (method url-fetch)
170 (uri (string-append "https://www.samba.org/ftp/talloc/talloc-"
171 version ".tar.gz"))
172 (sha256
173 (base32
174 "1pfx3kmj973hpacfw46fzfnjd7ms1j03ifkc30wk930brx8ffcrq"))))
175 (build-system gnu-build-system)
176 (arguments
177 '(#:phases
178 (modify-phases %standard-phases
179 (replace 'configure
180 (lambda* (#:key outputs #:allow-other-keys)
181 ;; test_magic_differs.sh has syntax error, and is not in the right
182 ;; place where wscript expected.
183 ;; Skip the test.
184 (substitute* "wscript"
185 (("magic_ret = .*") "magic_ret = 0\n"))
186 ;; talloc uses a custom configuration script that runs a
187 ;; python script called 'waf'.
188 (setenv "CONFIG_SHELL" (which "sh"))
189 (let ((out (assoc-ref outputs "out")))
190 (zero? (system* "./configure"
191 (string-append "--prefix=" out)))))))))
192 (inputs
193 `(("python" ,python-2)))
194 (home-page "http://talloc.samba.org")
195 (synopsis "Hierarchical, reference counted memory pool system")
196 (description
197 "Talloc is a hierarchical, reference counted memory pool system with
198 destructors. It is the core memory allocator used in Samba.")
199 (license gpl3+))) ;; The bundled "replace" library uses LGPL3.
200
201 (define-public tevent
202 (package
203 (name "tevent")
204 (version "0.9.26")
205 (source (origin
206 (method url-fetch)
207 (uri (string-append "https://www.samba.org/ftp/tevent/tevent-"
208 version ".tar.gz"))
209 (sha256
210 (base32
211 "1gbh6d2m49j1v2hkaiyrh8bj02i5wxd4hqayzk2g44yyivbi8b16"))))
212 (build-system gnu-build-system)
213 (arguments
214 '(#:phases
215 (modify-phases %standard-phases
216 (replace 'configure
217 ;; tevent uses a custom configuration script that runs waf.
218 (lambda* (#:key outputs #:allow-other-keys)
219 (let ((out (assoc-ref outputs "out")))
220 (zero? (system* "./configure"
221 (string-append "--prefix=" out)
222 "--bundled-libraries=NONE"))))))))
223 (native-inputs
224 `(("pkg-config" ,pkg-config)
225 ("python" ,python-2)))
226 (propagated-inputs
227 `(("talloc" ,talloc))) ; required by tevent.pc
228 (synopsis "Event system library")
229 (home-page "https://tevent.samba.org/")
230 (description
231 "Tevent is an event system based on the talloc memory management library.
232 It is the core event system used in Samba. The low level tevent has support for
233 many event types, including timers, signals, and the classic file descriptor events.")
234 (license lgpl3+)))
235
236 (define-public ldb
237 (package
238 (name "ldb")
239 (version "1.1.24")
240 (source (origin
241 (method url-fetch)
242 (uri (string-append "https://www.samba.org/ftp/ldb/ldb-"
243 version ".tar.gz"))
244 (sha256
245 (base32
246 "08ab66qzigfsfxqdvp6lx1knwsl3sqsww309xbq17l7hfcjgbsa5"))))
247 (build-system gnu-build-system)
248 (arguments
249 '(#:phases
250 (modify-phases %standard-phases
251 (replace 'configure
252 ;; ldb use a custom configuration script that runs waf.
253 (lambda* (#:key outputs #:allow-other-keys)
254 (let ((out (assoc-ref outputs "out")))
255 (zero? (system* "./configure"
256 (string-append "--prefix=" out)
257 (string-append "--with-modulesdir=" out
258 "/lib/ldb/modules")
259 "--bundled-libraries=NONE"))))))))
260 (native-inputs
261 `(("pkg-config" ,pkg-config)
262 ("python" ,python-2)))
263 (propagated-inputs
264 ;; ldb.pc refers to all these.
265 `(("talloc" ,talloc)
266 ("tdb" ,tdb)))
267 (inputs
268 `(("popt" ,popt)
269 ("tevent" ,tevent)))
270 (synopsis "LDAP-like embedded database")
271 (home-page "https://ldb.samba.org/")
272 (description
273 "Ldb is a LDAP-like embedded database built on top of TDB. What ldb does
274 is provide a fast database with an LDAP-like API designed to be used within an
275 application. In some ways it can be seen as a intermediate solution between
276 key-value pair databases and a real LDAP database.")
277 (license lgpl3+)))
278
279 (define-public ppp
280 (package
281 (name "ppp")
282 (version "2.4.7")
283 (source (origin
284 (method url-fetch)
285 (uri (string-append "https://www.samba.org/ftp/ppp/ppp-"
286 version ".tar.gz"))
287 (sha256
288 (base32
289 "0c7vrjxl52pdwi4ckrvfjr08b31lfpgwf3pp0cqy76a77vfs7q02"))))
290 (build-system gnu-build-system)
291 (arguments
292 '(#:tests? #f ; no check target
293 #:make-flags '("CC=gcc")
294 #:phases
295 (modify-phases %standard-phases
296 (add-before 'configure 'patch-Makefile
297 (lambda* (#:key inputs #:allow-other-keys)
298 (let ((libc (assoc-ref inputs "libc"))
299 (libpcap (assoc-ref inputs "libpcap")))
300 (substitute* "pppd/Makefile.linux"
301 (("/usr/include/crypt\\.h")
302 (string-append libc "/include/crypt.h"))
303 (("/usr/include/pcap-bpf.h")
304 (string-append libpcap "/include/pcap-bpf.h")))))))))
305 (inputs
306 `(("libpcap" ,libpcap)))
307 (synopsis "Implementation of the Point-to-Point Protocol")
308 (home-page "https://ppp.samba.org/")
309 (description
310 "The Point-to-Point Protocol (PPP) provides a standard way to establish
311 a network connection over a serial link. At present, this package supports IP
312 and IPV6 and the protocols layered above them, such as TCP and UDP.")
313 ;; pppd, pppstats and pppdump are under BSD-style notices.
314 ;; some of the pppd plugins are GPL'd.
315 ;; chat is public domain.
316 (license (list bsd-3 bsd-4 gpl2+ public-domain))))