| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 |
|
| 21 | (define-module (gnu packages libdaemon)
|
| 22 | #:use-module (gnu packages autotools)
|
| 23 | #:use-module (guix licenses)
|
| 24 | #:use-module (guix packages)
|
| 25 | #:use-module (guix utils)
|
| 26 | #:use-module (guix download)
|
| 27 | #:use-module (guix build-system gnu))
|
| 28 |
|
| 29 | (define-public libdaemon
|
| 30 | (package
|
| 31 | (name "libdaemon")
|
| 32 | (version "0.14")
|
| 33 | (source (origin
|
| 34 | (method url-fetch)
|
| 35 | (uri (list
|
| 36 | (string-append
|
| 37 | "mirror://debian/pool/main/libd/libdaemon/libdaemon_"
|
| 38 | version ".orig.tar.gz")
|
| 39 | "http://pkgs.fedoraproject.org/repo/pkgs/libdaemon/libdaemon-0.14.tar.gz/509dc27107c21bcd9fbf2f95f5669563/libdaemon-0.14.tar.gz"
|
| 40 |
|
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | ))
|
| 47 | (sha256
|
| 48 | (base32
|
| 49 | "0d5qlq5ab95wh1xc87rqrh1vx6i8lddka1w3f1zcqvcqdxgyn8zx"))
|
| 50 | (file-name (string-append name "-" version ".tar.gz"))))
|
| 51 | (build-system gnu-build-system)
|
| 52 | (native-inputs
|
| 53 | (if (or (and=> (%current-target-system) target-aarch64?)
|
| 54 | (and=> (%current-target-system) target-riscv64?))
|
| 55 | `(("config" ,config)) |
| 56 | '()))
|
| 57 | (arguments
|
| 58 | `(,@(if (%current-target-system)
|
| 59 | |
| 60 | |
| 61 | `(#:configure-flags (list "ac_cv_func_setpgrp_void=yes"
|
| 62 |
|
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | "--localstatedir=/var"))
|
| 70 | '())
|
| 71 | ,@(if (or (and=> (%current-target-system) target-aarch64?)
|
| 72 | (and=> (%current-target-system) target-riscv64?))
|
| 73 | `(#:phases
|
| 74 | (modify-phases %standard-phases
|
| 75 | (add-before 'configure 'update-config.sub
|
| 76 | (lambda _
|
| 77 | |
| 78 | |
| 79 | (delete-file "config.sub")
|
| 80 | (symlink (which "config.sub") "config.sub")))))
|
| 81 | '())))
|
| 82 | |
| 83 | (home-page "https://0pointer.de/lennart/projects/libdaemon/")
|
| 84 |
|
| 85 | (synopsis "Lightweight C library that eases the writing of UNIX daemons")
|
| 86 | (description
|
| 87 | "Libdaemon is a lightweight C library that eases the writing of UNIX
|
| 88 | daemons. It consists of the following parts:
|
| 89 |
|
| 90 | • A wrapper around fork() which does the correct daemonization procedure of
|
| 91 | a process
|
| 92 |
|
| 93 | • A wrapper around syslog() for simpler and compatible log output to Syslog
|
| 94 | or STDERR
|
| 95 |
|
| 96 | • An API for writing PID files
|
| 97 |
|
| 98 | • An API for serializing UNIX signals into a pipe for usage with select() or
|
| 99 | poll()
|
| 100 |
|
| 101 | • An API for running subprocesses with STDOUT and STDERR redirected to
|
| 102 | syslog.
|
| 103 |
|
| 104 | APIs like these are used in most daemon software available. It is not that
|
| 105 | simple to get it done right and code duplication is not a goal.")
|
| 106 | (license lgpl2.1+)))
|