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 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 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))
56 (define-public cifs-utils
63 (uri (string-append "https://download.samba.org/pub/linux-cifs/"
64 name "/" name "-" version ".tar.bz2"))
66 "0ygz3pagjpaj5ky11hzh4byyymb7fpmqiqkprn11zwj31h2zdlg7"))))
67 (build-system gnu-build-system)
69 `(("autoconf" ,autoconf)
70 ("automake" ,automake)
71 ("pkg-config" ,pkg-config)))
73 `(("keytuils" ,keyutils)
74 ("linux-pam" ,linux-pam)
75 ("libcap-ng" ,libcap-ng)
76 ("mit-krb5" ,mit-krb5)
81 (modify-phases %standard-phases
82 (add-before 'configure 'set-root-sbin
83 (lambda _ ; Don't try to install in "/sbin".
85 (string-append (assoc-ref %outputs "out") "/sbin"))
87 (synopsis "User-space utilities for Linux CIFS (Samba) mounts")
88 (description "@code{cifs-utils} is a set of user-space utilities for
89 mounting and managing @dfn{Common Internet File System} (CIFS) shares using
90 the Linux kernel CIFS client.")
91 (home-page "https://wiki.samba.org/index.php/LinuxCIFS_utils")
92 ;; cifs-utils is licensed as GPL3 or later, but 3 files contain LGPL code.
95 (define-public iniparser
101 (uri (string-append "https://github.com/ndevilla/iniparser/archive/v"
103 (file-name (string-append name "-" version ".tar.gz"))
106 "1bpk8dj9d5cl64lg6jsk0qlzrpg848nymwxc3fx707fk1n0al3cn"))))
107 (build-system gnu-build-system)
112 (modify-phases %standard-phases
114 (lambda* (#:key outputs #:allow-other-keys)
115 (substitute* '("Makefile" "test/Makefile")
117 (string-append (assoc-ref outputs "out") "/lib")))
120 (lambda* (#:key make-flags #:allow-other-keys)
121 (apply invoke "make" "libiniparser.so.1"
124 (lambda* (#:key outputs #:allow-other-keys)
125 (let* ((out (assoc-ref outputs "out"))
126 (lib (string-append out "/lib"))
127 (inc (string-append out "/include"))
128 (doc (string-append out "/share/doc/" ,name))
129 (html (string-append doc "/html")))
130 (define (install dir)
132 (install-file file dir)))
133 (for-each (install lib)
134 (find-files "." "^lib.*\\.so"))
135 (with-directory-excursion lib
136 (symlink "libiniparser.so.1" "libiniparser.so"))
137 (for-each (install inc)
138 (find-files "src" "\\.h$"))
139 (for-each (install html)
140 (find-files "html" ".*"))
141 (for-each (install doc)
142 '("AUTHORS" "INSTALL" "LICENSE" "README.md"))
144 (home-page "https://github.com/ndevilla/iniparser")
145 (synopsis "Standalone ini file parsing library")
147 "iniparser is a free stand-alone @code{ini} file parsing library (Windows
148 configuration files). It is written in portable ANSI C and should compile
158 (uri (string-append "https://download.samba.org/pub/samba/stable/"
159 "samba-" version ".tar.gz"))
162 "0n1ld77y8sydkpx6l8i2hqa1k7hpkr8df91pg849glc4b85407wz"))))
163 (build-system gnu-build-system)
166 (modify-phases %standard-phases
167 (add-before 'configure 'locate-docbook-stylesheets
168 (lambda* (#:key inputs #:allow-other-keys)
169 ;; XXX for some reason XML_CATALOG_FILES is not respected.
170 (substitute* '("buildtools/wafsamba/samba_conftests.py"
171 "buildtools/wafsamba/wafsamba.py"
172 "docs-xml/xslt/man.xsl")
173 (("http://docbook.sourceforge.net/release/xsl/current/")
174 (string-append (assoc-ref inputs "docbook-xsl")
175 "/xml/xsl/docbook-xsl-"
176 ,(package-version docbook-xsl) "/")))
179 ;; samba uses a custom configuration script that runs waf.
180 (lambda* (#:key outputs #:allow-other-keys)
181 (let* ((out (assoc-ref outputs "out"))
182 (libdir (string-append out "/lib")))
183 (invoke "./configure"
185 ;; XXX: heimdal not packaged.
186 "--bundled-libraries=com_err"
187 (string-append "--prefix=" out)
189 ;; Install public and private libraries into
190 ;; a single directory to avoid RPATH issues.
191 (string-append "--libdir=" libdir)
192 (string-append "--with-privatelibdir=" libdir)))))
193 (add-before 'install 'disable-etc-samba-directory-creation
195 (substitute* "dynconfig/wscript"
196 (("bld\\.INSTALL_DIR\\(\"\\$\\{CONFIGDIR\\}\"\\)")
199 ;; XXX: The test infrastructure attempts to set password with
200 ;; smbpasswd, which fails with "smbpasswd -L can only be used by root."
201 ;; So disable tests until there's a workaround.
203 (inputs ; TODO: Add missing dependencies
209 ("iniparser" ,iniparser)
212 ("libarchive" ,libarchive)
213 ("linux-pam" ,linux-pam)
215 ("openldap" ,openldap)
217 ("readline" ,readline)
220 ;; In Requires or Requires.private of pkg-config files.
225 `(("docbook-xsl" ,docbook-xsl) ;for generating manpages
226 ("xsltproc" ,libxslt) ;ditto
228 ("pkg-config" ,pkg-config)
230 (home-page "https://www.samba.org/")
232 "The standard Windows interoperability suite of programs for GNU and Unix")
234 "Since 1992, Samba has provided secure, stable and fast file and print
235 services for all clients using the SMB/CIFS protocol, such as all versions of
236 DOS and Windows, OS/2, GNU/Linux and many others.
238 Samba is an important component to seamlessly integrate Linux/Unix Servers and
239 Desktops into Active Directory environments using the winbind daemon.")
242 (define-public talloc
248 (uri (string-append "https://www.samba.org/ftp/talloc/talloc-"
252 "1g1fqa37xkjp9lp6lrwxrbfgashcink769ll505zvcwnxx2nlvsw"))))
253 (build-system gnu-build-system)
256 (modify-phases %standard-phases
258 (lambda* (#:key outputs #:allow-other-keys)
259 ;; talloc uses a custom configuration script that runs a Python
260 ;; script called 'waf', and doesn't tolerate unknown options.
261 (setenv "CONFIG_SHELL" (which "sh"))
262 (let ((out (assoc-ref outputs "out")))
263 (invoke "./configure"
264 (string-append "--prefix=" out))))))))
268 `(("python" ,python)))
269 (home-page "https://talloc.samba.org")
270 (synopsis "Hierarchical, reference counted memory pool system")
272 "Talloc is a hierarchical, reference counted memory pool system with
273 destructors. It is the core memory allocator used in Samba.")
274 (license gpl3+))) ;; The bundled "replace" library uses LGPL3.
276 (define-public talloc/static
279 (name "talloc-static")
281 "Hierarchical, reference counted memory pool system (static library)")
283 (substitute-keyword-arguments (package-arguments talloc)
285 ;; Since Waf, the build system talloc uses, apparently does not
286 ;; support building static libraries from a ./configure flag, roll our
287 ;; own build process. No need to be ashamed, we're not the only ones
289 ;; <https://github.com/proot-me/proot-static-build/blob/master/GNUmakefile>.
291 `(modify-phases ,phases
294 (invoke "gcc" "-c" "-Ibin/default" "-I" "lib/replace"
295 "-I." "-Wall" "-g" "-D__STDC_WANT_LIB_EXT1__=1"
297 (invoke "ar" "rc" "libtalloc.a" "talloc.o")))
299 (lambda* (#:key outputs #:allow-other-keys)
300 (let* ((out (assoc-ref outputs "out"))
301 (lib (string-append out "/lib"))
302 (include (string-append out "/include")))
304 (install-file "libtalloc.a" lib)
305 (install-file "talloc.h" include)
307 (delete 'check))))))) ;XXX: tests rely on Python modules
309 (define-public tevent
315 (uri (string-append "https://www.samba.org/ftp/tevent/tevent-"
319 "1rm4d9245ya15wyrh9vqn1dnz14l2ic88mr46ykyc6kdrl99dwrk"))))
320 (build-system gnu-build-system)
323 (modify-phases %standard-phases
325 ;; tevent uses a custom configuration script that runs waf.
326 (lambda* (#:key outputs #:allow-other-keys)
327 (let ((out (assoc-ref outputs "out")))
328 (invoke "./configure"
329 (string-append "--prefix=" out)
330 "--bundled-libraries=NONE")))))))
332 `(("pkg-config" ,pkg-config)
336 `(("talloc" ,talloc))) ; required by tevent.pc
337 (synopsis "Event system library")
338 (home-page "https://tevent.samba.org/")
340 "Tevent is an event system based on the talloc memory management library.
341 It is the core event system used in Samba. The low level tevent has support for
342 many event types, including timers, signals, and the classic file descriptor events.")
351 (uri (string-append "https://www.samba.org/ftp/ldb/ldb-"
355 "01livdy3g073bm6xnc8zqnqrxg53sw8q66d1903z62hd6g87whsa"))
356 (modules '((guix build utils)))
359 (for-each (lambda (file)
360 ;; Delete everything except the build tools.
361 (unless (or (string-prefix? "third_party/waf" file)
362 (string-suffix? "wscript" file))
364 (find-files "third_party"))
366 (build-system gnu-build-system)
368 '(;; LMDB is only supported on 64-bit systems, yet the test suite
370 #:tests? (assoc-ref %build-inputs "lmdb")
372 (modify-phases %standard-phases
374 ;; ldb use a custom configuration script that runs waf.
375 (lambda* (#:key outputs #:allow-other-keys)
376 (let ((out (assoc-ref outputs "out")))
377 (invoke "./configure"
378 (string-append "--prefix=" out)
379 (string-append "--with-modulesdir=" out
381 "--bundled-libraries=NONE")))))))
384 ("pkg-config" ,pkg-config)
388 ;; ldb.pc refers to all these.
392 `(,@(if (target-64bit?)
397 (synopsis "LDAP-like embedded database")
398 (home-page "https://ldb.samba.org/")
400 "Ldb is a LDAP-like embedded database built on top of TDB. What ldb does
401 is provide a fast database with an LDAP-like API designed to be used within an
402 application. In some ways it can be seen as a intermediate solution between
403 key-value pair databases and a real LDAP database.")
412 (uri (string-append "https://www.samba.org/ftp/ppp/ppp-"
416 ;; Use OpenSSL for cryptography instead of the obsolete glibc
417 ;; crypto functions that were removed in glibc 2.28.
419 (uri (string-append "https://github.com/paulusmack/ppp/commit/"
420 "3c7b86229f7bd2600d74db14b1fe5b3896be3875"
422 (file-name "ppp-use-openssl-crypto.patch")
425 "0qlbi247lx3injpy8a1gcij9yilik0vfaibkpvdp88k3sa1rs69z")))))
428 "0c7vrjxl52pdwi4ckrvfjr08b31lfpgwf3pp0cqy76a77vfs7q02"))))
429 (build-system gnu-build-system)
431 '(#:tests? #f ; no check target
432 #:make-flags '("CC=gcc")
434 (modify-phases %standard-phases
435 (add-before 'configure 'patch-Makefile
436 (lambda* (#:key inputs #:allow-other-keys)
437 (let ((libc (assoc-ref inputs "libc"))
438 (openssl (assoc-ref inputs "openssl"))
439 (libpcap (assoc-ref inputs "libpcap")))
440 (substitute* "pppd/Makefile.linux"
441 (("/usr/include/crypt\\.h")
442 (string-append libc "/include/crypt.h"))
443 (("/usr/include/openssl")
444 (string-append openssl "/include/openssl"))
445 (("/usr/include/pcap-bpf.h")
446 (string-append libpcap "/include/pcap-bpf.h")))
449 `(("libpcap" ,libpcap)
450 ("openssl" ,(@ (gnu packages tls) openssl))))
451 (synopsis "Implementation of the Point-to-Point Protocol")
452 (home-page "https://ppp.samba.org/")
454 "The Point-to-Point Protocol (PPP) provides a standard way to establish
455 a network connection over a serial link. At present, this package supports IP
456 and IPV6 and the protocols layered above them, such as TCP and UDP.")
457 ;; pppd, pppstats and pppdump are under BSD-style notices.
458 ;; some of the pppd plugins are GPL'd.
459 ;; chat is public domain.
460 (license (list bsd-3 bsd-4 gpl2+ public-domain))))