1 |
commit: 2ca6bc6ad0eed589bffad56c71d0974e957ed464 |
2 |
Author: Tomáš Mózes <hydrapolic <AT> gmail <DOT> com> |
3 |
AuthorDate: Sat Feb 19 10:43:29 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Feb 20 00:30:41 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2ca6bc6a |
7 |
|
8 |
www-apache/mod_security: keep unicode.mapping |
9 |
|
10 |
Closes: https://bugs.gentoo.org/642476 |
11 |
Signed-off-by: Tomáš Mózes <hydrapolic <AT> gmail.com> |
12 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
13 |
|
14 |
.../mod_security/mod_security-2.9.5-r1.ebuild | 125 +++++++++++++++++++++ |
15 |
1 file changed, 125 insertions(+) |
16 |
|
17 |
diff --git a/www-apache/mod_security/mod_security-2.9.5-r1.ebuild b/www-apache/mod_security/mod_security-2.9.5-r1.ebuild |
18 |
new file mode 100644 |
19 |
index 000000000000..baac45dfeee8 |
20 |
--- /dev/null |
21 |
+++ b/www-apache/mod_security/mod_security-2.9.5-r1.ebuild |
22 |
@@ -0,0 +1,125 @@ |
23 |
+# Copyright 1999-2022 Gentoo Authors |
24 |
+# Distributed under the terms of the GNU General Public License v2 |
25 |
+ |
26 |
+EAPI=7 |
27 |
+ |
28 |
+LUA_COMPAT=( lua5-{1..3} ) |
29 |
+ |
30 |
+inherit autotools apache-module lua-single |
31 |
+ |
32 |
+MY_PN=modsecurity |
33 |
+MY_P=${MY_PN}-${PV} |
34 |
+ |
35 |
+DESCRIPTION="Application firewall and intrusion detection for Apache" |
36 |
+HOMEPAGE="https://github.com/SpiderLabs/ModSecurity" |
37 |
+SRC_URI="https://github.com/SpiderLabs/ModSecurity/releases/download/v${PV}/${MY_P}.tar.gz" |
38 |
+ |
39 |
+LICENSE="Apache-2.0" |
40 |
+SLOT="0" |
41 |
+KEYWORDS="~amd64 ~x86" |
42 |
+IUSE="doc fuzzyhash geoip jit json lua mlogc" |
43 |
+ |
44 |
+REQUIRED_USE="lua? ( ${LUA_REQUIRED_USE} )" |
45 |
+ |
46 |
+COMMON_DEPEND="dev-libs/apr |
47 |
+ dev-libs/apr-util[openssl] |
48 |
+ dev-libs/libxml2 |
49 |
+ dev-libs/libpcre[jit?] |
50 |
+ virtual/libcrypt:= |
51 |
+ fuzzyhash? ( app-crypt/ssdeep ) |
52 |
+ json? ( dev-libs/yajl ) |
53 |
+ lua? ( ${LUA_DEPS} ) |
54 |
+ mlogc? ( net-misc/curl ) |
55 |
+ www-servers/apache[apache2_modules_unique_id]" |
56 |
+BDEPEND="doc? ( app-doc/doxygen )" |
57 |
+DEPEND="${COMMON_DEPEND}" |
58 |
+RDEPEND="${COMMON_DEPEND} |
59 |
+ geoip? ( dev-libs/geoip ) |
60 |
+ mlogc? ( dev-lang/perl )" |
61 |
+PDEPEND=">=www-apache/modsecurity-crs-2.2.6-r1" |
62 |
+ |
63 |
+S="${WORKDIR}/${MY_P}" |
64 |
+ |
65 |
+APACHE2_MOD_FILE="apache2/.libs/${PN}2.so" |
66 |
+APACHE2_MOD_CONF="79_${PN}" |
67 |
+APACHE2_MOD_DEFINE="SECURITY" |
68 |
+ |
69 |
+# Tests require symbols only defined within the Apache binary. |
70 |
+RESTRICT=test |
71 |
+ |
72 |
+PATCHES=( |
73 |
+ "${FILESDIR}"/${PN}-2.9.3-autoconf_lua_package_name.patch |
74 |
+) |
75 |
+ |
76 |
+need_apache2 |
77 |
+ |
78 |
+pkg_setup() { |
79 |
+ _init_apache2 |
80 |
+ _init_apache2_late |
81 |
+ use lua && lua-single_pkg_setup |
82 |
+} |
83 |
+ |
84 |
+src_prepare() { |
85 |
+ default |
86 |
+ eautoreconf |
87 |
+} |
88 |
+ |
89 |
+src_configure() { |
90 |
+ local myconf=( |
91 |
+ --disable-static |
92 |
+ --enable-request-early |
93 |
+ --with-apxs="${APXS}" |
94 |
+ --with-pic |
95 |
+ $(use_with fuzzyhash ssdeep) |
96 |
+ $(use_with json yajl) |
97 |
+ $(use_enable mlogc) |
98 |
+ $(use_with lua) |
99 |
+ $(use_enable lua lua-cache) |
100 |
+ $(use_enable jit pcre-jit) |
101 |
+ $(use_enable doc docs) ) |
102 |
+ |
103 |
+ econf ${myconf[@]} |
104 |
+} |
105 |
+ |
106 |
+src_compile() { |
107 |
+ default |
108 |
+} |
109 |
+ |
110 |
+src_install() { |
111 |
+ apache-module_src_install |
112 |
+ |
113 |
+ dodoc CHANGES README.md modsecurity.conf-recommended unicode.mapping |
114 |
+ |
115 |
+ if use doc; then |
116 |
+ dodoc -r doc/apache/html |
117 |
+ fi |
118 |
+ |
119 |
+ if use mlogc; then |
120 |
+ insinto /etc/ |
121 |
+ newins mlogc/mlogc-default.conf mlogc.conf |
122 |
+ dobin mlogc/mlogc |
123 |
+ dobin mlogc/mlogc-batch-load.pl |
124 |
+ newdoc mlogc/INSTALL INSTALL-mlogc |
125 |
+ fi |
126 |
+ |
127 |
+ # Use /var/lib instead of /var/cache. This stuff is "persistent," |
128 |
+ # and isn't a cached copy of something that we can recreate. |
129 |
+ # Bug 605496. |
130 |
+ keepdir /var/lib/modsecurity |
131 |
+ fowners apache:apache /var/lib/modsecurity |
132 |
+ fperms 0750 /var/lib/modsecurity |
133 |
+ for dir in data tmp upload; do |
134 |
+ keepdir "/var/lib/modsecurity/${dir}" |
135 |
+ fowners apache:apache "/var/lib/modsecurity/${dir}" |
136 |
+ fperms 0750 "/var/lib/modsecurity/${dir}" |
137 |
+ done |
138 |
+} |
139 |
+ |
140 |
+pkg_postinst() { |
141 |
+ elog "The base configuration file has been renamed ${APACHE2_MOD_CONF}" |
142 |
+ elog "so that you can put your own configuration in (for example)" |
143 |
+ elog "90_modsecurity_local.conf." |
144 |
+ elog "" |
145 |
+ elog "That would be the correct place for site-global security rules." |
146 |
+ elog "Note: 80_modsecurity_crs.conf is used by www-apache/modsecurity-crs" |
147 |
+} |