gnu: rottlog: Use gexps and bootstrap Autotools build system.

* gnu/packages/admin.scm (rottlog) [snippet]: Delete build system files.
Delete trailing #t.  Patch Makefile.am instead of Makefile.in.  Do not patch
INSTALL_RC and INSTALL_SCRIPT variables default values.
[arguments]: Use gexps.  Delete trailing #t.
[make-flags]: Override INSTALL_RC and INSTALL_SCRIPT.
[phases]{fix-configure}: Delete phase.
[native-inputs]: Add autoconf.  Sort inputs.
This commit is contained in:
Maxim Cournoyer 2022-10-27 20:14:10 -04:00
parent b42b0e6d62
commit ff097b450b
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -35,7 +35,7 @@
;;; Copyright © 2020, 2021, 2022 Michael Rohleder <mike@rohleder.de> ;;; Copyright © 2020, 2021, 2022 Michael Rohleder <mike@rohleder.de>
;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com> ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
;;; Copyright © 2020 Morgan Smith <Morgan.J.Smith@outlook.com> ;;; Copyright © 2020 Morgan Smith <Morgan.J.Smith@outlook.com>
;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; Copyright © 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2021 Zheng Junjie <873216071@qq.com> ;;; Copyright © 2021 Zheng Junjie <873216071@qq.com>
;;; Copyright © 2021 Stefan Reichör <stefan@xsteve.at> ;;; Copyright © 2021 Stefan Reichör <stefan@xsteve.at>
;;; Copyright © 2021 qblade <qblade@protonmail.com> ;;; Copyright © 2021 qblade <qblade@protonmail.com>
@ -43,7 +43,6 @@
;;; Copyright © 2021 David Larsson <david.larsson@selfhosted.xyz> ;;; Copyright © 2021 David Larsson <david.larsson@selfhosted.xyz>
;;; Copyright © 2021 WinterHound <winterhound@yandex.com> ;;; Copyright © 2021 WinterHound <winterhound@yandex.com>
;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re> ;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be> ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
;;; Copyright © 2021 muradm <mail@muradm.net> ;;; Copyright © 2021 muradm <mail@muradm.net>
;;; Copyright © 2021 pineapples <guixuser6392@protonmail.com> ;;; Copyright © 2021 pineapples <guixuser6392@protonmail.com>
@ -1826,52 +1825,46 @@ (define-public rottlog
(modules '((guix build utils))) (modules '((guix build utils)))
(snippet (snippet
'(begin '(begin
(substitute* "Makefile.in" ;; Delete outdated Autotools build system files.
(("-o \\$\\{LOG_OWN\\} -g \\$\\{LOG_GROUP\\}") (for-each delete-file
;; Don't try to chown root. (list "Makefile.in"
"") "config.guess"
"config.sub"
"configure"
"depcomp"
"install-sh"
"mdate-sh"
"missing"
"mkinstalldirs"
"texinfo.tex"))
(substitute* "Makefile.am"
(("mkdir -p \\$\\(ROTT_STATDIR\\)") (("mkdir -p \\$\\(ROTT_STATDIR\\)")
;; Don't attempt to create /var/lib/rottlog. ;; Don't attempt to create /var/lib/rottlog.
"true")) "true"))))))
#t))))
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
`(#:configure-flags (list "ROTT_ETCDIR=/etc/rottlog" ;rc file location (list
#:configure-flags #~(list "ROTT_ETCDIR=/etc/rottlog" ;rc file location
"--localstatedir=/var") "--localstatedir=/var")
;; Install example config files in OUT/etc. ;; Install example config files in OUT/etc.
#:make-flags (list (string-append "ROTT_ETCDIR=" #:make-flags #~(list (string-append "ROTT_ETCDIR=" #$output "/etc")
(assoc-ref %outputs "out") ;; Avoid the default -o root -g root arguments,
"/etc")) ;; which fail due to not running as root.
"INSTALL_RC=install"
#:phases (modify-phases %standard-phases "INSTALL_SCRIPT=install")
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'patch-paths (add-after 'unpack 'patch-paths
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(substitute* "rc/rc" (substitute* "rc/rc"
(("/usr/sbin/sendmail") (("/usr/sbin/sendmail")
(search-input-file inputs "/bin/mail"))) (search-input-file inputs "/bin/mail")))))
#t))
(add-after 'unpack 'fix-configure
(lambda* (#:key inputs native-inputs #:allow-other-keys)
;; Replace outdated config.sub and config.guess:
(for-each (lambda (file)
(install-file
(string-append
(assoc-ref
(or native-inputs inputs) "automake")
"/share/automake-"
,(version-major+minor
(package-version automake))
"/" file) "."))
'("config.sub" "config.guess"))
#t))
(add-after 'build 'set-packdir (add-after 'build 'set-packdir
(lambda _ (lambda _
;; Set a default location for archived logs. ;; Set a default location for archived logs.
(substitute* "rc/rc" (substitute* "rc/rc"
(("packdir=\"\"") (("packdir=\"\"")
"packdir=\"/var/log\"")) "packdir=\"/var/log\""))))
#t))
(add-before 'install 'tweak-rc-weekly (add-before 'install 'tweak-rc-weekly
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(substitute* "rc/weekly" (substitute* "rc/weekly"
@ -1883,7 +1876,7 @@ (define-public rottlog
(add-after 'install 'install-info (add-after 'install 'install-info
(lambda _ (lambda _
(invoke "make" "install-info")))))) (invoke "make" "install-info"))))))
(native-inputs (list texinfo automake util-linux)) ; for 'cal' (native-inputs (list autoconf automake texinfo util-linux)) ; for 'cal'
(inputs (list coreutils mailutils)) (inputs (list coreutils mailutils))
(home-page "https://www.gnu.org/software/rottlog/") (home-page "https://www.gnu.org/software/rottlog/")
(synopsis "Log rotation and management") (synopsis "Log rotation and management")