1 |
|
# Copyright 1999-2024 Gentoo Authors
|
|
1 |
# Copyright 2022-2025 Gentoo Authors
|
2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
|
EAPI=8
|
|
4 |
EAPI="8"
|
5 |
5 |
|
6 |
|
DESCRIPTION="A mail statistics RRDtool frontend for Postfix"
|
7 |
|
HOMEPAGE="https://mailgraph.schweikert.ch/"
|
8 |
|
SRC_URI="https://mailgraph.schweikert.ch/pub/${P}.tar.gz"
|
9 |
|
|
10 |
|
LICENSE="GPL-2"
|
11 |
|
# Change SLOT to 0 when appropriate
|
12 |
|
SLOT="1.14"
|
13 |
|
KEYWORDS="amd64 x86"
|
14 |
|
IUSE="apache2 nginx"
|
15 |
|
|
16 |
|
# for the RRDs
|
17 |
|
DEPEND="
|
18 |
|
acct-group/mgraph
|
19 |
|
acct-user/mgraph"
|
20 |
|
RDEPEND="
|
21 |
|
${DEPEND}
|
22 |
|
apache2? ( acct-user/apache[mgraph] )
|
23 |
|
nginx? ( acct-user/nginx[mgraph] )
|
24 |
|
dev-lang/perl
|
25 |
|
dev-perl/File-Tail
|
26 |
|
>=net-analyzer/rrdtool-1.2.2[graph,perl]"
|
27 |
|
|
28 |
|
PATCHES=( "${FILESDIR}"/${PN}-1.14-homedir.patch )
|
|
6 |
DESCRIPTION="Apple Silicon support scripts"
|
|
7 |
HOMEPAGE="https://asahilinux.org/"
|
|
8 |
SRC_URI="https://github.com/AsahiLinux/${PN}/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
|
|
9 |
|
|
10 |
LICENSE="MIT"
|
|
11 |
SLOT="0"
|
|
12 |
KEYWORDS="~arm64"
|
|
13 |
|
|
14 |
BDEPEND="
|
|
15 |
virtual/udev
|
|
16 |
"
|
29 |
17 |
|
30 |
18 |
src_install() {
|
31 |
|
# log and pid file
|
32 |
|
diropts ""
|
33 |
|
dodir /var/log
|
34 |
|
dodir /var/run
|
35 |
|
diropts -omgraph -gadm -m0750
|
36 |
|
dodir /var/log/mailgraph
|
37 |
|
keepdir /var/log/mailgraph
|
38 |
|
|
39 |
|
# logrotate config for mailgraph log
|
40 |
|
diropts ""
|
41 |
|
dodir /etc/logrotate.d
|
42 |
|
insopts -m0644
|
43 |
|
insinto /etc/logrotate.d
|
44 |
|
newins "${FILESDIR}"/mailgraph.logrotate-new mailgraph
|
45 |
|
|
46 |
|
# mailgraph daemon
|
47 |
|
newbin mailgraph.pl mailgraph
|
48 |
|
|
49 |
|
# mailgraph CGI script
|
50 |
|
exeinto /usr/share/mailgraph
|
51 |
|
doexe mailgraph.cgi
|
52 |
|
insinto /usr/share/mailgraph
|
53 |
|
doins mailgraph.css
|
54 |
|
|
55 |
|
# init/conf files for mailgraph daemon
|
56 |
|
newinitd "${FILESDIR}"/mailgraph.initd-new mailgraph
|
57 |
|
newconfd "${FILESDIR}"/mailgraph.confd-new mailgraph
|
|
19 |
emake DESTDIR="${D}" PREFIX="/usr" SYS_PREFIX="" install-dracut
|
|
20 |
emake DESTDIR="${D}" PREFIX="/usr" install-macsmc-battery
|
|
21 |
|
|
22 |
newinitd "${FILESDIR}/${PN}-macsmc-battery.openrc" "macsmc-battery"
|
58 |
23 |
|
59 |
|
# docs
|
60 |
|
dodoc README CHANGES
|
|
24 |
# install gentoo sys config
|
|
25 |
insinto /etc/default
|
|
26 |
newins "${FILESDIR}"/update-m1n1.gentoo.conf update-m1n1
|
|
27 |
exeinto /usr/lib/kernel/install.d/
|
|
28 |
doexe "${FILESDIR}/99-update-m1n1.install"
|
61 |
29 |
}
|
62 |
30 |
|
63 |
31 |
pkg_postinst() {
|
64 |
|
elog "Mailgraph will run as user mgraph with group adm by default."
|
65 |
|
elog "This can be changed in /etc/conf.d/mailgraph if it doesn't fit."
|
66 |
|
elog "Remember to adjust MG_DAEMON_LOG, MG_DAEMON_PID and MG_DAEMON_RRD"
|
67 |
|
elog "as well!"
|
68 |
|
|
69 |
|
ewarn "Please make sure the MG_LOGFILE (default: /var/log/messages) is readable"
|
70 |
|
ewarn "by group adm or change MG_DAEMON_GID in /etc/conf.d/mailgraph accordingly!"
|
71 |
|
ewarn
|
72 |
|
ewarn "Please make sure *all* mail related logs (MTA, spamfilter, virus scanner)"
|
73 |
|
ewarn "go to the file /var/log/messages or change MG_LOGFILE in"
|
74 |
|
ewarn "/etc/conf.d/mailgraph accordingly! Otherwise mailgraph won't get to know"
|
75 |
|
ewarn "the corresponding events (virus/spam mail found etc.)."
|
76 |
|
|
77 |
|
elog "If you are using neither apache nor nginx and the included CGI script"
|
78 |
|
elog "is unable to read the mailgraph RRD files, please add the user for"
|
79 |
|
elog "that webserver to the group mgraph manually:"
|
80 |
|
elog
|
81 |
|
elog "\tgpasswd -a <user> mgraph"
|
82 |
|
|
83 |
|
ewarn
|
84 |
|
ewarn "mailgraph.cgi is installed in /usr/share/${PN}/"
|
85 |
|
ewarn "You need to put it somewhere accessible though a web-server."
|
|
32 |
if [[ ! -e ${ROOT}/usr/lib/asahi-boot ]]; then
|
|
33 |
ewarn "These scripts are intended for use on Apple Silicon"
|
|
34 |
ewarn "machines with the Asahi tooling installed! Please"
|
|
35 |
ewarn "install sys-boot/m1n1, sys-boot/u-boot and"
|
|
36 |
ewarn "sys-firmware/asahi-firmware!"
|
|
37 |
fi
|
|
38 |
|
|
39 |
elog "Asahi scripts have been installed to /usr/. For more"
|
|
40 |
elog "information on how to use them, please visit the Wiki."
|
|
41 |
|
|
42 |
if [[ -e ${ROOT}/usr/local/share/asahi-scripts/functions.sh ]]; then
|
|
43 |
ewarn "You have upgraded to a new version of ${PN}. Please"
|
|
44 |
ewarn "remove /usr/local/share/asahi-scripts/,"
|
|
45 |
ewarn " /usr/local/bin/update-m1n1, and"
|
|
46 |
ewarn "/usr/local/bin/update-vendor-firmware."
|
|
47 |
fi
|
|
48 |
|
|
49 |
if [[ -e ${ROOT}/etc/dracut.conf.d/10-apple.conf ]]; then
|
|
50 |
ewarn "Please remove /etc/dracut.conf.d/10-apple.conf"
|
|
51 |
fi
|
86 |
52 |
}
|