sssd.scm 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
  3. ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
  4. ;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
  5. ;;; Copyright © 2021 Timotej Lazar <timotej.lazar@araneo.si>
  6. ;;; Copyright © 2021, 2022 Remco van 't Veer <remco@remworks.net>
  7. ;;;
  8. ;;; This file is part of GNU Guix.
  9. ;;;
  10. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  11. ;;; under the terms of the GNU General Public License as published by
  12. ;;; the Free Software Foundation; either version 3 of the License, or (at
  13. ;;; your option) any later version.
  14. ;;;
  15. ;;; GNU Guix is distributed in the hope that it will be useful, but
  16. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  17. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. ;;; GNU General Public License for more details.
  19. ;;;
  20. ;;; You should have received a copy of the GNU General Public License
  21. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  22. (define-module (gnu packages sssd)
  23. #:use-module ((guix licenses) #:prefix license:)
  24. #:use-module (guix packages)
  25. #:use-module (guix download)
  26. #:use-module (guix git-download)
  27. #:use-module (guix utils)
  28. #:use-module (guix build-system gnu)
  29. #:use-module (gnu packages)
  30. #:use-module (gnu packages)
  31. #:use-module (gnu packages adns)
  32. #:use-module (gnu packages augeas)
  33. #:use-module (gnu packages autotools)
  34. #:use-module (gnu packages check)
  35. #:use-module (gnu packages curl)
  36. #:use-module (gnu packages cyrus-sasl)
  37. #:use-module (gnu packages databases)
  38. #:use-module (gnu packages dns)
  39. #:use-module (gnu packages docbook)
  40. #:use-module (gnu packages documentation)
  41. #:use-module (gnu packages glib)
  42. #:use-module (gnu packages kerberos)
  43. #:use-module (gnu packages libunistring)
  44. #:use-module (gnu packages linux)
  45. #:use-module (gnu packages nss)
  46. #:use-module (gnu packages openldap)
  47. #:use-module (gnu packages tls)
  48. #:use-module (gnu packages pcre)
  49. #:use-module (gnu packages popt)
  50. #:use-module (gnu packages pkg-config)
  51. #:use-module (gnu packages samba)
  52. #:use-module (gnu packages selinux)
  53. #:use-module (gnu packages web)
  54. #:use-module (gnu packages xml))
  55. (define-public adcli
  56. (package
  57. (name "adcli")
  58. (version "0.9.1")
  59. (source
  60. (origin
  61. (method git-fetch)
  62. (uri (git-reference
  63. (url "https://gitlab.freedesktop.org/realmd/adcli.git")
  64. (commit version)))
  65. (file-name (git-file-name name version))
  66. (sha256
  67. (base32 "1mwzd5vakdsssdvs6vljqpp8pw8i97n5lhxvmn9dn9720am7hfv7"))))
  68. (build-system gnu-build-system)
  69. (arguments
  70. `(#:configure-flags
  71. ;; The net tool is used to update the stored machine key for samba.
  72. (list (string-append "--with-samba-data-tool="
  73. (assoc-ref %build-inputs "samba") "/bin/net"))
  74. #:phases
  75. (modify-phases %standard-phases
  76. (add-after 'unpack 'use-local-docbook
  77. ;; Patch Makefile and docs to use local docbook resources.
  78. (lambda _
  79. (let* ((docbook-xml (assoc-ref %build-inputs "docbook-xml"))
  80. (docbook-xsl (assoc-ref %build-inputs "docbook-xsl"))
  81. (xsldir (string-append docbook-xsl "/xml/xsl/docbook-xsl-"
  82. ,(package-version docbook-xsl))))
  83. (with-directory-excursion "doc"
  84. (substitute*
  85. '("Makefile.am" "adcli.xml" "adcli-devel.xml" "adcli-docs.xml")
  86. (("http://docbook.sourceforge.net/release/xsl/current(/[^\"]*)" _ path)
  87. (string-append xsldir path))
  88. (("http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd")
  89. (string-append docbook-xml "/xml/dtd/docbook/docbookx.dtd")))
  90. (substitute* "Makefile.am"
  91. (("\\$\\(XMLTO\\)" xmlto)
  92. (string-append xmlto " --searchpath " xsldir "/html"))))))))))
  93. (native-inputs
  94. (list autoconf
  95. automake
  96. docbook-xml
  97. docbook-xsl
  98. libtool
  99. libxslt
  100. util-linux ; For `rev` command used in tests.
  101. xmlto))
  102. (inputs
  103. (list cyrus-sasl mit-krb5 samba openldap))
  104. (home-page "https://gitlab.freedesktop.org/realmd/adcli/")
  105. (synopsis "Helper library and tools for Active Directory client operations")
  106. (description "@command{adcli} is a command‐line tool to join a computer to
  107. an Active Directory domain. It can also update the machine password and
  108. manage user, group and computer accounts for a domain.")
  109. (license license:lgpl2.1+)))
  110. (define-public ding-libs
  111. (package
  112. (name "ding-libs")
  113. (version "0.6.1")
  114. (source (origin
  115. (method url-fetch)
  116. (uri (string-append "https://releases.pagure.org/SSSD/ding-libs/"
  117. "ding-libs-" version ".tar.gz"))
  118. (sha256
  119. (base32
  120. "1h97mx2jdv4caiz4r7y8rxfsq78fx0k4jjnfp7x2s7xqvqks66d3"))))
  121. (build-system gnu-build-system)
  122. (home-page "https://pagure.io/SSSD/ding-libs/")
  123. (synopsis "Libraries for SSSD")
  124. (description
  125. "DING-LIBS (DING Is Not Glib) are a set of small, useful libraries that
  126. the @dfn{System Security Services Daemon} (SSSD) uses and makes available to
  127. other projects. They include: libdhash, an implementation of a dynamic hash
  128. table which will dynamically resize to achieve optimal storage and access time
  129. properties; ini_config, a library for parsing and managing @code{INI} files;
  130. path_utils, a library to manage UNIX paths and subsets of paths; collection, a
  131. generic, hierarchical grouping mechanism for complex data sets; ref_array, a
  132. dynamically-growing, reference-counted array; libbasicobjects, a set of
  133. fundamental object types for C.")
  134. (license license:lgpl3+)))
  135. ;; Note: This package installs modules for ldb and nss. For the former we
  136. ;; need to set LDB_MODULES_PATH. For the latter LD_PRELOAD or LD_LIBRARY_PATH
  137. ;; is needed.
  138. (define-public sssd
  139. (package
  140. (name "sssd")
  141. (version "1.16.5")
  142. (source (origin
  143. (method url-fetch)
  144. (uri (string-append "https://releases.pagure.org/SSSD/sssd/"
  145. "sssd-" version ".tar.gz"))
  146. (sha256
  147. (base32
  148. "1h6hwibaf3xa2w6qpzjiiywmfj6zkgbz4r2isf3gd0xm6vq7n6if"))
  149. (patches (search-patches "sssd-fix-samba.patch"
  150. "sssd-system-directories.patch"
  151. "sssd-collision-with-external-nss-symbol.patch"
  152. "sssd-fix-samba-4.15.3.patch"))))
  153. (build-system gnu-build-system)
  154. (arguments
  155. `(#:make-flags
  156. (list (string-append "DOCBOOK_XSLT="
  157. (assoc-ref %build-inputs "docbook-xsl")
  158. "/xml/xsl/docbook-xsl-"
  159. ,(package-version docbook-xsl)
  160. "/manpages/docbook.xsl")
  161. ;; Remove "--postvalid" option, because that requires access to
  162. ;; online DTDs.
  163. "XMLLINT_FLAGS = --catalogs --nonet --noent --xinclude --noout")
  164. #:configure-flags
  165. (list "--localstatedir=/var" ;for /var/lib/sss, /var/run/sssd.pid, etc.
  166. "--sysconfdir=/etc" ;/etc/sssd
  167. "--disable-cifs-idmap-plugin"
  168. "--without-nfsv4-idmapd-plugin"
  169. "--without-python2-bindings"
  170. "--without-python3-bindings"
  171. (string-append "--with-plugin-path="
  172. (assoc-ref %outputs "out")
  173. "/lib/sssd")
  174. (string-append "--with-krb5-plugin-path="
  175. (assoc-ref %outputs "out")
  176. "/lib/krb5/plugins/libkrb5")
  177. (string-append "--with-cifs-plugin-path="
  178. (assoc-ref %outputs "out")
  179. "/lib/cifs-utils")
  180. (string-append "--with-init-dir="
  181. (assoc-ref %outputs "out")
  182. "/etc/init.d")
  183. (string-append "--with-ldb-lib-dir="
  184. (assoc-ref %outputs "out")
  185. "/lib/ldb/modules/ldb")
  186. (string-append "--with-xml-catalog-path="
  187. (assoc-ref %build-inputs "docbook-xml")
  188. "/xml/dtd/docbook/catalog.xml"))
  189. #:phases
  190. (modify-phases %standard-phases
  191. (add-after 'unpack 'disable-failing-test
  192. (lambda _
  193. (substitute* "src/tests/responder_socket_access-tests.c"
  194. (("tcase_add_test\\(tc_utils, resp_str_to_array_test\\);") ""))
  195. #t))
  196. (add-after 'unpack 'add-config-in
  197. (lambda _
  198. (let ((config.h (open-file "config.h.in" "a")))
  199. (display (string-append "
  200. /* Missing in commits on original repo, dunno why but won't work without. */
  201. #undef SMB_HAS_NEW_NDR_PULL_STEAL_SWITCH
  202. ")
  203. config.h)
  204. (close config.h))))
  205. (add-before 'configure 'autoconf
  206. (lambda _
  207. (invoke "autoconf"))))))
  208. (inputs
  209. (list augeas
  210. `(,isc-bind "utils")
  211. c-ares
  212. curl
  213. cyrus-sasl
  214. dbus
  215. ding-libs
  216. glib
  217. gnutls
  218. http-parser
  219. jansson
  220. ldb
  221. libselinux
  222. libsemanage
  223. libunistring
  224. linux-pam
  225. mit-krb5
  226. nss
  227. openldap
  228. openssl
  229. pcre
  230. popt
  231. samba
  232. talloc
  233. tdb
  234. tevent))
  235. (native-inputs
  236. (list autoconf-2.69
  237. check-0.14
  238. docbook-xsl
  239. docbook-xml
  240. libxml2 ; for xmllint
  241. libxslt
  242. pkg-config
  243. `(,util-linux "lib"))) ;for uuid.h, reqired for KCM
  244. (home-page "https://pagure.io/SSSD/sssd/")
  245. (synopsis "System security services daemon")
  246. (description "SSSD is a system daemon. Its primary function is to provide
  247. access to identity and authentication remote resource through a common
  248. framework that can provide caching and offline support to the system. It
  249. provides PAM and NSS modules, and in the future will support D-BUS based
  250. interfaces for extended user information. It also provides a better database
  251. to store local users as well as extended user data.")
  252. (license license:gpl3+)))