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 Marius Bakke <mbakke@fastmail.com>
9 ;;; This file is part of GNU Guix.
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24 (define-module (gnu packages samba)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix build-system gnu)
28 #:use-module (guix licenses)
29 #:use-module (guix utils)
30 #:use-module (gnu packages acl)
31 #:use-module (gnu packages admin)
32 #:use-module (gnu packages autotools)
33 #:use-module (gnu packages check)
34 #:use-module (gnu packages crypto)
35 #:use-module (gnu packages cups)
36 #:use-module (gnu packages databases)
37 #:use-module (gnu packages docbook)
38 #:use-module (gnu packages tls)
39 #:use-module (gnu packages popt)
40 #:use-module (gnu packages pkg-config)
41 #:use-module (gnu packages openldap)
42 #:use-module (gnu packages readline)
43 #:use-module (gnu packages kerberos)
44 #:use-module (gnu packages linux)
45 #:use-module (gnu packages perl)
46 #:use-module (gnu packages python)
47 #:use-module (gnu packages xml))
49 (define-public cifs-utils
56 (uri (string-append "https://download.samba.org/pub/linux-cifs/"
57 name "/" name "-" version ".tar.bz2"))
59 "1ayghnkryy1n1zm5dyvyyr7n3807nsm6glfcbbki5c2a8w91dwmj"))))
60 (build-system gnu-build-system)
62 `(("autoconf" ,autoconf)
63 ("automake" ,automake)
64 ("pkg-config" ,pkg-config)))
66 `(("keytuils" ,keyutils)
67 ("linux-pam" ,linux-pam)
68 ("libcap-ng" ,libcap-ng)
69 ("mit-krb5" ,mit-krb5)
74 (modify-phases %standard-phases
75 ;; The 6.7 tarball is missing ‘install.sh’. Create it.
76 (add-after 'unpack 'autoreconf
78 (zero? (system* "autoreconf" "-i"))))
79 (add-before 'configure 'set-root-sbin
80 (lambda _ ; Don't try to install in "/sbin".
82 (string-append (assoc-ref %outputs "out") "/sbin"))
84 (synopsis "User-space utilities for Linux CIFS (Samba) mounts")
85 (description "@code{cifs-utils} is a set of user-space utilities for
86 mounting and managing @dfn{Common Internet File System} (CIFS) shares using
87 the Linux kernel CIFS client.")
88 (home-page "https://wiki.samba.org/index.php/LinuxCIFS_utils")
89 ;; cifs-utils is licensed as GPL3 or later, but 3 files contain LGPL code.
92 (define-public iniparser
98 (uri (string-append "https://github.com/ndevilla/iniparser/archive/v"
100 (file-name (string-append name "-" version ".tar.gz"))
103 "1flj7srvh2hp9ls96qz922bklyhw7f27mmn23b16839zpdjddfz0"))))
104 (build-system gnu-build-system)
107 (modify-phases %standard-phases
109 (lambda* (#:key outputs #:allow-other-keys)
110 (substitute* '("Makefile" "test/Makefile")
112 (string-append (assoc-ref outputs "out") "/lib"))
113 (("\\?= gcc") "= gcc"))))
116 (and (zero? (system* "make" "libiniparser.so"))
117 (symlink "libiniparser.so.0" "libiniparser.so"))))
119 (lambda* (#:key outputs #:allow-other-keys)
120 (let* ((out (assoc-ref outputs "out"))
121 (lib (string-append out "/lib"))
122 (inc (string-append out "/include"))
123 (doc (string-append out "/share/doc"))
124 (html (string-append doc "/html")))
128 (string-append dir "/"
132 (find-files "." "^lib.*\\.(so\\.|a)"))
133 (with-directory-excursion lib
134 (symlink "libiniparser.so.0" "libiniparser.so"))
137 (find-files "src" "\\.h$"))
139 (for-each (copy html)
140 (find-files "html" ".*"))
142 '("AUTHORS" "INSTALL" "LICENSE" "README.md"))))))))
143 (home-page "http://ndevilla.free.fr/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 "0b7xbfjpg7l1lz13gvj4ifcp9j3cvfp6pswjbq03z06bl4n1br06"))))
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")))
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_DIRS\\(\"\",[[:blank:]]{1,}\"\\$\\{CONFIGDIR\\}[[:blank:]]{1,}")
197 "bld.INSTALL_DIRS(\"\", \""))
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
208 ("iniparser" ,iniparser)
211 ("linux-pam" ,linux-pam)
212 ("openldap" ,openldap)
214 ("readline" ,readline)
219 `(("docbook-xsl" ,docbook-xsl) ;for generating manpages
220 ("xsltproc" ,libxslt) ;ditto
222 ("pkg-config" ,pkg-config)
223 ("python" ,python-2))) ; incompatible with Python 3
224 (home-page "https://www.samba.org/")
226 "The standard Windows interoperability suite of programs for GNU and Unix")
228 "Since 1992, Samba has provided secure, stable and fast file and print
229 services for all clients using the SMB/CIFS protocol, such as all versions of
230 DOS and Windows, OS/2, GNU/Linux and many others.
232 Samba is an important component to seamlessly integrate Linux/Unix Servers and
233 Desktops into Active Directory environments using the winbind daemon.")
236 (define-public talloc
242 (uri (string-append "https://www.samba.org/ftp/talloc/talloc-"
246 "06gn45if56g81vbj3841fzdjsahrrczwqpfrydm2zv6nxd5yk1f9"))))
247 (build-system gnu-build-system)
250 (modify-phases %standard-phases
252 (lambda* (#:key outputs #:allow-other-keys)
253 ;; test_magic_differs.sh has syntax error, and is not in the right
254 ;; place where wscript expected.
256 (substitute* "wscript"
257 (("magic_ret = .*") "magic_ret = 0\n"))
258 ;; talloc uses a custom configuration script that runs a
259 ;; python script called 'waf'.
260 (setenv "CONFIG_SHELL" (which "sh"))
261 (let ((out (assoc-ref outputs "out")))
262 (zero? (system* "./configure"
263 (string-append "--prefix=" out)))))))))
265 `(("python" ,python-2)))
266 (home-page "https://talloc.samba.org")
267 (synopsis "Hierarchical, reference counted memory pool system")
269 "Talloc is a hierarchical, reference counted memory pool system with
270 destructors. It is the core memory allocator used in Samba.")
271 (license gpl3+))) ;; The bundled "replace" library uses LGPL3.
273 (define-public talloc/static
276 (name "talloc-static")
278 "Hierarchical, reference counted memory pool system (static library)")
280 (substitute-keyword-arguments (package-arguments talloc)
282 ;; Since Waf, the build system talloc uses, apparently does not
283 ;; support building static libraries from a ./configure flag, roll our
284 ;; own build process. No need to be ashamed, we're not the only ones
286 ;; <https://github.com/proot-me/proot-static-build/blob/master/GNUmakefile>.
288 `(modify-phases ,phases
291 (letrec-syntax ((shell (syntax-rules ()
292 ((_ (command ...) rest ...)
293 (and (zero? (system* command ...))
297 (shell ("gcc" "-c" "-Ibin/default" "-I" "lib/replace"
298 "-I." "-Wall" "-g" "talloc.c")
299 ("ar" "rc" "libtalloc.a" "talloc.o")))))
301 (lambda* (#:key outputs #:allow-other-keys)
302 (let* ((out (assoc-ref outputs "out"))
303 (lib (string-append out "/lib"))
304 (include (string-append out "/include")))
306 (install-file "libtalloc.a" lib)
307 (install-file "talloc.h" include)
309 (delete 'check))))))) ;XXX: tests rely on Python modules
311 (define-public tevent
317 (uri (string-append "https://www.samba.org/ftp/tevent/tevent-"
321 "12kvfjs0dwi4iqbz740a37z0c7kmg8bhl53mwdj02jkznbw3w8bk"))))
322 (build-system gnu-build-system)
325 (modify-phases %standard-phases
327 ;; tevent uses a custom configuration script that runs waf.
328 (lambda* (#:key outputs #:allow-other-keys)
329 (let ((out (assoc-ref outputs "out")))
330 (zero? (system* "./configure"
331 (string-append "--prefix=" out)
332 "--bundled-libraries=NONE"))))))))
334 `(("pkg-config" ,pkg-config)
335 ("python" ,python-2)))
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 "03arsnsbkxb2d811pbarb7d12yg8g05f1q576z48sp647dd3xda4"))))
357 (build-system gnu-build-system)
360 (modify-phases %standard-phases
362 ;; ldb use a custom configuration script that runs waf.
363 (lambda* (#:key outputs #:allow-other-keys)
364 (let ((out (assoc-ref outputs "out")))
365 (zero? (system* "./configure"
366 (string-append "--prefix=" out)
367 (string-append "--with-modulesdir=" out
369 "--bundled-libraries=NONE"))))))))
372 ("pkg-config" ,pkg-config)
373 ("python" ,python-2)))
375 ;; ldb.pc refers to all these.
381 (synopsis "LDAP-like embedded database")
382 (home-page "https://ldb.samba.org/")
384 "Ldb is a LDAP-like embedded database built on top of TDB. What ldb does
385 is provide a fast database with an LDAP-like API designed to be used within an
386 application. In some ways it can be seen as a intermediate solution between
387 key-value pair databases and a real LDAP database.")
396 (uri (string-append "https://www.samba.org/ftp/ppp/ppp-"
400 "0c7vrjxl52pdwi4ckrvfjr08b31lfpgwf3pp0cqy76a77vfs7q02"))))
401 (build-system gnu-build-system)
403 '(#:tests? #f ; no check target
404 #:make-flags '("CC=gcc")
406 (modify-phases %standard-phases
407 (add-before 'configure 'patch-Makefile
408 (lambda* (#:key inputs #:allow-other-keys)
409 (let ((libc (assoc-ref inputs "libc"))
410 (libpcap (assoc-ref inputs "libpcap")))
411 (substitute* "pppd/Makefile.linux"
412 (("/usr/include/crypt\\.h")
413 (string-append libc "/include/crypt.h"))
414 (("/usr/include/pcap-bpf.h")
415 (string-append libpcap "/include/pcap-bpf.h")))))))))
417 `(("libpcap" ,libpcap)))
418 (synopsis "Implementation of the Point-to-Point Protocol")
419 (home-page "https://ppp.samba.org/")
421 "The Point-to-Point Protocol (PPP) provides a standard way to establish
422 a network connection over a serial link. At present, this package supports IP
423 and IPV6 and the protocols layered above them, such as TCP and UDP.")
424 ;; pppd, pppstats and pppdump are under BSD-style notices.
425 ;; some of the pppd plugins are GPL'd.
426 ;; chat is public domain.
427 (license (list bsd-3 bsd-4 gpl2+ public-domain))))