diff options
-rw-r--r-- | src/xyz/euandreh/docs.scm | 48 |
1 files changed, 44 insertions, 4 deletions
diff --git a/src/xyz/euandreh/docs.scm b/src/xyz/euandreh/docs.scm index b97a199..e181d48 100644 --- a/src/xyz/euandreh/docs.scm +++ b/src/xyz/euandreh/docs.scm @@ -1,8 +1,11 @@ (define-module (xyz euandreh docs) + #:use-module (gnu packages base) + #:use-module (gnu packages compression) #:use-module (guix licenses) #:use-module (guix download) #:use-module (guix packages) - #:use-module (guix build-system gnu)) + #:use-module (guix build-system gnu) + #:use-module (guix build-system trivial)) (define-public posix-man-pages (package @@ -27,8 +30,45 @@ (description "This package provides the reference POSIX version of Unix \"man pages\" documenting the specification.") - ;; FIXME - (license gpl2+))) + (license gpl2+))) ;; FIXME + +(define-public rfcs + (package + (name "rfcs") + (version "singleton") + (source (origin + (method url-fetch) + (uri "https://www.rfc-editor.org/in-notes/tar/RFC-all.tar.gz") + (sha256 + (base32 + "0lhmvf1qsryf19pl9pk9k8431crq70xz5hcrlifs9srbr3ig3qkc")))) + (build-system trivial-build-system) + (native-inputs (list tar gzip)) + (arguments + `(#:modules ((guix build utils)) + #:builder + (begin + (use-modules (guix build utils) + (ice-9 string-fun)) + (let* ((source (assoc-ref %build-inputs "source")) + (tar (string-append (assoc-ref %build-inputs "tar") "/bin/tar")) + (out (assoc-ref %outputs "out")) + (man (string-append out "/share/man/man7rfc/"))) + (setenv "PATH" (string-append (assoc-ref %build-inputs "gzip") "/bin")) + (invoke tar "-xvf" source "rfc1111.txt" "rfc2222.txt" "rfc3333.json") + (mkdir-p man) + (define (rename-extension s) + (string-replace-substring s ".txt" ".7rfc")) + (for-each (lambda (f) + (copy-file f (string-append man (rename-extension f)))) + (find-files "." ".*\\.txt$")))))) + (home-page "https://www.rfc-editor.org/") + (synopsis "The RFC technical and organizational documents about the Internet") + (description + "This package provies reference RFC (Request For Comments) documents.") + (license gpl2+))) ;; FIXME + (list - posix-man-pages) + posix-man-pages + rfcs) |