app-admin/metalog: stable 3-r2 for ia64, bug #634998
[gentoo.git] / app-admin / metalog / metalog-3-r2.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="6"
5 inherit eutils systemd
6
7 DESCRIPTION="A highly configurable replacement for syslogd/klogd"
8 HOMEPAGE="http://metalog.sourceforge.net/"
9 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.xz"
10
11 LICENSE="GPL-2"
12 SLOT="0"
13 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh ~sparc x86 ~sparc-fbsd ~x86-fbsd"
14 IUSE="unicode"
15
16 RDEPEND=">=dev-libs/libpcre-3.4"
17 DEPEND="${RDEPEND}
18         virtual/pkgconfig
19         app-arch/xz-utils"
20
21 PATCHES=( "${FILESDIR}"/${PN}-0.9-metalog-conf.patch )
22
23 src_configure() {
24         econf $(use_with unicode)
25 }
26
27 src_install() {
28         emake DESTDIR="${D}" install
29         dodoc AUTHORS ChangeLog README NEWS metalog.conf
30
31         into /
32         dosbin "${FILESDIR}"/consolelog.sh
33
34         newinitd "${FILESDIR}"/metalog.initd metalog
35         newconfd "${FILESDIR}"/metalog.confd metalog
36         systemd_newunit "${FILESDIR}/${PN}.service-r1" "${PN}.service"
37 }
38
39 pkg_preinst() {
40         if [[ -d "${ROOT}"/etc/metalog ]] && [[ ! -e "${ROOT}"/etc/metalog.conf ]] ; then
41                 mv -f "${ROOT}"/etc/metalog/metalog.conf "${ROOT}"/etc/metalog.conf
42                 rmdir "${ROOT}"/etc/metalog
43                 export MOVED_METALOG_CONF=true
44         else
45                 export MOVED_METALOG_CONF=false
46         fi
47 }
48
49 pkg_postinst() {
50         if ${MOVED_METALOG_CONF} ; then
51                 ewarn "The default metalog.conf file has been moved"
52                 ewarn "from /etc/metalog/metalog.conf to just"
53                 ewarn "/etc/metalog.conf.  If you had a standard"
54                 ewarn "setup, the file has been moved for you."
55         fi
56 }