gnu: emacs-consult: Fix grammar.
[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, 2020 Marius Bakke <mbakke@fastmail.com>
8 ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
9 ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
10 ;;; Copyright © 2019 Rutger Helling <rhelling@mykolab.com>
11 ;;; Copyright © 2020 Pierre Langlois <pierre.langlois@gmx.com>
12 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
13 ;;;
14 ;;; This file is part of GNU Guix.
15 ;;;
16 ;;; GNU Guix is free software; you can redistribute it and/or modify it
17 ;;; under the terms of the GNU General Public License as published by
18 ;;; the Free Software Foundation; either version 3 of the License, or (at
19 ;;; your option) any later version.
20 ;;;
21 ;;; GNU Guix is distributed in the hope that it will be useful, but
22 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
23 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 ;;; GNU General Public License for more details.
25 ;;;
26 ;;; You should have received a copy of the GNU General Public License
27 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
28
29 (define-module (gnu packages samba)
30 #:use-module (guix packages)
31 #:use-module (guix download)
32 #:use-module (guix git-download)
33 #:use-module (guix build-system gnu)
34 #:use-module (guix licenses)
35 #:use-module (guix utils)
36 #:use-module (gnu packages)
37 #:use-module (gnu packages acl)
38 #:use-module (gnu packages admin)
39 #:use-module (gnu packages autotools)
40 #:use-module (gnu packages backup)
41 #:use-module (gnu packages base)
42 #:use-module (gnu packages check)
43 #:use-module (gnu packages crypto)
44 #:use-module (gnu packages cups)
45 #:use-module (gnu packages databases)
46 #:use-module (gnu packages docbook)
47 #:use-module (gnu packages glib)
48 #:use-module (gnu packages gnome)
49 #:use-module (gnu packages gnupg)
50 #:use-module (gnu packages kerberos)
51 #:use-module (gnu packages linux)
52 #:use-module (gnu packages onc-rpc)
53 #:use-module (gnu packages openldap)
54 #:use-module (gnu packages perl)
55 #:use-module (gnu packages pkg-config)
56 #:use-module (gnu packages popt)
57 #:use-module (gnu packages python)
58 #:use-module (gnu packages readline)
59 #:use-module (gnu packages time)
60 #:use-module (gnu packages tls)
61 #:use-module (gnu packages web)
62 #:use-module (gnu packages xml))
63
64 (define-public cifs-utils
65 (package
66 (name "cifs-utils")
67 (version "6.13")
68 (source
69 (origin
70 (method url-fetch)
71 (uri (string-append "https://download.samba.org/pub/linux-cifs/"
72 "cifs-utils/cifs-utils-" version ".tar.bz2"))
73 (sha256 (base32
74 "0mnhcc4ayj2vn2azhk45fnal1hibsv0q2c4ihkxcrjhkhrn7in23"))))
75 (build-system gnu-build-system)
76 (native-inputs
77 `(("autoconf" ,autoconf)
78 ("automake" ,automake)
79 ("pkg-config" ,pkg-config)))
80 (inputs
81 `(("keytuils" ,keyutils)
82 ("linux-pam" ,linux-pam)
83 ("libcap-ng" ,libcap-ng)
84 ("mit-krb5" ,mit-krb5)
85 ("samba" ,samba)
86 ("talloc" ,talloc)))
87 (arguments
88 `(#:phases
89 (modify-phases %standard-phases
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 ,(string-append "CC=" (cc-for-target)))
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 "Simple @file{.ini} configuration file parsing library")
162 (description
163 "The iniParser C library reads and writes Windows-style @file{.ini}
164 configuration files. These are simple text files with a basic structure
165 composed of sections, properties, and values. While not expressive, they
166 are easy to read, write, and modify.
167
168 The library is small, thread safe, and written in portable ANSI C with no
169 external dependencies.")
170 (license x11)))
171
172 (define-public samba
173 (package
174 (name "samba")
175 (version "4.13.4")
176 (source
177 (origin
178 (method url-fetch)
179 (uri (string-append "https://download.samba.org/pub/samba/stable/"
180 "samba-" version ".tar.gz"))
181 (sha256
182 (base32 "0y2wc7njhyhg055krp878xfv9c3wbhrhzn02d5ich30hyxilrcx1"))
183 (patches (search-patches "samba-fix-fcntl-hint-detection.patch"))
184 (modules '((guix build utils)))
185 (snippet
186 '(begin
187 ;; XXX: Some bundled libraries (e.g, popt, cmocka) are used from
188 ;; the system, but their bundled sources must be kept as they
189 ;; include the WAF scripts used for detecting them.
190 (delete-file-recursively "third_party/pyiso8601")
191 #t))))
192 (build-system gnu-build-system)
193 (arguments
194 `(#:make-flags '("TEST_OPTIONS=--quick") ;some tests are very long
195 #:phases
196 (modify-phases %standard-phases
197 (add-before 'configure 'setup-docbook-stylesheets
198 (lambda* (#:key inputs #:allow-other-keys)
199 ;; Append Samba's own DTDs to XML_CATALOG_FILES
200 ;; (c.f. docs-xml/build/README).
201 (copy-file "docs-xml/build/catalog.xml.in"
202 "docs-xml/build/catalog.xml")
203 (substitute* "docs-xml/build/catalog.xml"
204 (("/@abs_top_srcdir@")
205 (string-append (getcwd) "/docs-xml")))
206 ;; Honor XML_CATALOG_FILES.
207 (substitute* "buildtools/wafsamba/wafsamba.py"
208 (("XML_CATALOG_FILES=\"\\$\\{SAMBA_CATALOGS\\}" all)
209 (string-append all " $XML_CATALOG_FILES")))
210 #t))
211 (replace 'configure
212 ;; Samba uses a custom configuration script that runs WAF.
213 (lambda* (#:key outputs #:allow-other-keys)
214 (let* ((out (assoc-ref outputs "out"))
215 (libdir (string-append out "/lib")))
216 (invoke "./configure"
217 "--enable-selftest"
218 "--enable-fhs"
219 (string-append "--prefix=" out)
220 "--sysconfdir=/etc"
221 "--localstatedir=/var"
222 ;; Install public and private libraries into
223 ;; a single directory to avoid RPATH issues.
224 (string-append "--libdir=" libdir)
225 (string-append "--with-privatelibdir=" libdir)))))
226 (add-before 'install 'disable-etc,var-samba-directories-setup
227 (lambda _
228 (substitute* "dynconfig/wscript"
229 (("bld\\.INSTALL_DIR.*") ""))
230 #t)))
231 ;; FIXME: The test suite seemingly hangs after failing to provision the
232 ;; test environment.
233 #:tests? #f))
234 (inputs
235 `(("acl" ,acl)
236 ("cmocka" ,cmocka)
237 ("cups" ,cups)
238 ("gamin" ,gamin)
239 ("dbus" ,dbus)
240 ("gpgme" ,gpgme)
241 ("gnutls" ,gnutls)
242 ("heimdal" ,heimdal)
243 ("jansson" ,jansson)
244 ("libarchive" ,libarchive)
245 ("libtirpc" ,libtirpc)
246 ("linux-pam" ,linux-pam)
247 ("lmdb" ,lmdb)
248 ("openldap" ,openldap)
249 ("perl" ,perl)
250 ("python" ,python)
251 ("popt" ,popt)
252 ("readline" ,readline)
253 ("tdb" ,tdb)))
254 (propagated-inputs
255 ;; In Requires or Requires.private of pkg-config files.
256 `(("ldb" ,ldb)
257 ("talloc" ,talloc)
258 ("tevent" ,tevent)))
259 (native-inputs
260 `(("perl-parse-yapp" ,perl-parse-yapp)
261 ("pkg-config" ,pkg-config)
262 ("python-iso8601" ,python-iso8601)
263 ("rpcsvc-proto" ,rpcsvc-proto) ; for 'rpcgen'
264 ;; For generating man pages.
265 ("docbook-xml" ,docbook-xml-4.2)
266 ("docbook-xsl" ,docbook-xsl)
267 ("xsltproc" ,libxslt)
268 ("libxml2" ,libxml2))) ;for XML_CATALOG_FILES
269 (home-page "https://www.samba.org/")
270 (synopsis
271 "The standard Windows interoperability suite of programs for GNU and Unix")
272 (description
273 "Since 1992, Samba has provided secure, stable and fast file and print
274 services for all clients using the SMB/CIFS protocol, such as all versions of
275 DOS and Windows, OS/2, GNU/Linux and many others.
276
277 Samba is an important component to seamlessly integrate Linux/Unix Servers and
278 Desktops into Active Directory environments using the winbind daemon.")
279 (license gpl3+)))
280
281 (define-public talloc
282 (package
283 (name "talloc")
284 (version "2.3.2")
285 (source (origin
286 (method url-fetch)
287 (uri (string-append "https://www.samba.org/ftp/talloc/talloc-"
288 version ".tar.gz"))
289 (sha256
290 (base32
291 "1mvv57srpzcc1qh6vjjyjhgpdlcw4bmmsxfz4j8pfk9qkvwkx817"))))
292 (build-system gnu-build-system)
293 (arguments
294 '(#:phases
295 (modify-phases %standard-phases
296 (replace 'configure
297 (lambda* (#:key outputs #:allow-other-keys)
298 ;; talloc uses a custom configuration script that runs a Python
299 ;; script called 'waf', and doesn't tolerate unknown options.
300 (setenv "CONFIG_SHELL" (which "sh"))
301 (let ((out (assoc-ref outputs "out")))
302 (invoke "./configure"
303 (string-append "--prefix=" out))))))))
304 (native-inputs
305 `(("which" ,which)))
306 (inputs
307 `(("python" ,python)))
308 (home-page "https://talloc.samba.org")
309 (synopsis "Hierarchical, reference counted memory pool system")
310 (description
311 "Talloc is a hierarchical, reference counted memory pool system with
312 destructors. It is the core memory allocator used in Samba.")
313 (license gpl3+))) ;; The bundled "replace" library uses LGPL3.
314
315 (define-public talloc/static
316 (package
317 (inherit talloc)
318 (name "talloc-static")
319 (synopsis
320 "Hierarchical, reference counted memory pool system (static library)")
321 (arguments
322 (substitute-keyword-arguments (package-arguments talloc)
323 ((#:phases phases)
324 ;; Since Waf, the build system talloc uses, apparently does not
325 ;; support building static libraries from a ./configure flag, roll our
326 ;; own build process. No need to be ashamed, we're not the only ones
327 ;; doing that:
328 ;; <https://github.com/proot-me/proot-static-build/blob/master/GNUmakefile>.
329 ;; :-)
330 `(modify-phases ,phases
331 (replace 'build
332 (lambda _
333 (invoke "gcc" "-c" "-Ibin/default" "-I" "lib/replace"
334 "-I." "-Wall" "-g" "-D__STDC_WANT_LIB_EXT1__=1"
335 "talloc.c")
336 (invoke "ar" "rc" "libtalloc.a" "talloc.o")))
337 (replace 'install
338 (lambda* (#:key outputs #:allow-other-keys)
339 (let* ((out (assoc-ref outputs "out"))
340 (lib (string-append out "/lib"))
341 (include (string-append out "/include")))
342 (mkdir-p lib)
343 (install-file "libtalloc.a" lib)
344 (install-file "talloc.h" include)
345 #t)))
346 (delete 'check))))))) ;XXX: tests rely on Python modules
347
348 (define-public tevent
349 (package
350 (name "tevent")
351 (version "0.10.2")
352 (source (origin
353 (method url-fetch)
354 (uri (string-append "https://www.samba.org/ftp/tevent/tevent-"
355 version ".tar.gz"))
356 (sha256
357 (base32
358 "15k6i8ad5lpxfjsjyq9h64zlyws8d3cm0vwdnaw8z1xjwli7hhpq"))))
359 (build-system gnu-build-system)
360 (arguments
361 '(#:phases
362 (modify-phases %standard-phases
363 (replace 'configure
364 ;; tevent uses a custom configuration script that runs waf.
365 (lambda* (#:key outputs #:allow-other-keys)
366 (let ((out (assoc-ref outputs "out")))
367 (invoke "./configure"
368 (string-append "--prefix=" out)
369 "--bundled-libraries=NONE")))))))
370 (native-inputs
371 `(("pkg-config" ,pkg-config)
372 ("python" ,python)
373 ("which" ,which)))
374 (propagated-inputs
375 `(("talloc" ,talloc))) ; required by tevent.pc
376 (synopsis "Event system library")
377 (home-page "https://tevent.samba.org/")
378 (description
379 "Tevent is an event system based on the talloc memory management library.
380 It is the core event system used in Samba. The low level tevent has support for
381 many event types, including timers, signals, and the classic file descriptor events.")
382 (license lgpl3+)))
383
384 (define-public ldb
385 (package
386 (name "ldb")
387 (version "1.5.6")
388 (source (origin
389 (method url-fetch)
390 (uri (string-append "https://www.samba.org/ftp/ldb/ldb-"
391 version ".tar.gz"))
392 (sha256
393 (base32
394 "0nwpkqidsna4yz3vhjzzadm4hpviwnyk80yml8ay82gi1d6lg0pz"))
395 (modules '((guix build utils)))
396 (snippet
397 '(begin
398 (for-each (lambda (file)
399 ;; Delete everything except the build tools.
400 (unless (or (string-prefix? "third_party/waf" file)
401 (string-suffix? "wscript" file))
402 (delete-file file)))
403 (find-files "third_party"))
404 #t))))
405 (build-system gnu-build-system)
406 (arguments
407 '(;; LMDB is only supported on 64-bit systems, yet the test suite
408 ;; requires it.
409 #:tests? (assoc-ref %build-inputs "lmdb")
410 #:phases
411 (modify-phases %standard-phases
412 (replace 'configure
413 ;; ldb use a custom configuration script that runs waf.
414 (lambda* (#:key outputs #:allow-other-keys)
415 (let ((out (assoc-ref outputs "out")))
416 (invoke "./configure"
417 (string-append "--prefix=" out)
418 (string-append "--with-modulesdir=" out
419 "/lib/ldb/modules")
420 "--bundled-libraries=NONE")))))))
421 (native-inputs
422 `(("cmocka" ,cmocka)
423 ("pkg-config" ,pkg-config)
424 ("python" ,python)
425 ("which" ,which)))
426 (propagated-inputs
427 ;; ldb.pc refers to all these.
428 `(("talloc" ,talloc)
429 ("tdb" ,tdb)))
430 (inputs
431 `(,@(if (target-64bit?)
432 `(("lmdb" ,lmdb))
433 '())
434 ("popt" ,popt)
435 ("tevent" ,tevent)))
436 (synopsis "LDAP-like embedded database")
437 (home-page "https://ldb.samba.org/")
438 (description
439 "Ldb is a LDAP-like embedded database built on top of TDB. What ldb does
440 is provide a fast database with an LDAP-like API designed to be used within an
441 application. In some ways it can be seen as a intermediate solution between
442 key-value pair databases and a real LDAP database.")
443 (license lgpl3+)))
444
445 (define-public ppp
446 (package
447 (name "ppp")
448 (version "2.4.9")
449 (source (origin
450 (method git-fetch)
451 (uri (git-reference
452 (url "https://github.com/paulusmack/ppp")
453 (commit version)))
454 (file-name (git-file-name name version))
455 (sha256
456 (base32
457 "1bhhksdclsnkw54a517ndrw55q5zljjbh9pcqz1z4a2z2flxpsgk"))))
458 (build-system gnu-build-system)
459 (arguments
460 '(#:tests? #f ; no check target
461 #:make-flags '("CC=gcc")
462 #:phases
463 (modify-phases %standard-phases
464 (add-before 'configure 'patch-Makefile
465 (lambda* (#:key inputs #:allow-other-keys)
466 (let ((libc (assoc-ref inputs "libc"))
467 (openssl (assoc-ref inputs "openssl"))
468 (libpcap (assoc-ref inputs "libpcap")))
469 (substitute* "pppd/Makefile.linux"
470 (("/usr/include/crypt\\.h")
471 (string-append libc "/include/crypt.h"))
472 (("/usr/include/openssl")
473 (string-append openssl "/include/openssl"))
474 (("/usr/include/pcap-bpf.h")
475 (string-append libpcap "/include/pcap-bpf.h")))
476 #t))))))
477 (inputs
478 `(("libpcap" ,libpcap)
479 ("openssl" ,(@ (gnu packages tls) openssl))))
480 (synopsis "Implementation of the Point-to-Point Protocol")
481 (home-page "https://ppp.samba.org/")
482 (description
483 "The Point-to-Point Protocol (PPP) provides a standard way to establish
484 a network connection over a serial link. At present, this package supports IP
485 and IPV6 and the protocols layered above them, such as TCP and UDP.")
486 ;; pppd, pppstats and pppdump are under BSD-style notices.
487 ;; some of the pppd plugins are GPL'd.
488 ;; chat is public domain.
489 (license (list bsd-3 bsd-4 gpl2+ public-domain))))
490