gnu: libretro-lowresnx: Update to 1.2.
[jackhill/guix/guix.git] / gnu / packages / samba.scm
CommitLineData
a40f1543 1;;; GNU Guix --- Functional package management for GNU
602db62c 2;;; Copyright © 2013, 2015, 2017 Ludovic Courtès <ludo@gnu.org>
baece08a 3;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
d177ac2d 4;;; Copyright © 2016, 2017, 2019 Efraim Flashner <efraim@flashner.co.il>
c4514744 5;;; Copyright © 2016 Adonay "adfeno" Felipe Nogueira <https://libreplanet.org/wiki/User:Adfeno> <adfeno@openmailbox.org>
b4dcfce5 6;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
dfe5beb2 7;;; Copyright © 2017, 2018, 2020 Marius Bakke <mbakke@fastmail.com>
43cb64d0 8;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
2b61cd37 9;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
bcf66fc2 10;;; Copyright © 2019 Rutger Helling <rhelling@mykolab.com>
a2b25890 11;;; Copyright © 2020 Pierre Langlois <pierre.langlois@gmx.com>
0c96afe9 12;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
a40f1543
LC
13;;;
14;;; This file is part of GNU Guix.
15;;;
16;;; GNU Guix is free software; you can redistribute it and/or modify it
17;;; under the terms of the GNU General Public License as published by
18;;; the Free Software Foundation; either version 3 of the License, or (at
19;;; your option) any later version.
20;;;
21;;; GNU Guix is distributed in the hope that it will be useful, but
22;;; WITHOUT ANY WARRANTY; without even the implied warranty of
23;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24;;; GNU General Public License for more details.
25;;;
26;;; You should have received a copy of the GNU General Public License
27;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
28
29(define-module (gnu packages samba)
30 #:use-module (guix packages)
31 #:use-module (guix download)
d177ac2d 32 #:use-module (guix git-download)
a40f1543
LC
33 #:use-module (guix build-system gnu)
34 #:use-module (guix licenses)
602db62c 35 #:use-module (guix utils)
d3456739 36 #:use-module (gnu packages)
a40f1543 37 #:use-module (gnu packages acl)
ae916e02 38 #:use-module (gnu packages admin)
b4dcfce5 39 #:use-module (gnu packages autotools)
44eff75e 40 #:use-module (gnu packages backup)
966c56f8 41 #:use-module (gnu packages base)
fbed1501 42 #:use-module (gnu packages check)
b4dcfce5 43 #:use-module (gnu packages crypto)
710964d1 44 #:use-module (gnu packages cups)
52513595 45 #:use-module (gnu packages databases)
cb1e0cfc 46 #:use-module (gnu packages docbook)
0c96afe9 47 #:use-module (gnu packages glib)
3185c29a 48 #:use-module (gnu packages gnome)
44eff75e 49 #:use-module (gnu packages gnupg)
b4dcfce5 50 #:use-module (gnu packages kerberos)
a40f1543 51 #:use-module (gnu packages linux)
2f15e0a1 52 #:use-module (gnu packages onc-rpc)
17074cae 53 #:use-module (gnu packages openldap)
a40f1543 54 #:use-module (gnu packages perl)
17074cae
MB
55 #:use-module (gnu packages pkg-config)
56 #:use-module (gnu packages popt)
cb1e0cfc 57 #:use-module (gnu packages python)
17074cae 58 #:use-module (gnu packages readline)
2760d104 59 #:use-module (gnu packages time)
17074cae 60 #:use-module (gnu packages tls)
44eff75e 61 #:use-module (gnu packages web)
cb1e0cfc 62 #:use-module (gnu packages xml))
a40f1543 63
b4dcfce5
TD
64(define-public cifs-utils
65 (package
66 (name "cifs-utils")
0379b6e8 67 (version "6.13")
b4dcfce5
TD
68 (source
69 (origin
70 (method url-fetch)
71 (uri (string-append "https://download.samba.org/pub/linux-cifs/"
1a0a4a69 72 "cifs-utils/cifs-utils-" version ".tar.bz2"))
b4dcfce5 73 (sha256 (base32
0379b6e8 74 "0mnhcc4ayj2vn2azhk45fnal1hibsv0q2c4ihkxcrjhkhrn7in23"))))
b4dcfce5
TD
75 (build-system gnu-build-system)
76 (native-inputs
77 `(("autoconf" ,autoconf)
78 ("automake" ,automake)
79 ("pkg-config" ,pkg-config)))
80 (inputs
81 `(("keytuils" ,keyutils)
82 ("linux-pam" ,linux-pam)
83 ("libcap-ng" ,libcap-ng)
84 ("mit-krb5" ,mit-krb5)
85 ("samba" ,samba)
86 ("talloc" ,talloc)))
87 (arguments
88 `(#:phases
89 (modify-phases %standard-phases
b4dcfce5 90 (add-before 'configure 'set-root-sbin
7927a0d9 91 (lambda* (#:key outputs #:allow-other-keys)
89ab360e 92 ;; Don't try to install into "/sbin".
b4dcfce5 93 (setenv "ROOTSBINDIR"
7927a0d9 94 (string-append (assoc-ref outputs "out") "/sbin"))
b0a46bcc
TGR
95 #t))
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"))
101 #t))))))
b4dcfce5
TD
102 (synopsis "User-space utilities for Linux CIFS (Samba) mounts")
103 (description "@code{cifs-utils} is a set of user-space utilities for
104mounting and managing @dfn{Common Internet File System} (CIFS) shares using
105the 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.
108 (license gpl3+)))
109
a40f1543
LC
110(define-public iniparser
111 (package
112 (name "iniparser")
a9691718 113 (version "4.1")
a40f1543 114 (source (origin
d177ac2d
EF
115 (method git-fetch)
116 (uri (git-reference
117 (url "https://github.com/ndevilla/iniparser")
118 (commit (string-append "v" version))))
119 (file-name (git-file-name name version))
a40f1543
LC
120 (sha256
121 (base32
d177ac2d 122 "0dhab6pad6wh816lr7r3jb6z273njlgw2vpw8kcfnmi7ijaqhnr5"))))
a40f1543
LC
123 (build-system gnu-build-system)
124 (arguments
cf52c925 125 `(#:make-flags
ebde5cfd 126 (list ,(string-append "CC=" (cc-for-target)))
cf52c925 127 #:phases
2af56bfa
EF
128 (modify-phases %standard-phases
129 (replace 'configure
130 (lambda* (#:key outputs #:allow-other-keys)
131 (substitute* '("Makefile" "test/Makefile")
132 (("/usr/lib")
444173f2
MW
133 (string-append (assoc-ref outputs "out") "/lib")))
134 #t))
2af56bfa 135 (replace 'build
cf52c925 136 (lambda* (#:key make-flags #:allow-other-keys)
a9691718 137 (apply invoke "make" "libiniparser.so.1"
cf52c925 138 make-flags)))
2af56bfa
EF
139 (replace 'install
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"))
33fa13ea 144 (doc (string-append out "/share/doc/" ,name))
2af56bfa 145 (html (string-append doc "/html")))
fa5e6618 146 (define (install dir)
2af56bfa 147 (lambda (file)
fa5e6618
TGR
148 (install-file file dir)))
149 (for-each (install lib)
150 (find-files "." "^lib.*\\.so"))
2af56bfa 151 (with-directory-excursion lib
a9691718 152 (symlink "libiniparser.so.1" "libiniparser.so"))
fa5e6618 153 (for-each (install inc)
2af56bfa 154 (find-files "src" "\\.h$"))
fa5e6618 155 (for-each (install html)
2af56bfa 156 (find-files "html" ".*"))
fa5e6618 157 (for-each (install doc)
444173f2
MW
158 '("AUTHORS" "INSTALL" "LICENSE" "README.md"))
159 #t))))))
a9691718 160 (home-page "https://github.com/ndevilla/iniparser")
ae05ac8f 161 (synopsis "Simple @file{.ini} configuration file parsing library")
a40f1543 162 (description
ae05ac8f
TGR
163 "The iniParser C library reads and writes Windows-style @file{.ini}
164configuration files. These are simple text files with a basic structure
165composed of sections, properties, and values. While not expressive, they
166are easy to read, write, and modify.
167
168The library is small, thread safe, and written in portable ANSI C with no
169external dependencies.")
a40f1543
LC
170 (license x11)))
171
172(define-public samba
173 (package
174 (name "samba")
a3600f8d 175 (version "4.13.4")
2f26e2d6
TGR
176 (source
177 (origin
178 (method url-fetch)
179 (uri (string-append "https://download.samba.org/pub/samba/stable/"
180 "samba-" version ".tar.gz"))
181 (sha256
a3600f8d 182 (base32 "0y2wc7njhyhg055krp878xfv9c3wbhrhzn02d5ich30hyxilrcx1"))
d3456739 183 (patches (search-patches "samba-fix-fcntl-hint-detection.patch"))
2f26e2d6 184 (modules '((guix build utils)))
2760d104
TGR
185 (snippet
186 '(begin
3185c29a
MC
187 ;; XXX: Some bundled libraries (e.g, popt, cmocka) are used from
188 ;; the system, but their bundled sources must be kept as they
189 ;; include the WAF scripts used for detecting them.
2760d104
TGR
190 (delete-file-recursively "third_party/pyiso8601")
191 #t))))
a40f1543
LC
192 (build-system gnu-build-system)
193 (arguments
25e81158
MC
194 `(#:make-flags '("TEST_OPTIONS=--quick") ;some tests are very long
195 #:phases
710964d1 196 (modify-phases %standard-phases
0c96afe9 197 (add-before 'configure 'setup-docbook-stylesheets
cb1e0cfc 198 (lambda* (#:key inputs #:allow-other-keys)
0c96afe9
MC
199 ;; Append Samba's own DTDs to XML_CATALOG_FILES
200 ;; (c.f. docs-xml/build/README).
201 (copy-file "docs-xml/build/catalog.xml.in"
202 "docs-xml/build/catalog.xml")
203 (substitute* "docs-xml/build/catalog.xml"
204 (("/@abs_top_srcdir@")
205 (string-append (getcwd) "/docs-xml")))
206 ;; Honor XML_CATALOG_FILES.
207 (substitute* "buildtools/wafsamba/wafsamba.py"
208 (("XML_CATALOG_FILES=\"\\$\\{SAMBA_CATALOGS\\}" all)
209 (string-append all " $XML_CATALOG_FILES")))
cb1e0cfc 210 #t))
710964d1 211 (replace 'configure
3185c29a 212 ;; Samba uses a custom configuration script that runs WAF.
710964d1
SB
213 (lambda* (#:key outputs #:allow-other-keys)
214 (let* ((out (assoc-ref outputs "out"))
215 (libdir (string-append out "/lib")))
6ac59f45 216 (invoke "./configure"
25e81158 217 "--enable-selftest"
710964d1 218 "--enable-fhs"
710964d1 219 (string-append "--prefix=" out)
c8c14704 220 "--sysconfdir=/etc"
db29ee0b 221 "--localstatedir=/var"
710964d1
SB
222 ;; Install public and private libraries into
223 ;; a single directory to avoid RPATH issues.
224 (string-append "--libdir=" libdir)
6ac59f45 225 (string-append "--with-privatelibdir=" libdir)))))
db29ee0b 226 (add-before 'install 'disable-etc,var-samba-directories-setup
c4514744
AFN
227 (lambda _
228 (substitute* "dynconfig/wscript"
db29ee0b 229 (("bld\\.INSTALL_DIR.*") ""))
c8c14704 230 #t)))
25e81158
MC
231 ;; FIXME: The test suite seemingly hangs after failing to provision the
232 ;; test environment.
a40f1543 233 #:tests? #f))
3185c29a 234 (inputs
710964d1 235 `(("acl" ,acl)
3185c29a 236 ("cmocka" ,cmocka)
710964d1 237 ("cups" ,cups)
3185c29a 238 ("gamin" ,gamin)
ade77dd0 239 ("dbus" ,dbus)
44eff75e 240 ("gpgme" ,gpgme)
710964d1 241 ("gnutls" ,gnutls)
3185c29a 242 ("heimdal" ,heimdal)
44eff75e 243 ("jansson" ,jansson)
44eff75e 244 ("libarchive" ,libarchive)
25e81158 245 ("libtirpc" ,libtirpc)
a40f1543 246 ("linux-pam" ,linux-pam)
44eff75e 247 ("lmdb" ,lmdb)
710964d1 248 ("openldap" ,openldap)
2760d104
TGR
249 ("perl" ,perl)
250 ("python" ,python)
710964d1 251 ("popt" ,popt)
3665b4dc 252 ("readline" ,readline)
710964d1 253 ("tdb" ,tdb)))
470771c5
MB
254 (propagated-inputs
255 ;; In Requires or Requires.private of pkg-config files.
256 `(("ldb" ,ldb)
257 ("talloc" ,talloc)
258 ("tevent" ,tevent)))
710964d1 259 (native-inputs
2760d104 260 `(("perl-parse-yapp" ,perl-parse-yapp)
710964d1 261 ("pkg-config" ,pkg-config)
2760d104
TGR
262 ("python-iso8601" ,python-iso8601)
263 ("rpcsvc-proto" ,rpcsvc-proto) ; for 'rpcgen'
2760d104
TGR
264 ;; For generating man pages.
265 ("docbook-xml" ,docbook-xml-4.2)
266 ("docbook-xsl" ,docbook-xsl)
0c96afe9 267 ("xsltproc" ,libxslt)
ade77dd0 268 ("libxml2" ,libxml2))) ;for XML_CATALOG_FILES
8b21d22d 269 (home-page "https://www.samba.org/")
a40f1543
LC
270 (synopsis
271 "The standard Windows interoperability suite of programs for GNU and Unix")
272 (description
273 "Since 1992, Samba has provided secure, stable and fast file and print
274services for all clients using the SMB/CIFS protocol, such as all versions of
275DOS and Windows, OS/2, GNU/Linux and many others.
276
277Samba is an important component to seamlessly integrate Linux/Unix Servers and
278Desktops into Active Directory environments using the winbind daemon.")
279 (license gpl3+)))
1790739c
DT
280
281(define-public talloc
282 (package
283 (name "talloc")
23c2f0af 284 (version "2.3.2")
1790739c
DT
285 (source (origin
286 (method url-fetch)
01e64ef5 287 (uri (string-append "https://www.samba.org/ftp/talloc/talloc-"
1790739c
DT
288 version ".tar.gz"))
289 (sha256
290 (base32
23c2f0af 291 "1mvv57srpzcc1qh6vjjyjhgpdlcw4bmmsxfz4j8pfk9qkvwkx817"))))
1790739c
DT
292 (build-system gnu-build-system)
293 (arguments
960ae0cd
SB
294 '(#:phases
295 (modify-phases %standard-phases
296 (replace 'configure
297 (lambda* (#:key outputs #:allow-other-keys)
adbfc6b9
TGR
298 ;; talloc uses a custom configuration script that runs a Python
299 ;; script called 'waf', and doesn't tolerate unknown options.
960ae0cd
SB
300 (setenv "CONFIG_SHELL" (which "sh"))
301 (let ((out (assoc-ref outputs "out")))
adbfc6b9
TGR
302 (invoke "./configure"
303 (string-append "--prefix=" out))))))))
966c56f8
MB
304 (native-inputs
305 `(("which" ,which)))
1790739c 306 (inputs
966c56f8 307 `(("python" ,python)))
2e200ee8 308 (home-page "https://talloc.samba.org")
1790739c
DT
309 (synopsis "Hierarchical, reference counted memory pool system")
310 (description
311 "Talloc is a hierarchical, reference counted memory pool system with
312destructors. It is the core memory allocator used in Samba.")
313 (license gpl3+))) ;; The bundled "replace" library uses LGPL3.
ae916e02 314
602db62c
LC
315(define-public talloc/static
316 (package
317 (inherit talloc)
318 (name "talloc-static")
319 (synopsis
320 "Hierarchical, reference counted memory pool system (static library)")
321 (arguments
322 (substitute-keyword-arguments (package-arguments talloc)
323 ((#:phases phases)
324 ;; Since Waf, the build system talloc uses, apparently does not
325 ;; support building static libraries from a ./configure flag, roll our
326 ;; own build process. No need to be ashamed, we're not the only ones
327 ;; doing that:
328 ;; <https://github.com/proot-me/proot-static-build/blob/master/GNUmakefile>.
329 ;; :-)
330 `(modify-phases ,phases
331 (replace 'build
332 (lambda _
d83c52c6 333 (invoke "gcc" "-c" "-Ibin/default" "-I" "lib/replace"
966c56f8
MB
334 "-I." "-Wall" "-g" "-D__STDC_WANT_LIB_EXT1__=1"
335 "talloc.c")
d83c52c6 336 (invoke "ar" "rc" "libtalloc.a" "talloc.o")))
602db62c
LC
337 (replace 'install
338 (lambda* (#:key outputs #:allow-other-keys)
339 (let* ((out (assoc-ref outputs "out"))
340 (lib (string-append out "/lib"))
341 (include (string-append out "/include")))
342 (mkdir-p lib)
343 (install-file "libtalloc.a" lib)
344 (install-file "talloc.h" include)
345 #t)))
346 (delete 'check))))))) ;XXX: tests rely on Python modules
347
0674b3c9
SB
348(define-public tevent
349 (package
350 (name "tevent")
293454f2 351 (version "0.10.2")
0674b3c9
SB
352 (source (origin
353 (method url-fetch)
354 (uri (string-append "https://www.samba.org/ftp/tevent/tevent-"
355 version ".tar.gz"))
356 (sha256
357 (base32
293454f2 358 "15k6i8ad5lpxfjsjyq9h64zlyws8d3cm0vwdnaw8z1xjwli7hhpq"))))
0674b3c9
SB
359 (build-system gnu-build-system)
360 (arguments
361 '(#:phases
362 (modify-phases %standard-phases
363 (replace 'configure
364 ;; tevent uses a custom configuration script that runs waf.
365 (lambda* (#:key outputs #:allow-other-keys)
366 (let ((out (assoc-ref outputs "out")))
ed0d6ed9
RW
367 (invoke "./configure"
368 (string-append "--prefix=" out)
369 "--bundled-libraries=NONE")))))))
0674b3c9
SB
370 (native-inputs
371 `(("pkg-config" ,pkg-config)
1ca20daa
MB
372 ("python" ,python)
373 ("which" ,which)))
0674b3c9
SB
374 (propagated-inputs
375 `(("talloc" ,talloc))) ; required by tevent.pc
376 (synopsis "Event system library")
377 (home-page "https://tevent.samba.org/")
378 (description
379 "Tevent is an event system based on the talloc memory management library.
380It is the core event system used in Samba. The low level tevent has support for
381many event types, including timers, signals, and the classic file descriptor events.")
382 (license lgpl3+)))
383
52513595
SB
384(define-public ldb
385 (package
386 (name "ldb")
7152a714 387 (version "1.5.6")
52513595
SB
388 (source (origin
389 (method url-fetch)
390 (uri (string-append "https://www.samba.org/ftp/ldb/ldb-"
391 version ".tar.gz"))
392 (sha256
393 (base32
7152a714 394 "0nwpkqidsna4yz3vhjzzadm4hpviwnyk80yml8ay82gi1d6lg0pz"))
21a21c20
MB
395 (modules '((guix build utils)))
396 (snippet
397 '(begin
398 (for-each (lambda (file)
399 ;; Delete everything except the build tools.
400 (unless (or (string-prefix? "third_party/waf" file)
401 (string-suffix? "wscript" file))
402 (delete-file file)))
403 (find-files "third_party"))
404 #t))))
52513595
SB
405 (build-system gnu-build-system)
406 (arguments
3d53869e
MB
407 '(;; LMDB is only supported on 64-bit systems, yet the test suite
408 ;; requires it.
409 #:tests? (assoc-ref %build-inputs "lmdb")
410 #:phases
52513595
SB
411 (modify-phases %standard-phases
412 (replace 'configure
413 ;; ldb use a custom configuration script that runs waf.
414 (lambda* (#:key outputs #:allow-other-keys)
415 (let ((out (assoc-ref outputs "out")))
5b848463
RW
416 (invoke "./configure"
417 (string-append "--prefix=" out)
418 (string-append "--with-modulesdir=" out
419 "/lib/ldb/modules")
420 "--bundled-libraries=NONE")))))))
52513595 421 (native-inputs
fbed1501
MB
422 `(("cmocka" ,cmocka)
423 ("pkg-config" ,pkg-config)
4422a8c6
MB
424 ("python" ,python)
425 ("which" ,which)))
52513595
SB
426 (propagated-inputs
427 ;; ldb.pc refers to all these.
428 `(("talloc" ,talloc)
429 ("tdb" ,tdb)))
430 (inputs
3d53869e
MB
431 `(,@(if (target-64bit?)
432 `(("lmdb" ,lmdb))
433 '())
bdf16125 434 ("popt" ,popt)
52513595
SB
435 ("tevent" ,tevent)))
436 (synopsis "LDAP-like embedded database")
437 (home-page "https://ldb.samba.org/")
438 (description
439 "Ldb is a LDAP-like embedded database built on top of TDB. What ldb does
440is provide a fast database with an LDAP-like API designed to be used within an
441application. In some ways it can be seen as a intermediate solution between
442key-value pair databases and a real LDAP database.")
443 (license lgpl3+)))
444
ae916e02 445(define-public ppp
bd46b80a
VL
446 (package
447 (name "ppp")
448 (version "2.4.9")
449 (source (origin
450 (method git-fetch)
451 (uri (git-reference
452 (url "https://github.com/paulusmack/ppp")
453 (commit version)))
454 (file-name (git-file-name name version))
455 (sha256
456 (base32
457 "1bhhksdclsnkw54a517ndrw55q5zljjbh9pcqz1z4a2z2flxpsgk"))))
458 (build-system gnu-build-system)
459 (arguments
460 '(#:tests? #f ; no check target
461 #:make-flags '("CC=gcc")
462 #:phases
463 (modify-phases %standard-phases
464 (add-before 'configure 'patch-Makefile
465 (lambda* (#:key inputs #:allow-other-keys)
466 (let ((libc (assoc-ref inputs "libc"))
467 (openssl (assoc-ref inputs "openssl"))
468 (libpcap (assoc-ref inputs "libpcap")))
469 (substitute* "pppd/Makefile.linux"
470 (("/usr/include/crypt\\.h")
471 (string-append libc "/include/crypt.h"))
472 (("/usr/include/openssl")
473 (string-append openssl "/include/openssl"))
474 (("/usr/include/pcap-bpf.h")
475 (string-append libpcap "/include/pcap-bpf.h")))
476 #t))))))
477 (inputs
478 `(("libpcap" ,libpcap)
479 ("openssl" ,(@ (gnu packages tls) openssl))))
480 (synopsis "Implementation of the Point-to-Point Protocol")
481 (home-page "https://ppp.samba.org/")
482 (description
483 "The Point-to-Point Protocol (PPP) provides a standard way to establish
ae916e02
SB
484a network connection over a serial link. At present, this package supports IP
485and IPV6 and the protocols layered above them, such as TCP and UDP.")
bd46b80a
VL
486 ;; pppd, pppstats and pppdump are under BSD-style notices.
487 ;; some of the pppd plugins are GPL'd.
488 ;; chat is public domain.
489 (license (list bsd-3 bsd-4 gpl2+ public-domain))))
4c8b874f 490