summaryrefslogtreecommitdiff
path: root/siguix/packages/samba.scm
blob: b9372a7e30391f4e72477ebb2892500f5050ae57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2015, 2017, 2021 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2016, 2017, 2019, 2021 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2016 Adonay "adfeno" Felipe Nogueira <https://libreplanet.org/wiki/User:Adfeno> <adfeno@openmailbox.org>
;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
;;; Copyright © 2017, 2018, 2020 Marius Bakke <mbakke@fastmail.com>
;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2019 Rutger Helling <rhelling@mykolab.com>
;;; Copyright © 2020 Pierre Langlois <pierre.langlois@gmx.com>
;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2021 Simon Streit <simon@netpanic.org>
;;;
;;; This file is NOT part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (siguix packages samba)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module (guix build-system gnu)
  #:use-module (guix build-system copy)
  #:use-module (guix licenses)
  #:use-module (guix utils)
  #:use-module (gnu packages)
  #:use-module (gnu packages acl)
  #:use-module (gnu packages admin)
  #:use-module (gnu packages avahi)
  #:use-module (gnu packages samba)
  #:use-module (gnu packages autotools)
  #:use-module (gnu packages backup)
  #:use-module (gnu packages base)
  #:use-module (gnu packages check)
  #:use-module (gnu packages crypto)
  #:use-module (gnu packages cups)
  #:use-module (gnu packages databases)
  #:use-module (gnu packages docbook)
  #:use-module (gnu packages glib)
  #:use-module (gnu packages gnome)
  #:use-module (gnu packages gnupg)
  #:use-module (gnu packages kerberos)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages onc-rpc)
  #:use-module (gnu packages openldap)
  #:use-module (gnu packages perl)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages popt)
  #:use-module (gnu packages python)
  #:use-module (gnu packages python-xyz)
  #:use-module (gnu packages readline)
  #:use-module (gnu packages time)
  #:use-module (gnu packages tls)
  #:use-module (gnu packages web)
  #:use-module (gnu packages xml))

(define-public samba-mod
  (package/inherit samba
    (name "samba-mod")
    ;; (arguments
    ;;  `(#:make-flags '("TEST_OPTIONS=--quick") ;some tests are very long
    ;;    #:phases
    ;;    (modify-phases %standard-phases
    ;;      (add-before 'configure 'setup-docbook-stylesheets
    ;;        (lambda* (#:key inputs #:allow-other-keys)
    ;;          ;; Append Samba's own DTDs to XML_CATALOG_FILES
    ;;          ;; (c.f. docs-xml/build/README).
    ;;          (copy-file "docs-xml/build/catalog.xml.in"
    ;;                     "docs-xml/build/catalog.xml")
    ;;          (substitute* "docs-xml/build/catalog.xml"
    ;;            (("/@abs_top_srcdir@")
    ;;             (string-append (getcwd) "/docs-xml")))
    ;;          ;; Honor XML_CATALOG_FILES.
    ;;          (substitute* "buildtools/wafsamba/wafsamba.py"
    ;;            (("XML_CATALOG_FILES=\"\\$\\{SAMBA_CATALOGS\\}" all)
    ;;             (string-append all " $XML_CATALOG_FILES")))
    ;;          #t))
    ;;      (replace 'configure
    ;;        ;; Samba uses a custom configuration script that runs WAF.
    ;;        (lambda* (#:key outputs #:allow-other-keys)
    ;;          (let* ((out    (assoc-ref outputs "out"))
    ;;                 (libdir (string-append out "/lib")))
    ;;            (invoke "./configure"
    ;;                    "--enable-selftest"
    ;;                    "--enable-fhs"
    ;;                    (string-append "--prefix=" out)
    ;;                    "--sysconfdir=/etc"
    ;;                    "--localstatedir=/var"
    ;;                    ;; Install public and private libraries into
    ;;                    ;; a single directory to avoid RPATH issues.
    ;;                    (string-append "--libdir=" libdir)
    ;;                    (string-append "--with-privatelibdir=" libdir)
    ;;                    ;; Build samba instead with mit-krb5
    ;;                    "--with-system-mitkrb5"
    ;;                    (string-append "--with-system-mitkdc="
    ;;                                   (assoc-ref %build-inputs "mit-krb5"))
    ;;                    "--with-experimental-mit-ad-dc"))))
    ;;      (add-before 'install 'disable-etc,var-samba-directories-setup
    ;;        (lambda _
    ;;          (substitute* "dynconfig/wscript"
    ;;            (("bld\\.INSTALL_DIR.*") ""))
    ;;          #t))
    ;;      (add-after 'install 'wrap-program
    ;;        ;; Some samba tools selectively fail to find talloc, tdb
    ;;        ;; and dnspython.
    ;;        (lambda* (#:key inputs outputs #:allow-other-keys)
    ;;          (let ((out (string-append (assoc-ref outputs "out")))
    ;;                (talloc (string-append (assoc-ref inputs "talloc")
    ;;                                       "/lib/python3.9/site-packages"))
    ;;                (tdb (string-append (assoc-ref inputs "tdb")
    ;;                                    "/lib/python3.9/site-packages"))
    ;;                (python-dnspython (string-append
    ;;                                   (assoc-ref inputs "python-dnspython")
    ;;                                   "/lib/python3.9/site-packages")))
    ;;            (for-each
    ;;             (lambda (bin)
    ;;               (wrap-program (string-append out bin)
    ;;                 `("PYTHONPATH" prefix (,talloc ,tdb ,python-dnspython))))
    ;;             '("/bin/samba-tool"
    ;;               "/sbin/samba-gpupdate"
    ;;               "/sbin/samba_dnsupdate"
    ;;               "/sbin/samba_downgrade_db"
    ;;               "/sbin/samba_kcc"
    ;;               "/sbin/samba_spnupdate"
    ;;               "/sbin/samba_upgradedns"))))))
    ;;    ;; FIXME: The test suite seemingly hangs after failing to provision the
    ;;    ;; test environment.
    ;;    #:tests? #f))
    (inputs (modify-inputs (package-inputs samba)
              (append avahi
                      ;; mit-krb5 ;new!
                      ;; python-dnspython ;add missing dns module
                      )))))

(define-public wsdd
  (package
    (name "wsdd")
    (version "0.7.0")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference (url "https://github.com/christgau/wsdd")
                           (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "04an2w6hamnai668ag4vq8x0i09fsg2jrayb4a7ar0x6bn837k7m"))))
    (build-system copy-build-system)
    (inputs
     `(("python" ,python)))
    (arguments
     '(#:install-plan
       '(("src/wsdd.py" "bin/wsdd")
         ("man/wsdd.1" "share/man/man1/"))))
    (home-page "https://github.com/christgau/wsdd")
    (synopsis "A Web Service Discovery host daemon")
    (description "This daemon allows (Samba) hosts to be found by Web
Service Dicovery Clients.  It also implements the client side of the
discovery protocol which allows to search for devices implementing
WSD.")
    (license expat)))