gnu: zabbix-server: Split output.

* gnu/packages/monitoring.scm (zabbix-server)[outputs]: Add 'front-end' and
'schema' outputs.
This commit is contained in:
Oleg Pykhalov 2018-11-29 19:48:02 +03:00
parent a7ad051d8a
commit 2c9ac8392a
No known key found for this signature in database
GPG key ID: 167F8EA5001AFA9C

View file

@ -182,21 +182,34 @@ (define-public zabbix-server
(package (package
(inherit zabbix-agentd) (inherit zabbix-agentd)
(name "zabbix-server") (name "zabbix-server")
(outputs '("out" "front-end" "schema"))
(arguments (arguments
(substitute-keyword-arguments (substitute-keyword-arguments
`(#:phases `(#:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(add-after 'install 'install-frontend (add-after 'install 'install-front-end
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(let* ((php (string-append (assoc-ref outputs "out") (let* ((php (string-append (assoc-ref outputs "front-end")
"/share/zabbix/php")) "/share/zabbix/php"))
(front-end-conf (string-append php "/conf")) (front-end-conf (string-append php "/conf"))
(etc (string-append php "/etc"))) (etc (string-append php "/etc")))
(mkdir-p php) (mkdir-p php)
(copy-recursively "./frontends/php" php) (copy-recursively "frontends/php" php)
;; Make front-end write config to /etc/zabbix directory.
(rename-file front-end-conf (rename-file front-end-conf
(string-append front-end-conf "-example")) (string-append front-end-conf "-example"))
(symlink "/etc/zabbix" front-end-conf))))) (symlink "/etc/zabbix" front-end-conf))
#t))
(add-after 'install 'install-schema
(lambda* (#:key outputs #:allow-other-keys)
(let ((database-directory
(string-append (assoc-ref outputs "schema")
"/database")))
(for-each delete-file
(find-files "database" "Makefile\\.in|\\.am$"))
(mkdir-p database-directory)
(copy-recursively "database" database-directory))
#t)))
,@(package-arguments zabbix-agentd)) ,@(package-arguments zabbix-agentd))
((#:configure-flags flags) ((#:configure-flags flags)
`(cons* "--enable-server" `(cons* "--enable-server"