diff options
author | Yi Zhao <yi.zhao@windriver.com> | 2024-03-01 19:20:54 +0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2024-03-01 16:37:55 -0800 |
commit | a326451eb637ccdd6e27a0377c4f00d20b1494d8 (patch) | |
tree | 59cf4bf2127187516e8cf86d9d3b86f793baf1d4 /meta-networking/recipes-daemons/postfix/postfix.inc | |
parent | 425f999eb93ce6056b504e20c7717555ef7856ca (diff) | |
download | meta-openembedded-a326451eb637ccdd6e27a0377c4f00d20b1494d8.tar.gz |
postfix: upgrade 3.7.3 -> 3.8.5
ChangeLog:
https://www.postfix.org/announcements/postfix-3.8.0.html
https://www.postfix.org/announcements/postfix-3.8.1.html
https://www.postfix.org/announcements/postfix-3.8.2.html
https://www.postfix.org/announcements/postfix-3.8.3.html
https://www.postfix.org/announcements/postfix-3.8.4.html
https://www.postfix.org/announcements/postfix-3.8.5.html
* Drop 0006-makedefs-Account-for-linux-6.x-version.patch as the issue
has been fixed upstream.
* Merge inc file into single recipe
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-networking/recipes-daemons/postfix/postfix.inc')
-rw-r--r-- | meta-networking/recipes-daemons/postfix/postfix.inc | 222 |
1 files changed, 0 insertions, 222 deletions
diff --git a/meta-networking/recipes-daemons/postfix/postfix.inc b/meta-networking/recipes-daemons/postfix/postfix.inc deleted file mode 100644 index 5133caaa4..000000000 --- a/meta-networking/recipes-daemons/postfix/postfix.inc +++ /dev/null | |||
@@ -1,222 +0,0 @@ | |||
1 | SUMMARY = "Postfix Mail Transport Agent" | ||
2 | DESCRIPTION = "Postfix is Wietse Venema's mail server that started life at \ | ||
3 | IBM research as an alternative to the widely-used Sendmail program. \ | ||
4 | Postfix attempts to be fast, easy to administer, and secure. The outsidei \ | ||
5 | has a definite Sendmail-ish flavor, but the inside is completely different." | ||
6 | |||
7 | HOMEPAGE= "http://www.postfix.org" | ||
8 | SECTION = "mail" | ||
9 | DEPENDS = "db icu libpcre libnsl2 m4-native openssl postfix-native \ | ||
10 | ${@bb.utils.contains('DISTRO_FEATURES', 'ldap', 'openldap', '', d)} \ | ||
11 | ${@bb.utils.contains('DISTRO_FEATURES', 'sasl', 'cyrus-sasl', '', d)} \ | ||
12 | " | ||
13 | |||
14 | LICENSE = "IPL-1.0 | EPL-2.0" | ||
15 | LIC_FILES_CHKSUM = "file://LICENSE;md5=b181651ad99a7dc4cc8c4ce2f491ed1a" | ||
16 | |||
17 | S = "${WORKDIR}/postfix-${PV}" | ||
18 | |||
19 | CLEANBROKEN = "1" | ||
20 | |||
21 | BBCLASSEXTEND = "native" | ||
22 | |||
23 | inherit pkgconfig update-rc.d useradd update-alternatives systemd lib_package | ||
24 | |||
25 | INITSCRIPT_NAME = "postfix" | ||
26 | INITSCRIPT_PARAMS = "start 58 3 4 5 . stop 13 0 1 6 ." | ||
27 | USERADD_PACKAGES = "${PN}-bin" | ||
28 | USERADD_PARAM:${PN}-bin = \ | ||
29 | "-d /var/spool/postfix -r -g postfix --shell /bin/false postfix; \ | ||
30 | -d /var/spool/vmail -r -g vmail --shell /bin/false vmail \ | ||
31 | " | ||
32 | GROUPADD_PARAM:${PN}-bin = "--system postfix;--system postdrop;--system vmail" | ||
33 | |||
34 | export SYSLIBS = "${LDFLAGS}" | ||
35 | |||
36 | # CCARGS specifies includes, defines | ||
37 | # AUXLIBS specifies libraries | ||
38 | # Linux2/Linux3 has HAS_DB defined | ||
39 | # makedefs will make CC to be CC+CCARGS | ||
40 | |||
41 | # ldap support | ||
42 | export CCARGS-ldap = "\ | ||
43 | ${@bb.utils.contains('DISTRO_FEATURES', 'ldap', '-DHAS_LDAP', '', d)}" | ||
44 | export AUXLIBS-ldap = "\ | ||
45 | ${@bb.utils.contains('DISTRO_FEATURES', 'ldap', '-lldap -llber', '', d)}" | ||
46 | |||
47 | # no native openldap | ||
48 | export CCARGS-ldap:class-native = "" | ||
49 | export AUXLIBS-ldap:class-native = "" | ||
50 | |||
51 | export CCARGS-nonis:libc-musl = "-DNO_NIS" | ||
52 | export CCARGS-nonis = "" | ||
53 | |||
54 | # SASL support -DUSE_LDAP_SASL -DUSE_SASL_AUTH | ||
55 | # current openldap didn't enable SASL | ||
56 | export CCARGS-sasl = "\ | ||
57 | ${@bb.utils.contains('DISTRO_FEATURES', 'sasl', '-DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I${STAGING_INCDIR}/sasl', '', d)}" | ||
58 | export AUXLIBS-sasl = "\ | ||
59 | ${@bb.utils.contains('DISTRO_FEATURES', 'sasl', '-lsasl2', '', d)}" | ||
60 | export CCARGS-sasl:class-native = "" | ||
61 | export AUXLIBS-sasl:class-native = "" | ||
62 | |||
63 | # PCRE, TLS support default | ||
64 | export CCARGS = "${CFLAGS} -DHAS_PCRE -DUSE_TLS -I${STAGING_INCDIR}/openssl ${CCARGS-ldap} ${CCARGS-sasl} ${CCARGS-nonis}" | ||
65 | export AUXLIBS = "-lpcre -lssl -lcrypto ${AUXLIBS-sasl} ${AUXLIBS-ldap}" | ||
66 | export POSTCONF = "${STAGING_DIR_NATIVE}${sbindir_native}/postconf" | ||
67 | |||
68 | # OPT,DEBUG is aready in CFLAGS | ||
69 | # ignore the OPTS="CC=$CC" in Makefile it will not use the CC=$CC $CCARGS | ||
70 | EXTRA_OEMAKE += "OPT= DEBUG= OPTS= " | ||
71 | |||
72 | do_compile () { | ||
73 | unset CFLAGS CPPFLAGS CXXFLAGS | ||
74 | local native_build | ||
75 | |||
76 | native_build="${@['0', '1'][bb.data.inherits_class('native', d) or bb.data.inherits_class('nativesdk', d)]}" | ||
77 | |||
78 | # if not native build, then pass SYSTEM and RELEASE to makedefs | ||
79 | if [ "${native_build}" != "1" ]; then | ||
80 | # uname -s for target | ||
81 | SYSTEM="Linux" | ||
82 | |||
83 | # uname -r, use 2.6 as bottomline, even target kernel ver > 2.6 | ||
84 | RELEASE="2.6.34" | ||
85 | sed -i -e \ | ||
86 | "s:\$(SHELL) makedefs):\$(SHELL) makedefs $SYSTEM $RELEASE):" \ | ||
87 | ${S}/Makefile.in | ||
88 | export BUILD_SYSROOT="${STAGING_DIR_HOST}" | ||
89 | else | ||
90 | # native build | ||
91 | export BUILD_SYSROOT="${STAGING_DIR_NATIVE}" | ||
92 | fi | ||
93 | |||
94 | oe_runmake makefiles | ||
95 | oe_runmake | ||
96 | } | ||
97 | |||
98 | do_install:prepend:class-native() { | ||
99 | export POSTCONF="bin/postconf" | ||
100 | } | ||
101 | |||
102 | SYSTEMD_SERVICE:${PN} = "postfix.service" | ||
103 | |||
104 | do_install () { | ||
105 | sh ./postfix-install 'install_root=${D}' \ | ||
106 | 'config_directory=${sysconfdir}/postfix' \ | ||
107 | 'daemon_directory=${libexecdir}/postfix' \ | ||
108 | 'command_directory=${sbindir}' \ | ||
109 | 'queue_directory=${localstatedir}/spool/postfix' \ | ||
110 | 'sendmail_path=${sbindir}/sendmail.postfix' \ | ||
111 | 'newaliases_path=${bindir}/newaliases' \ | ||
112 | 'mailq_path=${bindir}/mailq' \ | ||
113 | 'manpage_directory=${mandir}' \ | ||
114 | 'readme_directory=${datadir}/doc/postfix' \ | ||
115 | 'data_directory=${localstatedir}/lib/postfix' \ | ||
116 | -non-interactive | ||
117 | rm -rf ${D}${localstatedir}/spool/postfix | ||
118 | mv ${D}${sysconfdir}/postfix/main.cf ${D}${sysconfdir}/postfix/${MLPREFIX}sample-main.cf | ||
119 | install -m 755 ${S}/bin/smtp-sink ${D}/${sbindir}/ | ||
120 | install -d ${D}${sysconfdir}/init.d | ||
121 | install -m 644 ${WORKDIR}/main.cf ${D}${sysconfdir}/postfix/main.cf | ||
122 | sed -i 's#@LIBEXECDIR@#${libexecdir}#' ${D}${sysconfdir}/postfix/main.cf | ||
123 | |||
124 | install -m 755 ${WORKDIR}/check_hostname.sh ${D}${sbindir}/ | ||
125 | |||
126 | install -m 755 ${WORKDIR}/postfix ${D}${sysconfdir}/init.d/postfix | ||
127 | install -m 644 ${WORKDIR}/internal_recipient ${D}${sysconfdir}/postfix/internal_recipient | ||
128 | |||
129 | install -d ${D}${systemd_unitdir}/system | ||
130 | install -m 0644 ${WORKDIR}/postfix.service ${D}${systemd_unitdir}/system | ||
131 | sed -i -e 's#@LIBEXECDIR@#${libexecdir}#g' ${D}${systemd_unitdir}/system/postfix.service | ||
132 | sed -i -e 's#@LOCALSTATEDIR@#${localstatedir}#g' ${D}${systemd_unitdir}/system/postfix.service | ||
133 | sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/postfix.service | ||
134 | |||
135 | install -m 0755 ${WORKDIR}/aliasesdb ${D}${libexecdir}/postfix | ||
136 | |||
137 | install -m 770 -d ${D}${localstatedir}/spool/postfix | ||
138 | chown postfix:postfix ${D}${localstatedir}/spool/postfix | ||
139 | |||
140 | install -m 0755 -d ${D}${localstatedir}/lib/postfix | ||
141 | chown postfix:nogroup ${D}${localstatedir}/lib/postfix | ||
142 | install -m 0755 -d ${D}${localstatedir}/spool/postfix | ||
143 | chown root:postfix ${D}${localstatedir}/spool/postfix | ||
144 | install -m 0700 -d ${D}${localstatedir}/spool/postfix/active | ||
145 | chown postfix:root ${D}${localstatedir}/spool/postfix/active | ||
146 | install -m 0700 -d ${D}${localstatedir}/spool/postfix/bounce | ||
147 | chown postfix:root ${D}${localstatedir}/spool/postfix/bounce | ||
148 | install -m 0700 -d ${D}${localstatedir}/spool/postfix/corrupt | ||
149 | chown postfix:root ${D}${localstatedir}/spool/postfix/corrupt | ||
150 | install -m 0700 -d ${D}${localstatedir}/spool/postfix/defer | ||
151 | chown postfix:root ${D}${localstatedir}/spool/postfix/defer | ||
152 | install -m 0700 -d ${D}${localstatedir}/spool/postfix/deferred | ||
153 | chown postfix:root ${D}${localstatedir}/spool/postfix/deferred | ||
154 | install -m 0700 -d ${D}${localstatedir}/spool/postfix/flush | ||
155 | chown postfix:root ${D}${localstatedir}/spool/postfix/flush | ||
156 | install -m 0700 -d ${D}${localstatedir}/spool/postfix/hold | ||
157 | chown postfix:root ${D}${localstatedir}/spool/postfix/hold | ||
158 | install -m 0700 -d ${D}${localstatedir}/spool/postfix/incoming | ||
159 | chown postfix:root ${D}${localstatedir}/spool/postfix/incoming | ||
160 | install -m 0700 -d ${D}${localstatedir}/spool/postfix/saved | ||
161 | chown postfix:root ${D}${localstatedir}/spool/postfix/saved | ||
162 | install -m 0700 -d ${D}${localstatedir}/spool/postfix/trace | ||
163 | chown postfix:root ${D}${localstatedir}/spool/postfix/trace | ||
164 | install -m 0730 -d ${D}${localstatedir}/spool/postfix/maildrop | ||
165 | chown postfix:postdrop ${D}${localstatedir}/spool/postfix/maildrop | ||
166 | install -m 0755 -d ${D}${localstatedir}/spool/postfix/pid | ||
167 | chown root:root ${D}${localstatedir}/spool/postfix/pid | ||
168 | install -m 0700 -d ${D}${localstatedir}/spool/postfix/private | ||
169 | chown postfix:root ${D}${localstatedir}/spool/postfix/private | ||
170 | install -m 0710 -d ${D}${localstatedir}/spool/postfix/public | ||
171 | chown postfix:postdrop ${D}${localstatedir}/spool/postfix/public | ||
172 | install -m 0755 -d ${D}${localstatedir}/spool/vmail | ||
173 | chown vmail:vmail ${D}${localstatedir}/spool/vmail | ||
174 | |||
175 | chown :postdrop ${D}${sbindir}/postqueue | ||
176 | chown :postdrop ${D}${sbindir}/postdrop | ||
177 | chmod g+s ${D}${sbindir}/postqueue | ||
178 | chmod g+s ${D}${sbindir}/postdrop | ||
179 | |||
180 | rm -rf ${D}/etc/postfix/makedefs.out | ||
181 | } | ||
182 | |||
183 | do_install:append:class-native() { | ||
184 | ln -sf ../sbin/sendmail.postfix ${D}${bindir}/newaliases | ||
185 | ln -sf ../sbin/sendmail.postfix ${D}${bindir}/mailq | ||
186 | } | ||
187 | |||
188 | ALTERNATIVE:${PN}-bin = "sendmail mailq newaliases" | ||
189 | # /usr/lib/sendmial is required by LSB core test | ||
190 | ALTERNATIVE:${PN}-bin:linuxstdbase = "sendmail mailq newaliases usr-lib-sendmail" | ||
191 | ALTERNATIVE_TARGET[mailq] = "${bindir}/mailq" | ||
192 | ALTERNATIVE_TARGET[newaliases] = "${bindir}/newaliases" | ||
193 | ALTERNATIVE_TARGET[sendmail] = "${sbindir}/sendmail.postfix" | ||
194 | ALTERNATIVE_LINK_NAME[sendmail] = "${sbindir}/sendmail" | ||
195 | ALTERNATIVE_TARGET[usr-lib-sendmail] = "${sbindir}/sendmail.postfix" | ||
196 | ALTERNATIVE_LINK_NAME[usr-lib-sendmail] = "/usr/lib/sendmail" | ||
197 | |||
198 | ALTERNATIVE_PRIORITY = "120" | ||
199 | |||
200 | ALTERNATIVE:${PN}-doc += "mailq.1 newaliases.1 sendmail.1" | ||
201 | ALTERNATIVE_LINK_NAME[mailq.1] = "${mandir}/man1/mailq.1" | ||
202 | ALTERNATIVE_LINK_NAME[newaliases.1] = "${mandir}/man1/newaliases.1" | ||
203 | ALTERNATIVE_LINK_NAME[sendmail.1] = "${mandir}/man1/sendmail.1" | ||
204 | |||
205 | pkg_postinst_ontarget:${PN}-cfg () { | ||
206 | touch /etc/aliases | ||
207 | newaliases | ||
208 | |||
209 | # generate virtual_alias, default is hash | ||
210 | touch /etc/postfix/virtual_alias | ||
211 | postmap /etc/postfix/virtual_alias | ||
212 | } | ||
213 | |||
214 | PACKAGES =+ "${PN}-cfg" | ||
215 | RDEPENDS:${PN}-cfg:class-target += "${PN}-bin" | ||
216 | RDEPENDS:${PN}:class-target += "${PN}-cfg" | ||
217 | # Exclude .debug directories from the main package | ||
218 | FILES:${PN}-bin += "${localstatedir} ${bindir}/* ${sbindir}/* \ | ||
219 | ${libexecdir}/* ${systemd_unitdir}/*" | ||
220 | FILES:${PN}-cfg = "${sysconfdir}" | ||
221 | FILES:${PN}-dbg += "${libexecdir}/postfix/.debug" | ||
222 | ALLOW_EMPTY:${PN} = "1" | ||