diff --git a/glicid/packages/nginx.scm b/glicid/packages/nginx.scm index 4b953e6..a148f7c 100644 --- a/glicid/packages/nginx.scm +++ b/glicid/packages/nginx.scm @@ -88,7 +88,7 @@ (inherit nginx) (name "nginx-ldap-auth-module") (version "83c059b") - (source (origin + (source (origin (method url-fetch) (uri (list (string-append "https://github.com/kvspb/nginx-auth-ldap/archive/" version ".tar.gz"))) (sha256 (base32 "0r44dhsbw2ssg84vc5i68zdnhd0131nkbkbmxq7rpq9avddlw339")))) @@ -252,3 +252,36 @@ (install-file "objs/ngx_http_subs_filter_module.so" modules-dir) #t))) (delete 'fix-root-dirs) (delete 'install-man-page))))))) + +(define-public nginx-module-vts + (package + (inherit nginx) + (name "nginx-module-vts") + (version "v0.2.1") + (source (origin + (method url-fetch) + (uri (list (string-append "https://github.com/vozlt/nginx-module-vts/archive/" version ".tar.gz"))) + (sha256 (base32 "1x046w94n026f2aa4zmaf6yw1k86w3p6wqbslnriipz47a6xfqqs")))) + (synopsis "Nginx virtual host traffic status module") + (description "Nginx virtual host traffic status module.") + (build-system gnu-build-system) + (inputs `(("nginx-sources" ,(package-source nginx)) + ,@(package-inputs nginx))) + (arguments + (substitute-keyword-arguments `(#:configure-flags '("--add-dynamic-module=.") + #:make-flags '("modules") + ,@(package-arguments nginx)) + ((#:phases phases) + `(modify-phases ,phases + (add-after 'unpack 'unpack-nginx-sources + (lambda* (#:key inputs native-inputs #:allow-other-keys) + (begin + (format #t "decompressing nginx source code~%") + (let ((tar (assoc-ref inputs "tar")) (nginx-srcs (assoc-ref inputs "nginx-sources"))) + (invoke (string-append tar "/bin/tar") "xvf" nginx-srcs "--strip-components=1")) #t))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((modules-dir (string-append (assoc-ref outputs "out") "/etc/nginx/modules"))) + (install-file "objs/ngx_http_vhost_traffic_status_module.so" modules-dir) #t))) + (delete 'fix-root-dirs) + (delete 'install-man-page)))))))