Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 395089 | Differences between
and this patch

Collapse All | Expand All

(-)/usr/portage/net-irc/anope/anope-1.8.5.ebuild (-100 / +64 lines)
Lines 1-17 Link Here
1
# Copyright 1999-2010 Gentoo Foundation
1
# Copyright 1999-2011 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
2
# Distributed under the terms of the GNU General Public License v2
3
# $Header: /var/cvsroot/gentoo-x86/net-irc/anope/anope-1.8.5.ebuild,v 1.1 2010/10/10 18:07:36 gurligebis Exp $
3
# $Header: $
4
4
5
EAPI="2"
5
EAPI=4
6
6
7
inherit eutils versionator
7
inherit autotools eutils multilib versionator
8
9
MY_PV=$(replace_version_separator 3 '-')
10
S="${WORKDIR}/${PN}-${MY_PV}"
11
8
12
DESCRIPTION="Anope IRC Services"
9
DESCRIPTION="Anope IRC Services"
13
HOMEPAGE="http://www.anope.org"
10
HOMEPAGE="http://www.anope.org"
14
SRC_URI="mirror://sourceforge/${PN}/${PN}-${MY_PV}.tar.gz"
11
SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
15
12
16
LICENSE="GPL-2"
13
LICENSE="GPL-2"
17
SLOT="0"
14
SLOT="0"
Lines 19-41 Link Here
19
IUSE="mysql"
16
IUSE="mysql"
20
17
21
DEPEND="mysql? ( virtual/mysql )"
18
DEPEND="mysql? ( virtual/mysql )"
19
RDEPEND="${DEPEND}"
22
20
23
INSTALL_DIR="/opt/anope"
21
pkg_pretend() {
22
	local replaced_version
23
	for replaced_version in ${REPLACING_VERSIONS} ; do
24
		if ! version_is_at_least 1.8.7 ${replaced_version} && [[ -f ${ROOT}opt/anope/data/nick.db ]]; then
25
			eerror "It looks like you have an older version of Anope installed."
26
			eerror "To upgrade, shut down Anope and copy your databases to"
27
			eerror "${ROOT}var/lib/anope and your configuration to ${ROOT}etc/anope"
28
			eerror "You can do this by:"
29
			eerror "# mkdir -p ${ROOT}var/lib/anope ${ROOT}etc/anope"
30
			eerror "# chown anope:anope ${ROOT}var/lib/anope"
31
			eerror "# mv ${ROOT}opt/anope/data/*.db ${ROOT}var/lib/anope"
32
			eerror "# mv ${ROOT}opt/anope/data/services.conf ${ROOT}etc/anope"
33
			die "Please move your anope database files from /opt/anope/data"
34
		fi
35
	done
36
}
24
37
25
pkg_setup() {
38
pkg_setup() {
26
	enewgroup anope
39
	enewgroup anope
27
	enewuser anope -1 -1 "${INSTALL_DIR}" anope
40
	enewuser anope -1 -1 -1 anope
28
	if has_version net-irc/anope ; then
29
		ewarn
30
		ewarn "Make backups before updating as they will be overwritten"
31
		ewarn
32
		ebeep 10
33
	fi
34
}
41
}
35
42
36
src_prepare() {
43
src_prepare() {
37
	epatch "${FILESDIR}/pid-patch.diff"
44
	epatch "${FILESDIR}"/pid-patch.diff
38
	epatch "${FILESDIR}/ldflags-fix.patch"
45
	epatch "${FILESDIR}"/ldflags-fix.patch
46
	epatch "${FILESDIR}"/anope-1.8-libdir-gentoo.patch
47
	eautoconf
39
}
48
}
40
49
41
src_configure() {
50
src_configure() {
Lines 46-155 Link Here
46
55
47
	econf \
56
	econf \
48
		${myconf} \
57
		${myconf} \
49
		--bindir ${INSTALL_DIR} \
58
		--with-bindir=/usr/bin/ \
50
		--with-bindir=${INSTALL_DIR} \
59
		--with-datadir=/var/lib/anope \
51
		--with-datadir=${INSTALL_DIR}/data \
60
		--with-libdir=/usr/$(get_libdir)/anope/ \
52
		--with-modules=${INSTALL_DIR}/modules \
53
		--with-encryption \
54
		--with-rungroup=anope \
61
		--with-rungroup=anope \
55
		--with-permissions=077 \
62
		--with-permissions=077
56
	|| die "Configuration failed."
57
63
58
	sed -i -e "/^build:/s:$: language:g" "${S}"/Makefile || die "sed failed"
64
	sed -i -e "/^build:/s:$: language:g" "${S}"/Makefile || die "sed failed"
59
}
65
}
60
66
61
src_install() {
67
src_install() {
62
	dodir ${INSTALL_DIR}
68
	keepdir /var/{lib,log,run}/anope
63
	dodir ${INSTALL_DIR}/data
69
	fowners anope:anope /var/{lib,log,run}/anope
64
	dodir ${INSTALL_DIR}/data/logs
65
	dodir ${INSTALL_DIR}/data/languages
66
	dodir ${INSTALL_DIR}/data/modules
67
	dodir ${INSTALL_DIR}/data/modules/runtime
68
69
	dodir /var/run/anope
70
	fowners anope:anope /var/run/anope
71
	keepdir /var/run/anope
72
73
	fowners anope:anope ${INSTALL_DIR}
74
	fowners anope:anope ${INSTALL_DIR}/data
75
	fowners anope:anope ${INSTALL_DIR}/data/logs
76
	fowners anope:anope ${INSTALL_DIR}/data/languages
77
	fowners anope:anope ${INSTALL_DIR}/data/modules
78
	fowners anope:anope ${INSTALL_DIR}/data/modules/runtime
79
80
	exeinto ${INSTALL_DIR}
81
	doexe src/services
82
	insinto ${INSTALL_DIR}/data
83
	newins data/example.conf services.conf.example
84
85
	newinitd "${FILESDIR}"/anope.initd anope
86
	newconfd "${FILESDIR}"/anope.confd anope
87
88
	insinto ${INSTALL_DIR}/data/modules
89
	doins src/modules/*.so
90
70
91
	keepdir ${INSTALL_DIR}/data/logs
71
	local baselibdir
72
	baselibdir="${D}/usr/$(get_libdir)/anope"
92
73
93
	insinto ${INSTALL_DIR}/data/languages
74
	dodir /usr/$(get_libdir)/anope/{lang,modules}
94
	doins lang/cat
75
	emake DATDEST="${baselibdir}" \
95
	doins lang/de
76
		BINDEST="${D}/usr/bin" \
96
	doins lang/en_us
77
		MODULE_PATH="${baselibdir}/modules" \
97
	doins lang/es
78
		install
98
	doins lang/fr
99
	doins lang/gr
100
	doins lang/hun
101
	doins lang/it
102
	doins lang/nl
103
	doins lang/pl
104
	doins lang/pt
105
	doins lang/ru
106
	doins lang/tr
107
108
	keepdir ${INSTALL_DIR}/data/modules/runtime
109
110
	insinto ${INSTALL_DIR}/data/modules
111
	doins src/protocol/*.so
112
	doins src/core/*.so
113
114
	fowners anope:anope ${INSTALL_DIR}/services
115
	fowners anope:anope ${INSTALL_DIR}/data/languages/cat
116
	fowners anope:anope ${INSTALL_DIR}/data/languages/de
117
	fowners anope:anope ${INSTALL_DIR}/data/languages/en_us
118
	fowners anope:anope ${INSTALL_DIR}/data/languages/fr
119
	fowners anope:anope ${INSTALL_DIR}/data/languages/gr
120
	fowners anope:anope ${INSTALL_DIR}/data/languages/hun
121
	fowners anope:anope ${INSTALL_DIR}/data/languages/it
122
	fowners anope:anope ${INSTALL_DIR}/data/languages/nl
123
	fowners anope:anope ${INSTALL_DIR}/data/languages/pl
124
	fowners anope:anope ${INSTALL_DIR}/data/languages/pt
125
	fowners anope:anope ${INSTALL_DIR}/data/languages/ru
126
	fowners anope:anope ${INSTALL_DIR}/data/languages/tr
127
79
128
	dodoc Changes Changes.conf Changes.lang Changes.mysql docs/*
80
	newinitd "${FILESDIR}"/anope.initd-r1 anope
81
	newconfd "${FILESDIR}"/anope.confd anope
129
82
83
	dodoc Changes Changes.conf Changes.lang Changes.mysql docs/* data/example.conf
130
	use mysql && dodoc data/tables.sql
84
	use mysql && dodoc data/tables.sql
85
86
	insinto /etc/anope
87
	newins data/example.conf services.conf
131
}
88
}
132
89
133
pkg_preinst() {
90
pkg_preinst() {
134
	if has_version net-irc/anope ; then
91
	if has_version net-irc/anope ; then
135
		elog "Making a backup of your config to data/pre-update"
92
		local directory
136
		mkdir "${ROOT}"opt/anope/data/pre-update
93
		directory="${ROOT}"var/lib/anope/pre-update
137
		cp "${ROOT}"opt/anope/data/* "${ROOT}"opt/anope/data/pre-update
94
		elog "Making a backup of your databases to ${directory}"
95
		if [ ! -d "${directory}" ]; then
96
			mkdir -p "${directory}" || die "failed to create backup directory"
97
			chown anope:anope "${directory}"/../ || die "failed to chown data directory"
98
		fi
99
		# don't die otherwise merge will fail if there are no existing databases
100
		cp "${ROOT}"/var/lib/anope/*.db "${directory}"
138
	fi
101
	fi
139
}
102
}
140
103
141
pkg_postinst() {
104
pkg_postinst() {
142
	echo
105
	echo
143
	ewarn "Anope won't run out of the box, you still have to configure it to match your IRCDs configuration."
106
	ewarn "Anope won't run out of the box, you still have to configure it to match your IRCD's configuration."
144
	ewarn "Edit ${INSTALL_DIR}/data/services.conf to configure Anope."
107
	ewarn "Edit /etc/anope/services.conf to configure Anope."
145
	echo
146
	ewarn "!!! ATTENTION !!!"
147
	ewarn "Be sure to read Changes.mysql to update your MySQL"
148
	ewarn "tables or anope will break after restart"
149
	ewarn "!!! ATTENTION !!!"
150
108
151
	if use mysql; then
109
	if use mysql; then
110
		echo
111
		ewarn "!!! ATTENTION !!!"
112
		ewarn "Be sure to read Changes.mysql to update your MySQL"
113
		ewarn "tables or anope will break after restart"
114
		ewarn "!!! ATTENTION !!!"
115
		echo
152
		einfo "The mysql script for updating the tables is located in the"
116
		einfo "The mysql script for updating the tables is located in the"
153
		einfo "/usr/share/doc/${P} directory"
117
		einfo "/usr/share/doc/${PF} directory"
154
	fi
118
	fi
155
}
119
}

Return to bug 395089