Commit | Line | Data |
---|---|---|
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> |
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 TD |
78 | (lambda _ |
79 | (zero? (system* "autoreconf" "-i")))) | |
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 | |
87 | mounting and managing @dfn{Common Internet File System} (CIFS) shares using | |
88 | the 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") | |
cf52c925 | 115 | (string-append (assoc-ref outputs "out") "/lib"))))) |
2af56bfa | 116 | (replace 'build |
cf52c925 | 117 | (lambda* (#:key make-flags #:allow-other-keys) |
a9691718 | 118 | (apply invoke "make" "libiniparser.so.1" |
cf52c925 | 119 | make-flags))) |
2af56bfa EF |
120 | (replace 'install |
121 | (lambda* (#:key outputs #:allow-other-keys) | |
122 | (let* ((out (assoc-ref outputs "out")) | |
123 | (lib (string-append out "/lib")) | |
124 | (inc (string-append out "/include")) | |
33fa13ea | 125 | (doc (string-append out "/share/doc/" ,name)) |
2af56bfa | 126 | (html (string-append doc "/html"))) |
fa5e6618 | 127 | (define (install dir) |
2af56bfa | 128 | (lambda (file) |
fa5e6618 TGR |
129 | (install-file file dir))) |
130 | (for-each (install lib) | |
131 | (find-files "." "^lib.*\\.so")) | |
2af56bfa | 132 | (with-directory-excursion lib |
a9691718 | 133 | (symlink "libiniparser.so.1" "libiniparser.so")) |
fa5e6618 | 134 | (for-each (install inc) |
2af56bfa | 135 | (find-files "src" "\\.h$")) |
fa5e6618 | 136 | (for-each (install html) |
2af56bfa | 137 | (find-files "html" ".*")) |
fa5e6618 | 138 | (for-each (install doc) |
2af56bfa | 139 | '("AUTHORS" "INSTALL" "LICENSE" "README.md")))))))) |
a9691718 | 140 | (home-page "https://github.com/ndevilla/iniparser") |
a40f1543 LC |
141 | (synopsis "Standalone ini file parsing library") |
142 | (description | |
143 | "iniparser is a free stand-alone `ini' file parsing library (Windows | |
144 | configuration files). It is written in portable ANSI C and should compile | |
145 | anywhere.") | |
146 | (license x11))) | |
147 | ||
148 | (define-public samba | |
149 | (package | |
150 | (name "samba") | |
26633cb8 | 151 | (version "4.8.2") |
a40f1543 LC |
152 | (source (origin |
153 | (method url-fetch) | |
31c6bfed EF |
154 | (uri (string-append "https://download.samba.org/pub/samba/stable/" |
155 | "samba-" version ".tar.gz")) | |
a40f1543 LC |
156 | (sha256 |
157 | (base32 | |
26633cb8 | 158 | "08mz29jmjxqvyyhm6pa388paagw1i2i21lc7pd2aprj9dllm5rb2")))) |
a40f1543 LC |
159 | (build-system gnu-build-system) |
160 | (arguments | |
cb1e0cfc | 161 | `(#:phases |
710964d1 | 162 | (modify-phases %standard-phases |
cb1e0cfc MB |
163 | (add-before 'configure 'locate-docbook-stylesheets |
164 | (lambda* (#:key inputs #:allow-other-keys) | |
165 | ;; XXX for some reason XML_CATALOG_FILES is not respected. | |
166 | (substitute* '("buildtools/wafsamba/samba_conftests.py" | |
167 | "buildtools/wafsamba/wafsamba.py" | |
168 | "docs-xml/xslt/man.xsl") | |
169 | (("http://docbook.sourceforge.net/release/xsl/current/") | |
170 | (string-append (assoc-ref inputs "docbook-xsl") | |
171 | "/xml/xsl/docbook-xsl-" | |
172 | ,(package-version docbook-xsl) "/"))) | |
173 | #t)) | |
710964d1 SB |
174 | (replace 'configure |
175 | ;; samba uses a custom configuration script that runs waf. | |
176 | (lambda* (#:key outputs #:allow-other-keys) | |
177 | (let* ((out (assoc-ref outputs "out")) | |
178 | (libdir (string-append out "/lib"))) | |
179 | (zero? (system* | |
180 | "./configure" | |
181 | "--enable-fhs" | |
182 | ;; XXX: heimdal not packaged. | |
183 | "--bundled-libraries=com_err" | |
184 | (string-append "--prefix=" out) | |
c8c14704 | 185 | "--sysconfdir=/etc" |
710964d1 SB |
186 | ;; Install public and private libraries into |
187 | ;; a single directory to avoid RPATH issues. | |
188 | (string-append "--libdir=" libdir) | |
c4514744 | 189 | (string-append "--with-privatelibdir=" libdir)))))) |
c8c14704 | 190 | (add-before 'install 'disable-etc-samba-directory-creation |
c4514744 AFN |
191 | (lambda _ |
192 | (substitute* "dynconfig/wscript" | |
2ea806f0 MB |
193 | (("bld\\.INSTALL_DIR\\(\"\\$\\{CONFIGDIR\\}\"\\)") |
194 | "")) | |
c8c14704 | 195 | #t))) |
a40f1543 LC |
196 | ;; XXX: The test infrastructure attempts to set password with |
197 | ;; smbpasswd, which fails with "smbpasswd -L can only be used by root." | |
198 | ;; So disable tests until there's a workaround. | |
199 | #:tests? #f)) | |
200 | (inputs ; TODO: Add missing dependencies | |
710964d1 SB |
201 | `(("acl" ,acl) |
202 | ("cups" ,cups) | |
a40f1543 | 203 | ;; ("gamin" ,gamin) |
710964d1 | 204 | ("gnutls" ,gnutls) |
a40f1543 | 205 | ("iniparser" ,iniparser) |
710964d1 | 206 | ("libaio" ,libaio) |
a40f1543 | 207 | ("linux-pam" ,linux-pam) |
710964d1 SB |
208 | ("openldap" ,openldap) |
209 | ("popt" ,popt) | |
3665b4dc | 210 | ("readline" ,readline) |
710964d1 | 211 | ("tdb" ,tdb))) |
470771c5 MB |
212 | (propagated-inputs |
213 | ;; In Requires or Requires.private of pkg-config files. | |
214 | `(("ldb" ,ldb) | |
215 | ("talloc" ,talloc) | |
216 | ("tevent" ,tevent))) | |
710964d1 | 217 | (native-inputs |
cb1e0cfc MB |
218 | `(("docbook-xsl" ,docbook-xsl) ;for generating manpages |
219 | ("xsltproc" ,libxslt) ;ditto | |
220 | ("perl" ,perl) | |
710964d1 SB |
221 | ("pkg-config" ,pkg-config) |
222 | ("python" ,python-2))) ; incompatible with Python 3 | |
8b21d22d | 223 | (home-page "https://www.samba.org/") |
a40f1543 LC |
224 | (synopsis |
225 | "The standard Windows interoperability suite of programs for GNU and Unix") | |
226 | (description | |
227 | "Since 1992, Samba has provided secure, stable and fast file and print | |
228 | services for all clients using the SMB/CIFS protocol, such as all versions of | |
229 | DOS and Windows, OS/2, GNU/Linux and many others. | |
230 | ||
231 | Samba is an important component to seamlessly integrate Linux/Unix Servers and | |
232 | Desktops into Active Directory environments using the winbind daemon.") | |
233 | (license gpl3+))) | |
1790739c DT |
234 | |
235 | (define-public talloc | |
236 | (package | |
237 | (name "talloc") | |
a81000fb | 238 | (version "2.1.13") |
1790739c DT |
239 | (source (origin |
240 | (method url-fetch) | |
01e64ef5 | 241 | (uri (string-append "https://www.samba.org/ftp/talloc/talloc-" |
1790739c DT |
242 | version ".tar.gz")) |
243 | (sha256 | |
244 | (base32 | |
a81000fb | 245 | "0iv09iv385x69gfzvassq6m3y0rd8ncylls95dm015xdy3drkww4")))) |
1790739c DT |
246 | (build-system gnu-build-system) |
247 | (arguments | |
960ae0cd SB |
248 | '(#:phases |
249 | (modify-phases %standard-phases | |
250 | (replace 'configure | |
251 | (lambda* (#:key outputs #:allow-other-keys) | |
adbfc6b9 TGR |
252 | ;; talloc uses a custom configuration script that runs a Python |
253 | ;; script called 'waf', and doesn't tolerate unknown options. | |
960ae0cd SB |
254 | (setenv "CONFIG_SHELL" (which "sh")) |
255 | (let ((out (assoc-ref outputs "out"))) | |
adbfc6b9 TGR |
256 | (invoke "./configure" |
257 | (string-append "--prefix=" out)))))))) | |
1790739c DT |
258 | (inputs |
259 | `(("python" ,python-2))) | |
2e200ee8 | 260 | (home-page "https://talloc.samba.org") |
1790739c DT |
261 | (synopsis "Hierarchical, reference counted memory pool system") |
262 | (description | |
263 | "Talloc is a hierarchical, reference counted memory pool system with | |
264 | destructors. It is the core memory allocator used in Samba.") | |
265 | (license gpl3+))) ;; The bundled "replace" library uses LGPL3. | |
ae916e02 | 266 | |
602db62c LC |
267 | (define-public talloc/static |
268 | (package | |
269 | (inherit talloc) | |
270 | (name "talloc-static") | |
271 | (synopsis | |
272 | "Hierarchical, reference counted memory pool system (static library)") | |
273 | (arguments | |
274 | (substitute-keyword-arguments (package-arguments talloc) | |
275 | ((#:phases phases) | |
276 | ;; Since Waf, the build system talloc uses, apparently does not | |
277 | ;; support building static libraries from a ./configure flag, roll our | |
278 | ;; own build process. No need to be ashamed, we're not the only ones | |
279 | ;; doing that: | |
280 | ;; <https://github.com/proot-me/proot-static-build/blob/master/GNUmakefile>. | |
281 | ;; :-) | |
282 | `(modify-phases ,phases | |
283 | (replace 'build | |
284 | (lambda _ | |
285 | (letrec-syntax ((shell (syntax-rules () | |
286 | ((_ (command ...) rest ...) | |
287 | (and (zero? (system* command ...)) | |
288 | (shell rest ...))) | |
289 | ((_) | |
290 | #t)))) | |
291 | (shell ("gcc" "-c" "-Ibin/default" "-I" "lib/replace" | |
292 | "-I." "-Wall" "-g" "talloc.c") | |
293 | ("ar" "rc" "libtalloc.a" "talloc.o"))))) | |
294 | (replace 'install | |
295 | (lambda* (#:key outputs #:allow-other-keys) | |
296 | (let* ((out (assoc-ref outputs "out")) | |
297 | (lib (string-append out "/lib")) | |
298 | (include (string-append out "/include"))) | |
299 | (mkdir-p lib) | |
300 | (install-file "libtalloc.a" lib) | |
301 | (install-file "talloc.h" include) | |
302 | #t))) | |
303 | (delete 'check))))))) ;XXX: tests rely on Python modules | |
304 | ||
0674b3c9 SB |
305 | (define-public tevent |
306 | (package | |
307 | (name "tevent") | |
6db2accc | 308 | (version "0.9.36") |
0674b3c9 SB |
309 | (source (origin |
310 | (method url-fetch) | |
311 | (uri (string-append "https://www.samba.org/ftp/tevent/tevent-" | |
312 | version ".tar.gz")) | |
313 | (sha256 | |
314 | (base32 | |
6db2accc | 315 | "0k1v4vnlzpf7h3p4khaw8a7damrc68g136bf2xzys08nzpinnaxx")))) |
0674b3c9 SB |
316 | (build-system gnu-build-system) |
317 | (arguments | |
318 | '(#:phases | |
319 | (modify-phases %standard-phases | |
320 | (replace 'configure | |
321 | ;; tevent uses a custom configuration script that runs waf. | |
322 | (lambda* (#:key outputs #:allow-other-keys) | |
323 | (let ((out (assoc-ref outputs "out"))) | |
324 | (zero? (system* "./configure" | |
325 | (string-append "--prefix=" out) | |
326 | "--bundled-libraries=NONE")))))))) | |
327 | (native-inputs | |
328 | `(("pkg-config" ,pkg-config) | |
329 | ("python" ,python-2))) | |
330 | (propagated-inputs | |
331 | `(("talloc" ,talloc))) ; required by tevent.pc | |
332 | (synopsis "Event system library") | |
333 | (home-page "https://tevent.samba.org/") | |
334 | (description | |
335 | "Tevent is an event system based on the talloc memory management library. | |
336 | It is the core event system used in Samba. The low level tevent has support for | |
337 | many event types, including timers, signals, and the classic file descriptor events.") | |
338 | (license lgpl3+))) | |
339 | ||
52513595 SB |
340 | (define-public ldb |
341 | (package | |
342 | (name "ldb") | |
43e68aa4 | 343 | (version "1.3.3") |
52513595 SB |
344 | (source (origin |
345 | (method url-fetch) | |
346 | (uri (string-append "https://www.samba.org/ftp/ldb/ldb-" | |
347 | version ".tar.gz")) | |
348 | (sha256 | |
349 | (base32 | |
43e68aa4 | 350 | "14gsrm7dvyjpbpnc60z75j6fz2p187abm2h353lq95kx2bv70c1b")))) |
52513595 SB |
351 | (build-system gnu-build-system) |
352 | (arguments | |
353 | '(#:phases | |
354 | (modify-phases %standard-phases | |
355 | (replace 'configure | |
356 | ;; ldb use a custom configuration script that runs waf. | |
357 | (lambda* (#:key outputs #:allow-other-keys) | |
358 | (let ((out (assoc-ref outputs "out"))) | |
359 | (zero? (system* "./configure" | |
360 | (string-append "--prefix=" out) | |
361 | (string-append "--with-modulesdir=" out | |
362 | "/lib/ldb/modules") | |
363 | "--bundled-libraries=NONE")))))))) | |
364 | (native-inputs | |
fbed1501 MB |
365 | `(("cmocka" ,cmocka) |
366 | ("pkg-config" ,pkg-config) | |
52513595 SB |
367 | ("python" ,python-2))) |
368 | (propagated-inputs | |
369 | ;; ldb.pc refers to all these. | |
370 | `(("talloc" ,talloc) | |
371 | ("tdb" ,tdb))) | |
372 | (inputs | |
373 | `(("popt" ,popt) | |
374 | ("tevent" ,tevent))) | |
375 | (synopsis "LDAP-like embedded database") | |
376 | (home-page "https://ldb.samba.org/") | |
377 | (description | |
378 | "Ldb is a LDAP-like embedded database built on top of TDB. What ldb does | |
379 | is provide a fast database with an LDAP-like API designed to be used within an | |
380 | application. In some ways it can be seen as a intermediate solution between | |
381 | key-value pair databases and a real LDAP database.") | |
382 | (license lgpl3+))) | |
383 | ||
ae916e02 SB |
384 | (define-public ppp |
385 | (package | |
386 | (name "ppp") | |
387 | (version "2.4.7") | |
388 | (source (origin | |
389 | (method url-fetch) | |
390 | (uri (string-append "https://www.samba.org/ftp/ppp/ppp-" | |
391 | version ".tar.gz")) | |
392 | (sha256 | |
393 | (base32 | |
394 | "0c7vrjxl52pdwi4ckrvfjr08b31lfpgwf3pp0cqy76a77vfs7q02")))) | |
395 | (build-system gnu-build-system) | |
396 | (arguments | |
397 | '(#:tests? #f ; no check target | |
398 | #:make-flags '("CC=gcc") | |
399 | #:phases | |
400 | (modify-phases %standard-phases | |
401 | (add-before 'configure 'patch-Makefile | |
402 | (lambda* (#:key inputs #:allow-other-keys) | |
403 | (let ((libc (assoc-ref inputs "libc")) | |
404 | (libpcap (assoc-ref inputs "libpcap"))) | |
405 | (substitute* "pppd/Makefile.linux" | |
406 | (("/usr/include/crypt\\.h") | |
407 | (string-append libc "/include/crypt.h")) | |
408 | (("/usr/include/pcap-bpf.h") | |
409 | (string-append libpcap "/include/pcap-bpf.h"))))))))) | |
410 | (inputs | |
411 | `(("libpcap" ,libpcap))) | |
412 | (synopsis "Implementation of the Point-to-Point Protocol") | |
413 | (home-page "https://ppp.samba.org/") | |
414 | (description | |
415 | "The Point-to-Point Protocol (PPP) provides a standard way to establish | |
416 | a network connection over a serial link. At present, this package supports IP | |
417 | and IPV6 and the protocols layered above them, such as TCP and UDP.") | |
418 | ;; pppd, pppstats and pppdump are under BSD-style notices. | |
419 | ;; some of the pppd plugins are GPL'd. | |
420 | ;; chat is public domain. | |
421 | (license (list bsd-3 bsd-4 gpl2+ public-domain)))) |