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, 2019, 2020 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>
14 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
64 (define-public cifs-utils
71 (uri (string-append "https://download.samba.org/pub/linux-cifs/"
72 "cifs-utils/cifs-utils-" version ".tar.bz2"))
74 "1n98hy3zi4klm1xxhb840br1x7hhz0xx8kp5sch84kr07yd26ndq"))))
75 (build-system gnu-build-system)
77 `(("autoconf" ,autoconf)
78 ("automake" ,automake)
79 ("pkg-config" ,pkg-config)))
81 `(("keytuils" ,keyutils)
82 ("linux-pam" ,linux-pam)
83 ("libcap-ng" ,libcap-ng)
84 ("mit-krb5" ,mit-krb5)
89 (modify-phases %standard-phases
91 ;; Force a bootstrap to fix a ‘cannot find install-sh, install.sh,
92 ;; or shtool’ error since version 6.10.
94 (invoke "autoreconf" "-vfi")
96 (add-before 'configure 'set-root-sbin
97 (lambda* (#:key outputs #:allow-other-keys)
98 ;; Don't try to install into "/sbin".
100 (string-append (assoc-ref outputs "out") "/sbin"))
102 (add-before 'install 'create-man8dir
103 ;; Create a directory that isn't created since version 6.10.
104 (lambda* (#:key outputs #:allow-other-keys)
105 (let ((out (assoc-ref outputs "out")))
106 (mkdir-p (string-append out "/share/man/man8"))
108 (synopsis "User-space utilities for Linux CIFS (Samba) mounts")
109 (description "@code{cifs-utils} is a set of user-space utilities for
110 mounting and managing @dfn{Common Internet File System} (CIFS) shares using
111 the Linux kernel CIFS client.")
112 (home-page "https://wiki.samba.org/index.php/LinuxCIFS_utils")
113 ;; cifs-utils is licensed as GPL3 or later, but 3 files contain LGPL code.
116 (define-public iniparser
123 (url "https://github.com/ndevilla/iniparser")
124 (commit (string-append "v" version))))
125 (file-name (git-file-name name version))
128 "0dhab6pad6wh816lr7r3jb6z273njlgw2vpw8kcfnmi7ijaqhnr5"))))
129 (build-system gnu-build-system)
132 (list ,(string-append "CC=" (cc-for-target)))
134 (modify-phases %standard-phases
136 (lambda* (#:key outputs #:allow-other-keys)
137 (substitute* '("Makefile" "test/Makefile")
139 (string-append (assoc-ref outputs "out") "/lib")))
142 (lambda* (#:key make-flags #:allow-other-keys)
143 (apply invoke "make" "libiniparser.so.1"
146 (lambda* (#:key outputs #:allow-other-keys)
147 (let* ((out (assoc-ref outputs "out"))
148 (lib (string-append out "/lib"))
149 (inc (string-append out "/include"))
150 (doc (string-append out "/share/doc/" ,name))
151 (html (string-append doc "/html")))
152 (define (install dir)
154 (install-file file dir)))
155 (for-each (install lib)
156 (find-files "." "^lib.*\\.so"))
157 (with-directory-excursion lib
158 (symlink "libiniparser.so.1" "libiniparser.so"))
159 (for-each (install inc)
160 (find-files "src" "\\.h$"))
161 (for-each (install html)
162 (find-files "html" ".*"))
163 (for-each (install doc)
164 '("AUTHORS" "INSTALL" "LICENSE" "README.md"))
166 (home-page "https://github.com/ndevilla/iniparser")
167 (synopsis "Simple @file{.ini} configuration file parsing library")
169 "The iniParser C library reads and writes Windows-style @file{.ini}
170 configuration files. These are simple text files with a basic structure
171 composed of sections, properties, and values. While not expressive, they
172 are easy to read, write, and modify.
174 The library is small, thread safe, and written in portable ANSI C with no
175 external dependencies.")
185 (uri (string-append "https://download.samba.org/pub/samba/stable/"
186 "samba-" version ".tar.gz"))
188 (base32 "1d7j79c8aggwiv90y2q1yz63d9p5n4paq0fsbdvqpn05d8wn8r17"))
189 (patches (search-patches "samba-fix-fcntl-hint-detection.patch"))
190 (modules '((guix build utils)))
193 ;; XXX: Some bundled libraries (e.g, popt, cmocka) are used from
194 ;; the system, but their bundled sources must be kept as they
195 ;; include the WAF scripts used for detecting them.
196 (delete-file-recursively "third_party/pyiso8601")
198 (build-system gnu-build-system)
200 `(#:make-flags '("TEST_OPTIONS=--quick") ;some tests are very long
202 (modify-phases %standard-phases
203 (add-before 'configure 'setup-docbook-stylesheets
204 (lambda* (#:key inputs #:allow-other-keys)
205 ;; Append Samba's own DTDs to XML_CATALOG_FILES
206 ;; (c.f. docs-xml/build/README).
207 (copy-file "docs-xml/build/catalog.xml.in"
208 "docs-xml/build/catalog.xml")
209 (substitute* "docs-xml/build/catalog.xml"
210 (("/@abs_top_srcdir@")
211 (string-append (getcwd) "/docs-xml")))
212 ;; Honor XML_CATALOG_FILES.
213 (substitute* "buildtools/wafsamba/wafsamba.py"
214 (("XML_CATALOG_FILES=\"\\$\\{SAMBA_CATALOGS\\}" all)
215 (string-append all " $XML_CATALOG_FILES")))
218 ;; Samba uses a custom configuration script that runs WAF.
219 (lambda* (#:key outputs #:allow-other-keys)
220 (let* ((out (assoc-ref outputs "out"))
221 (libdir (string-append out "/lib")))
222 (invoke "./configure"
225 (string-append "--prefix=" out)
227 "--localstatedir=/var"
228 ;; Install public and private libraries into
229 ;; a single directory to avoid RPATH issues.
230 (string-append "--libdir=" libdir)
231 (string-append "--with-privatelibdir=" libdir)))))
232 (add-before 'install 'disable-etc,var-samba-directories-setup
234 (substitute* "dynconfig/wscript"
235 (("bld\\.INSTALL_DIR.*") ""))
237 ;; FIXME: The test suite seemingly hangs after failing to provision the
250 ("libarchive" ,libarchive)
251 ("libtirpc" ,libtirpc)
252 ("linux-pam" ,linux-pam)
254 ("openldap" ,openldap)
258 ("readline" ,readline)
261 ;; In Requires or Requires.private of pkg-config files.
266 `(("perl-parse-yapp" ,perl-parse-yapp)
267 ("pkg-config" ,pkg-config)
268 ("python-iso8601" ,python-iso8601)
269 ("rpcsvc-proto" ,rpcsvc-proto) ; for 'rpcgen'
270 ;; For generating man pages.
271 ("docbook-xml" ,docbook-xml-4.2)
272 ("docbook-xsl" ,docbook-xsl)
273 ("xsltproc" ,libxslt)
274 ("libxml2", libxml2))) ;for XML_CATALOG_FILES
275 (home-page "https://www.samba.org/")
277 "The standard Windows interoperability suite of programs for GNU and Unix")
279 "Since 1992, Samba has provided secure, stable and fast file and print
280 services for all clients using the SMB/CIFS protocol, such as all versions of
281 DOS and Windows, OS/2, GNU/Linux and many others.
283 Samba is an important component to seamlessly integrate Linux/Unix Servers and
284 Desktops into Active Directory environments using the winbind daemon.")
287 (define-public talloc
293 (uri (string-append "https://www.samba.org/ftp/talloc/talloc-"
297 "0xwzgzrqamfdlklwacp9d219pqkah0yfrhxb1j7bxlmgzp924j7g"))))
298 (build-system gnu-build-system)
301 (modify-phases %standard-phases
303 (lambda* (#:key outputs #:allow-other-keys)
304 ;; talloc uses a custom configuration script that runs a Python
305 ;; script called 'waf', and doesn't tolerate unknown options.
306 (setenv "CONFIG_SHELL" (which "sh"))
307 (let ((out (assoc-ref outputs "out")))
308 (invoke "./configure"
309 (string-append "--prefix=" out))))))))
313 `(("python" ,python)))
314 (home-page "https://talloc.samba.org")
315 (synopsis "Hierarchical, reference counted memory pool system")
317 "Talloc is a hierarchical, reference counted memory pool system with
318 destructors. It is the core memory allocator used in Samba.")
319 (license gpl3+))) ;; The bundled "replace" library uses LGPL3.
321 (define-public talloc/static
324 (name "talloc-static")
326 "Hierarchical, reference counted memory pool system (static library)")
328 (substitute-keyword-arguments (package-arguments talloc)
330 ;; Since Waf, the build system talloc uses, apparently does not
331 ;; support building static libraries from a ./configure flag, roll our
332 ;; own build process. No need to be ashamed, we're not the only ones
334 ;; <https://github.com/proot-me/proot-static-build/blob/master/GNUmakefile>.
336 `(modify-phases ,phases
339 (invoke "gcc" "-c" "-Ibin/default" "-I" "lib/replace"
340 "-I." "-Wall" "-g" "-D__STDC_WANT_LIB_EXT1__=1"
342 (invoke "ar" "rc" "libtalloc.a" "talloc.o")))
344 (lambda* (#:key outputs #:allow-other-keys)
345 (let* ((out (assoc-ref outputs "out"))
346 (lib (string-append out "/lib"))
347 (include (string-append out "/include")))
349 (install-file "libtalloc.a" lib)
350 (install-file "talloc.h" include)
352 (delete 'check))))))) ;XXX: tests rely on Python modules
354 (define-public tevent
360 (uri (string-append "https://www.samba.org/ftp/tevent/tevent-"
364 "15k6i8ad5lpxfjsjyq9h64zlyws8d3cm0vwdnaw8z1xjwli7hhpq"))))
365 (build-system gnu-build-system)
368 (modify-phases %standard-phases
370 ;; tevent uses a custom configuration script that runs waf.
371 (lambda* (#:key outputs #:allow-other-keys)
372 (let ((out (assoc-ref outputs "out")))
373 (invoke "./configure"
374 (string-append "--prefix=" out)
375 "--bundled-libraries=NONE")))))))
377 `(("pkg-config" ,pkg-config)
381 `(("talloc" ,talloc))) ; required by tevent.pc
382 (synopsis "Event system library")
383 (home-page "https://tevent.samba.org/")
385 "Tevent is an event system based on the talloc memory management library.
386 It is the core event system used in Samba. The low level tevent has support for
387 many event types, including timers, signals, and the classic file descriptor events.")
396 (uri (string-append "https://www.samba.org/ftp/ldb/ldb-"
400 "0nwpkqidsna4yz3vhjzzadm4hpviwnyk80yml8ay82gi1d6lg0pz"))
401 (modules '((guix build utils)))
404 (for-each (lambda (file)
405 ;; Delete everything except the build tools.
406 (unless (or (string-prefix? "third_party/waf" file)
407 (string-suffix? "wscript" file))
409 (find-files "third_party"))
411 (build-system gnu-build-system)
413 '(;; LMDB is only supported on 64-bit systems, yet the test suite
415 #:tests? (assoc-ref %build-inputs "lmdb")
417 (modify-phases %standard-phases
419 ;; ldb use a custom configuration script that runs waf.
420 (lambda* (#:key outputs #:allow-other-keys)
421 (let ((out (assoc-ref outputs "out")))
422 (invoke "./configure"
423 (string-append "--prefix=" out)
424 (string-append "--with-modulesdir=" out
426 "--bundled-libraries=NONE")))))))
429 ("pkg-config" ,pkg-config)
433 ;; ldb.pc refers to all these.
437 `(,@(if (target-64bit?)
442 (synopsis "LDAP-like embedded database")
443 (home-page "https://ldb.samba.org/")
445 "Ldb is a LDAP-like embedded database built on top of TDB. What ldb does
446 is provide a fast database with an LDAP-like API designed to be used within an
447 application. In some ways it can be seen as a intermediate solution between
448 key-value pair databases and a real LDAP database.")
452 ;; This git commit contains unreleased fixes for CVE-2020-8597.
454 (commit "8d45443bb5c9372b4c6a362ba2f443d41c5636af"))
457 (version (git-version "2.4.8" revision commit))
461 (url "https://github.com/paulusmack/ppp")
463 (file-name (git-file-name name version))
466 "06cf8fb84l3h2zy5da4j7k2j1qjv2gfqn986sf43xgj75605aks2"))))
467 (build-system gnu-build-system)
469 '(#:tests? #f ; no check target
470 #:make-flags '("CC=gcc")
472 (modify-phases %standard-phases
473 (add-before 'configure 'patch-Makefile
474 (lambda* (#:key inputs #:allow-other-keys)
475 (let ((libc (assoc-ref inputs "libc"))
476 (openssl (assoc-ref inputs "openssl"))
477 (libpcap (assoc-ref inputs "libpcap")))
478 (substitute* "pppd/Makefile.linux"
479 (("/usr/include/crypt\\.h")
480 (string-append libc "/include/crypt.h"))
481 (("/usr/include/openssl")
482 (string-append openssl "/include/openssl"))
483 (("/usr/include/pcap-bpf.h")
484 (string-append libpcap "/include/pcap-bpf.h")))
487 `(("libpcap" ,libpcap)
488 ("openssl" ,(@ (gnu packages tls) openssl))))
489 (synopsis "Implementation of the Point-to-Point Protocol")
490 (home-page "https://ppp.samba.org/")
492 "The Point-to-Point Protocol (PPP) provides a standard way to establish
493 a network connection over a serial link. At present, this package supports IP
494 and IPV6 and the protocols layered above them, such as TCP and UDP.")
495 ;; pppd, pppstats and pppdump are under BSD-style notices.
496 ;; some of the pppd plugins are GPL'd.
497 ;; chat is public domain.
498 (license (list bsd-3 bsd-4 gpl2+ public-domain)))))