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 onc-rpc)
47 #:use-module (gnu packages openldap)
48 #:use-module (gnu packages perl)
49 #:use-module (gnu packages pkg-config)
50 #:use-module (gnu packages popt)
51 #:use-module (gnu packages python)
52 #:use-module (gnu packages readline)
53 #:use-module (gnu packages tls)
54 #:use-module (gnu packages web)
55 #:use-module (gnu packages xml))
57 (define-public cifs-utils
64 (uri (string-append "https://download.samba.org/pub/linux-cifs/"
65 "cifs-utils/cifs-utils-" version ".tar.bz2"))
67 "175cp509wn1zv8p8mv37hkf6sxiskrsxdnq22mhlsg61jazz3n0q"))))
68 (build-system gnu-build-system)
70 `(("autoconf" ,autoconf)
71 ("automake" ,automake)
72 ("pkg-config" ,pkg-config)))
74 `(("keytuils" ,keyutils)
75 ("linux-pam" ,linux-pam)
76 ("libcap-ng" ,libcap-ng)
77 ("mit-krb5" ,mit-krb5)
82 (modify-phases %standard-phases
83 (add-before 'configure 'set-root-sbin
85 ;; Don't try to install into "/sbin".
87 (string-append (assoc-ref %outputs "out") "/sbin"))
89 (synopsis "User-space utilities for Linux CIFS (Samba) mounts")
90 (description "@code{cifs-utils} is a set of user-space utilities for
91 mounting and managing @dfn{Common Internet File System} (CIFS) shares using
92 the Linux kernel CIFS client.")
93 (home-page "https://wiki.samba.org/index.php/LinuxCIFS_utils")
94 ;; cifs-utils is licensed as GPL3 or later, but 3 files contain LGPL code.
97 (define-public iniparser
103 (uri (string-append "https://github.com/ndevilla/iniparser/archive/v"
105 (file-name (string-append name "-" version ".tar.gz"))
108 "1bpk8dj9d5cl64lg6jsk0qlzrpg848nymwxc3fx707fk1n0al3cn"))))
109 (build-system gnu-build-system)
114 (modify-phases %standard-phases
116 (lambda* (#:key outputs #:allow-other-keys)
117 (substitute* '("Makefile" "test/Makefile")
119 (string-append (assoc-ref outputs "out") "/lib")))
122 (lambda* (#:key make-flags #:allow-other-keys)
123 (apply invoke "make" "libiniparser.so.1"
126 (lambda* (#:key outputs #:allow-other-keys)
127 (let* ((out (assoc-ref outputs "out"))
128 (lib (string-append out "/lib"))
129 (inc (string-append out "/include"))
130 (doc (string-append out "/share/doc/" ,name))
131 (html (string-append doc "/html")))
132 (define (install dir)
134 (install-file file dir)))
135 (for-each (install lib)
136 (find-files "." "^lib.*\\.so"))
137 (with-directory-excursion lib
138 (symlink "libiniparser.so.1" "libiniparser.so"))
139 (for-each (install inc)
140 (find-files "src" "\\.h$"))
141 (for-each (install html)
142 (find-files "html" ".*"))
143 (for-each (install doc)
144 '("AUTHORS" "INSTALL" "LICENSE" "README.md"))
146 (home-page "https://github.com/ndevilla/iniparser")
147 (synopsis "Standalone ini file parsing library")
149 "iniparser is a free stand-alone @code{ini} file parsing library (Windows
150 configuration files). It is written in portable ANSI C and should compile
160 (uri (string-append "https://download.samba.org/pub/samba/stable/"
161 "samba-" version ".tar.gz"))
164 "0xb3mz38hcayqxchk0ws9mxn10vswsn97jbxl4gcwi4cbrnjc43c"))))
165 (build-system gnu-build-system)
168 (modify-phases %standard-phases
169 (add-before 'configure 'locate-docbook-stylesheets
170 (lambda* (#:key inputs #:allow-other-keys)
171 ;; XXX for some reason XML_CATALOG_FILES is not respected.
172 (substitute* '("buildtools/wafsamba/samba_conftests.py"
173 "buildtools/wafsamba/wafsamba.py"
174 "docs-xml/xslt/man.xsl")
175 (("http://docbook.sourceforge.net/release/xsl/current/")
176 (string-append (assoc-ref inputs "docbook-xsl")
177 "/xml/xsl/docbook-xsl-"
178 ,(package-version docbook-xsl) "/")))
181 ;; samba uses a custom configuration script that runs waf.
182 (lambda* (#:key outputs #:allow-other-keys)
183 (let* ((out (assoc-ref outputs "out"))
184 (libdir (string-append out "/lib")))
185 (invoke "./configure"
187 ;; XXX: heimdal not packaged.
188 "--bundled-libraries=com_err"
189 (string-append "--prefix=" out)
191 ;; Install public and private libraries into
192 ;; a single directory to avoid RPATH issues.
193 (string-append "--libdir=" libdir)
194 (string-append "--with-privatelibdir=" libdir)))))
195 (add-before 'install 'disable-etc-samba-directory-creation
197 (substitute* "dynconfig/wscript"
198 (("bld\\.INSTALL_DIR\\(\"\\$\\{CONFIGDIR\\}\"\\)")
201 ;; XXX: The test infrastructure attempts to set password with
202 ;; smbpasswd, which fails with "smbpasswd -L can only be used by root."
203 ;; So disable tests until there's a workaround.
205 (inputs ; TODO: Add missing dependencies
211 ("iniparser" ,iniparser)
214 ("libarchive" ,libarchive)
215 ("linux-pam" ,linux-pam)
217 ("openldap" ,openldap)
219 ("readline" ,readline)
222 ;; In Requires or Requires.private of pkg-config files.
227 `(("docbook-xsl" ,docbook-xsl) ;for generating manpages
228 ("xsltproc" ,libxslt) ;ditto
229 ("rpcsvc-proto" ,rpcsvc-proto) ;for 'rpcgen'
231 ("pkg-config" ,pkg-config)
233 (home-page "https://www.samba.org/")
235 "The standard Windows interoperability suite of programs for GNU and Unix")
237 "Since 1992, Samba has provided secure, stable and fast file and print
238 services for all clients using the SMB/CIFS protocol, such as all versions of
239 DOS and Windows, OS/2, GNU/Linux and many others.
241 Samba is an important component to seamlessly integrate Linux/Unix Servers and
242 Desktops into Active Directory environments using the winbind daemon.")
245 (define-public talloc
251 (uri (string-append "https://www.samba.org/ftp/talloc/talloc-"
255 "1g1fqa37xkjp9lp6lrwxrbfgashcink769ll505zvcwnxx2nlvsw"))))
256 (build-system gnu-build-system)
259 (modify-phases %standard-phases
261 (lambda* (#:key outputs #:allow-other-keys)
262 ;; talloc uses a custom configuration script that runs a Python
263 ;; script called 'waf', and doesn't tolerate unknown options.
264 (setenv "CONFIG_SHELL" (which "sh"))
265 (let ((out (assoc-ref outputs "out")))
266 (invoke "./configure"
267 (string-append "--prefix=" out))))))))
271 `(("python" ,python)))
272 (home-page "https://talloc.samba.org")
273 (synopsis "Hierarchical, reference counted memory pool system")
275 "Talloc is a hierarchical, reference counted memory pool system with
276 destructors. It is the core memory allocator used in Samba.")
277 (license gpl3+))) ;; The bundled "replace" library uses LGPL3.
279 (define-public talloc/static
282 (name "talloc-static")
284 "Hierarchical, reference counted memory pool system (static library)")
286 (substitute-keyword-arguments (package-arguments talloc)
288 ;; Since Waf, the build system talloc uses, apparently does not
289 ;; support building static libraries from a ./configure flag, roll our
290 ;; own build process. No need to be ashamed, we're not the only ones
292 ;; <https://github.com/proot-me/proot-static-build/blob/master/GNUmakefile>.
294 `(modify-phases ,phases
297 (invoke "gcc" "-c" "-Ibin/default" "-I" "lib/replace"
298 "-I." "-Wall" "-g" "-D__STDC_WANT_LIB_EXT1__=1"
300 (invoke "ar" "rc" "libtalloc.a" "talloc.o")))
302 (lambda* (#:key outputs #:allow-other-keys)
303 (let* ((out (assoc-ref outputs "out"))
304 (lib (string-append out "/lib"))
305 (include (string-append out "/include")))
307 (install-file "libtalloc.a" lib)
308 (install-file "talloc.h" include)
310 (delete 'check))))))) ;XXX: tests rely on Python modules
312 (define-public tevent
318 (uri (string-append "https://www.samba.org/ftp/tevent/tevent-"
322 "1rm4d9245ya15wyrh9vqn1dnz14l2ic88mr46ykyc6kdrl99dwrk"))))
323 (build-system gnu-build-system)
326 (modify-phases %standard-phases
328 ;; tevent uses a custom configuration script that runs waf.
329 (lambda* (#:key outputs #:allow-other-keys)
330 (let ((out (assoc-ref outputs "out")))
331 (invoke "./configure"
332 (string-append "--prefix=" out)
333 "--bundled-libraries=NONE")))))))
335 `(("pkg-config" ,pkg-config)
339 `(("talloc" ,talloc))) ; required by tevent.pc
340 (synopsis "Event system library")
341 (home-page "https://tevent.samba.org/")
343 "Tevent is an event system based on the talloc memory management library.
344 It is the core event system used in Samba. The low level tevent has support for
345 many event types, including timers, signals, and the classic file descriptor events.")
354 (uri (string-append "https://www.samba.org/ftp/ldb/ldb-"
358 "01livdy3g073bm6xnc8zqnqrxg53sw8q66d1903z62hd6g87whsa"))
359 (modules '((guix build utils)))
362 (for-each (lambda (file)
363 ;; Delete everything except the build tools.
364 (unless (or (string-prefix? "third_party/waf" file)
365 (string-suffix? "wscript" file))
367 (find-files "third_party"))
369 (build-system gnu-build-system)
371 '(;; LMDB is only supported on 64-bit systems, yet the test suite
373 #:tests? (assoc-ref %build-inputs "lmdb")
375 (modify-phases %standard-phases
377 ;; ldb use a custom configuration script that runs waf.
378 (lambda* (#:key outputs #:allow-other-keys)
379 (let ((out (assoc-ref outputs "out")))
380 (invoke "./configure"
381 (string-append "--prefix=" out)
382 (string-append "--with-modulesdir=" out
384 "--bundled-libraries=NONE")))))))
387 ("pkg-config" ,pkg-config)
391 ;; ldb.pc refers to all these.
395 `(,@(if (target-64bit?)
400 (synopsis "LDAP-like embedded database")
401 (home-page "https://ldb.samba.org/")
403 "Ldb is a LDAP-like embedded database built on top of TDB. What ldb does
404 is provide a fast database with an LDAP-like API designed to be used within an
405 application. In some ways it can be seen as a intermediate solution between
406 key-value pair databases and a real LDAP database.")
415 (uri (string-append "https://www.samba.org/ftp/ppp/ppp-"
419 ;; Use OpenSSL for cryptography instead of the obsolete glibc
420 ;; crypto functions that were removed in glibc 2.28.
422 (uri (string-append "https://github.com/paulusmack/ppp/commit/"
423 "3c7b86229f7bd2600d74db14b1fe5b3896be3875"
425 (file-name "ppp-use-openssl-crypto.patch")
428 "0qlbi247lx3injpy8a1gcij9yilik0vfaibkpvdp88k3sa1rs69z")))))
431 "0c7vrjxl52pdwi4ckrvfjr08b31lfpgwf3pp0cqy76a77vfs7q02"))))
432 (build-system gnu-build-system)
434 '(#:tests? #f ; no check target
435 #:make-flags '("CC=gcc")
437 (modify-phases %standard-phases
438 (add-before 'configure 'patch-Makefile
439 (lambda* (#:key inputs #:allow-other-keys)
440 (let ((libc (assoc-ref inputs "libc"))
441 (openssl (assoc-ref inputs "openssl"))
442 (libpcap (assoc-ref inputs "libpcap")))
443 (substitute* "pppd/Makefile.linux"
444 (("/usr/include/crypt\\.h")
445 (string-append libc "/include/crypt.h"))
446 (("/usr/include/openssl")
447 (string-append openssl "/include/openssl"))
448 (("/usr/include/pcap-bpf.h")
449 (string-append libpcap "/include/pcap-bpf.h")))
452 `(("libpcap" ,libpcap)
453 ("openssl" ,(@ (gnu packages tls) openssl))))
454 (synopsis "Implementation of the Point-to-Point Protocol")
455 (home-page "https://ppp.samba.org/")
457 "The Point-to-Point Protocol (PPP) provides a standard way to establish
458 a network connection over a serial link. At present, this package supports IP
459 and IPV6 and the protocols layered above them, such as TCP and UDP.")
460 ;; pppd, pppstats and pppdump are under BSD-style notices.
461 ;; some of the pppd plugins are GPL'd.
462 ;; chat is public domain.
463 (license (list bsd-3 bsd-4 gpl2+ public-domain))))