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 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 tls)
55 #:use-module (gnu packages web)
56 #:use-module (gnu packages xml))
58 (define-public cifs-utils
65 (uri (string-append "https://download.samba.org/pub/linux-cifs/"
66 "cifs-utils/cifs-utils-" version ".tar.bz2"))
68 "19q4b5bzlxhn1hpi843xrp6f50d33w7m0rs26krkg5h3x742kz4j"))))
69 (build-system gnu-build-system)
71 `(("autoconf" ,autoconf)
72 ("automake" ,automake)
73 ("pkg-config" ,pkg-config)))
75 `(("keytuils" ,keyutils)
76 ("linux-pam" ,linux-pam)
77 ("libcap-ng" ,libcap-ng)
78 ("mit-krb5" ,mit-krb5)
83 (modify-phases %standard-phases
85 ;; Force a bootstrap to fix a ‘cannot find install-sh, install.sh,
86 ;; or shtool’ error since version 6.10.
88 (invoke "autoreconf" "-vfi")
90 (add-before 'configure 'set-root-sbin
91 (lambda* (#:key outputs #:allow-other-keys)
92 ;; Don't try to install into "/sbin".
94 (string-append (assoc-ref outputs "out") "/sbin"))
96 (add-before 'install 'create-man8dir
97 ;; Create a directory that isn't created since version 6.10.
98 (lambda* (#:key outputs #:allow-other-keys)
99 (let ((out (assoc-ref outputs "out")))
100 (mkdir-p (string-append out "/share/man/man8"))
102 (synopsis "User-space utilities for Linux CIFS (Samba) mounts")
103 (description "@code{cifs-utils} is a set of user-space utilities for
104 mounting and managing @dfn{Common Internet File System} (CIFS) shares using
105 the Linux kernel CIFS client.")
106 (home-page "https://wiki.samba.org/index.php/LinuxCIFS_utils")
107 ;; cifs-utils is licensed as GPL3 or later, but 3 files contain LGPL code.
110 (define-public iniparser
117 (url "https://github.com/ndevilla/iniparser")
118 (commit (string-append "v" version))))
119 (file-name (git-file-name name version))
122 "0dhab6pad6wh816lr7r3jb6z273njlgw2vpw8kcfnmi7ijaqhnr5"))))
123 (build-system gnu-build-system)
128 (modify-phases %standard-phases
130 (lambda* (#:key outputs #:allow-other-keys)
131 (substitute* '("Makefile" "test/Makefile")
133 (string-append (assoc-ref outputs "out") "/lib")))
136 (lambda* (#:key make-flags #:allow-other-keys)
137 (apply invoke "make" "libiniparser.so.1"
140 (lambda* (#:key outputs #:allow-other-keys)
141 (let* ((out (assoc-ref outputs "out"))
142 (lib (string-append out "/lib"))
143 (inc (string-append out "/include"))
144 (doc (string-append out "/share/doc/" ,name))
145 (html (string-append doc "/html")))
146 (define (install dir)
148 (install-file file dir)))
149 (for-each (install lib)
150 (find-files "." "^lib.*\\.so"))
151 (with-directory-excursion lib
152 (symlink "libiniparser.so.1" "libiniparser.so"))
153 (for-each (install inc)
154 (find-files "src" "\\.h$"))
155 (for-each (install html)
156 (find-files "html" ".*"))
157 (for-each (install doc)
158 '("AUTHORS" "INSTALL" "LICENSE" "README.md"))
160 (home-page "https://github.com/ndevilla/iniparser")
161 (synopsis "Standalone ini file parsing library")
163 "iniparser is a free stand-alone @code{ini} file parsing library (Windows
164 configuration files). It is written in portable ANSI C and should compile
174 (uri (string-append "https://download.samba.org/pub/samba/stable/"
175 "samba-" version ".tar.gz"))
178 "0f7g17zw4nzk1bjnqqrr84hkyq9vn0k7zyim2i177xkigd6qyhwi"))))
179 (build-system gnu-build-system)
182 (modify-phases %standard-phases
183 (add-before 'configure 'locate-docbook-stylesheets
184 (lambda* (#:key inputs #:allow-other-keys)
185 ;; XXX for some reason XML_CATALOG_FILES is not respected.
186 (substitute* '("buildtools/wafsamba/samba_conftests.py"
187 "buildtools/wafsamba/wafsamba.py"
188 "docs-xml/xslt/man.xsl")
189 (("http://docbook.sourceforge.net/release/xsl/current/")
190 (string-append (assoc-ref inputs "docbook-xsl")
191 "/xml/xsl/docbook-xsl-"
192 ,(package-version docbook-xsl) "/")))
195 ;; samba uses a custom configuration script that runs waf.
196 (lambda* (#:key outputs #:allow-other-keys)
197 (let* ((out (assoc-ref outputs "out"))
198 (libdir (string-append out "/lib")))
199 (invoke "./configure"
201 ;; XXX: heimdal not packaged.
202 "--bundled-libraries=com_err"
203 (string-append "--prefix=" out)
205 ;; Install public and private libraries into
206 ;; a single directory to avoid RPATH issues.
207 (string-append "--libdir=" libdir)
208 (string-append "--with-privatelibdir=" libdir)))))
209 (add-before 'install 'disable-etc-samba-directory-creation
211 (substitute* "dynconfig/wscript"
212 (("bld\\.INSTALL_DIR\\(\"\\$\\{CONFIGDIR\\}\"\\)")
215 ;; XXX: The test infrastructure attempts to set password with
216 ;; smbpasswd, which fails with "smbpasswd -L can only be used by root."
217 ;; So disable tests until there's a workaround.
219 (inputs ; TODO: Add missing dependencies
225 ("iniparser" ,iniparser)
228 ("libarchive" ,libarchive)
229 ("linux-pam" ,linux-pam)
231 ("openldap" ,openldap)
233 ("readline" ,readline)
236 ;; In Requires or Requires.private of pkg-config files.
241 `(("docbook-xsl" ,docbook-xsl) ;for generating manpages
242 ("xsltproc" ,libxslt) ;ditto
243 ("rpcsvc-proto" ,rpcsvc-proto) ;for 'rpcgen'
245 ("pkg-config" ,pkg-config)
247 (home-page "https://www.samba.org/")
249 "The standard Windows interoperability suite of programs for GNU and Unix")
251 "Since 1992, Samba has provided secure, stable and fast file and print
252 services for all clients using the SMB/CIFS protocol, such as all versions of
253 DOS and Windows, OS/2, GNU/Linux and many others.
255 Samba is an important component to seamlessly integrate Linux/Unix Servers and
256 Desktops into Active Directory environments using the winbind daemon.")
259 (define-public talloc
265 (uri (string-append "https://www.samba.org/ftp/talloc/talloc-"
269 "0xwzgzrqamfdlklwacp9d219pqkah0yfrhxb1j7bxlmgzp924j7g"))))
270 (build-system gnu-build-system)
273 (modify-phases %standard-phases
275 (lambda* (#:key outputs #:allow-other-keys)
276 ;; talloc uses a custom configuration script that runs a Python
277 ;; script called 'waf', and doesn't tolerate unknown options.
278 (setenv "CONFIG_SHELL" (which "sh"))
279 (let ((out (assoc-ref outputs "out")))
280 (invoke "./configure"
281 (string-append "--prefix=" out))))))))
285 `(("python" ,python)))
286 (home-page "https://talloc.samba.org")
287 (synopsis "Hierarchical, reference counted memory pool system")
289 "Talloc is a hierarchical, reference counted memory pool system with
290 destructors. It is the core memory allocator used in Samba.")
291 (license gpl3+))) ;; The bundled "replace" library uses LGPL3.
293 (define-public talloc/static
296 (name "talloc-static")
298 "Hierarchical, reference counted memory pool system (static library)")
300 (substitute-keyword-arguments (package-arguments talloc)
302 ;; Since Waf, the build system talloc uses, apparently does not
303 ;; support building static libraries from a ./configure flag, roll our
304 ;; own build process. No need to be ashamed, we're not the only ones
306 ;; <https://github.com/proot-me/proot-static-build/blob/master/GNUmakefile>.
308 `(modify-phases ,phases
311 (invoke "gcc" "-c" "-Ibin/default" "-I" "lib/replace"
312 "-I." "-Wall" "-g" "-D__STDC_WANT_LIB_EXT1__=1"
314 (invoke "ar" "rc" "libtalloc.a" "talloc.o")))
316 (lambda* (#:key outputs #:allow-other-keys)
317 (let* ((out (assoc-ref outputs "out"))
318 (lib (string-append out "/lib"))
319 (include (string-append out "/include")))
321 (install-file "libtalloc.a" lib)
322 (install-file "talloc.h" include)
324 (delete 'check))))))) ;XXX: tests rely on Python modules
326 (define-public tevent
332 (uri (string-append "https://www.samba.org/ftp/tevent/tevent-"
336 "15k6i8ad5lpxfjsjyq9h64zlyws8d3cm0vwdnaw8z1xjwli7hhpq"))))
337 (build-system gnu-build-system)
340 (modify-phases %standard-phases
342 ;; tevent uses a custom configuration script that runs waf.
343 (lambda* (#:key outputs #:allow-other-keys)
344 (let ((out (assoc-ref outputs "out")))
345 (invoke "./configure"
346 (string-append "--prefix=" out)
347 "--bundled-libraries=NONE")))))))
349 `(("pkg-config" ,pkg-config)
353 `(("talloc" ,talloc))) ; required by tevent.pc
354 (synopsis "Event system library")
355 (home-page "https://tevent.samba.org/")
357 "Tevent is an event system based on the talloc memory management library.
358 It is the core event system used in Samba. The low level tevent has support for
359 many event types, including timers, signals, and the classic file descriptor events.")
368 (uri (string-append "https://www.samba.org/ftp/ldb/ldb-"
372 "0nwpkqidsna4yz3vhjzzadm4hpviwnyk80yml8ay82gi1d6lg0pz"))
373 (modules '((guix build utils)))
376 (for-each (lambda (file)
377 ;; Delete everything except the build tools.
378 (unless (or (string-prefix? "third_party/waf" file)
379 (string-suffix? "wscript" file))
381 (find-files "third_party"))
383 (build-system gnu-build-system)
385 '(;; LMDB is only supported on 64-bit systems, yet the test suite
387 #:tests? (assoc-ref %build-inputs "lmdb")
389 (modify-phases %standard-phases
391 ;; ldb use a custom configuration script that runs waf.
392 (lambda* (#:key outputs #:allow-other-keys)
393 (let ((out (assoc-ref outputs "out")))
394 (invoke "./configure"
395 (string-append "--prefix=" out)
396 (string-append "--with-modulesdir=" out
398 "--bundled-libraries=NONE")))))))
401 ("pkg-config" ,pkg-config)
405 ;; ldb.pc refers to all these.
409 `(,@(if (target-64bit?)
414 (synopsis "LDAP-like embedded database")
415 (home-page "https://ldb.samba.org/")
417 "Ldb is a LDAP-like embedded database built on top of TDB. What ldb does
418 is provide a fast database with an LDAP-like API designed to be used within an
419 application. In some ways it can be seen as a intermediate solution between
420 key-value pair databases and a real LDAP database.")
430 (url "https://github.com/paulusmack/ppp")
431 (commit (string-append "ppp-" version))))
432 (file-name (git-file-name name version))
435 "1i88m79h6g3fzsb4yw3k8bq1grsx3hsyawm7id2vcaab0gfqzjjv"))))
436 (build-system gnu-build-system)
438 '(#:tests? #f ; no check target
439 #:make-flags '("CC=gcc")
441 (modify-phases %standard-phases
442 (add-before 'configure 'patch-Makefile
443 (lambda* (#:key inputs #:allow-other-keys)
444 (let ((libc (assoc-ref inputs "libc"))
445 (openssl (assoc-ref inputs "openssl"))
446 (libpcap (assoc-ref inputs "libpcap")))
447 (substitute* "pppd/Makefile.linux"
448 (("/usr/include/crypt\\.h")
449 (string-append libc "/include/crypt.h"))
450 (("/usr/include/openssl")
451 (string-append openssl "/include/openssl"))
452 (("/usr/include/pcap-bpf.h")
453 (string-append libpcap "/include/pcap-bpf.h")))
456 `(("libpcap" ,libpcap)
457 ("openssl" ,(@ (gnu packages tls) openssl))))
458 (synopsis "Implementation of the Point-to-Point Protocol")
459 (home-page "https://ppp.samba.org/")
461 "The Point-to-Point Protocol (PPP) provides a standard way to establish
462 a network connection over a serial link. At present, this package supports IP
463 and IPV6 and the protocols layered above them, such as TCP and UDP.")
464 ;; pppd, pppstats and pppdump are under BSD-style notices.
465 ;; some of the pppd plugins are GPL'd.
466 ;; chat is public domain.
467 (license (list bsd-3 bsd-4 gpl2+ public-domain))))