1 |
Signed-off-by: David Seifert <soap@g.o> |
2 |
--- |
3 |
eclass/qmail.eclass | 59 ++++++++++++++++++++++++--------------------- |
4 |
1 file changed, 31 insertions(+), 28 deletions(-) |
5 |
|
6 |
diff --git a/eclass/qmail.eclass b/eclass/qmail.eclass |
7 |
index b647ac5d8e3a..149bfa0c25f3 100644 |
8 |
--- a/eclass/qmail.eclass |
9 |
+++ b/eclass/qmail.eclass |
10 |
@@ -1,18 +1,18 @@ |
11 |
-# Copyright 1999-2022 Gentoo Authors |
12 |
+# Copyright 1999-2023 Gentoo Authors |
13 |
# Distributed under the terms of the GNU General Public License v2 |
14 |
|
15 |
# @ECLASS: qmail.eclass |
16 |
# @MAINTAINER: |
17 |
# Rolf Eike Beer <eike@×××××××.de> |
18 |
-# @SUPPORTED_EAPIS: 6 7 8 |
19 |
+# @SUPPORTED_EAPIS: 7 8 |
20 |
# @BLURB: common qmail functions |
21 |
|
22 |
-case ${EAPI:-0} in |
23 |
- [678]) ;; |
24 |
+case ${EAPI} in |
25 |
+ 7|8) ;; |
26 |
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; |
27 |
esac |
28 |
|
29 |
-if [[ -z ${_QMAIL_ECLASS} ]] ; then |
30 |
+if [[ -z ${_QMAIL_ECLASS} ]]; then |
31 |
_QMAIL_ECLASS=1 |
32 |
|
33 |
inherit flag-o-matic toolchain-funcs fixheadtails |
34 |
@@ -58,7 +58,7 @@ is_prime() { |
35 |
|
36 |
dospp() { |
37 |
exeinto "${QMAIL_HOME}"/plugins/ |
38 |
- newexe ${1} ${2:-$(basename ${1})} |
39 |
+ newexe ${1} ${2:-${1##*/}} |
40 |
} |
41 |
|
42 |
# @FUNCTION: dosupervise |
43 |
@@ -68,7 +68,7 @@ dospp() { |
44 |
dosupervise() { |
45 |
local service=$1 |
46 |
local runfile=${2:-${service}} logfile=${3:-${service}-log} |
47 |
- [[ -z "${service}" ]] && die "no service given" |
48 |
+ [[ -z ${service} ]] && die "no service given" |
49 |
|
50 |
dodir ${SUPERVISE_DIR}/${service}{,/log} |
51 |
fperms +t ${SUPERVISE_DIR}/${service}{,/log} |
52 |
@@ -92,16 +92,16 @@ qmail_set_cc() { |
53 |
|
54 |
echo "${cc} ${CFLAGS} ${CPPFLAGS}" > ./conf-cc || die 'Patching conf-cc failed.' |
55 |
echo "${ld} ${LDFLAGS}" > ./conf-ld || die 'Patching conf-ld failed.' |
56 |
- sed -e "s#'ar #'$(tc-getAR) #" -e "s#'ranlib #'$(tc-getRANLIB) #" -i make-makelib.sh |
57 |
+ sed -e "s#'ar #'$(tc-getAR) #" -e "s#'ranlib #'$(tc-getRANLIB) #" -i make-makelib.sh || die |
58 |
} |
59 |
|
60 |
genqmail_src_unpack() { |
61 |
- cd "${WORKDIR}" |
62 |
+ cd "${WORKDIR}" || die |
63 |
[[ -n ${GENQMAIL_PV} ]] && unpack "${GENQMAIL_F}" |
64 |
} |
65 |
|
66 |
qmail_spp_src_unpack() { |
67 |
- cd "${WORKDIR}" |
68 |
+ cd "${WORKDIR}" || die |
69 |
[[ -n ${QMAIL_SPP_PV} ]] && unpack "${QMAIL_SPP_F}" |
70 |
} |
71 |
|
72 |
@@ -109,23 +109,23 @@ qmail_spp_src_unpack() { |
73 |
# @DESCRIPTION: |
74 |
# Unpack common config files, and set built configuration (CFLAGS, LDFLAGS, etc) |
75 |
qmail_src_postunpack() { |
76 |
- cd "${S}" |
77 |
+ cd "${S}" || die |
78 |
|
79 |
qmail_set_cc |
80 |
|
81 |
mysplit=${QMAIL_CONF_SPLIT:-23} |
82 |
is_prime ${mysplit} || die "QMAIL_CONF_SPLIT is not a prime number." |
83 |
einfo "Using conf-split value of ${mysplit}." |
84 |
- echo -n ${mysplit} > "${S}"/conf-split |
85 |
+ echo -n ${mysplit} > "${S}"/conf-split || die |
86 |
} |
87 |
|
88 |
qmail_src_compile() { |
89 |
- cd "${S}" |
90 |
+ cd "${S}" || die |
91 |
emake it man "$@" |
92 |
} |
93 |
|
94 |
qmail_spp_src_compile() { |
95 |
- cd "${GENQMAIL_S}"/spp/ |
96 |
+ cd "${GENQMAIL_S}"/spp/ || die |
97 |
emake |
98 |
} |
99 |
|
100 |
@@ -152,6 +152,7 @@ qmail_base_install() { |
101 |
qreceipt sendmail tcp-env |
102 |
|
103 |
# obsolete tools, install if they are still present |
104 |
+ local i |
105 |
for i in elq maildirwatch pinq qail qsmhook; do |
106 |
[[ -x ${i} ]] && doexe ${i} |
107 |
done |
108 |
@@ -167,7 +168,6 @@ qmail_base_install() { |
109 |
|
110 |
exeopts -o qmailq -g qmail -m 4711 |
111 |
doexe qmail-queue |
112 |
- |
113 |
) |
114 |
} |
115 |
|
116 |
@@ -189,7 +189,7 @@ qmail_man_install() { |
117 |
dodoc BLURB* INSTALL* PIC* README* REMOVE* \ |
118 |
SENDMAIL* TEST* THANKS* VERSION* |
119 |
# notqmail converted the files to markdown |
120 |
- if [ -f CHANGES ]; then |
121 |
+ if [[ -f CHANGES ]]; then |
122 |
dodoc CHANGES FAQ SECURITY THOUGHTS UPGRADE |
123 |
else |
124 |
dodoc CHANGES.md FAQ.md SECURITY.md THOUGHTS.md UPGRADE.md |
125 |
@@ -225,13 +225,13 @@ qmail_maildir_install() { |
126 |
"${MAILDIRMAKE}" "${D}${QMAIL_HOME}"/alias/.maildir |
127 |
keepdir "${QMAIL_HOME}"/alias/.maildir/{cur,new,tmp} |
128 |
|
129 |
+ local i |
130 |
for i in "${QMAIL_HOME}"/alias/.qmail-{mailer-daemon,postmaster,root}; do |
131 |
- if [[ ! -f "${ROOT}${i}" ]]; then |
132 |
+ if [[ ! -f ${ROOT}${i} ]]; then |
133 |
touch "${D}${i}" |
134 |
fowners alias:qmail "${i}" |
135 |
fi |
136 |
done |
137 |
- |
138 |
) |
139 |
} |
140 |
|
141 |
@@ -240,7 +240,7 @@ qmail_tcprules_install() { |
142 |
insinto "${TCPRULES_DIR}" |
143 |
doins "${GENQMAIL_S}"/tcprules/Makefile.qmail |
144 |
doins "${GENQMAIL_S}"/tcprules/tcp.qmail-* |
145 |
- rm -f "${D}${TCPRULES_DIR}"/tcp.qmail-pop3sd |
146 |
+ rm -f "${D}${TCPRULES_DIR}"/tcp.qmail-pop3sd || die |
147 |
} |
148 |
|
149 |
qmail_supervise_install_one() { |
150 |
@@ -255,8 +255,9 @@ qmail_supervise_install_one() { |
151 |
qmail_supervise_install() { |
152 |
einfo "Installing supervise scripts" |
153 |
|
154 |
- cd "${GENQMAIL_S}"/supervise |
155 |
+ cd "${GENQMAIL_S}"/supervise || die |
156 |
|
157 |
+ local i |
158 |
for i in qmail-{send,smtpd,qmtpd,qmqpd}; do |
159 |
qmail_supervise_install_one ${i} |
160 |
done |
161 |
@@ -273,6 +274,7 @@ qmail_spp_install() { |
162 |
|
163 |
einfo "Installing qmail-spp plugins" |
164 |
keepdir "${QMAIL_HOME}"/plugins/ |
165 |
+ local i |
166 |
for i in authlog mfdnscheck ifauthnext tarpit; do |
167 |
dospp "${GENQMAIL_S}"/spp/${i} |
168 |
done |
169 |
@@ -330,7 +332,7 @@ qmail_queue_setup() { |
170 |
qmail_rootmail_fixup() { |
171 |
local TMPCMD="ln -sf ${QMAIL_HOME}/alias/.maildir/ ${ROOT}/root/.maildir" |
172 |
|
173 |
- if [[ -d "${ROOT}"/root/.maildir && ! -L "${ROOT}"/root/.maildir ]] ; then |
174 |
+ if [[ -d ${ROOT}/root/.maildir && ! -L ${ROOT}/root/.maildir ]] ; then |
175 |
elog "Previously the qmail ebuilds created /root/.maildir/ but not" |
176 |
elog "every mail was delivered there. If the directory does not" |
177 |
elog "contain any mail, please delete it and run:" |
178 |
@@ -343,13 +345,14 @@ qmail_rootmail_fixup() { |
179 |
} |
180 |
|
181 |
qmail_tcprules_build() { |
182 |
+ local f |
183 |
for f in tcp.qmail-{smtp,qmtp,qmqp,pop3}; do |
184 |
# please note that we don't check if it exists |
185 |
# as we want it to make the cdb files anyway! |
186 |
- src="${ROOT}${TCPRULES_DIR}/${f}" |
187 |
- cdb="${ROOT}${TCPRULES_DIR}/${f}.cdb" |
188 |
- tmp="${ROOT}${TCPRULES_DIR}/.${f}.tmp" |
189 |
- [[ -e "${src}" ]] && tcprules "${cdb}" "${tmp}" < "${src}" |
190 |
+ local src="${ROOT}${TCPRULES_DIR}/${f}" |
191 |
+ local cdb="${ROOT}${TCPRULES_DIR}/${f}.cdb" |
192 |
+ local tmp="${ROOT}${TCPRULES_DIR}/.${f}.tmp" |
193 |
+ [[ -e ${src} ]] && tcprules "${cdb}" "${tmp}" < "${src}" |
194 |
done |
195 |
} |
196 |
|
197 |
@@ -382,10 +385,10 @@ qmail_supervise_config_notice() { |
198 |
} |
199 |
|
200 |
qmail_config_fast() { |
201 |
- if [[ ${ROOT} = / ]]; then |
202 |
+ if [[ -z ${ROOT} ]]; then |
203 |
local host=$(hostname --fqdn) |
204 |
|
205 |
- if [[ -z "${host}" ]]; then |
206 |
+ if [[ -z ${host} ]]; then |
207 |
eerror |
208 |
eerror "Cannot determine your fully-qualified hostname" |
209 |
eerror "Please setup your /etc/hosts as described in" |
210 |
@@ -394,7 +397,7 @@ qmail_config_fast() { |
211 |
die "cannot determine FQDN" |
212 |
fi |
213 |
|
214 |
- if [[ ! -f "${ROOT}${QMAIL_HOME}"/control/me ]]; then |
215 |
+ if [[ ! -f ${ROOT}${QMAIL_HOME}/control/me ]]; then |
216 |
"${ROOT}${QMAIL_HOME}"/bin/config-fast ${host} |
217 |
fi |
218 |
else |
219 |
-- |
220 |
2.40.0 |