gnu: samba: Update to 4.10.4.
[jackhill/guix/guix.git] / gnu / packages / samba.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2015, 2017 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2016 Adonay "adfeno" Felipe Nogueira <https://libreplanet.org/wiki/User:Adfeno> <adfeno@openmailbox.org>
6 ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
7 ;;; Copyright © 2017, 2018 Marius Bakke <mbakke@fastmail.com>
8 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
9 ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
10 ;;; Copyright © 2019 Rutger Helling <rhelling@mykolab.com>
11 ;;;
12 ;;; This file is part of GNU Guix.
13 ;;;
14 ;;; GNU Guix is free software; you can redistribute it and/or modify it
15 ;;; under the terms of the GNU General Public License as published by
16 ;;; the Free Software Foundation; either version 3 of the License, or (at
17 ;;; your option) any later version.
18 ;;;
19 ;;; GNU Guix is distributed in the hope that it will be useful, but
20 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;;; GNU General Public License for more details.
23 ;;;
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26
27 (define-module (gnu packages samba)
28 #:use-module (guix packages)
29 #:use-module (guix download)
30 #:use-module (guix build-system gnu)
31 #:use-module (guix licenses)
32 #:use-module (guix utils)
33 #:use-module (gnu packages acl)
34 #:use-module (gnu packages admin)
35 #:use-module (gnu packages autotools)
36 #:use-module (gnu packages backup)
37 #:use-module (gnu packages base)
38 #:use-module (gnu packages check)
39 #:use-module (gnu packages crypto)
40 #:use-module (gnu packages cups)
41 #:use-module (gnu packages databases)
42 #:use-module (gnu packages docbook)
43 #:use-module (gnu packages gnupg)
44 #:use-module (gnu packages kerberos)
45 #:use-module (gnu packages linux)
46 #:use-module (gnu packages openldap)
47 #:use-module (gnu packages perl)
48 #:use-module (gnu packages pkg-config)
49 #:use-module (gnu packages popt)
50 #:use-module (gnu packages python)
51 #:use-module (gnu packages readline)
52 #:use-module (gnu packages tls)
53 #:use-module (gnu packages web)
54 #:use-module (gnu packages xml))
55
56 (define-public cifs-utils
57 (package
58 (name "cifs-utils")
59 (version "6.9")
60 (source
61 (origin
62 (method url-fetch)
63 (uri (string-append "https://download.samba.org/pub/linux-cifs/"
64 "cifs-utils/cifs-utils-" version ".tar.bz2"))
65 (sha256 (base32
66 "175cp509wn1zv8p8mv37hkf6sxiskrsxdnq22mhlsg61jazz3n0q"))))
67 (build-system gnu-build-system)
68 (native-inputs
69 `(("autoconf" ,autoconf)
70 ("automake" ,automake)
71 ("pkg-config" ,pkg-config)))
72 (inputs
73 `(("keytuils" ,keyutils)
74 ("linux-pam" ,linux-pam)
75 ("libcap-ng" ,libcap-ng)
76 ("mit-krb5" ,mit-krb5)
77 ("samba" ,samba)
78 ("talloc" ,talloc)))
79 (arguments
80 `(#:phases
81 (modify-phases %standard-phases
82 (add-before 'configure 'set-root-sbin
83 (lambda _
84 ;; Don't try to install into "/sbin".
85 (setenv "ROOTSBINDIR"
86 (string-append (assoc-ref %outputs "out") "/sbin"))
87 #t)))))
88 (synopsis "User-space utilities for Linux CIFS (Samba) mounts")
89 (description "@code{cifs-utils} is a set of user-space utilities for
90 mounting and managing @dfn{Common Internet File System} (CIFS) shares using
91 the Linux kernel CIFS client.")
92 (home-page "https://wiki.samba.org/index.php/LinuxCIFS_utils")
93 ;; cifs-utils is licensed as GPL3 or later, but 3 files contain LGPL code.
94 (license gpl3+)))
95
96 (define-public iniparser
97 (package
98 (name "iniparser")
99 (version "4.1")
100 (source (origin
101 (method url-fetch)
102 (uri (string-append "https://github.com/ndevilla/iniparser/archive/v"
103 version ".tar.gz"))
104 (file-name (string-append name "-" version ".tar.gz"))
105 (sha256
106 (base32
107 "1bpk8dj9d5cl64lg6jsk0qlzrpg848nymwxc3fx707fk1n0al3cn"))))
108 (build-system gnu-build-system)
109 (arguments
110 `(#:make-flags
111 (list "CC=gcc")
112 #:phases
113 (modify-phases %standard-phases
114 (replace 'configure
115 (lambda* (#:key outputs #:allow-other-keys)
116 (substitute* '("Makefile" "test/Makefile")
117 (("/usr/lib")
118 (string-append (assoc-ref outputs "out") "/lib")))
119 #t))
120 (replace 'build
121 (lambda* (#:key make-flags #:allow-other-keys)
122 (apply invoke "make" "libiniparser.so.1"
123 make-flags)))
124 (replace 'install
125 (lambda* (#:key outputs #:allow-other-keys)
126 (let* ((out (assoc-ref outputs "out"))
127 (lib (string-append out "/lib"))
128 (inc (string-append out "/include"))
129 (doc (string-append out "/share/doc/" ,name))
130 (html (string-append doc "/html")))
131 (define (install dir)
132 (lambda (file)
133 (install-file file dir)))
134 (for-each (install lib)
135 (find-files "." "^lib.*\\.so"))
136 (with-directory-excursion lib
137 (symlink "libiniparser.so.1" "libiniparser.so"))
138 (for-each (install inc)
139 (find-files "src" "\\.h$"))
140 (for-each (install html)
141 (find-files "html" ".*"))
142 (for-each (install doc)
143 '("AUTHORS" "INSTALL" "LICENSE" "README.md"))
144 #t))))))
145 (home-page "https://github.com/ndevilla/iniparser")
146 (synopsis "Standalone ini file parsing library")
147 (description
148 "iniparser is a free stand-alone @code{ini} file parsing library (Windows
149 configuration files). It is written in portable ANSI C and should compile
150 anywhere.")
151 (license x11)))
152
153 (define-public samba
154 (package
155 (name "samba")
156 (version "4.10.4")
157 (source (origin
158 (method url-fetch)
159 (uri (string-append "https://download.samba.org/pub/samba/stable/"
160 "samba-" version ".tar.gz"))
161 (sha256
162 (base32
163 "0xhfbh42dihccc85ffx243lyhf3jnphhi6xfcsr3a6mhsm7w1p26"))))
164 (build-system gnu-build-system)
165 (arguments
166 `(#:phases
167 (modify-phases %standard-phases
168 (add-before 'configure 'locate-docbook-stylesheets
169 (lambda* (#:key inputs #:allow-other-keys)
170 ;; XXX for some reason XML_CATALOG_FILES is not respected.
171 (substitute* '("buildtools/wafsamba/samba_conftests.py"
172 "buildtools/wafsamba/wafsamba.py"
173 "docs-xml/xslt/man.xsl")
174 (("http://docbook.sourceforge.net/release/xsl/current/")
175 (string-append (assoc-ref inputs "docbook-xsl")
176 "/xml/xsl/docbook-xsl-"
177 ,(package-version docbook-xsl) "/")))
178 #t))
179 (replace 'configure
180 ;; samba uses a custom configuration script that runs waf.
181 (lambda* (#:key outputs #:allow-other-keys)
182 (let* ((out (assoc-ref outputs "out"))
183 (libdir (string-append out "/lib")))
184 (invoke "./configure"
185 "--enable-fhs"
186 ;; XXX: heimdal not packaged.
187 "--bundled-libraries=com_err"
188 (string-append "--prefix=" out)
189 "--sysconfdir=/etc"
190 ;; Install public and private libraries into
191 ;; a single directory to avoid RPATH issues.
192 (string-append "--libdir=" libdir)
193 (string-append "--with-privatelibdir=" libdir)))))
194 (add-before 'install 'disable-etc-samba-directory-creation
195 (lambda _
196 (substitute* "dynconfig/wscript"
197 (("bld\\.INSTALL_DIR\\(\"\\$\\{CONFIGDIR\\}\"\\)")
198 ""))
199 #t)))
200 ;; XXX: The test infrastructure attempts to set password with
201 ;; smbpasswd, which fails with "smbpasswd -L can only be used by root."
202 ;; So disable tests until there's a workaround.
203 #:tests? #f))
204 (inputs ; TODO: Add missing dependencies
205 `(("acl" ,acl)
206 ("cups" ,cups)
207 ;; ("gamin" ,gamin)
208 ("gpgme" ,gpgme)
209 ("gnutls" ,gnutls)
210 ("iniparser" ,iniparser)
211 ("jansson" ,jansson)
212 ("libaio" ,libaio)
213 ("libarchive" ,libarchive)
214 ("linux-pam" ,linux-pam)
215 ("lmdb" ,lmdb)
216 ("openldap" ,openldap)
217 ("popt" ,popt)
218 ("readline" ,readline)
219 ("tdb" ,tdb)))
220 (propagated-inputs
221 ;; In Requires or Requires.private of pkg-config files.
222 `(("ldb" ,ldb)
223 ("talloc" ,talloc)
224 ("tevent" ,tevent)))
225 (native-inputs
226 `(("docbook-xsl" ,docbook-xsl) ;for generating manpages
227 ("xsltproc" ,libxslt) ;ditto
228 ("perl" ,perl)
229 ("pkg-config" ,pkg-config)
230 ("python" ,python)))
231 (home-page "https://www.samba.org/")
232 (synopsis
233 "The standard Windows interoperability suite of programs for GNU and Unix")
234 (description
235 "Since 1992, Samba has provided secure, stable and fast file and print
236 services for all clients using the SMB/CIFS protocol, such as all versions of
237 DOS and Windows, OS/2, GNU/Linux and many others.
238
239 Samba is an important component to seamlessly integrate Linux/Unix Servers and
240 Desktops into Active Directory environments using the winbind daemon.")
241 (license gpl3+)))
242
243 (define-public talloc
244 (package
245 (name "talloc")
246 (version "2.2.0")
247 (source (origin
248 (method url-fetch)
249 (uri (string-append "https://www.samba.org/ftp/talloc/talloc-"
250 version ".tar.gz"))
251 (sha256
252 (base32
253 "1g1fqa37xkjp9lp6lrwxrbfgashcink769ll505zvcwnxx2nlvsw"))))
254 (build-system gnu-build-system)
255 (arguments
256 '(#:phases
257 (modify-phases %standard-phases
258 (replace 'configure
259 (lambda* (#:key outputs #:allow-other-keys)
260 ;; talloc uses a custom configuration script that runs a Python
261 ;; script called 'waf', and doesn't tolerate unknown options.
262 (setenv "CONFIG_SHELL" (which "sh"))
263 (let ((out (assoc-ref outputs "out")))
264 (invoke "./configure"
265 (string-append "--prefix=" out))))))))
266 (native-inputs
267 `(("which" ,which)))
268 (inputs
269 `(("python" ,python)))
270 (home-page "https://talloc.samba.org")
271 (synopsis "Hierarchical, reference counted memory pool system")
272 (description
273 "Talloc is a hierarchical, reference counted memory pool system with
274 destructors. It is the core memory allocator used in Samba.")
275 (license gpl3+))) ;; The bundled "replace" library uses LGPL3.
276
277 (define-public talloc/static
278 (package
279 (inherit talloc)
280 (name "talloc-static")
281 (synopsis
282 "Hierarchical, reference counted memory pool system (static library)")
283 (arguments
284 (substitute-keyword-arguments (package-arguments talloc)
285 ((#:phases phases)
286 ;; Since Waf, the build system talloc uses, apparently does not
287 ;; support building static libraries from a ./configure flag, roll our
288 ;; own build process. No need to be ashamed, we're not the only ones
289 ;; doing that:
290 ;; <https://github.com/proot-me/proot-static-build/blob/master/GNUmakefile>.
291 ;; :-)
292 `(modify-phases ,phases
293 (replace 'build
294 (lambda _
295 (invoke "gcc" "-c" "-Ibin/default" "-I" "lib/replace"
296 "-I." "-Wall" "-g" "-D__STDC_WANT_LIB_EXT1__=1"
297 "talloc.c")
298 (invoke "ar" "rc" "libtalloc.a" "talloc.o")))
299 (replace 'install
300 (lambda* (#:key outputs #:allow-other-keys)
301 (let* ((out (assoc-ref outputs "out"))
302 (lib (string-append out "/lib"))
303 (include (string-append out "/include")))
304 (mkdir-p lib)
305 (install-file "libtalloc.a" lib)
306 (install-file "talloc.h" include)
307 #t)))
308 (delete 'check))))))) ;XXX: tests rely on Python modules
309
310 (define-public tevent
311 (package
312 (name "tevent")
313 (version "0.10.0")
314 (source (origin
315 (method url-fetch)
316 (uri (string-append "https://www.samba.org/ftp/tevent/tevent-"
317 version ".tar.gz"))
318 (sha256
319 (base32
320 "1rm4d9245ya15wyrh9vqn1dnz14l2ic88mr46ykyc6kdrl99dwrk"))))
321 (build-system gnu-build-system)
322 (arguments
323 '(#:phases
324 (modify-phases %standard-phases
325 (replace 'configure
326 ;; tevent uses a custom configuration script that runs waf.
327 (lambda* (#:key outputs #:allow-other-keys)
328 (let ((out (assoc-ref outputs "out")))
329 (invoke "./configure"
330 (string-append "--prefix=" out)
331 "--bundled-libraries=NONE")))))))
332 (native-inputs
333 `(("pkg-config" ,pkg-config)
334 ("python" ,python)
335 ("which" ,which)))
336 (propagated-inputs
337 `(("talloc" ,talloc))) ; required by tevent.pc
338 (synopsis "Event system library")
339 (home-page "https://tevent.samba.org/")
340 (description
341 "Tevent is an event system based on the talloc memory management library.
342 It is the core event system used in Samba. The low level tevent has support for
343 many event types, including timers, signals, and the classic file descriptor events.")
344 (license lgpl3+)))
345
346 (define-public ldb
347 (package
348 (name "ldb")
349 (version "1.6.3")
350 (source (origin
351 (method url-fetch)
352 (uri (string-append "https://www.samba.org/ftp/ldb/ldb-"
353 version ".tar.gz"))
354 (sha256
355 (base32
356 "01livdy3g073bm6xnc8zqnqrxg53sw8q66d1903z62hd6g87whsa"))
357 (modules '((guix build utils)))
358 (snippet
359 '(begin
360 (for-each (lambda (file)
361 ;; Delete everything except the build tools.
362 (unless (or (string-prefix? "third_party/waf" file)
363 (string-suffix? "wscript" file))
364 (delete-file file)))
365 (find-files "third_party"))
366 #t))))
367 (build-system gnu-build-system)
368 (arguments
369 '(;; LMDB is only supported on 64-bit systems, yet the test suite
370 ;; requires it.
371 #:tests? (assoc-ref %build-inputs "lmdb")
372 #:phases
373 (modify-phases %standard-phases
374 (replace 'configure
375 ;; ldb use a custom configuration script that runs waf.
376 (lambda* (#:key outputs #:allow-other-keys)
377 (let ((out (assoc-ref outputs "out")))
378 (invoke "./configure"
379 (string-append "--prefix=" out)
380 (string-append "--with-modulesdir=" out
381 "/lib/ldb/modules")
382 "--bundled-libraries=NONE")))))))
383 (native-inputs
384 `(("cmocka" ,cmocka)
385 ("pkg-config" ,pkg-config)
386 ("python" ,python)
387 ("which" ,which)))
388 (propagated-inputs
389 ;; ldb.pc refers to all these.
390 `(("talloc" ,talloc)
391 ("tdb" ,tdb)))
392 (inputs
393 `(,@(if (target-64bit?)
394 `(("lmdb" ,lmdb))
395 '())
396 ("popt" ,popt)
397 ("tevent" ,tevent)))
398 (synopsis "LDAP-like embedded database")
399 (home-page "https://ldb.samba.org/")
400 (description
401 "Ldb is a LDAP-like embedded database built on top of TDB. What ldb does
402 is provide a fast database with an LDAP-like API designed to be used within an
403 application. In some ways it can be seen as a intermediate solution between
404 key-value pair databases and a real LDAP database.")
405 (license lgpl3+)))
406
407 (define-public ppp
408 (package
409 (name "ppp")
410 (version "2.4.7")
411 (source (origin
412 (method url-fetch)
413 (uri (string-append "https://www.samba.org/ftp/ppp/ppp-"
414 version ".tar.gz"))
415 (patches
416 (list (origin
417 ;; Use OpenSSL for cryptography instead of the obsolete glibc
418 ;; crypto functions that were removed in glibc 2.28.
419 (method url-fetch)
420 (uri (string-append "https://github.com/paulusmack/ppp/commit/"
421 "3c7b86229f7bd2600d74db14b1fe5b3896be3875"
422 ".patch"))
423 (file-name "ppp-use-openssl-crypto.patch")
424 (sha256
425 (base32
426 "0qlbi247lx3injpy8a1gcij9yilik0vfaibkpvdp88k3sa1rs69z")))))
427 (sha256
428 (base32
429 "0c7vrjxl52pdwi4ckrvfjr08b31lfpgwf3pp0cqy76a77vfs7q02"))))
430 (build-system gnu-build-system)
431 (arguments
432 '(#:tests? #f ; no check target
433 #:make-flags '("CC=gcc")
434 #:phases
435 (modify-phases %standard-phases
436 (add-before 'configure 'patch-Makefile
437 (lambda* (#:key inputs #:allow-other-keys)
438 (let ((libc (assoc-ref inputs "libc"))
439 (openssl (assoc-ref inputs "openssl"))
440 (libpcap (assoc-ref inputs "libpcap")))
441 (substitute* "pppd/Makefile.linux"
442 (("/usr/include/crypt\\.h")
443 (string-append libc "/include/crypt.h"))
444 (("/usr/include/openssl")
445 (string-append openssl "/include/openssl"))
446 (("/usr/include/pcap-bpf.h")
447 (string-append libpcap "/include/pcap-bpf.h")))
448 #t))))))
449 (inputs
450 `(("libpcap" ,libpcap)
451 ("openssl" ,(@ (gnu packages tls) openssl))))
452 (synopsis "Implementation of the Point-to-Point Protocol")
453 (home-page "https://ppp.samba.org/")
454 (description
455 "The Point-to-Point Protocol (PPP) provides a standard way to establish
456 a network connection over a serial link. At present, this package supports IP
457 and IPV6 and the protocols layered above them, such as TCP and UDP.")
458 ;; pppd, pppstats and pppdump are under BSD-style notices.
459 ;; some of the pppd plugins are GPL'd.
460 ;; chat is public domain.
461 (license (list bsd-3 bsd-4 gpl2+ public-domain))))