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, 2019 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 "cifs-utils/cifs-utils-" version ".tar.bz2"))
66 "175cp509wn1zv8p8mv37hkf6sxiskrsxdnq22mhlsg61jazz3n0q"))))
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
84 ;; Don't try to install into "/sbin".
86 (string-append (assoc-ref %outputs "out") "/sbin"))
88 (synopsis "User-space utilities for Linux CIFS (Samba) mounts")
89 (description "@code{cifs-utils} is a set of user-space utilities for
90 mounting and managing @dfn{Common Internet File System} (CIFS) shares using
91 the Linux kernel CIFS client.")
92 (home-page "https://wiki.samba.org/index.php/LinuxCIFS_utils")
93 ;; cifs-utils is licensed as GPL3 or later, but 3 files contain LGPL code.
96 (define-public iniparser
102 (uri (string-append "https://github.com/ndevilla/iniparser/archive/v"
104 (file-name (string-append name "-" version ".tar.gz"))
107 "1bpk8dj9d5cl64lg6jsk0qlzrpg848nymwxc3fx707fk1n0al3cn"))))
108 (build-system gnu-build-system)
113 (modify-phases %standard-phases
115 (lambda* (#:key outputs #:allow-other-keys)
116 (substitute* '("Makefile" "test/Makefile")
118 (string-append (assoc-ref outputs "out") "/lib")))
121 (lambda* (#:key make-flags #:allow-other-keys)
122 (apply invoke "make" "libiniparser.so.1"
125 (lambda* (#:key outputs #:allow-other-keys)
126 (let* ((out (assoc-ref outputs "out"))
127 (lib (string-append out "/lib"))
128 (inc (string-append out "/include"))
129 (doc (string-append out "/share/doc/" ,name))
130 (html (string-append doc "/html")))
131 (define (install dir)
133 (install-file file dir)))
134 (for-each (install lib)
135 (find-files "." "^lib.*\\.so"))
136 (with-directory-excursion lib
137 (symlink "libiniparser.so.1" "libiniparser.so"))
138 (for-each (install inc)
139 (find-files "src" "\\.h$"))
140 (for-each (install html)
141 (find-files "html" ".*"))
142 (for-each (install doc)
143 '("AUTHORS" "INSTALL" "LICENSE" "README.md"))
145 (home-page "https://github.com/ndevilla/iniparser")
146 (synopsis "Standalone ini file parsing library")
148 "iniparser is a free stand-alone @code{ini} file parsing library (Windows
149 configuration files). It is written in portable ANSI C and should compile
159 (uri (string-append "https://download.samba.org/pub/samba/stable/"
160 "samba-" version ".tar.gz"))
163 "0xhfbh42dihccc85ffx243lyhf3jnphhi6xfcsr3a6mhsm7w1p26"))))
164 (build-system gnu-build-system)
167 (modify-phases %standard-phases
168 (add-before 'configure 'locate-docbook-stylesheets
169 (lambda* (#:key inputs #:allow-other-keys)
170 ;; XXX for some reason XML_CATALOG_FILES is not respected.
171 (substitute* '("buildtools/wafsamba/samba_conftests.py"
172 "buildtools/wafsamba/wafsamba.py"
173 "docs-xml/xslt/man.xsl")
174 (("http://docbook.sourceforge.net/release/xsl/current/")
175 (string-append (assoc-ref inputs "docbook-xsl")
176 "/xml/xsl/docbook-xsl-"
177 ,(package-version docbook-xsl) "/")))
180 ;; samba uses a custom configuration script that runs waf.
181 (lambda* (#:key outputs #:allow-other-keys)
182 (let* ((out (assoc-ref outputs "out"))
183 (libdir (string-append out "/lib")))
184 (invoke "./configure"
186 ;; XXX: heimdal not packaged.
187 "--bundled-libraries=com_err"
188 (string-append "--prefix=" out)
190 ;; Install public and private libraries into
191 ;; a single directory to avoid RPATH issues.
192 (string-append "--libdir=" libdir)
193 (string-append "--with-privatelibdir=" libdir)))))
194 (add-before 'install 'disable-etc-samba-directory-creation
196 (substitute* "dynconfig/wscript"
197 (("bld\\.INSTALL_DIR\\(\"\\$\\{CONFIGDIR\\}\"\\)")
200 ;; XXX: The test infrastructure attempts to set password with
201 ;; smbpasswd, which fails with "smbpasswd -L can only be used by root."
202 ;; So disable tests until there's a workaround.
204 (inputs ; TODO: Add missing dependencies
210 ("iniparser" ,iniparser)
213 ("libarchive" ,libarchive)
214 ("linux-pam" ,linux-pam)
216 ("openldap" ,openldap)
218 ("readline" ,readline)
221 ;; In Requires or Requires.private of pkg-config files.
226 `(("docbook-xsl" ,docbook-xsl) ;for generating manpages
227 ("xsltproc" ,libxslt) ;ditto
229 ("pkg-config" ,pkg-config)
231 (home-page "https://www.samba.org/")
233 "The standard Windows interoperability suite of programs for GNU and Unix")
235 "Since 1992, Samba has provided secure, stable and fast file and print
236 services for all clients using the SMB/CIFS protocol, such as all versions of
237 DOS and Windows, OS/2, GNU/Linux and many others.
239 Samba is an important component to seamlessly integrate Linux/Unix Servers and
240 Desktops into Active Directory environments using the winbind daemon.")
243 (define-public talloc
249 (uri (string-append "https://www.samba.org/ftp/talloc/talloc-"
253 "1g1fqa37xkjp9lp6lrwxrbfgashcink769ll505zvcwnxx2nlvsw"))))
254 (build-system gnu-build-system)
257 (modify-phases %standard-phases
259 (lambda* (#:key outputs #:allow-other-keys)
260 ;; talloc uses a custom configuration script that runs a Python
261 ;; script called 'waf', and doesn't tolerate unknown options.
262 (setenv "CONFIG_SHELL" (which "sh"))
263 (let ((out (assoc-ref outputs "out")))
264 (invoke "./configure"
265 (string-append "--prefix=" out))))))))
269 `(("python" ,python)))
270 (home-page "https://talloc.samba.org")
271 (synopsis "Hierarchical, reference counted memory pool system")
273 "Talloc is a hierarchical, reference counted memory pool system with
274 destructors. It is the core memory allocator used in Samba.")
275 (license gpl3+))) ;; The bundled "replace" library uses LGPL3.
277 (define-public talloc/static
280 (name "talloc-static")
282 "Hierarchical, reference counted memory pool system (static library)")
284 (substitute-keyword-arguments (package-arguments talloc)
286 ;; Since Waf, the build system talloc uses, apparently does not
287 ;; support building static libraries from a ./configure flag, roll our
288 ;; own build process. No need to be ashamed, we're not the only ones
290 ;; <https://github.com/proot-me/proot-static-build/blob/master/GNUmakefile>.
292 `(modify-phases ,phases
295 (invoke "gcc" "-c" "-Ibin/default" "-I" "lib/replace"
296 "-I." "-Wall" "-g" "-D__STDC_WANT_LIB_EXT1__=1"
298 (invoke "ar" "rc" "libtalloc.a" "talloc.o")))
300 (lambda* (#:key outputs #:allow-other-keys)
301 (let* ((out (assoc-ref outputs "out"))
302 (lib (string-append out "/lib"))
303 (include (string-append out "/include")))
305 (install-file "libtalloc.a" lib)
306 (install-file "talloc.h" include)
308 (delete 'check))))))) ;XXX: tests rely on Python modules
310 (define-public tevent
316 (uri (string-append "https://www.samba.org/ftp/tevent/tevent-"
320 "1rm4d9245ya15wyrh9vqn1dnz14l2ic88mr46ykyc6kdrl99dwrk"))))
321 (build-system gnu-build-system)
324 (modify-phases %standard-phases
326 ;; tevent uses a custom configuration script that runs waf.
327 (lambda* (#:key outputs #:allow-other-keys)
328 (let ((out (assoc-ref outputs "out")))
329 (invoke "./configure"
330 (string-append "--prefix=" out)
331 "--bundled-libraries=NONE")))))))
333 `(("pkg-config" ,pkg-config)
337 `(("talloc" ,talloc))) ; required by tevent.pc
338 (synopsis "Event system library")
339 (home-page "https://tevent.samba.org/")
341 "Tevent is an event system based on the talloc memory management library.
342 It is the core event system used in Samba. The low level tevent has support for
343 many event types, including timers, signals, and the classic file descriptor events.")
352 (uri (string-append "https://www.samba.org/ftp/ldb/ldb-"
356 "01livdy3g073bm6xnc8zqnqrxg53sw8q66d1903z62hd6g87whsa"))
357 (modules '((guix build utils)))
360 (for-each (lambda (file)
361 ;; Delete everything except the build tools.
362 (unless (or (string-prefix? "third_party/waf" file)
363 (string-suffix? "wscript" file))
365 (find-files "third_party"))
367 (build-system gnu-build-system)
369 '(;; LMDB is only supported on 64-bit systems, yet the test suite
371 #:tests? (assoc-ref %build-inputs "lmdb")
373 (modify-phases %standard-phases
375 ;; ldb use a custom configuration script that runs waf.
376 (lambda* (#:key outputs #:allow-other-keys)
377 (let ((out (assoc-ref outputs "out")))
378 (invoke "./configure"
379 (string-append "--prefix=" out)
380 (string-append "--with-modulesdir=" out
382 "--bundled-libraries=NONE")))))))
385 ("pkg-config" ,pkg-config)
389 ;; ldb.pc refers to all these.
393 `(,@(if (target-64bit?)
398 (synopsis "LDAP-like embedded database")
399 (home-page "https://ldb.samba.org/")
401 "Ldb is a LDAP-like embedded database built on top of TDB. What ldb does
402 is provide a fast database with an LDAP-like API designed to be used within an
403 application. In some ways it can be seen as a intermediate solution between
404 key-value pair databases and a real LDAP database.")
413 (uri (string-append "https://www.samba.org/ftp/ppp/ppp-"
417 ;; Use OpenSSL for cryptography instead of the obsolete glibc
418 ;; crypto functions that were removed in glibc 2.28.
420 (uri (string-append "https://github.com/paulusmack/ppp/commit/"
421 "3c7b86229f7bd2600d74db14b1fe5b3896be3875"
423 (file-name "ppp-use-openssl-crypto.patch")
426 "0qlbi247lx3injpy8a1gcij9yilik0vfaibkpvdp88k3sa1rs69z")))))
429 "0c7vrjxl52pdwi4ckrvfjr08b31lfpgwf3pp0cqy76a77vfs7q02"))))
430 (build-system gnu-build-system)
432 '(#:tests? #f ; no check target
433 #:make-flags '("CC=gcc")
435 (modify-phases %standard-phases
436 (add-before 'configure 'patch-Makefile
437 (lambda* (#:key inputs #:allow-other-keys)
438 (let ((libc (assoc-ref inputs "libc"))
439 (openssl (assoc-ref inputs "openssl"))
440 (libpcap (assoc-ref inputs "libpcap")))
441 (substitute* "pppd/Makefile.linux"
442 (("/usr/include/crypt\\.h")
443 (string-append libc "/include/crypt.h"))
444 (("/usr/include/openssl")
445 (string-append openssl "/include/openssl"))
446 (("/usr/include/pcap-bpf.h")
447 (string-append libpcap "/include/pcap-bpf.h")))
450 `(("libpcap" ,libpcap)
451 ("openssl" ,(@ (gnu packages tls) openssl))))
452 (synopsis "Implementation of the Point-to-Point Protocol")
453 (home-page "https://ppp.samba.org/")
455 "The Point-to-Point Protocol (PPP) provides a standard way to establish
456 a network connection over a serial link. At present, this package supports IP
457 and IPV6 and the protocols layered above them, such as TCP and UDP.")
458 ;; pppd, pppstats and pppdump are under BSD-style notices.
459 ;; some of the pppd plugins are GPL'd.
460 ;; chat is public domain.
461 (license (list bsd-3 bsd-4 gpl2+ public-domain))))