Gentoo Archives: gentoo-commits

From: "José María Alonso" <nimiux@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-admin/logrotate/
Date: Mon, 28 Aug 2017 15:39:15
Message-Id: 1503934744.c9eb5579f753ed8995f9164853fcdfc92333a998.nimiux@gentoo
1 commit: c9eb5579f753ed8995f9164853fcdfc92333a998
2 Author: Chema Alonso Josa <nimiux <AT> gentoo <DOT> org>
3 AuthorDate: Mon Aug 28 15:38:31 2017 +0000
4 Commit: José María Alonso <nimiux <AT> gentoo <DOT> org>
5 CommitDate: Mon Aug 28 15:39:04 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c9eb5579
7
8 app-admin/logrotate: Reverts changes in bug 621850
9
10 Gentoo-Bug: 627698
11
12 Package-Manager: Portage-2.3.6, Repoman-2.3.1
13
14 app-admin/logrotate/logrotate-3.12.3-r1.ebuild | 94 ++++++++++++++++++++++++++
15 app-admin/logrotate/metadata.xml | 1 -
16 2 files changed, 94 insertions(+), 1 deletion(-)
17
18 diff --git a/app-admin/logrotate/logrotate-3.12.3-r1.ebuild b/app-admin/logrotate/logrotate-3.12.3-r1.ebuild
19 new file mode 100644
20 index 00000000000..6e1b74085b8
21 --- /dev/null
22 +++ b/app-admin/logrotate/logrotate-3.12.3-r1.ebuild
23 @@ -0,0 +1,94 @@
24 +# Copyright 1999-2017 Gentoo Foundation
25 +# Distributed under the terms of the GNU General Public License v2
26 +
27 +EAPI=6
28 +
29 +inherit systemd
30 +
31 +DESCRIPTION="Rotates, compresses, and mails system logs"
32 +HOMEPAGE="https://github.com/logrotate/logrotate"
33 +SRC_URI="https://github.com/${PN}/${PN}/releases/download/${PV}/${P}.tar.gz -> ${P}.tar.gz"
34 +
35 +LICENSE="GPL-2"
36 +SLOT="0"
37 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd"
38 +IUSE="acl +cron selinux"
39 +
40 +CDEPEND="
41 + >=dev-libs/popt-1.5
42 + selinux? ( sys-libs/libselinux )
43 + acl? ( virtual/acl )"
44 +
45 +DEPEND="${CDEPEND}
46 + >=sys-apps/sed-4"
47 +
48 +RDEPEND="${CDEPEND}
49 + selinux? ( sec-policy/selinux-logrotate )
50 + cron? ( virtual/cron )"
51 +
52 +STATEFILE="/var/lib/misc/logrotate.status"
53 +OLDSTATEFILE="/var/lib/logrotate.status"
54 +
55 +move_old_state_file() {
56 + elog "logrotate state file is now located at ${STATEFILE}"
57 + elog "See bug #357275"
58 + if [[ -e "${OLDSTATEFILE}" ]] ; then
59 + elog "Moving your current state file to new location: ${STATEFILE}"
60 + mv -n "${OLDSTATEFILE}" "${STATEFILE}"
61 + fi
62 +}
63 +
64 +install_cron_file() {
65 + exeinto /etc/cron.daily
66 + newexe "${S}"/examples/logrotate.cron "${PN}"
67 +}
68 +
69 +PATCHES=(
70 + "${FILESDIR}/${P}-ignore-hidden.patch"
71 + "${FILESDIR}/${P}-fbsd.patch"
72 +)
73 +
74 +src_prepare() {
75 + default
76 + sed -i -e 's#/usr/sbin/logrotate#/usr/bin/logrotate#' "${S}"/examples/logrotate.{cron,service} || die
77 +}
78 +
79 +src_configure() {
80 + econf $(use_with acl) $(use_with selinux) --with-state-file-path="${STATEFILE}"
81 +}
82 +
83 +src_test() {
84 + emake test
85 +}
86 +
87 +src_install() {
88 + insinto /usr
89 + dobin logrotate
90 + doman logrotate.8
91 + dodoc ChangeLog.md examples/logrotate-default
92 +
93 + insinto /etc
94 + doins "${FILESDIR}"/logrotate.conf
95 +
96 + use cron && install_cron_file
97 +
98 + systemd_dounit examples/logrotate.{service,timer}
99 +
100 + keepdir /etc/logrotate.d
101 +}
102 +
103 +pkg_postinst() {
104 + elog "The ${PN} binary is now installed under /usr/bin. Please"
105 + elog "update your links"
106 + elog
107 + move_old_state_file
108 + elog
109 + if [[ -z ${REPLACING_VERSIONS} ]] ; then
110 + elog "If you wish to have logrotate e-mail you updates, please"
111 + elog "emerge virtual/mailx and configure logrotate in"
112 + elog "/etc/logrotate.conf appropriately"
113 + elog
114 + elog "Additionally, /etc/logrotate.conf may need to be modified"
115 + elog "for your particular needs. See man logrotate for details."
116 + fi
117 +}
118
119 diff --git a/app-admin/logrotate/metadata.xml b/app-admin/logrotate/metadata.xml
120 index de61486807a..e5648d41d70 100644
121 --- a/app-admin/logrotate/metadata.xml
122 +++ b/app-admin/logrotate/metadata.xml
123 @@ -22,7 +22,6 @@
124 <flag name="acl">Installs acl support</flag>
125 <flag name="cron">Installs cron file</flag>
126 <flag name="selinux">Installs Security Enhanced Linux support</flag>
127 - <flag name="bzip2">Compresses rotated log files with bzip2 instead of gzip</flag>
128 </use>
129 <upstream>
130 <remote-id type="github">logrotate/logrotate</remote-id>