>From e7e454785b7d449376448485643e704e72a20d9e Mon Sep 17 00:00:00 2001 From: raingloom Date: Wed, 6 Jan 2021 22:13:14 +0100 Subject: [PATCH 2/3] gnu: WIP update Snapper. --- gnu/packages/linux.scm | 78 ++++++++++++++++++++++++++++-------------- 1 file changed, 52 insertions(+), 26 deletions(-) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 6bc3f1e52a..16279e50c3 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -74,6 +74,7 @@ #:use-module (gnu packages acl) #:use-module (gnu packages admin) #:use-module (gnu packages algebra) + #:use-module (gnu packages attr) #:use-module (gnu packages audio) #:use-module (gnu packages autotools) #:use-module (gnu packages backup) @@ -5084,15 +5085,15 @@ obviously it can be shared with files outside our set).") (define-public snapper (package (name "snapper") - (version "0.8.2") + (version "0.8.15") (source (origin - (method url-fetch) - (uri (string-append "ftp://ftp.suse.com/pub/projects/snapper/snapper-" - version - ".tar.bz2")) + (method git-fetch) + (uri (git-reference + (url "https://github.com/openSUSE/snapper") + (commit (string-append "v" version)))) (sha256 (base32 - "0s73x5h0fdggcxxcmjlf1q7pqlwd1ac4pngwsm6ayg8n4gxk3acy")))) + "1rqv1qfxr02qbkix1mpx91s4827irxryxkhby3ii0fdkm3ympsas")))) (build-system gnu-build-system) (arguments `( ;; TODO: 2 tests are failing: @@ -5105,7 +5106,12 @@ obviously it can be shared with files outside our set).") "-I" (assoc-ref %build-inputs "libxml2") "/include/libxml2") - "--disable-zypp") + ;; SUSE package manager stuff + "--disable-zypp" + ;; We have Shepherd. + "--disable-systemd" + ;; Don't use /etc/sysconfig, just /etc. + "--with-conf=/etc") #:phases (modify-phases %standard-phases (add-before 'build 'make-local-docbook-xml @@ -5121,11 +5127,14 @@ obviously it can be shared with files outside our set).") (string-append (assoc-ref inputs "docbook-xsl") "/xml/xsl/docbook-xsl-" ,(package-version docbook-xsl) - "/manpages/docbook.xsl"))) - #t)) + "/manpages/docbook.xsl"))))) (add-before 'build 'patch-makefiles (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) + (substitute* "client/utils/Makefile.am" + ;; I ain't patching ncurses to alias ncurses to ltinfo. + ;; Also adds libjson-c, which is missing for some reason. + (("-ltinfo") "-lncurses -ljson-c")) (substitute* "client/Makefile.am" (("libexecdir = /usr/lib/snapper") (string-append "libexecdir = " out @@ -5140,30 +5149,47 @@ obviously it can be shared with files outside our set).") (("\\$\\(DESTDIR\\)") out)) (substitute* "pam/Makefile.am" (("(securelibdir = )\\$\\(shell echo /`basename \\$\\(libdir\\)`/security\\)" _ before) - (string-append before out "/lib/security")))) - #t)) - (add-after 'install 'clean-up-systemd-services - (lambda* (#:key outputs #:allow-other-keys) - ;; TODO: Maybe we should not remove everything, we need dbus. - (delete-file-recursively - (string-append (assoc-ref outputs "out") "/usr")) - #t))))) + (string-append before out "/lib/security")))))) + (add-after 'install 'fix-paths...again + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (for-each + (lambda (f) + (substitute* f + (("CMD_SNAPPER=\"/usr/bin/snapper\"") + (string-append out "/bin/snapper")) + (("CMD_PAM_CONFIG=\"/usr/sbin/pam-config\"") + (string-append (assoc-ref inputs "linux-pam") "/sbin/pam-config")))) + (apply append + (map + (lambda (d) + (find-files (string-append out d) (const #t))) + '("/lib/pam_snapper/" + "/lib/systemd/system/" + "/share/dbus-1/system-services/")))))))))) (native-inputs - `(("pkg-config" ,pkg-config) + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("docbook-xsl" ,docbook-xsl) + ("docbook-xml" ,docbook-xml) ("gettext" ,gettext-minimal) ;for msgfmt + ("libtool" ,libtool) ("libxslt" ,libxslt) - ("docbook-xsl" ,docbook-xsl) - ("autoconf" ,autoconf) - ("automake" ,automake))) + ("pkg-config" ,pkg-config))) (inputs - `(("libmount" ,util-linux) - ("dbus" ,dbus) - ("acl" ,acl) + `(("acl" ,acl) + ("attr" ,attr) ("boost" ,boost) - ("libxml2" ,libxml2) ("btrfs-progs" ,btrfs-progs) + ("dbus" ,dbus) ("e2fsprogs" ,e2fsprogs) - ("linux-pam" ,linux-pam))) + ("json-c" ,json-c) + ("libxml2" ,libxml2) + ("linux-pam" ,linux-pam) + ("ncurses" ,ncurses) + ("util-linux" ,util-linux "lib") + ("lvm2" ,lvm2) + ("util-linux" ,util-linux))) (home-page "http://snapper.io/") (synopsis "Manage BTRFS and LVM snapshots") (description " Snapper is a tool for Linux filesystem snapshot -- 2.30.0