You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

432 lines
18 KiB

gnu: Separate Python core packages from the rest. * gnu/packages/python.scm: Move hundreds of package definitions from here... * gnu/packages/python-xyz.scm: ...to this new module. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. * gnu/packages/ada.scm, gnu/packages/admin.scm, gnu/packages/android.scm, gnu/packages/audio.scm, gnu/packages/backup.scm, gnu/packages/benchmark.scm, gnu/packages/bioinformatics.scm, gnu/packages/bittorrent.scm, gnu/packages/calendar.scm, gnu/packages/check.scm, gnu/packages/chemistry.scm, gnu/packages/cluster.scm, gnu/packages/compression.scm, gnu/packages/connman.scm, gnu/packages/crypto.scm, gnu/packages/cups.scm, gnu/packages/databases.scm, gnu/packages/dav.scm, gnu/packages/direct-connect.scm, gnu/packages/disk.scm, gnu/packages/django.scm, gnu/packages/dlang.scm, gnu/packages/docker.scm, gnu/packages/ebook.scm, gnu/packages/elf.scm, gnu/packages/emacs.scm, gnu/packages/emulators.scm, gnu/packages/engineering.scm, gnu/packages/enlightenment.scm, gnu/packages/finance.scm, gnu/packages/fltk.scm, gnu/packages/fontutils.scm, gnu/packages/freedesktop.scm, gnu/packages/game-development.scm, gnu/packages/games.scm, gnu/packages/geo.scm, gnu/packages/gl.scm, gnu/packages/glib.scm, gnu/packages/gnome.scm, gnu/packages/gnupg.scm, gnu/packages/gnuzilla.scm, gnu/packages/graph.scm, gnu/packages/graphics.scm, gnu/packages/graphviz.scm, gnu/packages/gtk.scm, gnu/packages/ham-radio.scm, gnu/packages/image-processing.scm, gnu/packages/image-viewers.scm, gnu/packages/image.scm, gnu/packages/irc.scm, gnu/packages/jrnl.scm, gnu/packages/julia.scm, gnu/packages/kde-frameworks.scm, gnu/packages/key-mon.scm, gnu/packages/libffi.scm, gnu/packages/libreoffice.scm, gnu/packages/libusb.scm, gnu/packages/lirc.scm, gnu/packages/logging.scm, gnu/packages/machine-learning.scm, gnu/packages/mail.scm, gnu/packages/mate.scm, gnu/packages/maths.scm, gnu/packages/medical.scm, gnu/packages/messaging.scm, gnu/packages/monitoring.scm, gnu/packages/mp3.scm, gnu/packages/mpd.scm, gnu/packages/music.scm, gnu/packages/networking.scm, gnu/packages/nutrition.scm, gnu/packages/openldap.scm, gnu/packages/openstack.scm, gnu/packages/package-management.scm, gnu/packages/password-utils.scm, gnu/packages/patchutils.scm, gnu/packages/pdf.scm, gnu/packages/photo.scm, gnu/packages/polkit.scm, gnu/packages/protobuf.scm, gnu/packages/python-crypto.scm, gnu/packages/python-web.scm, gnu/packages/qt.scm, gnu/packages/rdf.scm, gnu/packages/ruby.scm, gnu/packages/search.scm, gnu/packages/selinux.scm, gnu/packages/serialization.scm, gnu/packages/shells.scm, gnu/packages/simulation.scm, gnu/packages/ssh.scm, gnu/packages/statistics.scm, gnu/packages/storage.scm, gnu/packages/sync.scm, gnu/packages/terminals.scm, gnu/packages/textutils.scm, gnu/packages/time.scm, gnu/packages/tls.scm, gnu/packages/tor.scm, gnu/packages/tryton.scm, gnu/packages/version-control.scm, gnu/packages/video.scm, gnu/packages/virtualization.scm, gnu/packages/vpn.scm, gnu/packages/web-browsers.scm, gnu/packages/web.scm, gnu/packages/wicd.scm, gnu/packages/xdisorg.scm, gnu/packages/xorg.scm: Update module references.
3 years ago
gnu: Remove ".git" from "https://github/…/….git". Until now, 'lookup-origin' and thus 'lookup-origin-revision' in (guix swh) would sometimes return #f for these because the ".git" URLs are redirects to the non-".git" URLs. Consequently, 'guix lint -c archival' would keep saying "scheduled Software Heritage archival"; likewise, the fallback download code would fail. * gnu/packages/ada.scm, gnu/packages/admin.scm, gnu/packages/aidc.scm, gnu/packages/algebra.scm, gnu/packages/android.scm, gnu/packages/animation.scm, gnu/packages/arcan.scm, gnu/packages/assembly.scm, gnu/packages/audio.scm, gnu/packages/authentication.scm, gnu/packages/avr.scm, gnu/packages/axoloti.scm, gnu/packages/backup.scm, gnu/packages/bash.scm, gnu/packages/benchmark.scm, gnu/packages/bioconductor.scm, gnu/packages/bioinformatics.scm, gnu/packages/bittorrent.scm, gnu/packages/boost.scm, gnu/packages/build-tools.scm, gnu/packages/c.scm, gnu/packages/calendar.scm, gnu/packages/cdrom.scm, gnu/packages/check.scm, gnu/packages/chemistry.scm, gnu/packages/chez.scm, gnu/packages/clojure.scm, gnu/packages/code.scm, gnu/packages/compression.scm, gnu/packages/compton.scm, gnu/packages/coq.scm, gnu/packages/cpp.scm, gnu/packages/cran.scm, gnu/packages/crypto.scm, gnu/packages/curl.scm, gnu/packages/databases.scm, gnu/packages/datastructures.scm, gnu/packages/debug.scm, gnu/packages/disk.scm, gnu/packages/distributed.scm, gnu/packages/django.scm, gnu/packages/dlang.scm, gnu/packages/dns.scm, gnu/packages/docker.scm, gnu/packages/education.scm, gnu/packages/efi.scm, gnu/packages/elixir.scm, gnu/packages/emacs-xyz.scm, gnu/packages/embedded.scm, gnu/packages/emulators.scm, gnu/packages/engineering.scm, gnu/packages/erlang.scm, gnu/packages/fabric-management.scm, gnu/packages/file-systems.scm, gnu/packages/finance.scm, gnu/packages/firmware.scm, gnu/packages/flashing-tools.scm, gnu/packages/fonts.scm, gnu/packages/fontutils.scm, gnu/packages/fpga.scm, gnu/packages/game-development.scm, gnu/packages/games.scm, gnu/packages/genealogy.scm, gnu/packages/genimage.scm, gnu/packages/geo.scm, gnu/packages/gimp.scm, gnu/packages/gl.scm, gnu/packages/gnome-xyz.scm, gnu/packages/gnome.scm, gnu/packages/gnuzilla.scm, gnu/packages/golang.scm, gnu/packages/gpodder.scm, gnu/packages/graph.scm, gnu/packages/graphics.scm, gnu/packages/graphviz.scm, gnu/packages/groff.scm, gnu/packages/groovy.scm, gnu/packages/gtk.scm, gnu/packages/guile-xyz.scm, gnu/packages/guile.scm, gnu/packages/hardware.scm, gnu/packages/haskell-apps.scm, gnu/packages/haskell-xyz.scm, gnu/packages/hexedit.scm, gnu/packages/i2p.scm, gnu/packages/ibus.scm, gnu/packages/image-processing.scm, gnu/packages/image-viewers.scm, gnu/packages/image.scm, gnu/packages/ipfs.scm, gnu/packages/java-graphics.scm, gnu/packages/java-maths.scm, gnu/packages/java.scm, gnu/packages/javascript.scm, gnu/packages/jrnl.scm, gnu/packages/julia.scm, gnu/packages/jupyter.scm, gnu/packages/kodi.scm, gnu/packages/language.scm, gnu/packages/lego.scm, gnu/packages/less.scm, gnu/packages/libusb.scm, gnu/packages/linux.scm, gnu/packages/lirc.scm, gnu/packages/lisp-xyz.scm, gnu/packages/llvm.scm, gnu/packages/logging.scm, gnu/packages/lolcode.scm, gnu/packages/lua.scm, gnu/packages/lxde.scm, gnu/packages/lxqt.scm, gnu/packages/machine-learning.scm, gnu/packages/mail.scm, gnu/packages/markup.scm, gnu/packages/maths.scm, gnu/packages/maven.scm, gnu/packages/mes.scm, gnu/packages/messaging.scm, gnu/packages/monitoring.scm, gnu/packages/mpd.scm, gnu/packages/music.scm, gnu/packages/networking.scm, gnu/packages/node-xyz.scm, gnu/packages/ocaml.scm, gnu/packages/ocr.scm, gnu/packages/onc-rpc.scm, gnu/packages/opencl.scm, gnu/packages/opencog.scm, gnu/packages/pantheon.scm, gnu/packages/password-utils.scm, gnu/packages/patchutils.scm, gnu/packages/pdf.scm, gnu/packages/perl6.scm, gnu/packages/phabricator.scm, gnu/packages/popt.scm, gnu/packages/printers.scm, gnu/packages/prolog.scm, gnu/packages/protobuf.scm, gnu/packages/pulseaudio.scm, gnu/packages/python-crypto.scm, gnu/packages/python-web.scm, gnu/packages/python-xyz.scm, gnu/packages/qt.scm, gnu/packages/radio.scm, gnu/packages/rails.scm, gnu/packages/rdf.scm, gnu/packages/rednotebook.scm, gnu/packages/rpc.scm, gnu/packages/rsync.scm, gnu/packages/ruby.scm, gnu/packages/rust.scm, gnu/packages/scheme.scm, gnu/packages/screen.scm, gnu/packages/security-token.scm, gnu/packages/selinux.scm, gnu/packages/serialization.scm, gnu/packages/shells.scm, gnu/packages/shellutils.scm, gnu/packages/simh.scm, gnu/packages/sml.scm, gnu/packages/ssh.scm, gnu/packages/statistics.scm, gnu/packages/stenography.scm, gnu/packages/sync.scm, gnu/packages/syncthing.scm, gnu/packages/synergy.scm, gnu/packages/telephony.scm, gnu/packages/terminals.scm, gnu/packages/tex.scm, gnu/packages/texinfo.scm, gnu/packages/text-editors.scm, gnu/packages/textutils.scm, gnu/packages/time.scm, gnu/packages/tmux.scm, gnu/packages/tor.scm, gnu/packages/toys.scm, gnu/packages/version-control.scm, gnu/packages/video.scm, gnu/packages/vim.scm, gnu/packages/virtualization.scm, gnu/packages/vlang.scm, gnu/packages/vnc.scm, gnu/packages/vpn.scm, gnu/packages/web-browsers.scm, gnu/packages/web.scm, gnu/packages/wireservice.scm, gnu/packages/wm.scm, gnu/packages/wxwidgets.scm, gnu/packages/xdisorg.scm, gnu/packages/xml.scm, gnu/packages/xorg.scm, tests/lint.scm: Remove trailing ".git" from 'git-reference' URL.
1 year ago
gnu: Remove ".git" from "https://github/…/….git". Until now, 'lookup-origin' and thus 'lookup-origin-revision' in (guix swh) would sometimes return #f for these because the ".git" URLs are redirects to the non-".git" URLs. Consequently, 'guix lint -c archival' would keep saying "scheduled Software Heritage archival"; likewise, the fallback download code would fail. * gnu/packages/ada.scm, gnu/packages/admin.scm, gnu/packages/aidc.scm, gnu/packages/algebra.scm, gnu/packages/android.scm, gnu/packages/animation.scm, gnu/packages/arcan.scm, gnu/packages/assembly.scm, gnu/packages/audio.scm, gnu/packages/authentication.scm, gnu/packages/avr.scm, gnu/packages/axoloti.scm, gnu/packages/backup.scm, gnu/packages/bash.scm, gnu/packages/benchmark.scm, gnu/packages/bioconductor.scm, gnu/packages/bioinformatics.scm, gnu/packages/bittorrent.scm, gnu/packages/boost.scm, gnu/packages/build-tools.scm, gnu/packages/c.scm, gnu/packages/calendar.scm, gnu/packages/cdrom.scm, gnu/packages/check.scm, gnu/packages/chemistry.scm, gnu/packages/chez.scm, gnu/packages/clojure.scm, gnu/packages/code.scm, gnu/packages/compression.scm, gnu/packages/compton.scm, gnu/packages/coq.scm, gnu/packages/cpp.scm, gnu/packages/cran.scm, gnu/packages/crypto.scm, gnu/packages/curl.scm, gnu/packages/databases.scm, gnu/packages/datastructures.scm, gnu/packages/debug.scm, gnu/packages/disk.scm, gnu/packages/distributed.scm, gnu/packages/django.scm, gnu/packages/dlang.scm, gnu/packages/dns.scm, gnu/packages/docker.scm, gnu/packages/education.scm, gnu/packages/efi.scm, gnu/packages/elixir.scm, gnu/packages/emacs-xyz.scm, gnu/packages/embedded.scm, gnu/packages/emulators.scm, gnu/packages/engineering.scm, gnu/packages/erlang.scm, gnu/packages/fabric-management.scm, gnu/packages/file-systems.scm, gnu/packages/finance.scm, gnu/packages/firmware.scm, gnu/packages/flashing-tools.scm, gnu/packages/fonts.scm, gnu/packages/fontutils.scm, gnu/packages/fpga.scm, gnu/packages/game-development.scm, gnu/packages/games.scm, gnu/packages/genealogy.scm, gnu/packages/genimage.scm, gnu/packages/geo.scm, gnu/packages/gimp.scm, gnu/packages/gl.scm, gnu/packages/gnome-xyz.scm, gnu/packages/gnome.scm, gnu/packages/gnuzilla.scm, gnu/packages/golang.scm, gnu/packages/gpodder.scm, gnu/packages/graph.scm, gnu/packages/graphics.scm, gnu/packages/graphviz.scm, gnu/packages/groff.scm, gnu/packages/groovy.scm, gnu/packages/gtk.scm, gnu/packages/guile-xyz.scm, gnu/packages/guile.scm, gnu/packages/hardware.scm, gnu/packages/haskell-apps.scm, gnu/packages/haskell-xyz.scm, gnu/packages/hexedit.scm, gnu/packages/i2p.scm, gnu/packages/ibus.scm, gnu/packages/image-processing.scm, gnu/packages/image-viewers.scm, gnu/packages/image.scm, gnu/packages/ipfs.scm, gnu/packages/java-graphics.scm, gnu/packages/java-maths.scm, gnu/packages/java.scm, gnu/packages/javascript.scm, gnu/packages/jrnl.scm, gnu/packages/julia.scm, gnu/packages/jupyter.scm, gnu/packages/kodi.scm, gnu/packages/language.scm, gnu/packages/lego.scm, gnu/packages/less.scm, gnu/packages/libusb.scm, gnu/packages/linux.scm, gnu/packages/lirc.scm, gnu/packages/lisp-xyz.scm, gnu/packages/llvm.scm, gnu/packages/logging.scm, gnu/packages/lolcode.scm, gnu/packages/lua.scm, gnu/packages/lxde.scm, gnu/packages/lxqt.scm, gnu/packages/machine-learning.scm, gnu/packages/mail.scm, gnu/packages/markup.scm, gnu/packages/maths.scm, gnu/packages/maven.scm, gnu/packages/mes.scm, gnu/packages/messaging.scm, gnu/packages/monitoring.scm, gnu/packages/mpd.scm, gnu/packages/music.scm, gnu/packages/networking.scm, gnu/packages/node-xyz.scm, gnu/packages/ocaml.scm, gnu/packages/ocr.scm, gnu/packages/onc-rpc.scm, gnu/packages/opencl.scm, gnu/packages/opencog.scm, gnu/packages/pantheon.scm, gnu/packages/password-utils.scm, gnu/packages/patchutils.scm, gnu/packages/pdf.scm, gnu/packages/perl6.scm, gnu/packages/phabricator.scm, gnu/packages/popt.scm, gnu/packages/printers.scm, gnu/packages/prolog.scm, gnu/packages/protobuf.scm, gnu/packages/pulseaudio.scm, gnu/packages/python-crypto.scm, gnu/packages/python-web.scm, gnu/packages/python-xyz.scm, gnu/packages/qt.scm, gnu/packages/radio.scm, gnu/packages/rails.scm, gnu/packages/rdf.scm, gnu/packages/rednotebook.scm, gnu/packages/rpc.scm, gnu/packages/rsync.scm, gnu/packages/ruby.scm, gnu/packages/rust.scm, gnu/packages/scheme.scm, gnu/packages/screen.scm, gnu/packages/security-token.scm, gnu/packages/selinux.scm, gnu/packages/serialization.scm, gnu/packages/shells.scm, gnu/packages/shellutils.scm, gnu/packages/simh.scm, gnu/packages/sml.scm, gnu/packages/ssh.scm, gnu/packages/statistics.scm, gnu/packages/stenography.scm, gnu/packages/sync.scm, gnu/packages/syncthing.scm, gnu/packages/synergy.scm, gnu/packages/telephony.scm, gnu/packages/terminals.scm, gnu/packages/tex.scm, gnu/packages/texinfo.scm, gnu/packages/text-editors.scm, gnu/packages/textutils.scm, gnu/packages/time.scm, gnu/packages/tmux.scm, gnu/packages/tor.scm, gnu/packages/toys.scm, gnu/packages/version-control.scm, gnu/packages/video.scm, gnu/packages/vim.scm, gnu/packages/virtualization.scm, gnu/packages/vlang.scm, gnu/packages/vnc.scm, gnu/packages/vpn.scm, gnu/packages/web-browsers.scm, gnu/packages/web.scm, gnu/packages/wireservice.scm, gnu/packages/wm.scm, gnu/packages/wxwidgets.scm, gnu/packages/xdisorg.scm, gnu/packages/xml.scm, gnu/packages/xorg.scm, tests/lint.scm: Remove trailing ".git" from 'git-reference' URL.
1 year ago
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2016, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
  3. ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
  4. ;;; Copyright © 2019, 2020 Marius Bakke <mbakke@fastmail.com>
  5. ;;;
  6. ;;; This file is part of GNU Guix.
  7. ;;;
  8. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  9. ;;; under the terms of the GNU General Public License as published by
  10. ;;; the Free Software Foundation; either version 3 of the License, or (at
  11. ;;; your option) any later version.
  12. ;;;
  13. ;;; GNU Guix is distributed in the hope that it will be useful, but
  14. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  15. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. ;;; GNU General Public License for more details.
  17. ;;;
  18. ;;; You should have received a copy of the GNU General Public License
  19. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  20. (define-module (gnu packages selinux)
  21. #:use-module ((guix licenses) #:prefix license:)
  22. #:use-module (guix packages)
  23. #:use-module (guix download)
  24. #:use-module (guix git-download)
  25. #:use-module (guix utils)
  26. #:use-module (guix build-system gnu)
  27. #:use-module (guix build-system python)
  28. #:use-module (gnu packages)
  29. #:use-module (gnu packages admin)
  30. #:use-module (gnu packages bison)
  31. #:use-module (gnu packages docbook)
  32. #:use-module (gnu packages flex)
  33. #:use-module (gnu packages gettext)
  34. #:use-module (gnu packages glib)
  35. #:use-module (gnu packages linux)
  36. #:use-module (gnu packages networking)
  37. #:use-module (gnu packages pcre)
  38. #:use-module (gnu packages pkg-config)
  39. #:use-module (gnu packages python)
  40. #:use-module (gnu packages python-xyz)
  41. #:use-module (gnu packages swig)
  42. #:use-module (gnu packages xml))
  43. ;; Update the SELinux packages together!
  44. (define-public libsepol
  45. (package
  46. (name "libsepol")
  47. (version "3.0")
  48. (source (let ((release "20191204"))
  49. (origin
  50. (method git-fetch)
  51. (uri (git-reference
  52. (url "https://github.com/SELinuxProject/selinux")
  53. (commit release)))
  54. (file-name (string-append "selinux-" release "-checkout"))
  55. (sha256
  56. (base32
  57. "05rpzm72cgprd0ccr6lvx9hm8j8b5nkqi4avshlsyg7s3sdlcxjs")))))
  58. (build-system gnu-build-system)
  59. (arguments
  60. `(#:tests? #f ; tests require checkpolicy, which requires libsepol
  61. #:test-target "test"
  62. #:make-flags
  63. (let ((out (assoc-ref %outputs "out"))
  64. (target ,(%current-target-system)))
  65. (list (string-append "PREFIX=" out)
  66. (string-append "SHLIBDIR=" out "/lib")
  67. (string-append "MAN3DIR=" out "/share/man/man3")
  68. (string-append "MAN5DIR=" out "/share/man/man5")
  69. (string-append "MAN8DIR=" out "/share/man/man8")
  70. (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
  71. (string-append "CC="
  72. (if target
  73. (string-append (assoc-ref %build-inputs "cross-gcc")
  74. "/bin/" target "-gcc")
  75. "gcc"))))
  76. #:phases
  77. (modify-phases %standard-phases
  78. (delete 'configure)
  79. (add-after 'unpack 'enter-dir
  80. (lambda _ (chdir ,name) #t))
  81. (add-after 'enter-dir 'portability
  82. (lambda _
  83. (substitute* "src/ibpkeys.c"
  84. (("#include \"ibpkey_internal.h\"" line)
  85. (string-append line "\n#include <inttypes.h>\n"))
  86. (("%#lx") "%#\" PRIx64 \""))
  87. #t)))))
  88. (native-inputs
  89. `(("flex" ,flex)))
  90. (home-page "https://selinuxproject.org/")
  91. (synopsis "Library for manipulating SELinux policies")
  92. (description
  93. "The libsepol library provides an API for the manipulation of SELinux
  94. binary policies. It is used by @code{checkpolicy} (the policy compiler) and
  95. similar tools, and programs such as @code{load_policy}, which must perform
  96. specific transformations on binary policies (for example, customizing policy
  97. boolean settings).")
  98. (license license:lgpl2.1+)))
  99. (define-public checkpolicy
  100. (package (inherit libsepol)
  101. (name "checkpolicy")
  102. (arguments
  103. `(#:tests? #f ; there is no check target
  104. #:make-flags
  105. (let ((out (assoc-ref %outputs "out"))
  106. (target ,(%current-target-system)))
  107. (list (string-append "PREFIX=" out)
  108. (string-append "LIBSEPOLA="
  109. (assoc-ref %build-inputs "libsepol")
  110. "/lib/libsepol.a")
  111. (string-append "CC="
  112. (if target
  113. (string-append (assoc-ref %build-inputs "cross-gcc")
  114. "/bin/" target "-gcc")
  115. "gcc"))))
  116. #:phases
  117. (modify-phases %standard-phases
  118. (delete 'configure)
  119. (delete 'portability)
  120. (add-after 'unpack 'enter-dir
  121. (lambda _ (chdir ,name) #t)))))
  122. (inputs
  123. `(("libsepol" ,libsepol)))
  124. (native-inputs
  125. `(("bison" ,bison)
  126. ("flex" ,flex)))
  127. (synopsis "Check SELinux security policy configurations and modules")
  128. (description
  129. "This package provides the tools \"checkpolicy\" and \"checkmodule\".
  130. Checkpolicy is a program that checks and compiles a SELinux security policy
  131. configuration into a binary representation that can be loaded into the kernel.
  132. Checkmodule is a program that checks and compiles a SELinux security policy
  133. module into a binary representation.")
  134. ;; GPLv2 only
  135. (license license:gpl2)))
  136. (define-public libselinux
  137. (package (inherit libsepol)
  138. (name "libselinux")
  139. (outputs '("out" "python"))
  140. (arguments
  141. (substitute-keyword-arguments (package-arguments libsepol)
  142. ((#:make-flags flags)
  143. `(cons* "PYTHON=python3"
  144. (string-append "LIBSEPOLA="
  145. (assoc-ref %build-inputs "libsepol")
  146. "/lib/libsepol.a")
  147. (string-append "PYTHONLIBDIR="
  148. (assoc-ref %outputs "python")
  149. "/lib/python"
  150. ,(version-major+minor (package-version python))
  151. "/site-packages/")
  152. ,flags))
  153. ((#:phases phases)
  154. `(modify-phases ,phases
  155. (delete 'portability)
  156. (replace 'enter-dir
  157. (lambda _ (chdir ,name) #t))
  158. (add-after 'build 'pywrap
  159. (lambda* (#:key make-flags #:allow-other-keys)
  160. (apply invoke "make" "pywrap" make-flags)))
  161. (add-after 'install 'install-pywrap
  162. (lambda* (#:key make-flags outputs #:allow-other-keys)
  163. ;; The build system uses "python setup.py install" to install
  164. ;; Python bindings. Instruct it to use the correct output.
  165. (substitute* "src/Makefile"
  166. (("--prefix=\\$\\(PREFIX\\)")
  167. (string-append "--prefix=" (assoc-ref outputs "python"))))
  168. (apply invoke "make" "install-pywrap" make-flags)))))))
  169. ;; These libraries are in "Requires.private" in libselinux.pc.
  170. (propagated-inputs
  171. `(("libsepol" ,libsepol)
  172. ("pcre" ,pcre)))
  173. ;; For pywrap phase
  174. (inputs
  175. `(("python" ,python-wrapper)))
  176. ;; These inputs are only needed for the pywrap phase.
  177. (native-inputs
  178. `(("swig" ,swig)
  179. ("pkg-config" ,pkg-config)))
  180. (synopsis "SELinux core libraries and utilities")
  181. (description
  182. "The libselinux library provides an API for SELinux applications to get
  183. and set process and file security contexts, and to obtain security policy
  184. decisions. It is required for any applications that use the SELinux API, and
  185. used by all applications that are SELinux-aware. This package also includes
  186. the core SELinux management utilities.")
  187. (license license:public-domain)))
  188. (define-public libsemanage
  189. (package (inherit libsepol)
  190. (name "libsemanage")
  191. (arguments
  192. (substitute-keyword-arguments (package-arguments libsepol)
  193. ((#:make-flags flags)
  194. `(cons* "PYTHON=python3"
  195. (string-append "PYTHONLIBDIR="
  196. (assoc-ref %outputs "out")
  197. "/lib/python"
  198. ,(version-major+minor (package-version python))
  199. "/site-packages/")
  200. ,flags))
  201. ((#:phases phases)
  202. `(modify-phases ,phases
  203. (delete 'portability)
  204. (replace 'enter-dir
  205. (lambda _ (chdir ,name) #t))
  206. (add-before 'install 'adjust-semanage-conf-location
  207. (lambda _
  208. (substitute* "src/Makefile"
  209. (("DEFAULT_SEMANAGE_CONF_LOCATION=/etc")
  210. "DEFAULT_SEMANAGE_CONF_LOCATION=$(PREFIX)/etc"))
  211. #t))
  212. (add-after 'build 'pywrap
  213. (lambda* (#:key make-flags #:allow-other-keys)
  214. (apply invoke "make" "pywrap" make-flags)))
  215. (add-after 'install 'install-pywrap
  216. (lambda* (#:key make-flags #:allow-other-keys)
  217. (apply invoke "make" "install-pywrap" make-flags)))))))
  218. (inputs
  219. `(("libsepol" ,libsepol)
  220. ("libselinux" ,libselinux)
  221. ("audit" ,audit)
  222. ;; For pywrap phase
  223. ("python" ,python-wrapper)))
  224. (native-inputs
  225. `(("bison" ,bison)
  226. ("flex" ,flex)
  227. ;; For pywrap phase
  228. ("swig" ,swig)
  229. ("pkg-config" ,pkg-config)))
  230. (synopsis "SELinux policy management libraries")
  231. (description
  232. "The libsemanage library provides an API for the manipulation of SELinux
  233. binary policies.")
  234. (license license:lgpl2.1+)))
  235. (define-public secilc
  236. (package (inherit libsepol)
  237. (name "secilc")
  238. (arguments
  239. (substitute-keyword-arguments (package-arguments libsepol)
  240. ((#:make-flags flags)
  241. `(let ((docbook (assoc-ref %build-inputs "docbook-xsl")))
  242. (cons (string-append "XMLTO=xmlto --skip-validation -x "
  243. docbook "/xml/xsl/docbook-xsl-"
  244. ,(package-version docbook-xsl)
  245. "/manpages/docbook.xsl")
  246. ,flags)))
  247. ((#:phases phases)
  248. `(modify-phases ,phases
  249. (delete 'portability)
  250. (replace 'enter-dir
  251. (lambda _ (chdir ,name) #t))))))
  252. (inputs
  253. `(("libsepol" ,libsepol)))
  254. (native-inputs
  255. `(("xmlto" ,xmlto)
  256. ("docbook-xsl" ,docbook-xsl)))
  257. (synopsis "SELinux common intermediate language (CIL) compiler")
  258. (description "The SELinux CIL compiler is a compiler that converts the
  259. @dfn{common intermediate language} (CIL) into a kernel binary policy file.")
  260. (license license:bsd-2)))
  261. (define-public python-sepolgen
  262. (package (inherit libsepol)
  263. (name "python-sepolgen")
  264. (arguments
  265. `(#:modules ((srfi srfi-1)
  266. (guix build gnu-build-system)
  267. (guix build utils))
  268. ,@(substitute-keyword-arguments (package-arguments libsepol)
  269. ((#:phases phases)
  270. `(modify-phases ,phases
  271. (delete 'portability)
  272. (replace 'enter-dir
  273. (lambda _ (chdir "python/sepolgen") #t))
  274. ;; By default all Python files would be installed to
  275. ;; $out/gnu/store/...-python-.../, so we override the
  276. ;; PACKAGEDIR to fix this.
  277. (add-after 'enter-dir 'fix-target-path
  278. (lambda* (#:key inputs outputs #:allow-other-keys)
  279. (let ((get-python-version
  280. ;; FIXME: copied from python-build-system
  281. (lambda (python)
  282. (let* ((version (last (string-split python #\-)))
  283. (components (string-split version #\.))
  284. (major+minor (take components 2)))
  285. (string-join major+minor ".")))))
  286. (substitute* "src/sepolgen/Makefile"
  287. (("^PACKAGEDIR.*")
  288. (string-append "PACKAGEDIR="
  289. (assoc-ref outputs "out")
  290. "/lib/python"
  291. (get-python-version
  292. (assoc-ref inputs "python"))
  293. "/site-packages/sepolgen")))
  294. (substitute* "src/share/Makefile"
  295. (("\\$\\(DESTDIR\\)") (assoc-ref outputs "out"))))
  296. #t)))))))
  297. (inputs
  298. `(("python" ,python-wrapper)))
  299. (native-inputs '())
  300. (synopsis "Python module for generating SELinux policies")
  301. (description
  302. "This package contains a Python module that forms the core of
  303. @code{audit2allow}, a part of the package @code{policycoreutils}. The
  304. sepolgen library contains: Reference Policy Representation, which are Objects
  305. for representing policies and the reference policy interfaces. It has objects
  306. and algorithms for representing access and sets of access in an abstract way
  307. and searching that access. It also has a parser for reference policy
  308. \"headers\". It contains infrastructure for parsing SELinux related messages
  309. as produced by the audit system. It has facilities for generating policy
  310. based on required access.")
  311. ;; GPLv2 only
  312. (license license:gpl2)))
  313. (define-public python-setools
  314. (package
  315. (name "python-setools")
  316. (version "4.1.1")
  317. (source (origin
  318. (method git-fetch)
  319. (uri (git-reference
  320. (url "https://github.com/TresysTechnology/setools")
  321. (commit version)))
  322. (file-name (string-append name "-" version "-checkout"))
  323. (sha256
  324. (base32
  325. "0459xxly6zzqc5azcwk3rbbcxvj60dq08f8z6xr05y7dsbb16cg6"))))
  326. (build-system python-build-system)
  327. (arguments
  328. `(#:tests? #f ; the test target causes a rebuild
  329. #:phases
  330. (modify-phases %standard-phases
  331. (delete 'portability)
  332. (add-after 'unpack 'set-SEPOL-variable
  333. (lambda* (#:key inputs #:allow-other-keys)
  334. (setenv "SEPOL"
  335. (string-append (assoc-ref inputs "libsepol")
  336. "/lib/libsepol.a"))))
  337. (add-after 'unpack 'remove-Werror
  338. (lambda _
  339. (substitute* "setup.py"
  340. (("'-Werror',") ""))
  341. #t))
  342. (add-after 'unpack 'fix-target-paths
  343. (lambda* (#:key outputs #:allow-other-keys)
  344. (substitute* "setup.py"
  345. (("join\\(sys.prefix")
  346. (string-append "join(\"" (assoc-ref outputs "out") "/\"")))
  347. #t)))))
  348. (propagated-inputs
  349. `(("python-networkx" ,python-networkx)))
  350. (inputs
  351. `(("libsepol" ,libsepol)
  352. ("libselinux" ,libselinux)))
  353. (native-inputs
  354. `(("bison" ,bison)
  355. ("flex" ,flex)
  356. ("swig" ,swig)))
  357. (home-page "https://github.com/TresysTechnology/setools")
  358. (synopsis "Tools for SELinux policy analysis")
  359. (description "SETools is a collection of graphical tools, command-line
  360. tools, and libraries designed to facilitate SELinux policy analysis.")
  361. ;; Some programs are under GPL, all libraries under LGPL.
  362. (license (list license:lgpl2.1+
  363. license:gpl2+))))
  364. (define-public policycoreutils
  365. (package (inherit libsepol)
  366. (name "policycoreutils")
  367. (arguments
  368. `(#:test-target "test"
  369. #:make-flags
  370. (let ((out (assoc-ref %outputs "out")))
  371. (list "CC=gcc"
  372. (string-append "PREFIX=" out)
  373. (string-append "LOCALEDIR=" out "/share/locale")
  374. (string-append "BASHCOMPLETIONDIR=" out
  375. "/share/bash-completion/completions")
  376. "INSTALL=install -c -p"
  377. "INSTALL_DIR=install -d"
  378. ;; These ones are needed because some Makefiles define the
  379. ;; directories relative to DESTDIR, not relative to PREFIX.
  380. (string-append "SBINDIR=" out "/sbin")
  381. (string-append "ETCDIR=" out "/etc")
  382. (string-append "SYSCONFDIR=" out "/etc/sysconfig")
  383. (string-append "MAN5DIR=" out "/share/man/man5")
  384. (string-append "INSTALL_NLS_DIR=" out "/share/locale")
  385. (string-append "AUTOSTARTDIR=" out "/etc/xdg/autostart")
  386. (string-append "DBUSSERVICEDIR=" out "/share/dbus-1/services")
  387. (string-append "SYSTEMDDIR=" out "/lib/systemd")
  388. (string-append "INITDIR=" out "/etc/rc.d/init.d")
  389. (string-append "SELINUXDIR=" out "/etc/selinux")))
  390. #:phases
  391. (modify-phases %standard-phases
  392. (delete 'configure)
  393. (delete 'portability)
  394. (add-after 'unpack 'enter-dir
  395. (lambda _ (chdir ,name) #t))
  396. (add-after 'enter-dir 'ignore-/usr-tests
  397. (lambda* (#:key inputs #:allow-other-keys)
  398. ;; Rewrite lookup paths for header files.
  399. (substitute* '("newrole/Makefile"
  400. "setfiles/Makefile"
  401. "run_init/Makefile")
  402. (("/usr(/include/security/pam_appl.h)" _ file)
  403. (string-append (assoc-ref inputs "pam") file))
  404. (("/usr(/include/libaudit.h)" _ file)
  405. (string-append (assoc-ref inputs "audit") file)))
  406. #t)))))
  407. (inputs
  408. `(("audit" ,audit)
  409. ("pam" ,linux-pam)
  410. ("libsepol" ,libsepol)
  411. ("libselinux" ,libselinux)
  412. ("libsemanage" ,libsemanage)))
  413. (native-inputs
  414. `(("gettext" ,gettext-minimal)))
  415. (synopsis "SELinux core utilities")
  416. (description "The policycoreutils package contains the core utilities that
  417. are required for the basic operation of an SELinux-enabled GNU system and its
  418. policies. These utilities include @code{load_policy} to load policies,
  419. @code{setfiles} to label file systems, @code{newrole} to switch roles, and
  420. @code{run_init} to run service scripts in their proper context.")
  421. (license license:gpl2+)))