mirror of
https://gitlab.univ-nantes.fr/glicid-public/guix-glicid.git
synced 2025-05-02 07:05:38 +02:00
backporting master into devel (devel was behind master)
This commit is contained in:
parent
cc5cc2847f
commit
54560ad0ea
34 changed files with 10115 additions and 1803 deletions
|
@ -4,10 +4,11 @@
|
|||
#:use-module (guix build-system gnu)
|
||||
#:use-module (guix download)
|
||||
#:use-module (guix git-download)
|
||||
#:use-module ((guix licenses) #:select (asl2.0))
|
||||
#:use-module ((guix licenses) #:prefix license:)
|
||||
#:use-module (guix utils)
|
||||
#:use-module (gnu packages compression)
|
||||
#:use-module (gnu packages curl)
|
||||
#:use-module (gnu packages geo)
|
||||
#:use-module (gnu packages pcre)
|
||||
#:use-module (gnu packages perl)
|
||||
#:use-module (gnu packages pkg-config)
|
||||
|
@ -17,6 +18,88 @@
|
|||
#:use-module (glicid packages openldap)
|
||||
)
|
||||
|
||||
(define-public nginx
|
||||
(package
|
||||
(name "nginx")
|
||||
(version "1.21.6")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append "https://nginx.org/download/nginx-" version ".tar.gz"))
|
||||
(sha256 (base32 "1bh52jqqcaj5wlh2kvhxr00jhk2hnk8k97ki4pwyj4c8920p1p36"))))
|
||||
(build-system gnu-build-system)
|
||||
(inputs (list libxml2 libxslt openssl pcre zlib))
|
||||
(arguments
|
||||
`(#:tests? #f
|
||||
#:phases
|
||||
(modify-phases %standard-phases
|
||||
(add-before 'configure 'patch-/bin/sh
|
||||
(lambda _
|
||||
(substitute* "auto/feature"
|
||||
(("/bin/sh") (which "sh")))
|
||||
#t))
|
||||
(replace 'configure
|
||||
;; The configure script is hand-written, not from GNU autotools.
|
||||
(lambda* (#:key configure-flags inputs outputs #:allow-other-keys)
|
||||
(let ((flags
|
||||
(append (list (string-append "--prefix=" (assoc-ref outputs "out"))
|
||||
"--with-http_ssl_module"
|
||||
"--with-http_v2_module"
|
||||
"--with-http_xslt_module"
|
||||
"--with-http_gzip_static_module"
|
||||
"--with-http_gunzip_module"
|
||||
"--with-http_addition_module"
|
||||
"--with-http_sub_module"
|
||||
"--with-pcre-jit"
|
||||
"--with-debug"
|
||||
"--with-stream"
|
||||
;; Even when not cross-building, we pass the
|
||||
;; --crossbuild option to avoid customizing for the
|
||||
;; kernel version on the build machine.
|
||||
,(let ((system "Linux") ; uname -s
|
||||
(release "3.2.0") ; uname -r
|
||||
;; uname -m
|
||||
(machine (match (or (%current-target-system)
|
||||
(%current-system))
|
||||
("x86_64-linux" "x86_64")
|
||||
("i686-linux" "i686")
|
||||
("mips64el-linux" "mips64")
|
||||
(_ "UNSUPPORTED"))))
|
||||
(string-append "--crossbuild=" system ":" release ":" machine)
|
||||
))
|
||||
configure-flags)))
|
||||
(setenv "CC" ,(cc-for-target))
|
||||
(setenv "CFLAGS" ; CPPFLAGS is not respected
|
||||
(string-append "-I" (assoc-ref inputs "libxml2")
|
||||
"/include/libxml2"))
|
||||
(format #t "configure flags: ~s~%" flags)
|
||||
(apply invoke "./configure" flags)
|
||||
#t)))
|
||||
(add-after 'install 'install-man-page
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(let* ((out (assoc-ref outputs "out"))
|
||||
(man (string-append out "/share/man")))
|
||||
(install-file "objs/nginx.8" (string-append man "/man8"))
|
||||
#t)))
|
||||
(add-after 'install 'fix-root-dirs
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(let* ((out (assoc-ref outputs "out"))
|
||||
(share (string-append out "/share/nginx")))
|
||||
(rmdir (string-append out "/logs"))
|
||||
(mkdir-p share)
|
||||
(rename-file (string-append out "/conf")
|
||||
(string-append share "/conf"))
|
||||
(rename-file (string-append out "/html")
|
||||
(string-append share "/html"))
|
||||
#t))))))
|
||||
(home-page "https://nginx.org")
|
||||
(synopsis "HTTP and reverse proxy server")
|
||||
(description
|
||||
"Nginx (\"engine X\") is a high-performance web and reverse proxy server
|
||||
created by Igor Sysoev. It can be used both as a stand-alone web server
|
||||
and as a proxy to reduce the load on back-end HTTP or mail servers.")
|
||||
(license (list license:bsd-2 license:expat license:bsd-3 license:bsd-4))))
|
||||
|
||||
|
||||
(define-public nginx-ldap-auth-module
|
||||
(package
|
||||
(inherit nginx)
|
||||
|
@ -26,9 +109,9 @@
|
|||
(origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://github.com/kvspb/nginx-auth-ldap")
|
||||
(commit version)
|
||||
)
|
||||
(url "https://github.com/kvspb/nginx-auth-ldap")
|
||||
(commit version)
|
||||
)
|
||||
)
|
||||
(file-name (git-file-name "nginx-ldap-auth-module" version))
|
||||
(sha256 (base32 "023zmdir7w92dnb508ggskkc7kmd7k71hc597sb7i4xfgpwxzq1s" ))
|
||||
|
@ -86,15 +169,14 @@
|
|||
(origin
|
||||
(method url-fetch)
|
||||
(uri (list
|
||||
(string-append "https://github.com/SpiderLabs/ModSecurity/releases/download/v" version "/modsecurity-v" version ".tar.gz")
|
||||
)
|
||||
)
|
||||
(string-append "https://github.com/SpiderLabs/ModSecurity/releases/download/v" version "/modsecurity-v" version ".tar.gz")
|
||||
))
|
||||
(sha256 (base32 "1sarp7bjvkkdlpky5j9axfi0qmb177vw2vn2s10c8fcdg9dgj6vm" ))
|
||||
)
|
||||
)
|
||||
(synopsis "modsecurity module for nginx")
|
||||
(description "modsecurity module for nginx.")
|
||||
(license asl2.0)
|
||||
(license license:asl2.0)
|
||||
(home-page "https://github.com/SpiderLabs/ModSecurity")
|
||||
(build-system gnu-build-system)
|
||||
(inputs `(
|
||||
|
@ -128,9 +210,8 @@
|
|||
(origin
|
||||
(method url-fetch)
|
||||
(uri (list
|
||||
(string-append "https://github.com/SpiderLabs/ModSecurity-nginx/releases/download/v" version "/modsecurity-nginx-v" version ".tar.gz")
|
||||
)
|
||||
)
|
||||
(string-append "https://github.com/SpiderLabs/ModSecurity-nginx/releases/download/v" version "/modsecurity-nginx-v" version ".tar.gz")
|
||||
))
|
||||
(sha256 (base32 "0clcny8276d3j73ws661lh983vqq9m29rw7qb7gn132ha066d9j1" ))
|
||||
)
|
||||
)
|
||||
|
@ -177,4 +258,63 @@
|
|||
)
|
||||
)
|
||||
)
|
||||
nginx-modsecurity-module
|
||||
|
||||
(define-public nginx-geoip2-module
|
||||
(package
|
||||
(inherit nginx)
|
||||
(name "nginx-geoip2-module")
|
||||
(version "3.3")
|
||||
(source
|
||||
(origin
|
||||
(method url-fetch)
|
||||
(uri (list
|
||||
(string-append "https://github.com/leev/ngx_http_geoip2_module/archive/refs/tags/" version ".tar.gz")
|
||||
))
|
||||
(sha256 (base32 "19vqzwr6gaqkh3b7zbxc61f87d044ykw9l39i2hi7qrkr0w88ds1" ))
|
||||
)
|
||||
)
|
||||
(synopsis "GeoIP2 module for nginx")
|
||||
(description "GeoIP2 module for nginx.")
|
||||
(build-system gnu-build-system)
|
||||
(inputs
|
||||
`(("nginx-sources" ,(package-source nginx))
|
||||
("libmaxminddb", libmaxminddb)
|
||||
,@(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
|
||||
;; The nginx source code is part of the module’s source.
|
||||
(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_geoip2_module.so" modules-dir)
|
||||
(install-file "objs/ngx_stream_geoip2_module.so" modules-dir)
|
||||
#t
|
||||
)
|
||||
)
|
||||
)
|
||||
(delete 'fix-root-dirs)
|
||||
(delete 'install-man-page)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue