gnu: wine: Update to 3.0.3.
[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>
c8c14704 4;;; Copyright © 2016, 2017 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>
21a21c20 7;;; Copyright © 2017, 2018 Marius Bakke <mbakke@fastmail.com>
33fa13ea 8;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
a40f1543
LC
9;;;
10;;; This file is part of GNU Guix.
11;;;
12;;; GNU Guix is free software; you can redistribute it and/or modify it
13;;; under the terms of the GNU General Public License as published by
14;;; the Free Software Foundation; either version 3 of the License, or (at
15;;; your option) any later version.
16;;;
17;;; GNU Guix is distributed in the hope that it will be useful, but
18;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20;;; GNU General Public License for more details.
21;;;
22;;; You should have received a copy of the GNU General Public License
23;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24
25(define-module (gnu packages samba)
26 #:use-module (guix packages)
27 #:use-module (guix download)
28 #:use-module (guix build-system gnu)
29 #:use-module (guix licenses)
602db62c 30 #:use-module (guix utils)
a40f1543 31 #:use-module (gnu packages acl)
ae916e02 32 #:use-module (gnu packages admin)
b4dcfce5 33 #:use-module (gnu packages autotools)
fbed1501 34 #:use-module (gnu packages check)
b4dcfce5 35 #:use-module (gnu packages crypto)
710964d1 36 #:use-module (gnu packages cups)
52513595 37 #:use-module (gnu packages databases)
cb1e0cfc 38 #:use-module (gnu packages docbook)
710964d1 39 #:use-module (gnu packages tls)
a40f1543 40 #:use-module (gnu packages popt)
0674b3c9 41 #:use-module (gnu packages pkg-config)
a40f1543
LC
42 #:use-module (gnu packages openldap)
43 #:use-module (gnu packages readline)
b4dcfce5 44 #:use-module (gnu packages kerberos)
a40f1543
LC
45 #:use-module (gnu packages linux)
46 #:use-module (gnu packages perl)
cb1e0cfc
MB
47 #:use-module (gnu packages python)
48 #:use-module (gnu packages xml))
a40f1543 49
b4dcfce5
TD
50(define-public cifs-utils
51 (package
52 (name "cifs-utils")
1a7cc9ef 53 (version "6.8")
b4dcfce5
TD
54 (source
55 (origin
56 (method url-fetch)
57 (uri (string-append "https://download.samba.org/pub/linux-cifs/"
58 name "/" name "-" version ".tar.bz2"))
59 (sha256 (base32
1a7cc9ef 60 "0ygz3pagjpaj5ky11hzh4byyymb7fpmqiqkprn11zwj31h2zdlg7"))))
b4dcfce5
TD
61 (build-system gnu-build-system)
62 (native-inputs
63 `(("autoconf" ,autoconf)
64 ("automake" ,automake)
65 ("pkg-config" ,pkg-config)))
66 (inputs
67 `(("keytuils" ,keyutils)
68 ("linux-pam" ,linux-pam)
69 ("libcap-ng" ,libcap-ng)
70 ("mit-krb5" ,mit-krb5)
71 ("samba" ,samba)
72 ("talloc" ,talloc)))
73 (arguments
74 `(#:phases
75 (modify-phases %standard-phases
76 ;; The 6.7 tarball is missing ‘install.sh’. Create it.
d10092b8 77 (add-after 'unpack 'autoreconf
b4dcfce5 78 (lambda _
55f0e9cc 79 (invoke "autoreconf" "-i")))
b4dcfce5
TD
80 (add-before 'configure 'set-root-sbin
81 (lambda _ ; Don't try to install in "/sbin".
82 (setenv "ROOTSBINDIR"
83 (string-append (assoc-ref %outputs "out") "/sbin"))
84 #t)))))
85 (synopsis "User-space utilities for Linux CIFS (Samba) mounts")
86 (description "@code{cifs-utils} is a set of user-space utilities for
87mounting and managing @dfn{Common Internet File System} (CIFS) shares using
88the Linux kernel CIFS client.")
89 (home-page "https://wiki.samba.org/index.php/LinuxCIFS_utils")
90 ;; cifs-utils is licensed as GPL3 or later, but 3 files contain LGPL code.
91 (license gpl3+)))
92
a40f1543
LC
93(define-public iniparser
94 (package
95 (name "iniparser")
a9691718 96 (version "4.1")
a40f1543
LC
97 (source (origin
98 (method url-fetch)
def8f501 99 (uri (string-append "https://github.com/ndevilla/iniparser/archive/v"
a40f1543 100 version ".tar.gz"))
def8f501 101 (file-name (string-append name "-" version ".tar.gz"))
a40f1543
LC
102 (sha256
103 (base32
a9691718 104 "1bpk8dj9d5cl64lg6jsk0qlzrpg848nymwxc3fx707fk1n0al3cn"))))
a40f1543
LC
105 (build-system gnu-build-system)
106 (arguments
cf52c925
TGR
107 `(#:make-flags
108 (list "CC=gcc")
109 #:phases
2af56bfa
EF
110 (modify-phases %standard-phases
111 (replace 'configure
112 (lambda* (#:key outputs #:allow-other-keys)
113 (substitute* '("Makefile" "test/Makefile")
114 (("/usr/lib")
444173f2
MW
115 (string-append (assoc-ref outputs "out") "/lib")))
116 #t))
2af56bfa 117 (replace 'build
cf52c925 118 (lambda* (#:key make-flags #:allow-other-keys)
a9691718 119 (apply invoke "make" "libiniparser.so.1"
cf52c925 120 make-flags)))
2af56bfa
EF
121 (replace 'install
122 (lambda* (#:key outputs #:allow-other-keys)
123 (let* ((out (assoc-ref outputs "out"))
124 (lib (string-append out "/lib"))
125 (inc (string-append out "/include"))
33fa13ea 126 (doc (string-append out "/share/doc/" ,name))
2af56bfa 127 (html (string-append doc "/html")))
fa5e6618 128 (define (install dir)
2af56bfa 129 (lambda (file)
fa5e6618
TGR
130 (install-file file dir)))
131 (for-each (install lib)
132 (find-files "." "^lib.*\\.so"))
2af56bfa 133 (with-directory-excursion lib
a9691718 134 (symlink "libiniparser.so.1" "libiniparser.so"))
fa5e6618 135 (for-each (install inc)
2af56bfa 136 (find-files "src" "\\.h$"))
fa5e6618 137 (for-each (install html)
2af56bfa 138 (find-files "html" ".*"))
fa5e6618 139 (for-each (install doc)
444173f2
MW
140 '("AUTHORS" "INSTALL" "LICENSE" "README.md"))
141 #t))))))
a9691718 142 (home-page "https://github.com/ndevilla/iniparser")
a40f1543
LC
143 (synopsis "Standalone ini file parsing library")
144 (description
145 "iniparser is a free stand-alone `ini' file parsing library (Windows
146configuration files). It is written in portable ANSI C and should compile
147anywhere.")
148 (license x11)))
149
150(define-public samba
151 (package
152 (name "samba")
d3c1075c 153 (version "4.8.5")
a40f1543
LC
154 (source (origin
155 (method url-fetch)
31c6bfed
EF
156 (uri (string-append "https://download.samba.org/pub/samba/stable/"
157 "samba-" version ".tar.gz"))
a40f1543
LC
158 (sha256
159 (base32
d3c1075c 160 "0mailvhjsma19k6b6zjl02z9n2hbbyfybvicjfw2hh9d4sqyd3p5"))))
a40f1543
LC
161 (build-system gnu-build-system)
162 (arguments
cb1e0cfc 163 `(#:phases
710964d1 164 (modify-phases %standard-phases
cb1e0cfc
MB
165 (add-before 'configure 'locate-docbook-stylesheets
166 (lambda* (#:key inputs #:allow-other-keys)
167 ;; XXX for some reason XML_CATALOG_FILES is not respected.
168 (substitute* '("buildtools/wafsamba/samba_conftests.py"
169 "buildtools/wafsamba/wafsamba.py"
170 "docs-xml/xslt/man.xsl")
171 (("http://docbook.sourceforge.net/release/xsl/current/")
172 (string-append (assoc-ref inputs "docbook-xsl")
173 "/xml/xsl/docbook-xsl-"
174 ,(package-version docbook-xsl) "/")))
175 #t))
710964d1
SB
176 (replace 'configure
177 ;; samba uses a custom configuration script that runs waf.
178 (lambda* (#:key outputs #:allow-other-keys)
179 (let* ((out (assoc-ref outputs "out"))
180 (libdir (string-append out "/lib")))
6ac59f45 181 (invoke "./configure"
710964d1
SB
182 "--enable-fhs"
183 ;; XXX: heimdal not packaged.
184 "--bundled-libraries=com_err"
185 (string-append "--prefix=" out)
c8c14704 186 "--sysconfdir=/etc"
710964d1
SB
187 ;; Install public and private libraries into
188 ;; a single directory to avoid RPATH issues.
189 (string-append "--libdir=" libdir)
6ac59f45 190 (string-append "--with-privatelibdir=" libdir)))))
c8c14704 191 (add-before 'install 'disable-etc-samba-directory-creation
c4514744
AFN
192 (lambda _
193 (substitute* "dynconfig/wscript"
2ea806f0
MB
194 (("bld\\.INSTALL_DIR\\(\"\\$\\{CONFIGDIR\\}\"\\)")
195 ""))
c8c14704 196 #t)))
a40f1543
LC
197 ;; XXX: The test infrastructure attempts to set password with
198 ;; smbpasswd, which fails with "smbpasswd -L can only be used by root."
199 ;; So disable tests until there's a workaround.
200 #:tests? #f))
201 (inputs ; TODO: Add missing dependencies
710964d1
SB
202 `(("acl" ,acl)
203 ("cups" ,cups)
a40f1543 204 ;; ("gamin" ,gamin)
710964d1 205 ("gnutls" ,gnutls)
a40f1543 206 ("iniparser" ,iniparser)
710964d1 207 ("libaio" ,libaio)
a40f1543 208 ("linux-pam" ,linux-pam)
710964d1
SB
209 ("openldap" ,openldap)
210 ("popt" ,popt)
3665b4dc 211 ("readline" ,readline)
710964d1 212 ("tdb" ,tdb)))
470771c5
MB
213 (propagated-inputs
214 ;; In Requires or Requires.private of pkg-config files.
215 `(("ldb" ,ldb)
216 ("talloc" ,talloc)
217 ("tevent" ,tevent)))
710964d1 218 (native-inputs
cb1e0cfc
MB
219 `(("docbook-xsl" ,docbook-xsl) ;for generating manpages
220 ("xsltproc" ,libxslt) ;ditto
221 ("perl" ,perl)
710964d1
SB
222 ("pkg-config" ,pkg-config)
223 ("python" ,python-2))) ; incompatible with Python 3
8b21d22d 224 (home-page "https://www.samba.org/")
a40f1543
LC
225 (synopsis
226 "The standard Windows interoperability suite of programs for GNU and Unix")
227 (description
228 "Since 1992, Samba has provided secure, stable and fast file and print
229services for all clients using the SMB/CIFS protocol, such as all versions of
230DOS and Windows, OS/2, GNU/Linux and many others.
231
232Samba is an important component to seamlessly integrate Linux/Unix Servers and
233Desktops into Active Directory environments using the winbind daemon.")
234 (license gpl3+)))
1790739c
DT
235
236(define-public talloc
237 (package
238 (name "talloc")
f9e1cdb8 239 (version "2.1.14")
1790739c
DT
240 (source (origin
241 (method url-fetch)
01e64ef5 242 (uri (string-append "https://www.samba.org/ftp/talloc/talloc-"
1790739c
DT
243 version ".tar.gz"))
244 (sha256
245 (base32
f9e1cdb8 246 "1kk76dyav41ip7ddbbf04yfydb4jvywzi2ps0z2vla56aqkn11di"))))
1790739c
DT
247 (build-system gnu-build-system)
248 (arguments
960ae0cd
SB
249 '(#:phases
250 (modify-phases %standard-phases
251 (replace 'configure
252 (lambda* (#:key outputs #:allow-other-keys)
adbfc6b9
TGR
253 ;; talloc uses a custom configuration script that runs a Python
254 ;; script called 'waf', and doesn't tolerate unknown options.
960ae0cd
SB
255 (setenv "CONFIG_SHELL" (which "sh"))
256 (let ((out (assoc-ref outputs "out")))
adbfc6b9
TGR
257 (invoke "./configure"
258 (string-append "--prefix=" out))))))))
1790739c
DT
259 (inputs
260 `(("python" ,python-2)))
2e200ee8 261 (home-page "https://talloc.samba.org")
1790739c
DT
262 (synopsis "Hierarchical, reference counted memory pool system")
263 (description
264 "Talloc is a hierarchical, reference counted memory pool system with
265destructors. It is the core memory allocator used in Samba.")
266 (license gpl3+))) ;; The bundled "replace" library uses LGPL3.
ae916e02 267
602db62c
LC
268(define-public talloc/static
269 (package
270 (inherit talloc)
271 (name "talloc-static")
272 (synopsis
273 "Hierarchical, reference counted memory pool system (static library)")
274 (arguments
275 (substitute-keyword-arguments (package-arguments talloc)
276 ((#:phases phases)
277 ;; Since Waf, the build system talloc uses, apparently does not
278 ;; support building static libraries from a ./configure flag, roll our
279 ;; own build process. No need to be ashamed, we're not the only ones
280 ;; doing that:
281 ;; <https://github.com/proot-me/proot-static-build/blob/master/GNUmakefile>.
282 ;; :-)
283 `(modify-phases ,phases
284 (replace 'build
285 (lambda _
286 (letrec-syntax ((shell (syntax-rules ()
287 ((_ (command ...) rest ...)
288 (and (zero? (system* command ...))
289 (shell rest ...)))
290 ((_)
291 #t))))
292 (shell ("gcc" "-c" "-Ibin/default" "-I" "lib/replace"
293 "-I." "-Wall" "-g" "talloc.c")
294 ("ar" "rc" "libtalloc.a" "talloc.o")))))
295 (replace 'install
296 (lambda* (#:key outputs #:allow-other-keys)
297 (let* ((out (assoc-ref outputs "out"))
298 (lib (string-append out "/lib"))
299 (include (string-append out "/include")))
300 (mkdir-p lib)
301 (install-file "libtalloc.a" lib)
302 (install-file "talloc.h" include)
303 #t)))
304 (delete 'check))))))) ;XXX: tests rely on Python modules
305
0674b3c9
SB
306(define-public tevent
307 (package
308 (name "tevent")
e4bdd199 309 (version "0.9.37")
0674b3c9
SB
310 (source (origin
311 (method url-fetch)
312 (uri (string-append "https://www.samba.org/ftp/tevent/tevent-"
313 version ".tar.gz"))
314 (sha256
315 (base32
e4bdd199 316 "1q77vbjic2bb79li2a54ffscnrnwwww55fbpry2kgh7acpnlb0qn"))))
0674b3c9
SB
317 (build-system gnu-build-system)
318 (arguments
319 '(#:phases
320 (modify-phases %standard-phases
321 (replace 'configure
322 ;; tevent uses a custom configuration script that runs waf.
323 (lambda* (#:key outputs #:allow-other-keys)
324 (let ((out (assoc-ref outputs "out")))
325 (zero? (system* "./configure"
326 (string-append "--prefix=" out)
327 "--bundled-libraries=NONE"))))))))
328 (native-inputs
329 `(("pkg-config" ,pkg-config)
330 ("python" ,python-2)))
331 (propagated-inputs
332 `(("talloc" ,talloc))) ; required by tevent.pc
333 (synopsis "Event system library")
334 (home-page "https://tevent.samba.org/")
335 (description
336 "Tevent is an event system based on the talloc memory management library.
337It is the core event system used in Samba. The low level tevent has support for
338many event types, including timers, signals, and the classic file descriptor events.")
339 (license lgpl3+)))
340
52513595
SB
341(define-public ldb
342 (package
343 (name "ldb")
652940d0 344 (version "1.3.6")
52513595
SB
345 (source (origin
346 (method url-fetch)
347 (uri (string-append "https://www.samba.org/ftp/ldb/ldb-"
348 version ".tar.gz"))
349 (sha256
350 (base32
652940d0 351 "16lkz3gyvsm9als1wyimsl573hclr72xy6454mshwjanncs33lji"))
21a21c20
MB
352 (modules '((guix build utils)))
353 (snippet
354 '(begin
355 (for-each (lambda (file)
356 ;; Delete everything except the build tools.
357 (unless (or (string-prefix? "third_party/waf" file)
358 (string-suffix? "wscript" file))
359 (delete-file file)))
360 (find-files "third_party"))
361 #t))))
52513595
SB
362 (build-system gnu-build-system)
363 (arguments
041f84ed 364 '(#:phases
52513595
SB
365 (modify-phases %standard-phases
366 (replace 'configure
367 ;; ldb use a custom configuration script that runs waf.
368 (lambda* (#:key outputs #:allow-other-keys)
369 (let ((out (assoc-ref outputs "out")))
370 (zero? (system* "./configure"
371 (string-append "--prefix=" out)
372 (string-append "--with-modulesdir=" out
373 "/lib/ldb/modules")
374 "--bundled-libraries=NONE"))))))))
375 (native-inputs
fbed1501
MB
376 `(("cmocka" ,cmocka)
377 ("pkg-config" ,pkg-config)
52513595
SB
378 ("python" ,python-2)))
379 (propagated-inputs
380 ;; ldb.pc refers to all these.
381 `(("talloc" ,talloc)
382 ("tdb" ,tdb)))
383 (inputs
041f84ed 384 `(("popt" ,popt)
52513595
SB
385 ("tevent" ,tevent)))
386 (synopsis "LDAP-like embedded database")
387 (home-page "https://ldb.samba.org/")
388 (description
389 "Ldb is a LDAP-like embedded database built on top of TDB. What ldb does
390is provide a fast database with an LDAP-like API designed to be used within an
391application. In some ways it can be seen as a intermediate solution between
392key-value pair databases and a real LDAP database.")
393 (license lgpl3+)))
394
ae916e02
SB
395(define-public ppp
396 (package
397 (name "ppp")
398 (version "2.4.7")
399 (source (origin
400 (method url-fetch)
401 (uri (string-append "https://www.samba.org/ftp/ppp/ppp-"
402 version ".tar.gz"))
403 (sha256
404 (base32
405 "0c7vrjxl52pdwi4ckrvfjr08b31lfpgwf3pp0cqy76a77vfs7q02"))))
406 (build-system gnu-build-system)
407 (arguments
408 '(#:tests? #f ; no check target
409 #:make-flags '("CC=gcc")
410 #:phases
411 (modify-phases %standard-phases
412 (add-before 'configure 'patch-Makefile
413 (lambda* (#:key inputs #:allow-other-keys)
414 (let ((libc (assoc-ref inputs "libc"))
415 (libpcap (assoc-ref inputs "libpcap")))
416 (substitute* "pppd/Makefile.linux"
417 (("/usr/include/crypt\\.h")
418 (string-append libc "/include/crypt.h"))
419 (("/usr/include/pcap-bpf.h")
cbd7c657
MB
420 (string-append libpcap "/include/pcap-bpf.h")))
421 #t))))))
ae916e02
SB
422 (inputs
423 `(("libpcap" ,libpcap)))
424 (synopsis "Implementation of the Point-to-Point Protocol")
425 (home-page "https://ppp.samba.org/")
426 (description
427 "The Point-to-Point Protocol (PPP) provides a standard way to establish
428a network connection over a serial link. At present, this package supports IP
429and IPV6 and the protocols layered above them, such as TCP and UDP.")
430 ;; pppd, pppstats and pppdump are under BSD-style notices.
431 ;; some of the pppd plugins are GPL'd.
432 ;; chat is public domain.
433 (license (list bsd-3 bsd-4 gpl2+ public-domain))))