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