Gentoo Archives: gentoo-commits

From: Conrad Kostecki <conikost@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-apps/postfixadmin/
Date: Sun, 18 Jul 2021 18:42:44
Message-Id: 1626633732.cf258076c16c8cd519dae031a2f0c29128c974b8.conikost@gentoo
1 commit: cf258076c16c8cd519dae031a2f0c29128c974b8
2 Author: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jul 18 18:08:23 2021 +0000
4 Commit: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
5 CommitDate: Sun Jul 18 18:42:12 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cf258076
7
8 www-apps/postfixadmin: migrate to glep 81
9
10 Bug: https://bugs.gentoo.org/781524
11 Package-Manager: Portage-3.0.20, Repoman-3.0.3
12 Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>
13
14 www-apps/postfixadmin/postfixadmin-3.3.9-r1.ebuild | 106 +++++++++++++++++++++
15 1 file changed, 106 insertions(+)
16
17 diff --git a/www-apps/postfixadmin/postfixadmin-3.3.9-r1.ebuild b/www-apps/postfixadmin/postfixadmin-3.3.9-r1.ebuild
18 new file mode 100644
19 index 00000000000..fb348597596
20 --- /dev/null
21 +++ b/www-apps/postfixadmin/postfixadmin-3.3.9-r1.ebuild
22 @@ -0,0 +1,106 @@
23 +# Copyright 1999-2021 Gentoo Authors
24 +# Distributed under the terms of the GNU General Public License v2
25 +
26 +EAPI=7
27 +
28 +inherit webapp
29 +
30 +DESCRIPTION="Web Based Management tool for Postfix style virtual domains and users"
31 +HOMEPAGE="http://postfixadmin.sourceforge.net"
32 +SRC_URI="https://github.com/postfixadmin/postfixadmin/archive/${P}.tar.gz"
33 +S="${WORKDIR}/${PN}-${P}"
34 +
35 +LICENSE="GPL-2"
36 +KEYWORDS="amd64 ~ppc x86"
37 +IUSE="+mysql postgres +vacation"
38 +REQUIRED_USE="|| ( mysql postgres )"
39 +
40 +DEPEND="
41 + dev-lang/php:*[unicode,imap,postgres?]
42 + vacation? (
43 + acct-group/vacation
44 + acct-user/vacation
45 + dev-perl/DBI
46 + dev-perl/Email-Sender
47 + dev-perl/Email-Valid
48 + dev-perl/Log-Dispatch
49 + dev-perl/Log-Log4perl
50 + dev-perl/MIME-Charset
51 + dev-perl/MIME-EncWords
52 + mysql? ( dev-perl/DBD-mysql )
53 + postgres? ( dev-perl/DBD-Pg )
54 + )
55 +"
56 +
57 +RDEPEND="
58 + ${DEPEND}
59 + virtual/httpd-php
60 + mysql? ( || ( dev-lang/php[mysqli] dev-lang/php[mysql] ) )
61 +"
62 +
63 +need_httpd_cgi
64 +
65 +pkg_setup() {
66 + webapp_pkg_setup
67 +}
68 +
69 +src_install() {
70 + webapp_src_preinst
71 +
72 + if use vacation; then
73 + insinto /var/spool/vacation
74 + newins VIRTUAL_VACATION/vacation.pl vacation.pl-${SLOT}
75 + fowners vacation:vacation /var/spool/vacation/vacation.pl-${SLOT}
76 + fperms 770 /var/spool/vacation/vacation.pl-${SLOT}
77 + dodoc VIRTUAL_VACATION/FILTER_README
78 + newdoc VIRTUAL_VACATION/INSTALL.md VIRTUAL_VACATION_INSTALL.md
79 + rm -r VIRTUAL_VACATION/{vacation.pl,INSTALL.md,tests,FILTER_README} || die
80 + fi
81 +
82 + docinto /usr/share/doc/${PF}/
83 + dodoc -r ADDITIONS
84 +
85 + local docs="DOCUMENTS/*.txt INSTALL.TXT CHANGELOG.TXT"
86 + dodoc ${docs}
87 +
88 + rm -rf ${docs} DOCUMENTS/ GPL-LICENSE.TXT LICENSE.TXT debian/ tests/ ADDITIONS/
89 +
90 + insinto "${MY_HTDOCSDIR}"
91 + doins -r .
92 +
93 + webapp_configfile "${MY_HTDOCSDIR}"/config.inc.php
94 +
95 + webapp_postinst_txt en "${FILESDIR}"/postinstall-en-2.3.txt
96 + webapp_src_install
97 +}
98 +
99 +pkg_postinst() {
100 + webapp_pkg_postinst
101 +
102 + einfo "Please note that if upgrading from version prior to 3.3.0,"
103 + einfo "existing setup_password will no longer work and you will"
104 + einfo "need to generate new one. See instructions in setup.php."
105 +
106 + if use vacation; then
107 + # portage does not update owners of directories (feature :)
108 + chown vacation:vacation "${ROOT}"/var/spool/vacation/
109 + einfo
110 + einfo "/var/spool/vacation/vacation.pl symlink was updated to:"
111 + einfo "/var/spool/vacation/vacation.pl-${SLOT}"
112 + ln -sf "${ROOT}"/var/spool/vacation/vacation.pl{-${SLOT},} || die
113 + fi
114 +}
115 +
116 +pkg_postrm() {
117 + # Make sure we don't leave broken vacation.pl symlink
118 + find -L "${ROOT}"/var/spool/vacation/ -type l -delete
119 + local shopt_save=$(shopt -p nullglob)
120 + shopt -s nullglob
121 + local vacation=( "${ROOT}"/var/spool/vacation/vacation.pl-* )
122 + ${shopt_save}
123 + if [[ ! -e "${ROOT}"/var/spool/vacation/vacation.pl && -n ${vacation[@]} ]]; then
124 + ln -s "${vacation[-1]}" "${ROOT}"/var/spool/vacation/vacation.pl || die
125 + ewarn "/var/spool/vacation/vacation.pl was updated to point on most"
126 + ewarn "recent verion, but please, do your own checks"
127 + fi
128 +}