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>
12 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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 time)
55 #:use-module (gnu packages tls)
56 #:use-module (gnu packages web)
57 #:use-module (gnu packages xml))
59 (define-public cifs-utils
66 (uri (string-append "https://download.samba.org/pub/linux-cifs/"
67 "cifs-utils/cifs-utils-" version ".tar.bz2"))
69 "19q4b5bzlxhn1hpi843xrp6f50d33w7m0rs26krkg5h3x742kz4j"))))
70 (build-system gnu-build-system)
72 `(("autoconf" ,autoconf)
73 ("automake" ,automake)
74 ("pkg-config" ,pkg-config)))
76 `(("keytuils" ,keyutils)
77 ("linux-pam" ,linux-pam)
78 ("libcap-ng" ,libcap-ng)
79 ("mit-krb5" ,mit-krb5)
84 (modify-phases %standard-phases
86 ;; Force a bootstrap to fix a ‘cannot find install-sh, install.sh,
87 ;; or shtool’ error since version 6.10.
89 (invoke "autoreconf" "-vfi")
91 (add-before 'configure 'set-root-sbin
92 (lambda* (#:key outputs #:allow-other-keys)
93 ;; Don't try to install into "/sbin".
95 (string-append (assoc-ref outputs "out") "/sbin"))
97 (add-before 'install 'create-man8dir
98 ;; Create a directory that isn't created since version 6.10.
99 (lambda* (#:key outputs #:allow-other-keys)
100 (let ((out (assoc-ref outputs "out")))
101 (mkdir-p (string-append out "/share/man/man8"))
103 (synopsis "User-space utilities for Linux CIFS (Samba) mounts")
104 (description "@code{cifs-utils} is a set of user-space utilities for
105 mounting and managing @dfn{Common Internet File System} (CIFS) shares using
106 the Linux kernel CIFS client.")
107 (home-page "https://wiki.samba.org/index.php/LinuxCIFS_utils")
108 ;; cifs-utils is licensed as GPL3 or later, but 3 files contain LGPL code.
111 (define-public iniparser
118 (url "https://github.com/ndevilla/iniparser")
119 (commit (string-append "v" version))))
120 (file-name (git-file-name name version))
123 "0dhab6pad6wh816lr7r3jb6z273njlgw2vpw8kcfnmi7ijaqhnr5"))))
124 (build-system gnu-build-system)
127 (list ,(string-append "CC=" (cc-for-target)))
129 (modify-phases %standard-phases
131 (lambda* (#:key outputs #:allow-other-keys)
132 (substitute* '("Makefile" "test/Makefile")
134 (string-append (assoc-ref outputs "out") "/lib")))
137 (lambda* (#:key make-flags #:allow-other-keys)
138 (apply invoke "make" "libiniparser.so.1"
141 (lambda* (#:key outputs #:allow-other-keys)
142 (let* ((out (assoc-ref outputs "out"))
143 (lib (string-append out "/lib"))
144 (inc (string-append out "/include"))
145 (doc (string-append out "/share/doc/" ,name))
146 (html (string-append doc "/html")))
147 (define (install dir)
149 (install-file file dir)))
150 (for-each (install lib)
151 (find-files "." "^lib.*\\.so"))
152 (with-directory-excursion lib
153 (symlink "libiniparser.so.1" "libiniparser.so"))
154 (for-each (install inc)
155 (find-files "src" "\\.h$"))
156 (for-each (install html)
157 (find-files "html" ".*"))
158 (for-each (install doc)
159 '("AUTHORS" "INSTALL" "LICENSE" "README.md"))
161 (home-page "https://github.com/ndevilla/iniparser")
162 (synopsis "Simple @file{.ini} configuration file parsing library")
164 "The iniParser C library reads and writes Windows-style @file{.ini}
165 configuration files. These are simple text files with a basic structure
166 composed of sections, properties, and values. While not expressive, they
167 are easy to read, write, and modify.
169 The library is small, thread safe, and written in portable ANSI C with no
170 external dependencies.")
180 (uri (string-append "https://download.samba.org/pub/samba/stable/"
181 "samba-" version ".tar.gz"))
183 (base32 "09w7aap1cjc41ayhaksm1igc7p7gl40fad4a1l6q4ds9a2jbrb9z"))
184 (modules '((guix build utils)))
187 ;; TODO: also remove the bundled ‘third_party/popt’.
188 (delete-file-recursively "third_party/pyiso8601")
190 (build-system gnu-build-system)
193 (modify-phases %standard-phases
194 (add-before 'configure 'locate-docbook-stylesheets
195 (lambda* (#:key inputs #:allow-other-keys)
196 ;; XXX for some reason XML_CATALOG_FILES is not respected.
197 (substitute* '("buildtools/wafsamba/samba_conftests.py"
198 "buildtools/wafsamba/wafsamba.py"
199 "docs-xml/xslt/man.xsl")
200 (("http://docbook.sourceforge.net/release/xsl/current/")
201 (string-append (assoc-ref inputs "docbook-xsl")
202 "/xml/xsl/docbook-xsl-"
203 ,(package-version docbook-xsl) "/")))
206 ;; samba uses a custom configuration script that runs waf.
207 (lambda* (#:key outputs #:allow-other-keys)
208 (let* ((out (assoc-ref outputs "out"))
209 (libdir (string-append out "/lib")))
210 (invoke "./configure"
212 ;; XXX: heimdal not packaged.
213 "--bundled-libraries=com_err"
214 (string-append "--prefix=" out)
216 ;; Install public and private libraries into
217 ;; a single directory to avoid RPATH issues.
218 (string-append "--libdir=" libdir)
219 (string-append "--with-privatelibdir=" libdir)))))
220 (add-before 'install 'disable-etc-samba-directory-creation
222 (substitute* "dynconfig/wscript"
223 (("bld\\.INSTALL_DIR\\(\"\\$\\{CONFIGDIR\\}\"\\)")
226 ;; XXX: The test infrastructure attempts to set password with
227 ;; smbpasswd, which fails with "smbpasswd -L can only be used by root."
228 ;; So disable tests until there's a workaround.
230 (inputs ; TODO: Add missing dependencies
237 ("libarchive" ,libarchive)
238 ("linux-pam" ,linux-pam)
240 ("openldap" ,openldap)
244 ("readline" ,readline)
247 ;; In Requires or Requires.private of pkg-config files.
252 `(("perl-parse-yapp" ,perl-parse-yapp)
253 ("pkg-config" ,pkg-config)
254 ("python-iso8601" ,python-iso8601)
255 ("rpcsvc-proto" ,rpcsvc-proto) ; for 'rpcgen'
257 ;; For generating man pages.
258 ("docbook-xml" ,docbook-xml-4.2)
259 ("docbook-xsl" ,docbook-xsl)
260 ("xsltproc" ,libxslt)))
261 (home-page "https://www.samba.org/")
263 "The standard Windows interoperability suite of programs for GNU and Unix")
265 "Since 1992, Samba has provided secure, stable and fast file and print
266 services for all clients using the SMB/CIFS protocol, such as all versions of
267 DOS and Windows, OS/2, GNU/Linux and many others.
269 Samba is an important component to seamlessly integrate Linux/Unix Servers and
270 Desktops into Active Directory environments using the winbind daemon.")
273 (define-public talloc
279 (uri (string-append "https://www.samba.org/ftp/talloc/talloc-"
283 "0xwzgzrqamfdlklwacp9d219pqkah0yfrhxb1j7bxlmgzp924j7g"))))
284 (build-system gnu-build-system)
287 (modify-phases %standard-phases
289 (lambda* (#:key outputs #:allow-other-keys)
290 ;; talloc uses a custom configuration script that runs a Python
291 ;; script called 'waf', and doesn't tolerate unknown options.
292 (setenv "CONFIG_SHELL" (which "sh"))
293 (let ((out (assoc-ref outputs "out")))
294 (invoke "./configure"
295 (string-append "--prefix=" out))))))))
299 `(("python" ,python)))
300 (home-page "https://talloc.samba.org")
301 (synopsis "Hierarchical, reference counted memory pool system")
303 "Talloc is a hierarchical, reference counted memory pool system with
304 destructors. It is the core memory allocator used in Samba.")
305 (license gpl3+))) ;; The bundled "replace" library uses LGPL3.
307 (define-public talloc/static
310 (name "talloc-static")
312 "Hierarchical, reference counted memory pool system (static library)")
314 (substitute-keyword-arguments (package-arguments talloc)
316 ;; Since Waf, the build system talloc uses, apparently does not
317 ;; support building static libraries from a ./configure flag, roll our
318 ;; own build process. No need to be ashamed, we're not the only ones
320 ;; <https://github.com/proot-me/proot-static-build/blob/master/GNUmakefile>.
322 `(modify-phases ,phases
325 (invoke "gcc" "-c" "-Ibin/default" "-I" "lib/replace"
326 "-I." "-Wall" "-g" "-D__STDC_WANT_LIB_EXT1__=1"
328 (invoke "ar" "rc" "libtalloc.a" "talloc.o")))
330 (lambda* (#:key outputs #:allow-other-keys)
331 (let* ((out (assoc-ref outputs "out"))
332 (lib (string-append out "/lib"))
333 (include (string-append out "/include")))
335 (install-file "libtalloc.a" lib)
336 (install-file "talloc.h" include)
338 (delete 'check))))))) ;XXX: tests rely on Python modules
340 (define-public tevent
346 (uri (string-append "https://www.samba.org/ftp/tevent/tevent-"
350 "15k6i8ad5lpxfjsjyq9h64zlyws8d3cm0vwdnaw8z1xjwli7hhpq"))))
351 (build-system gnu-build-system)
354 (modify-phases %standard-phases
356 ;; tevent uses a custom configuration script that runs waf.
357 (lambda* (#:key outputs #:allow-other-keys)
358 (let ((out (assoc-ref outputs "out")))
359 (invoke "./configure"
360 (string-append "--prefix=" out)
361 "--bundled-libraries=NONE")))))))
363 `(("pkg-config" ,pkg-config)
367 `(("talloc" ,talloc))) ; required by tevent.pc
368 (synopsis "Event system library")
369 (home-page "https://tevent.samba.org/")
371 "Tevent is an event system based on the talloc memory management library.
372 It is the core event system used in Samba. The low level tevent has support for
373 many event types, including timers, signals, and the classic file descriptor events.")
382 (uri (string-append "https://www.samba.org/ftp/ldb/ldb-"
386 "0nwpkqidsna4yz3vhjzzadm4hpviwnyk80yml8ay82gi1d6lg0pz"))
387 (modules '((guix build utils)))
390 (for-each (lambda (file)
391 ;; Delete everything except the build tools.
392 (unless (or (string-prefix? "third_party/waf" file)
393 (string-suffix? "wscript" file))
395 (find-files "third_party"))
397 (build-system gnu-build-system)
399 '(;; LMDB is only supported on 64-bit systems, yet the test suite
401 #:tests? (assoc-ref %build-inputs "lmdb")
403 (modify-phases %standard-phases
405 ;; ldb use a custom configuration script that runs waf.
406 (lambda* (#:key outputs #:allow-other-keys)
407 (let ((out (assoc-ref outputs "out")))
408 (invoke "./configure"
409 (string-append "--prefix=" out)
410 (string-append "--with-modulesdir=" out
412 "--bundled-libraries=NONE")))))))
415 ("pkg-config" ,pkg-config)
419 ;; ldb.pc refers to all these.
423 `(,@(if (target-64bit?)
428 (synopsis "LDAP-like embedded database")
429 (home-page "https://ldb.samba.org/")
431 "Ldb is a LDAP-like embedded database built on top of TDB. What ldb does
432 is provide a fast database with an LDAP-like API designed to be used within an
433 application. In some ways it can be seen as a intermediate solution between
434 key-value pair databases and a real LDAP database.")
438 ;; This git commit contains unreleased fixes for CVE-2020-8597.
440 (commit "8d45443bb5c9372b4c6a362ba2f443d41c5636af"))
443 (version (git-version "2.4.8" revision commit))
447 (url "https://github.com/paulusmack/ppp")
449 (file-name (git-file-name name version))
452 "06cf8fb84l3h2zy5da4j7k2j1qjv2gfqn986sf43xgj75605aks2"))))
453 (build-system gnu-build-system)
455 '(#:tests? #f ; no check target
456 #:make-flags '("CC=gcc")
458 (modify-phases %standard-phases
459 (add-before 'configure 'patch-Makefile
460 (lambda* (#:key inputs #:allow-other-keys)
461 (let ((libc (assoc-ref inputs "libc"))
462 (openssl (assoc-ref inputs "openssl"))
463 (libpcap (assoc-ref inputs "libpcap")))
464 (substitute* "pppd/Makefile.linux"
465 (("/usr/include/crypt\\.h")
466 (string-append libc "/include/crypt.h"))
467 (("/usr/include/openssl")
468 (string-append openssl "/include/openssl"))
469 (("/usr/include/pcap-bpf.h")
470 (string-append libpcap "/include/pcap-bpf.h")))
473 `(("libpcap" ,libpcap)
474 ("openssl" ,(@ (gnu packages tls) openssl))))
475 (synopsis "Implementation of the Point-to-Point Protocol")
476 (home-page "https://ppp.samba.org/")
478 "The Point-to-Point Protocol (PPP) provides a standard way to establish
479 a network connection over a serial link. At present, this package supports IP
480 and IPV6 and the protocols layered above them, such as TCP and UDP.")
481 ;; pppd, pppstats and pppdump are under BSD-style notices.
482 ;; some of the pppd plugins are GPL'd.
483 ;; chat is public domain.
484 (license (list bsd-3 bsd-4 gpl2+ public-domain)))))