gnu: vsftpd: Use CentOS version and patches.
* gnu/packages/ftp.scm (vftpd)[source]: Use CentOS source RPM. [arguments]: Adapt the 'unpack phase, and apply CentOS patches in a new 'apply-CentOS-patches phase. [inputs]: Add openssl, linux-pam, and libcap. [native-inputs]: Add p7zip and cpio. Signed-off-by: Tobias Geerinckx-Rice <me@tobias.gr>
This commit is contained in:
parent
5cf90c43ca
commit
634d9845a6
1 changed files with 81 additions and 36 deletions
|
|
@ -2,8 +2,9 @@
|
||||||
;;; Copyright © 2014, 2015, 2018 Ludovic Courtès <ludo@gnu.org>
|
;;; Copyright © 2014, 2015, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||||
;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
|
;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
|
||||||
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
|
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
|
||||||
;;; Copyright © 2016, 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
|
;;; Copyright © 2016–2021 Tobias Geerinckx-Rice <me@tobias.gr>
|
||||||
;;; Copyright © 2017 Rene Saavedra <rennes@openmailbox.org>
|
;;; Copyright © 2017 Rene Saavedra <rennes@openmailbox.org>
|
||||||
|
;;; Copyright © 2021 David Larsson <david.larsson@selfhosted.xyz>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
|
@ -28,12 +29,14 @@
|
||||||
#:use-module (gnu packages)
|
#:use-module (gnu packages)
|
||||||
#:use-module (gnu packages autotools)
|
#:use-module (gnu packages autotools)
|
||||||
#:use-module (gnu packages check)
|
#:use-module (gnu packages check)
|
||||||
|
#:use-module (gnu packages cpio)
|
||||||
#:use-module (gnu packages compression)
|
#:use-module (gnu packages compression)
|
||||||
#:use-module (gnu packages freedesktop)
|
#:use-module (gnu packages freedesktop)
|
||||||
#:use-module (gnu packages gettext)
|
#:use-module (gnu packages gettext)
|
||||||
#:use-module (gnu packages glib)
|
#:use-module (gnu packages glib)
|
||||||
#:use-module (gnu packages gtk)
|
#:use-module (gnu packages gtk)
|
||||||
#:use-module (gnu packages libidn)
|
#:use-module (gnu packages libidn)
|
||||||
|
#:use-module (gnu packages linux)
|
||||||
#:use-module (gnu packages ncurses)
|
#:use-module (gnu packages ncurses)
|
||||||
#:use-module (gnu packages nettle)
|
#:use-module (gnu packages nettle)
|
||||||
#:use-module (gnu packages pkg-config)
|
#:use-module (gnu packages pkg-config)
|
||||||
|
|
@ -251,40 +254,82 @@ directory comparison and more.")
|
||||||
(properties '((upstream-name . "FileZilla")))))
|
(properties '((upstream-name . "FileZilla")))))
|
||||||
|
|
||||||
(define-public vsftpd
|
(define-public vsftpd
|
||||||
(package
|
;; Use a significantly patched CentOS variant supporting TLSv1.2, ‘email
|
||||||
(name "vsftpd")
|
;; passwords’, and XXX davidl: anything else?
|
||||||
(version "3.0.3")
|
(let ((upstream-version "3.0.3")
|
||||||
(source (origin
|
(centos-version "8.3.2011")
|
||||||
(method url-fetch)
|
(revision "32.el8"))
|
||||||
(uri (string-append "https://security.appspot.com/downloads/"
|
(package
|
||||||
name "-" version ".tar.gz"))
|
(name "vsftpd")
|
||||||
(sha256
|
(version (string-append upstream-version "." revision))
|
||||||
(base32
|
(source
|
||||||
"1xsyjn68k3fgm2incpb3lz2nikffl9by2safp994i272wvv2nkcx"))))
|
(origin
|
||||||
(build-system gnu-build-system)
|
(method url-fetch)
|
||||||
(arguments
|
(uri (string-append
|
||||||
`(#:make-flags '("LDFLAGS=-lcrypt")
|
"https://vault.centos.org/centos/" centos-version
|
||||||
#:tests? #f ; No tests exist.
|
"/AppStream/Source/SPackages/vsftpd-" upstream-version "-"
|
||||||
#:phases
|
revision ".src.rpm"))
|
||||||
(modify-phases %standard-phases
|
(sha256
|
||||||
(add-after 'unpack 'patch-installation-directory
|
(base32 "1xl0kqcismf82hl99klqbvvpylpyk1yr1qjy5hd8f80cj4lyl0f4"))))
|
||||||
(lambda* (#:key outputs #:allow-other-keys)
|
(build-system gnu-build-system)
|
||||||
(substitute* "Makefile"
|
(arguments
|
||||||
(("/usr") (assoc-ref outputs "out")))
|
`(#:make-flags '("LDFLAGS=-lcrypt -lssl -pie")
|
||||||
#t))
|
#:tests? #f ; no tests exist
|
||||||
(add-before 'install 'mkdir
|
#:phases
|
||||||
(lambda* (#:key outputs #:allow-other-keys)
|
(modify-phases %standard-phases
|
||||||
(let ((out (assoc-ref outputs "out")))
|
(replace 'unpack
|
||||||
(mkdir-p out)
|
(lambda* (#:key source #:allow-other-keys)
|
||||||
(mkdir (string-append out "/sbin"))
|
(invoke "7z" "e" source "-ocpio")
|
||||||
(mkdir (string-append out "/man"))
|
(invoke "cpio" "-idmv"
|
||||||
(mkdir (string-append out "/man/man5"))
|
(string-append "--file=cpio/vsftpd-"
|
||||||
(mkdir (string-append out "/man/man8"))
|
,upstream-version "-" ,revision
|
||||||
#t)))
|
".src.cpio"))
|
||||||
(delete 'configure))))
|
(invoke "tar" "xvf"
|
||||||
(synopsis "vsftpd FTP daemon")
|
(string-append "vsftpd-" ,upstream-version ".tar.gz"))
|
||||||
(description "@command{vsftpd} is a daemon that listens on a TCP socket
|
(chdir (string-append "vsftpd-" ,upstream-version))))
|
||||||
|
(add-after 'unpack 'apply-CentOS-patches
|
||||||
|
;; Apply all patches as enumerated in vsftpd.spec, in order:
|
||||||
|
;; simply using FIND-FILES would silently corrupt the result.
|
||||||
|
(lambda _
|
||||||
|
(call-with-input-file "../vsftpd.spec"
|
||||||
|
(lambda (port)
|
||||||
|
(use-modules (ice-9 rdelim))
|
||||||
|
(let loop ()
|
||||||
|
(let ((line (read-line port)))
|
||||||
|
(unless (eof-object? line)
|
||||||
|
(when (string-prefix? "Patch" line)
|
||||||
|
(let* ((space (string-rindex line #\space))
|
||||||
|
(patch (string-drop line (+ 1 space))))
|
||||||
|
(format #t "Applying '~a'.\n" patch)
|
||||||
|
(invoke "patch" "-Np1"
|
||||||
|
"-i" (string-append "../" patch))))
|
||||||
|
(loop))))))))
|
||||||
|
(add-after 'unpack 'patch-installation-directory
|
||||||
|
(lambda* (#:key outputs #:allow-other-keys)
|
||||||
|
(substitute* "Makefile"
|
||||||
|
(("/usr") (assoc-ref outputs "out")))
|
||||||
|
#t))
|
||||||
|
(add-before 'install 'mkdir
|
||||||
|
(lambda* (#:key outputs #:allow-other-keys)
|
||||||
|
(let ((out (assoc-ref outputs "out")))
|
||||||
|
(mkdir-p out)
|
||||||
|
(mkdir (string-append out "/sbin"))
|
||||||
|
(mkdir (string-append out "/man"))
|
||||||
|
(mkdir (string-append out "/man/man5"))
|
||||||
|
(mkdir (string-append out "/man/man8"))
|
||||||
|
#t)))
|
||||||
|
(delete 'configure))))
|
||||||
|
(native-inputs
|
||||||
|
;; Used to unpack the source RPM.
|
||||||
|
`(("p7zip" ,p7zip)
|
||||||
|
("cpio" ,cpio)))
|
||||||
|
(inputs
|
||||||
|
`(("libcap" ,libcap)
|
||||||
|
("linux-pam" ,linux-pam)
|
||||||
|
("openssl" ,openssl)))
|
||||||
|
(home-page "https://security.appspot.com/vsftpd.html")
|
||||||
|
(synopsis "Share files securely over FTP or FTPS")
|
||||||
|
(description "@command{vsftpd} is a daemon that listens on a TCP socket
|
||||||
for clients and gives them access to local files via File Transfer
|
for clients and gives them access to local files via File Transfer
|
||||||
Protocol.")
|
Protocol.")
|
||||||
(home-page "https://security.appspot.com/vsftpd.html")
|
(license gpl2))))
|
||||||
(license gpl2)))
|
|
||||||
|
|
|
||||||
Reference in a new issue