gnu: Fix descriptions to not use quotes.
[jackhill/guix/guix.git] / gnu / packages / samba.scm
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>
10 ;;; Copyright © 2019 Rutger Helling <rhelling@mykolab.com>
11 ;;;
12 ;;; This file is part of GNU Guix.
13 ;;;
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.
18 ;;;
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.
23 ;;;
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/>.
26
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))
55
56 (define-public cifs-utils
57 (package
58 (name "cifs-utils")
59 (version "6.8")
60 (source
61 (origin
62 (method url-fetch)
63 (uri (string-append "https://download.samba.org/pub/linux-cifs/"
64 name "/" name "-" version ".tar.bz2"))
65 (sha256 (base32
66 "0ygz3pagjpaj5ky11hzh4byyymb7fpmqiqkprn11zwj31h2zdlg7"))))
67 (build-system gnu-build-system)
68 (native-inputs
69 `(("autoconf" ,autoconf)
70 ("automake" ,automake)
71 ("pkg-config" ,pkg-config)))
72 (inputs
73 `(("keytuils" ,keyutils)
74 ("linux-pam" ,linux-pam)
75 ("libcap-ng" ,libcap-ng)
76 ("mit-krb5" ,mit-krb5)
77 ("samba" ,samba)
78 ("talloc" ,talloc)))
79 (arguments
80 `(#:phases
81 (modify-phases %standard-phases
82 (add-before 'configure 'set-root-sbin
83 (lambda _ ; Don't try to install in "/sbin".
84 (setenv "ROOTSBINDIR"
85 (string-append (assoc-ref %outputs "out") "/sbin"))
86 #t)))))
87 (synopsis "User-space utilities for Linux CIFS (Samba) mounts")
88 (description "@code{cifs-utils} is a set of user-space utilities for
89 mounting and managing @dfn{Common Internet File System} (CIFS) shares using
90 the Linux kernel CIFS client.")
91 (home-page "https://wiki.samba.org/index.php/LinuxCIFS_utils")
92 ;; cifs-utils is licensed as GPL3 or later, but 3 files contain LGPL code.
93 (license gpl3+)))
94
95 (define-public iniparser
96 (package
97 (name "iniparser")
98 (version "4.1")
99 (source (origin
100 (method url-fetch)
101 (uri (string-append "https://github.com/ndevilla/iniparser/archive/v"
102 version ".tar.gz"))
103 (file-name (string-append name "-" version ".tar.gz"))
104 (sha256
105 (base32
106 "1bpk8dj9d5cl64lg6jsk0qlzrpg848nymwxc3fx707fk1n0al3cn"))))
107 (build-system gnu-build-system)
108 (arguments
109 `(#:make-flags
110 (list "CC=gcc")
111 #:phases
112 (modify-phases %standard-phases
113 (replace 'configure
114 (lambda* (#:key outputs #:allow-other-keys)
115 (substitute* '("Makefile" "test/Makefile")
116 (("/usr/lib")
117 (string-append (assoc-ref outputs "out") "/lib")))
118 #t))
119 (replace 'build
120 (lambda* (#:key make-flags #:allow-other-keys)
121 (apply invoke "make" "libiniparser.so.1"
122 make-flags)))
123 (replace 'install
124 (lambda* (#:key outputs #:allow-other-keys)
125 (let* ((out (assoc-ref outputs "out"))
126 (lib (string-append out "/lib"))
127 (inc (string-append out "/include"))
128 (doc (string-append out "/share/doc/" ,name))
129 (html (string-append doc "/html")))
130 (define (install dir)
131 (lambda (file)
132 (install-file file dir)))
133 (for-each (install lib)
134 (find-files "." "^lib.*\\.so"))
135 (with-directory-excursion lib
136 (symlink "libiniparser.so.1" "libiniparser.so"))
137 (for-each (install inc)
138 (find-files "src" "\\.h$"))
139 (for-each (install html)
140 (find-files "html" ".*"))
141 (for-each (install doc)
142 '("AUTHORS" "INSTALL" "LICENSE" "README.md"))
143 #t))))))
144 (home-page "https://github.com/ndevilla/iniparser")
145 (synopsis "Standalone ini file parsing library")
146 (description
147 "iniparser is a free stand-alone @code{ini} file parsing library (Windows
148 configuration files). It is written in portable ANSI C and should compile
149 anywhere.")
150 (license x11)))
151
152 (define-public samba
153 (package
154 (name "samba")
155 (version "4.10.0")
156 (source (origin
157 (method url-fetch)
158 (uri (string-append "https://download.samba.org/pub/samba/stable/"
159 "samba-" version ".tar.gz"))
160 (sha256
161 (base32
162 "0n1ld77y8sydkpx6l8i2hqa1k7hpkr8df91pg849glc4b85407wz"))))
163 (build-system gnu-build-system)
164 (arguments
165 `(#:phases
166 (modify-phases %standard-phases
167 (add-before 'configure 'locate-docbook-stylesheets
168 (lambda* (#:key inputs #:allow-other-keys)
169 ;; XXX for some reason XML_CATALOG_FILES is not respected.
170 (substitute* '("buildtools/wafsamba/samba_conftests.py"
171 "buildtools/wafsamba/wafsamba.py"
172 "docs-xml/xslt/man.xsl")
173 (("http://docbook.sourceforge.net/release/xsl/current/")
174 (string-append (assoc-ref inputs "docbook-xsl")
175 "/xml/xsl/docbook-xsl-"
176 ,(package-version docbook-xsl) "/")))
177 #t))
178 (replace 'configure
179 ;; samba uses a custom configuration script that runs waf.
180 (lambda* (#:key outputs #:allow-other-keys)
181 (let* ((out (assoc-ref outputs "out"))
182 (libdir (string-append out "/lib")))
183 (invoke "./configure"
184 "--enable-fhs"
185 ;; XXX: heimdal not packaged.
186 "--bundled-libraries=com_err"
187 (string-append "--prefix=" out)
188 "--sysconfdir=/etc"
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
194 (lambda _
195 (substitute* "dynconfig/wscript"
196 (("bld\\.INSTALL_DIR\\(\"\\$\\{CONFIGDIR\\}\"\\)")
197 ""))
198 #t)))
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.
202 #:tests? #f))
203 (inputs ; TODO: Add missing dependencies
204 `(("acl" ,acl)
205 ("cups" ,cups)
206 ;; ("gamin" ,gamin)
207 ("gpgme" ,gpgme)
208 ("gnutls" ,gnutls)
209 ("iniparser" ,iniparser)
210 ("jansson" ,jansson)
211 ("libaio" ,libaio)
212 ("libarchive" ,libarchive)
213 ("linux-pam" ,linux-pam)
214 ("lmdb" ,lmdb)
215 ("openldap" ,openldap)
216 ("popt" ,popt)
217 ("readline" ,readline)
218 ("tdb" ,tdb)))
219 (propagated-inputs
220 ;; In Requires or Requires.private of pkg-config files.
221 `(("ldb" ,ldb)
222 ("talloc" ,talloc)
223 ("tevent" ,tevent)))
224 (native-inputs
225 `(("docbook-xsl" ,docbook-xsl) ;for generating manpages
226 ("xsltproc" ,libxslt) ;ditto
227 ("perl" ,perl)
228 ("pkg-config" ,pkg-config)
229 ("python" ,python)))
230 (home-page "https://www.samba.org/")
231 (synopsis
232 "The standard Windows interoperability suite of programs for GNU and Unix")
233 (description
234 "Since 1992, Samba has provided secure, stable and fast file and print
235 services for all clients using the SMB/CIFS protocol, such as all versions of
236 DOS and Windows, OS/2, GNU/Linux and many others.
237
238 Samba is an important component to seamlessly integrate Linux/Unix Servers and
239 Desktops into Active Directory environments using the winbind daemon.")
240 (license gpl3+)))
241
242 (define-public talloc
243 (package
244 (name "talloc")
245 (version "2.2.0")
246 (source (origin
247 (method url-fetch)
248 (uri (string-append "https://www.samba.org/ftp/talloc/talloc-"
249 version ".tar.gz"))
250 (sha256
251 (base32
252 "1g1fqa37xkjp9lp6lrwxrbfgashcink769ll505zvcwnxx2nlvsw"))))
253 (build-system gnu-build-system)
254 (arguments
255 '(#:phases
256 (modify-phases %standard-phases
257 (replace 'configure
258 (lambda* (#:key outputs #:allow-other-keys)
259 ;; talloc uses a custom configuration script that runs a Python
260 ;; script called 'waf', and doesn't tolerate unknown options.
261 (setenv "CONFIG_SHELL" (which "sh"))
262 (let ((out (assoc-ref outputs "out")))
263 (invoke "./configure"
264 (string-append "--prefix=" out))))))))
265 (native-inputs
266 `(("which" ,which)))
267 (inputs
268 `(("python" ,python)))
269 (home-page "https://talloc.samba.org")
270 (synopsis "Hierarchical, reference counted memory pool system")
271 (description
272 "Talloc is a hierarchical, reference counted memory pool system with
273 destructors. It is the core memory allocator used in Samba.")
274 (license gpl3+))) ;; The bundled "replace" library uses LGPL3.
275
276 (define-public talloc/static
277 (package
278 (inherit talloc)
279 (name "talloc-static")
280 (synopsis
281 "Hierarchical, reference counted memory pool system (static library)")
282 (arguments
283 (substitute-keyword-arguments (package-arguments talloc)
284 ((#:phases phases)
285 ;; Since Waf, the build system talloc uses, apparently does not
286 ;; support building static libraries from a ./configure flag, roll our
287 ;; own build process. No need to be ashamed, we're not the only ones
288 ;; doing that:
289 ;; <https://github.com/proot-me/proot-static-build/blob/master/GNUmakefile>.
290 ;; :-)
291 `(modify-phases ,phases
292 (replace 'build
293 (lambda _
294 (invoke "gcc" "-c" "-Ibin/default" "-I" "lib/replace"
295 "-I." "-Wall" "-g" "-D__STDC_WANT_LIB_EXT1__=1"
296 "talloc.c")
297 (invoke "ar" "rc" "libtalloc.a" "talloc.o")))
298 (replace 'install
299 (lambda* (#:key outputs #:allow-other-keys)
300 (let* ((out (assoc-ref outputs "out"))
301 (lib (string-append out "/lib"))
302 (include (string-append out "/include")))
303 (mkdir-p lib)
304 (install-file "libtalloc.a" lib)
305 (install-file "talloc.h" include)
306 #t)))
307 (delete 'check))))))) ;XXX: tests rely on Python modules
308
309 (define-public tevent
310 (package
311 (name "tevent")
312 (version "0.10.0")
313 (source (origin
314 (method url-fetch)
315 (uri (string-append "https://www.samba.org/ftp/tevent/tevent-"
316 version ".tar.gz"))
317 (sha256
318 (base32
319 "1rm4d9245ya15wyrh9vqn1dnz14l2ic88mr46ykyc6kdrl99dwrk"))))
320 (build-system gnu-build-system)
321 (arguments
322 '(#:phases
323 (modify-phases %standard-phases
324 (replace 'configure
325 ;; tevent uses a custom configuration script that runs waf.
326 (lambda* (#:key outputs #:allow-other-keys)
327 (let ((out (assoc-ref outputs "out")))
328 (invoke "./configure"
329 (string-append "--prefix=" out)
330 "--bundled-libraries=NONE")))))))
331 (native-inputs
332 `(("pkg-config" ,pkg-config)
333 ("python" ,python)
334 ("which" ,which)))
335 (propagated-inputs
336 `(("talloc" ,talloc))) ; required by tevent.pc
337 (synopsis "Event system library")
338 (home-page "https://tevent.samba.org/")
339 (description
340 "Tevent is an event system based on the talloc memory management library.
341 It is the core event system used in Samba. The low level tevent has support for
342 many event types, including timers, signals, and the classic file descriptor events.")
343 (license lgpl3+)))
344
345 (define-public ldb
346 (package
347 (name "ldb")
348 (version "1.6.3")
349 (source (origin
350 (method url-fetch)
351 (uri (string-append "https://www.samba.org/ftp/ldb/ldb-"
352 version ".tar.gz"))
353 (sha256
354 (base32
355 "01livdy3g073bm6xnc8zqnqrxg53sw8q66d1903z62hd6g87whsa"))
356 (modules '((guix build utils)))
357 (snippet
358 '(begin
359 (for-each (lambda (file)
360 ;; Delete everything except the build tools.
361 (unless (or (string-prefix? "third_party/waf" file)
362 (string-suffix? "wscript" file))
363 (delete-file file)))
364 (find-files "third_party"))
365 #t))))
366 (build-system gnu-build-system)
367 (arguments
368 '(;; LMDB is only supported on 64-bit systems, yet the test suite
369 ;; requires it.
370 #:tests? (assoc-ref %build-inputs "lmdb")
371 #:phases
372 (modify-phases %standard-phases
373 (replace 'configure
374 ;; ldb use a custom configuration script that runs waf.
375 (lambda* (#:key outputs #:allow-other-keys)
376 (let ((out (assoc-ref outputs "out")))
377 (invoke "./configure"
378 (string-append "--prefix=" out)
379 (string-append "--with-modulesdir=" out
380 "/lib/ldb/modules")
381 "--bundled-libraries=NONE")))))))
382 (native-inputs
383 `(("cmocka" ,cmocka)
384 ("pkg-config" ,pkg-config)
385 ("python" ,python)
386 ("which" ,which)))
387 (propagated-inputs
388 ;; ldb.pc refers to all these.
389 `(("talloc" ,talloc)
390 ("tdb" ,tdb)))
391 (inputs
392 `(,@(if (target-64bit?)
393 `(("lmdb" ,lmdb))
394 '())
395 ("popt" ,popt)
396 ("tevent" ,tevent)))
397 (synopsis "LDAP-like embedded database")
398 (home-page "https://ldb.samba.org/")
399 (description
400 "Ldb is a LDAP-like embedded database built on top of TDB. What ldb does
401 is provide a fast database with an LDAP-like API designed to be used within an
402 application. In some ways it can be seen as a intermediate solution between
403 key-value pair databases and a real LDAP database.")
404 (license lgpl3+)))
405
406 (define-public ppp
407 (package
408 (name "ppp")
409 (version "2.4.7")
410 (source (origin
411 (method url-fetch)
412 (uri (string-append "https://www.samba.org/ftp/ppp/ppp-"
413 version ".tar.gz"))
414 (patches
415 (list (origin
416 ;; Use OpenSSL for cryptography instead of the obsolete glibc
417 ;; crypto functions that were removed in glibc 2.28.
418 (method url-fetch)
419 (uri (string-append "https://github.com/paulusmack/ppp/commit/"
420 "3c7b86229f7bd2600d74db14b1fe5b3896be3875"
421 ".patch"))
422 (file-name "ppp-use-openssl-crypto.patch")
423 (sha256
424 (base32
425 "0qlbi247lx3injpy8a1gcij9yilik0vfaibkpvdp88k3sa1rs69z")))))
426 (sha256
427 (base32
428 "0c7vrjxl52pdwi4ckrvfjr08b31lfpgwf3pp0cqy76a77vfs7q02"))))
429 (build-system gnu-build-system)
430 (arguments
431 '(#:tests? #f ; no check target
432 #:make-flags '("CC=gcc")
433 #:phases
434 (modify-phases %standard-phases
435 (add-before 'configure 'patch-Makefile
436 (lambda* (#:key inputs #:allow-other-keys)
437 (let ((libc (assoc-ref inputs "libc"))
438 (openssl (assoc-ref inputs "openssl"))
439 (libpcap (assoc-ref inputs "libpcap")))
440 (substitute* "pppd/Makefile.linux"
441 (("/usr/include/crypt\\.h")
442 (string-append libc "/include/crypt.h"))
443 (("/usr/include/openssl")
444 (string-append openssl "/include/openssl"))
445 (("/usr/include/pcap-bpf.h")
446 (string-append libpcap "/include/pcap-bpf.h")))
447 #t))))))
448 (inputs
449 `(("libpcap" ,libpcap)
450 ("openssl" ,(@ (gnu packages tls) openssl))))
451 (synopsis "Implementation of the Point-to-Point Protocol")
452 (home-page "https://ppp.samba.org/")
453 (description
454 "The Point-to-Point Protocol (PPP) provides a standard way to establish
455 a network connection over a serial link. At present, this package supports IP
456 and IPV6 and the protocols layered above them, such as TCP and UDP.")
457 ;; pppd, pppstats and pppdump are under BSD-style notices.
458 ;; some of the pppd plugins are GPL'd.
459 ;; chat is public domain.
460 (license (list bsd-3 bsd-4 gpl2+ public-domain))))