gnu: python-pandas: Fix build on 32-bit.
[jackhill/guix/guix.git] / gnu / packages / samba.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2015 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2016 Adonay "adfeno" Felipe Nogueira <https://libreplanet.org/wiki/User:Adfeno> <adfeno@openmailbox.org>
6 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
13 ;;;
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
18 ;;;
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22 (define-module (gnu packages samba)
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix build-system gnu)
26 #:use-module (guix licenses)
27 #:use-module (gnu packages acl)
28 #:use-module (gnu packages admin)
29 #:use-module (gnu packages cups)
30 #:use-module (gnu packages databases)
31 #:use-module (gnu packages tls)
32 #:use-module (gnu packages popt)
33 #:use-module (gnu packages pkg-config)
34 #:use-module (gnu packages openldap)
35 #:use-module (gnu packages readline)
36 #:use-module (gnu packages linux)
37 #:use-module (gnu packages perl)
38 #:use-module (gnu packages python))
39
40 (define-public iniparser
41 (package
42 (name "iniparser")
43 (version "4.0")
44 (source (origin
45 (method url-fetch)
46 (uri (string-append "https://github.com/ndevilla/iniparser/archive/v"
47 version ".tar.gz"))
48 (file-name (string-append name "-" version ".tar.gz"))
49 (sha256
50 (base32
51 "1flj7srvh2hp9ls96qz922bklyhw7f27mmn23b16839zpdjddfz0"))))
52 (build-system gnu-build-system)
53 (arguments
54 '(#:phases
55 (modify-phases %standard-phases
56 (replace 'configure
57 (lambda* (#:key outputs #:allow-other-keys)
58 (substitute* '("Makefile" "test/Makefile")
59 (("/usr/lib")
60 (string-append (assoc-ref outputs "out") "/lib"))
61 (("\\?= gcc") "= gcc"))))
62 (replace 'build
63 (lambda _
64 (and (zero? (system* "make" "libiniparser.so"))
65 (symlink "libiniparser.so.0" "libiniparser.so"))))
66 (replace 'install
67 (lambda* (#:key outputs #:allow-other-keys)
68 (let* ((out (assoc-ref outputs "out"))
69 (lib (string-append out "/lib"))
70 (inc (string-append out "/include"))
71 (doc (string-append out "/share/doc"))
72 (html (string-append doc "/html")))
73 (define (copy dir)
74 (lambda (file)
75 (copy-file file
76 (string-append dir "/"
77 (basename file)))))
78 (mkdir-p lib)
79 (for-each (copy lib)
80 (find-files "." "^lib.*\\.(so\\.|a)"))
81 (with-directory-excursion lib
82 (symlink "libiniparser.so.0" "libiniparser.so"))
83 (mkdir-p inc)
84 (for-each (copy inc)
85 (find-files "src" "\\.h$"))
86 (mkdir-p html)
87 (for-each (copy html)
88 (find-files "html" ".*"))
89 (for-each (copy doc)
90 '("AUTHORS" "INSTALL" "LICENSE" "README.md"))))))))
91 (home-page "http://ndevilla.free.fr/iniparser")
92 (synopsis "Standalone ini file parsing library")
93 (description
94 "iniparser is a free stand-alone `ini' file parsing library (Windows
95 configuration files). It is written in portable ANSI C and should compile
96 anywhere.")
97 (license x11)))
98
99 (define-public samba
100 (package
101 (name "samba")
102 (version "4.5.3")
103 (source (origin
104 (method url-fetch)
105 (uri (string-append "https://download.samba.org/pub/samba/stable/"
106 "samba-" version ".tar.gz"))
107 (sha256
108 (base32
109 "1jif95684swssqwp9v3i2r08cn3r2iddf6ly68db4wmvl5ac8vgh"))))
110 (build-system gnu-build-system)
111 (arguments
112 '(#:phases
113 (modify-phases %standard-phases
114 (replace 'configure
115 ;; samba uses a custom configuration script that runs waf.
116 (lambda* (#:key outputs #:allow-other-keys)
117 (let* ((out (assoc-ref outputs "out"))
118 (libdir (string-append out "/lib")))
119 (zero? (system*
120 "./configure"
121 "--enable-fhs"
122 ;; XXX: heimdal not packaged.
123 "--bundled-libraries=com_err"
124 (string-append "--prefix=" out)
125 "--sysconfdir=/etc"
126 ;; Install public and private libraries into
127 ;; a single directory to avoid RPATH issues.
128 (string-append "--libdir=" libdir)
129 (string-append "--with-privatelibdir=" libdir))))))
130 (add-before 'install 'disable-etc-samba-directory-creation
131 (lambda _
132 (substitute* "dynconfig/wscript"
133 (("bld\\.INSTALL_DIRS\\(\"\",[[:blank:]]{1,}\"\\$\\{CONFIGDIR\\}[[:blank:]]{1,}")
134 "bld.INSTALL_DIRS(\"\", \"")))))
135 ;; XXX: The test infrastructure attempts to set password with
136 ;; smbpasswd, which fails with "smbpasswd -L can only be used by root."
137 ;; So disable tests until there's a workaround.
138 #:tests? #f))
139 (inputs ; TODO: Add missing dependencies
140 `(("acl" ,acl)
141 ("cups" ,cups)
142 ;; ("gamin" ,gamin)
143 ("gnutls" ,gnutls)
144 ("iniparser" ,iniparser)
145 ("libaio" ,libaio)
146 ("ldb" ,ldb)
147 ("linux-pam" ,linux-pam)
148 ("openldap" ,openldap)
149 ("popt" ,popt)
150 ("readline" ,readline)
151 ("talloc" ,talloc)
152 ("tevent" ,tevent)
153 ("tdb" ,tdb)))
154 (native-inputs
155 `(("perl" ,perl)
156 ("pkg-config" ,pkg-config)
157 ("python" ,python-2))) ; incompatible with Python 3
158 (home-page "https://www.samba.org/")
159 (synopsis
160 "The standard Windows interoperability suite of programs for GNU and Unix")
161 (description
162 "Since 1992, Samba has provided secure, stable and fast file and print
163 services for all clients using the SMB/CIFS protocol, such as all versions of
164 DOS and Windows, OS/2, GNU/Linux and many others.
165
166 Samba is an important component to seamlessly integrate Linux/Unix Servers and
167 Desktops into Active Directory environments using the winbind daemon.")
168 (license gpl3+)))
169
170 (define-public talloc
171 (package
172 (name "talloc")
173 (version "2.1.8")
174 (source (origin
175 (method url-fetch)
176 (uri (string-append "https://www.samba.org/ftp/talloc/talloc-"
177 version ".tar.gz"))
178 (sha256
179 (base32
180 "0c3ihyb0jd8mhvi7gg2mr5w1zl2habx6jlkbyxzyckad2q8lkl92"))))
181 (build-system gnu-build-system)
182 (arguments
183 '(#:phases
184 (modify-phases %standard-phases
185 (replace 'configure
186 (lambda* (#:key outputs #:allow-other-keys)
187 ;; test_magic_differs.sh has syntax error, and is not in the right
188 ;; place where wscript expected.
189 ;; Skip the test.
190 (substitute* "wscript"
191 (("magic_ret = .*") "magic_ret = 0\n"))
192 ;; talloc uses a custom configuration script that runs a
193 ;; python script called 'waf'.
194 (setenv "CONFIG_SHELL" (which "sh"))
195 (let ((out (assoc-ref outputs "out")))
196 (zero? (system* "./configure"
197 (string-append "--prefix=" out)))))))))
198 (inputs
199 `(("python" ,python-2)))
200 (home-page "http://talloc.samba.org")
201 (synopsis "Hierarchical, reference counted memory pool system")
202 (description
203 "Talloc is a hierarchical, reference counted memory pool system with
204 destructors. It is the core memory allocator used in Samba.")
205 (license gpl3+))) ;; The bundled "replace" library uses LGPL3.
206
207 (define-public tevent
208 (package
209 (name "tevent")
210 (version "0.9.31")
211 (source (origin
212 (method url-fetch)
213 (uri (string-append "https://www.samba.org/ftp/tevent/tevent-"
214 version ".tar.gz"))
215 (sha256
216 (base32
217 "1z1bij9gccps34q8zakr1k7k3gpqs25jas20x1hch16qd8jz44sa"))))
218 (build-system gnu-build-system)
219 (arguments
220 '(#:phases
221 (modify-phases %standard-phases
222 (replace 'configure
223 ;; tevent uses a custom configuration script that runs waf.
224 (lambda* (#:key outputs #:allow-other-keys)
225 (let ((out (assoc-ref outputs "out")))
226 (zero? (system* "./configure"
227 (string-append "--prefix=" out)
228 "--bundled-libraries=NONE"))))))))
229 (native-inputs
230 `(("pkg-config" ,pkg-config)
231 ("python" ,python-2)))
232 (propagated-inputs
233 `(("talloc" ,talloc))) ; required by tevent.pc
234 (synopsis "Event system library")
235 (home-page "https://tevent.samba.org/")
236 (description
237 "Tevent is an event system based on the talloc memory management library.
238 It is the core event system used in Samba. The low level tevent has support for
239 many event types, including timers, signals, and the classic file descriptor events.")
240 (license lgpl3+)))
241
242 (define-public ldb
243 (package
244 (name "ldb")
245 (version "1.1.27")
246 (source (origin
247 (method url-fetch)
248 (uri (string-append "https://www.samba.org/ftp/ldb/ldb-"
249 version ".tar.gz"))
250 (sha256
251 (base32
252 "1b1mkl5p8swb67s9aswavhzswlib34hpgsv66zgns009paf2df6d"))))
253 (build-system gnu-build-system)
254 (arguments
255 '(#:phases
256 (modify-phases %standard-phases
257 (replace 'configure
258 ;; ldb use a custom configuration script that runs waf.
259 (lambda* (#:key outputs #:allow-other-keys)
260 (let ((out (assoc-ref outputs "out")))
261 (zero? (system* "./configure"
262 (string-append "--prefix=" out)
263 (string-append "--with-modulesdir=" out
264 "/lib/ldb/modules")
265 "--bundled-libraries=NONE"))))))))
266 (native-inputs
267 `(("pkg-config" ,pkg-config)
268 ("python" ,python-2)))
269 (propagated-inputs
270 ;; ldb.pc refers to all these.
271 `(("talloc" ,talloc)
272 ("tdb" ,tdb)))
273 (inputs
274 `(("popt" ,popt)
275 ("tevent" ,tevent)))
276 (synopsis "LDAP-like embedded database")
277 (home-page "https://ldb.samba.org/")
278 (description
279 "Ldb is a LDAP-like embedded database built on top of TDB. What ldb does
280 is provide a fast database with an LDAP-like API designed to be used within an
281 application. In some ways it can be seen as a intermediate solution between
282 key-value pair databases and a real LDAP database.")
283 (license lgpl3+)))
284
285 (define-public ppp
286 (package
287 (name "ppp")
288 (version "2.4.7")
289 (source (origin
290 (method url-fetch)
291 (uri (string-append "https://www.samba.org/ftp/ppp/ppp-"
292 version ".tar.gz"))
293 (sha256
294 (base32
295 "0c7vrjxl52pdwi4ckrvfjr08b31lfpgwf3pp0cqy76a77vfs7q02"))))
296 (build-system gnu-build-system)
297 (arguments
298 '(#:tests? #f ; no check target
299 #:make-flags '("CC=gcc")
300 #:phases
301 (modify-phases %standard-phases
302 (add-before 'configure 'patch-Makefile
303 (lambda* (#:key inputs #:allow-other-keys)
304 (let ((libc (assoc-ref inputs "libc"))
305 (libpcap (assoc-ref inputs "libpcap")))
306 (substitute* "pppd/Makefile.linux"
307 (("/usr/include/crypt\\.h")
308 (string-append libc "/include/crypt.h"))
309 (("/usr/include/pcap-bpf.h")
310 (string-append libpcap "/include/pcap-bpf.h")))))))))
311 (inputs
312 `(("libpcap" ,libpcap)))
313 (synopsis "Implementation of the Point-to-Point Protocol")
314 (home-page "https://ppp.samba.org/")
315 (description
316 "The Point-to-Point Protocol (PPP) provides a standard way to establish
317 a network connection over a serial link. At present, this package supports IP
318 and IPV6 and the protocols layered above them, such as TCP and UDP.")
319 ;; pppd, pppstats and pppdump are under BSD-style notices.
320 ;; some of the pppd plugins are GPL'd.
321 ;; chat is public domain.
322 (license (list bsd-3 bsd-4 gpl2+ public-domain))))