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>
11 ;;; This file is part of GNU Guix.
13 ;;; GNU Guix is free software; you can redistribute it and/or modify it
14 ;;; under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 3 of the License, or (at
16 ;;; your option) any later version.
18 ;;; GNU Guix is distributed in the hope that it will be useful, but
19 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;;; GNU General Public License for more details.
23 ;;; You should have received a copy of the GNU General Public License
24 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26 (define-module (gnu packages samba)
27 #:use-module (guix packages)
28 #:use-module (guix download)
29 #:use-module (guix build-system gnu)
30 #:use-module (guix licenses)
31 #:use-module (guix utils)
32 #:use-module (gnu packages acl)
33 #:use-module (gnu packages admin)
34 #:use-module (gnu packages autotools)
35 #:use-module (gnu packages backup)
36 #:use-module (gnu packages base)
37 #:use-module (gnu packages check)
38 #:use-module (gnu packages crypto)
39 #:use-module (gnu packages cups)
40 #:use-module (gnu packages databases)
41 #:use-module (gnu packages docbook)
42 #:use-module (gnu packages gnupg)
43 #:use-module (gnu packages kerberos)
44 #:use-module (gnu packages linux)
45 #:use-module (gnu packages openldap)
46 #:use-module (gnu packages perl)
47 #:use-module (gnu packages pkg-config)
48 #:use-module (gnu packages popt)
49 #:use-module (gnu packages python)
50 #:use-module (gnu packages readline)
51 #:use-module (gnu packages tls)
52 #:use-module (gnu packages web)
53 #:use-module (gnu packages xml))
55 (define-public cifs-utils
62 (uri (string-append "https://download.samba.org/pub/linux-cifs/"
63 name "/" name "-" version ".tar.bz2"))
65 "0ygz3pagjpaj5ky11hzh4byyymb7fpmqiqkprn11zwj31h2zdlg7"))))
66 (build-system gnu-build-system)
68 `(("autoconf" ,autoconf)
69 ("automake" ,automake)
70 ("pkg-config" ,pkg-config)))
72 `(("keytuils" ,keyutils)
73 ("linux-pam" ,linux-pam)
74 ("libcap-ng" ,libcap-ng)
75 ("mit-krb5" ,mit-krb5)
80 (modify-phases %standard-phases
81 (add-before 'configure 'set-root-sbin
82 (lambda _ ; Don't try to install in "/sbin".
84 (string-append (assoc-ref %outputs "out") "/sbin"))
86 (synopsis "User-space utilities for Linux CIFS (Samba) mounts")
87 (description "@code{cifs-utils} is a set of user-space utilities for
88 mounting and managing @dfn{Common Internet File System} (CIFS) shares using
89 the Linux kernel CIFS client.")
90 (home-page "https://wiki.samba.org/index.php/LinuxCIFS_utils")
91 ;; cifs-utils is licensed as GPL3 or later, but 3 files contain LGPL code.
94 (define-public iniparser
100 (uri (string-append "https://github.com/ndevilla/iniparser/archive/v"
102 (file-name (string-append name "-" version ".tar.gz"))
105 "1bpk8dj9d5cl64lg6jsk0qlzrpg848nymwxc3fx707fk1n0al3cn"))))
106 (build-system gnu-build-system)
111 (modify-phases %standard-phases
113 (lambda* (#:key outputs #:allow-other-keys)
114 (substitute* '("Makefile" "test/Makefile")
116 (string-append (assoc-ref outputs "out") "/lib")))
119 (lambda* (#:key make-flags #:allow-other-keys)
120 (apply invoke "make" "libiniparser.so.1"
123 (lambda* (#:key outputs #:allow-other-keys)
124 (let* ((out (assoc-ref outputs "out"))
125 (lib (string-append out "/lib"))
126 (inc (string-append out "/include"))
127 (doc (string-append out "/share/doc/" ,name))
128 (html (string-append doc "/html")))
129 (define (install dir)
131 (install-file file dir)))
132 (for-each (install lib)
133 (find-files "." "^lib.*\\.so"))
134 (with-directory-excursion lib
135 (symlink "libiniparser.so.1" "libiniparser.so"))
136 (for-each (install inc)
137 (find-files "src" "\\.h$"))
138 (for-each (install html)
139 (find-files "html" ".*"))
140 (for-each (install doc)
141 '("AUTHORS" "INSTALL" "LICENSE" "README.md"))
143 (home-page "https://github.com/ndevilla/iniparser")
144 (synopsis "Standalone ini file parsing library")
146 "iniparser is a free stand-alone `ini' file parsing library (Windows
147 configuration files). It is written in portable ANSI C and should compile
157 (uri (string-append "https://download.samba.org/pub/samba/stable/"
158 "samba-" version ".tar.gz"))
161 "001p896z609vb0qs196bgl362j7y3qibgm5gcl9028lfv795d287"))))
162 (build-system gnu-build-system)
165 (modify-phases %standard-phases
166 (add-before 'configure 'locate-docbook-stylesheets
167 (lambda* (#:key inputs #:allow-other-keys)
168 ;; XXX for some reason XML_CATALOG_FILES is not respected.
169 (substitute* '("buildtools/wafsamba/samba_conftests.py"
170 "buildtools/wafsamba/wafsamba.py"
171 "docs-xml/xslt/man.xsl")
172 (("http://docbook.sourceforge.net/release/xsl/current/")
173 (string-append (assoc-ref inputs "docbook-xsl")
174 "/xml/xsl/docbook-xsl-"
175 ,(package-version docbook-xsl) "/")))
178 ;; samba uses a custom configuration script that runs waf.
179 (lambda* (#:key outputs #:allow-other-keys)
180 (let* ((out (assoc-ref outputs "out"))
181 (libdir (string-append out "/lib")))
182 (invoke "./configure"
184 ;; XXX: heimdal not packaged.
185 "--bundled-libraries=com_err"
186 (string-append "--prefix=" out)
188 ;; Install public and private libraries into
189 ;; a single directory to avoid RPATH issues.
190 (string-append "--libdir=" libdir)
191 (string-append "--with-privatelibdir=" libdir)))))
192 (add-before 'install 'disable-etc-samba-directory-creation
194 (substitute* "dynconfig/wscript"
195 (("bld\\.INSTALL_DIR\\(\"\\$\\{CONFIGDIR\\}\"\\)")
198 ;; XXX: The test infrastructure attempts to set password with
199 ;; smbpasswd, which fails with "smbpasswd -L can only be used by root."
200 ;; So disable tests until there's a workaround.
202 (inputs ; TODO: Add missing dependencies
208 ("iniparser" ,iniparser)
211 ("libarchive" ,libarchive)
212 ("linux-pam" ,linux-pam)
214 ("openldap" ,openldap)
216 ("readline" ,readline)
219 ;; In Requires or Requires.private of pkg-config files.
224 `(("docbook-xsl" ,docbook-xsl) ;for generating manpages
225 ("xsltproc" ,libxslt) ;ditto
227 ("pkg-config" ,pkg-config)
228 ("python" ,python-2))) ; incompatible with Python 3
229 (home-page "https://www.samba.org/")
231 "The standard Windows interoperability suite of programs for GNU and Unix")
233 "Since 1992, Samba has provided secure, stable and fast file and print
234 services for all clients using the SMB/CIFS protocol, such as all versions of
235 DOS and Windows, OS/2, GNU/Linux and many others.
237 Samba is an important component to seamlessly integrate Linux/Unix Servers and
238 Desktops into Active Directory environments using the winbind daemon.")
241 (define-public talloc
247 (uri (string-append "https://www.samba.org/ftp/talloc/talloc-"
251 "1aajda08yf7njgvg6r21ccxlvkarb9bwvf4jqh8yn3871a1zcnqr"))))
252 (build-system gnu-build-system)
255 (modify-phases %standard-phases
257 (lambda* (#:key outputs #:allow-other-keys)
258 ;; talloc uses a custom configuration script that runs a Python
259 ;; script called 'waf', and doesn't tolerate unknown options.
260 (setenv "CONFIG_SHELL" (which "sh"))
261 (let ((out (assoc-ref outputs "out")))
262 (invoke "./configure"
263 (string-append "--prefix=" out))))))))
267 `(("python" ,python)))
268 (home-page "https://talloc.samba.org")
269 (synopsis "Hierarchical, reference counted memory pool system")
271 "Talloc is a hierarchical, reference counted memory pool system with
272 destructors. It is the core memory allocator used in Samba.")
273 (license gpl3+))) ;; The bundled "replace" library uses LGPL3.
275 (define-public talloc/static
278 (name "talloc-static")
280 "Hierarchical, reference counted memory pool system (static library)")
282 (substitute-keyword-arguments (package-arguments talloc)
284 ;; Since Waf, the build system talloc uses, apparently does not
285 ;; support building static libraries from a ./configure flag, roll our
286 ;; own build process. No need to be ashamed, we're not the only ones
288 ;; <https://github.com/proot-me/proot-static-build/blob/master/GNUmakefile>.
290 `(modify-phases ,phases
293 (invoke "gcc" "-c" "-Ibin/default" "-I" "lib/replace"
294 "-I." "-Wall" "-g" "-D__STDC_WANT_LIB_EXT1__=1"
296 (invoke "ar" "rc" "libtalloc.a" "talloc.o")))
298 (lambda* (#:key outputs #:allow-other-keys)
299 (let* ((out (assoc-ref outputs "out"))
300 (lib (string-append out "/lib"))
301 (include (string-append out "/include")))
303 (install-file "libtalloc.a" lib)
304 (install-file "talloc.h" include)
306 (delete 'check))))))) ;XXX: tests rely on Python modules
308 (define-public tevent
314 (uri (string-append "https://www.samba.org/ftp/tevent/tevent-"
318 "1rnln76ngd2b8lgqvfa9iscy6jizwycj85nfp9zd46b1c760z3gn"))))
319 (build-system gnu-build-system)
322 (modify-phases %standard-phases
324 ;; tevent uses a custom configuration script that runs waf.
325 (lambda* (#:key outputs #:allow-other-keys)
326 (let ((out (assoc-ref outputs "out")))
327 (invoke "./configure"
328 (string-append "--prefix=" out)
329 "--bundled-libraries=NONE")))))))
331 `(("pkg-config" ,pkg-config)
335 `(("talloc" ,talloc))) ; required by tevent.pc
336 (synopsis "Event system library")
337 (home-page "https://tevent.samba.org/")
339 "Tevent is an event system based on the talloc memory management library.
340 It is the core event system used in Samba. The low level tevent has support for
341 many event types, including timers, signals, and the classic file descriptor events.")
350 (uri (string-append "https://www.samba.org/ftp/ldb/ldb-"
354 "1kiwlra6nfkb5n870k2db41jrm59bq9lxqmil4v7ignblgsdfdwb"))
355 (modules '((guix build utils)))
358 (for-each (lambda (file)
359 ;; Delete everything except the build tools.
360 (unless (or (string-prefix? "third_party/waf" file)
361 (string-suffix? "wscript" file))
363 (find-files "third_party"))
365 (build-system gnu-build-system)
367 '(;; LMDB is only supported on 64-bit systems, yet the test suite
369 #:tests? (assoc-ref %build-inputs "lmdb")
371 (modify-phases %standard-phases
373 ;; ldb use a custom configuration script that runs waf.
374 (lambda* (#:key outputs #:allow-other-keys)
375 (let ((out (assoc-ref outputs "out")))
376 (invoke "./configure"
377 (string-append "--prefix=" out)
378 (string-append "--with-modulesdir=" out
380 "--bundled-libraries=NONE")))))))
383 ("pkg-config" ,pkg-config)
387 ;; ldb.pc refers to all these.
391 `(,@(if (target-64bit?)
396 (synopsis "LDAP-like embedded database")
397 (home-page "https://ldb.samba.org/")
399 "Ldb is a LDAP-like embedded database built on top of TDB. What ldb does
400 is provide a fast database with an LDAP-like API designed to be used within an
401 application. In some ways it can be seen as a intermediate solution between
402 key-value pair databases and a real LDAP database.")
411 (uri (string-append "https://www.samba.org/ftp/ppp/ppp-"
415 ;; Use OpenSSL for cryptography instead of the obsolete glibc
416 ;; crypto functions that were removed in glibc 2.28.
418 (uri (string-append "https://github.com/paulusmack/ppp/commit/"
419 "3c7b86229f7bd2600d74db14b1fe5b3896be3875"
421 (file-name "ppp-use-openssl-crypto.patch")
424 "0qlbi247lx3injpy8a1gcij9yilik0vfaibkpvdp88k3sa1rs69z")))))
427 "0c7vrjxl52pdwi4ckrvfjr08b31lfpgwf3pp0cqy76a77vfs7q02"))))
428 (build-system gnu-build-system)
430 '(#:tests? #f ; no check target
431 #:make-flags '("CC=gcc")
433 (modify-phases %standard-phases
434 (add-before 'configure 'patch-Makefile
435 (lambda* (#:key inputs #:allow-other-keys)
436 (let ((libc (assoc-ref inputs "libc"))
437 (openssl (assoc-ref inputs "openssl"))
438 (libpcap (assoc-ref inputs "libpcap")))
439 (substitute* "pppd/Makefile.linux"
440 (("/usr/include/crypt\\.h")
441 (string-append libc "/include/crypt.h"))
442 (("/usr/include/openssl")
443 (string-append openssl "/include/openssl"))
444 (("/usr/include/pcap-bpf.h")
445 (string-append libpcap "/include/pcap-bpf.h")))
448 `(("libpcap" ,libpcap)
449 ("openssl" ,(@ (gnu packages tls) openssl))))
450 (synopsis "Implementation of the Point-to-Point Protocol")
451 (home-page "https://ppp.samba.org/")
453 "The Point-to-Point Protocol (PPP) provides a standard way to establish
454 a network connection over a serial link. At present, this package supports IP
455 and IPV6 and the protocols layered above them, such as TCP and UDP.")
456 ;; pppd, pppstats and pppdump are under BSD-style notices.
457 ;; some of the pppd plugins are GPL'd.
458 ;; chat is public domain.
459 (license (list bsd-3 bsd-4 gpl2+ public-domain))))