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