gnu: fish: Update to 2.7.1.
[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 Marius Bakke <mbakke@fastmail.com>
8 ;;;
9 ;;; This file is part of GNU Guix.
10 ;;;
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.
15 ;;;
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.
20 ;;;
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/>.
23
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))
48
49 (define-public cifs-utils
50 (package
51 (name "cifs-utils")
52 (version "6.7")
53 (source
54 (origin
55 (method url-fetch)
56 (uri (string-append "https://download.samba.org/pub/linux-cifs/"
57 name "/" name "-" version ".tar.bz2"))
58 (sha256 (base32
59 "1ayghnkryy1n1zm5dyvyyr7n3807nsm6glfcbbki5c2a8w91dwmj"))))
60 (build-system gnu-build-system)
61 (native-inputs
62 `(("autoconf" ,autoconf)
63 ("automake" ,automake)
64 ("pkg-config" ,pkg-config)))
65 (inputs
66 `(("keytuils" ,keyutils)
67 ("linux-pam" ,linux-pam)
68 ("libcap-ng" ,libcap-ng)
69 ("mit-krb5" ,mit-krb5)
70 ("samba" ,samba)
71 ("talloc" ,talloc)))
72 (arguments
73 `(#:phases
74 (modify-phases %standard-phases
75 ;; The 6.7 tarball is missing ‘install.sh’. Create it.
76 (add-after 'unpack 'autoreconf
77 (lambda _
78 (zero? (system* "autoreconf" "-i"))))
79 (add-before 'configure 'set-root-sbin
80 (lambda _ ; Don't try to install in "/sbin".
81 (setenv "ROOTSBINDIR"
82 (string-append (assoc-ref %outputs "out") "/sbin"))
83 #t)))))
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.
90 (license gpl3+)))
91
92 (define-public iniparser
93 (package
94 (name "iniparser")
95 (version "4.0")
96 (source (origin
97 (method url-fetch)
98 (uri (string-append "https://github.com/ndevilla/iniparser/archive/v"
99 version ".tar.gz"))
100 (file-name (string-append name "-" version ".tar.gz"))
101 (sha256
102 (base32
103 "1flj7srvh2hp9ls96qz922bklyhw7f27mmn23b16839zpdjddfz0"))))
104 (build-system gnu-build-system)
105 (arguments
106 '(#:phases
107 (modify-phases %standard-phases
108 (replace 'configure
109 (lambda* (#:key outputs #:allow-other-keys)
110 (substitute* '("Makefile" "test/Makefile")
111 (("/usr/lib")
112 (string-append (assoc-ref outputs "out") "/lib"))
113 (("\\?= gcc") "= gcc"))))
114 (replace 'build
115 (lambda _
116 (and (zero? (system* "make" "libiniparser.so"))
117 (symlink "libiniparser.so.0" "libiniparser.so"))))
118 (replace 'install
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")))
125 (define (copy dir)
126 (lambda (file)
127 (copy-file file
128 (string-append dir "/"
129 (basename file)))))
130 (mkdir-p lib)
131 (for-each (copy lib)
132 (find-files "." "^lib.*\\.(so\\.|a)"))
133 (with-directory-excursion lib
134 (symlink "libiniparser.so.0" "libiniparser.so"))
135 (mkdir-p inc)
136 (for-each (copy inc)
137 (find-files "src" "\\.h$"))
138 (mkdir-p html)
139 (for-each (copy html)
140 (find-files "html" ".*"))
141 (for-each (copy doc)
142 '("AUTHORS" "INSTALL" "LICENSE" "README.md"))))))))
143 (home-page "http://ndevilla.free.fr/iniparser")
144 (synopsis "Standalone ini file parsing library")
145 (description
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
148 anywhere.")
149 (license x11)))
150
151 (define-public samba
152 (package
153 (name "samba")
154 (version "4.7.3")
155 (source (origin
156 (method url-fetch)
157 (uri (string-append "https://download.samba.org/pub/samba/stable/"
158 "samba-" version ".tar.gz"))
159 (sha256
160 (base32
161 "0b7xbfjpg7l1lz13gvj4ifcp9j3cvfp6pswjbq03z06bl4n1br06"))))
162 (build-system gnu-build-system)
163 (arguments
164 `(#:phases
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) "/")))
176 #t))
177 (replace 'configure
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")))
182 (zero? (system*
183 "./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_DIRS\\(\"\",[[:blank:]]{1,}\"\\$\\{CONFIGDIR\\}[[:blank:]]{1,}")
197 "bld.INSTALL_DIRS(\"\", \""))
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 ("gnutls" ,gnutls)
208 ("iniparser" ,iniparser)
209 ("libaio" ,libaio)
210 ("ldb" ,ldb)
211 ("linux-pam" ,linux-pam)
212 ("openldap" ,openldap)
213 ("popt" ,popt)
214 ("readline" ,readline)
215 ("talloc" ,talloc)
216 ("tevent" ,tevent)
217 ("tdb" ,tdb)))
218 (native-inputs
219 `(("docbook-xsl" ,docbook-xsl) ;for generating manpages
220 ("xsltproc" ,libxslt) ;ditto
221 ("perl" ,perl)
222 ("pkg-config" ,pkg-config)
223 ("python" ,python-2))) ; incompatible with Python 3
224 (home-page "https://www.samba.org/")
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
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.
231
232 Samba is an important component to seamlessly integrate Linux/Unix Servers and
233 Desktops into Active Directory environments using the winbind daemon.")
234 (license gpl3+)))
235
236 (define-public talloc
237 (package
238 (name "talloc")
239 (version "2.1.10")
240 (source (origin
241 (method url-fetch)
242 (uri (string-append "https://www.samba.org/ftp/talloc/talloc-"
243 version ".tar.gz"))
244 (sha256
245 (base32
246 "06gn45if56g81vbj3841fzdjsahrrczwqpfrydm2zv6nxd5yk1f9"))))
247 (build-system gnu-build-system)
248 (arguments
249 '(#:phases
250 (modify-phases %standard-phases
251 (replace 'configure
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.
255 ;; Skip the test.
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)))))))))
264 (inputs
265 `(("python" ,python-2)))
266 (home-page "https://talloc.samba.org")
267 (synopsis "Hierarchical, reference counted memory pool system")
268 (description
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.
272
273 (define-public talloc/static
274 (package
275 (inherit talloc)
276 (name "talloc-static")
277 (synopsis
278 "Hierarchical, reference counted memory pool system (static library)")
279 (arguments
280 (substitute-keyword-arguments (package-arguments talloc)
281 ((#:phases phases)
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
285 ;; doing that:
286 ;; <https://github.com/proot-me/proot-static-build/blob/master/GNUmakefile>.
287 ;; :-)
288 `(modify-phases ,phases
289 (replace 'build
290 (lambda _
291 (letrec-syntax ((shell (syntax-rules ()
292 ((_ (command ...) rest ...)
293 (and (zero? (system* command ...))
294 (shell rest ...)))
295 ((_)
296 #t))))
297 (shell ("gcc" "-c" "-Ibin/default" "-I" "lib/replace"
298 "-I." "-Wall" "-g" "talloc.c")
299 ("ar" "rc" "libtalloc.a" "talloc.o")))))
300 (replace 'install
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")))
305 (mkdir-p lib)
306 (install-file "libtalloc.a" lib)
307 (install-file "talloc.h" include)
308 #t)))
309 (delete 'check))))))) ;XXX: tests rely on Python modules
310
311 (define-public tevent
312 (package
313 (name "tevent")
314 (version "0.9.34")
315 (source (origin
316 (method url-fetch)
317 (uri (string-append "https://www.samba.org/ftp/tevent/tevent-"
318 version ".tar.gz"))
319 (sha256
320 (base32
321 "12kvfjs0dwi4iqbz740a37z0c7kmg8bhl53mwdj02jkznbw3w8bk"))))
322 (build-system gnu-build-system)
323 (arguments
324 '(#:phases
325 (modify-phases %standard-phases
326 (replace 'configure
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"))))))))
333 (native-inputs
334 `(("pkg-config" ,pkg-config)
335 ("python" ,python-2)))
336 (propagated-inputs
337 `(("talloc" ,talloc))) ; required by tevent.pc
338 (synopsis "Event system library")
339 (home-page "https://tevent.samba.org/")
340 (description
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.")
344 (license lgpl3+)))
345
346 (define-public ldb
347 (package
348 (name "ldb")
349 (version "1.3.0")
350 (source (origin
351 (method url-fetch)
352 (uri (string-append "https://www.samba.org/ftp/ldb/ldb-"
353 version ".tar.gz"))
354 (sha256
355 (base32
356 "03arsnsbkxb2d811pbarb7d12yg8g05f1q576z48sp647dd3xda4"))))
357 (build-system gnu-build-system)
358 (arguments
359 '(#:phases
360 (modify-phases %standard-phases
361 (replace 'configure
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
368 "/lib/ldb/modules")
369 "--bundled-libraries=NONE"))))))))
370 (native-inputs
371 `(("cmocka" ,cmocka)
372 ("pkg-config" ,pkg-config)
373 ("python" ,python-2)))
374 (propagated-inputs
375 ;; ldb.pc refers to all these.
376 `(("talloc" ,talloc)
377 ("tdb" ,tdb)))
378 (inputs
379 `(("popt" ,popt)
380 ("tevent" ,tevent)))
381 (synopsis "LDAP-like embedded database")
382 (home-page "https://ldb.samba.org/")
383 (description
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.")
388 (license lgpl3+)))
389
390 (define-public ppp
391 (package
392 (name "ppp")
393 (version "2.4.7")
394 (source (origin
395 (method url-fetch)
396 (uri (string-append "https://www.samba.org/ftp/ppp/ppp-"
397 version ".tar.gz"))
398 (sha256
399 (base32
400 "0c7vrjxl52pdwi4ckrvfjr08b31lfpgwf3pp0cqy76a77vfs7q02"))))
401 (build-system gnu-build-system)
402 (arguments
403 '(#:tests? #f ; no check target
404 #:make-flags '("CC=gcc")
405 #:phases
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")))))))))
416 (inputs
417 `(("libpcap" ,libpcap)))
418 (synopsis "Implementation of the Point-to-Point Protocol")
419 (home-page "https://ppp.samba.org/")
420 (description
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))))