/[gentoo-x86]/app-office/openerp-server/openerp-server-5.0.15.ebuild
Gentoo

Contents of /app-office/openerp-server/openerp-server-5.0.15.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Sat Jun 2 06:50:50 2012 UTC (2 years, 2 months ago) by zmedico
Branch: MAIN
Changes since 1.2: +3 -3 lines
inherit user for enewgroup and enewuser

(Portage version: 2.2.0_alpha108_p30/cvs/Linux i686)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/app-office/openerp-server/openerp-server-5.0.15.ebuild,v 1.2 2011/04/06 16:59:15 arfrever Exp $
4
5 EAPI="3"
6 PYTHON_DEPEND="2"
7
8 inherit distutils user
9
10 DESCRIPTION="Open Source ERP & CRM"
11 HOMEPAGE="http://www.openerp.com/"
12 SRC_URI="http://www.openerp.com/download/stable/source/${P}.tar.gz"
13
14 LICENSE="GPL-2"
15 SLOT="0"
16 KEYWORDS="~amd64 ~x86"
17 IUSE=""
18
19 CDEPEND="dev-db/postgresql-server
20 dev-python/lxml
21 dev-python/psycopg
22 dev-python/pychart
23 dev-python/pytz
24 dev-python/pyxml
25 dev-python/pyopenssl
26 dev-python/reportlab
27 media-gfx/pydot
28 dev-libs/libxslt[python]
29 dev-libs/libxml2[python]"
30
31 RDEPEND="${CDEPEND}"
32 DEPEND="${CDEPEND}"
33
34 OPENERP_USER="openerp"
35 OPENERP_GROUP="openerp"
36
37 pkg_setup() {
38 python_set_active_version 2
39 python_pkg_setup
40 }
41
42 src_install() {
43 distutils_src_install
44
45 doinitd "${FILESDIR}/${PN}"
46 newconfd "${FILESDIR}/openerp-server-confd" "${PN}"
47 keepdir /var/run/openerp
48 keepdir /var/log/openerp
49
50 rm "${D}/usr/bin/openerp-server"
51
52 insinto /etc/logrotate.d
53 newins "${FILESDIR}"/openerp-server.logrotate openerp-server || die
54 dodir /etc/openerp
55 insinto /etc/openerp
56 newins "${FILESDIR}"/openerp-server.cfg openerp-server.cfg || die
57 }
58
59 pkg_preinst() {
60 enewgroup ${OPENERP_GROUP}
61 enewuser ${OPENERP_USER} -1 -1 -1 ${OPENERP_GROUP}
62
63 fowners ${OPENERP_USER}:${OPENERP_GROUP} /var/run/openerp
64 fowners ${OPENERP_USER}:${OPENERP_GROUP} /var/log/openerp
65 }
66
67 pkg_postinst() {
68 elog "In order to setup the initial database, run:"
69 elog " emerge --config =${CATEGORY}/${PF}"
70 elog "Be sure the database is started before"
71 }
72
73 pquery() {
74 psql -q -At -U postgres -d template1 -c "$@"
75 }
76
77 pkg_config() {
78 einfo "In the following, the 'postgres' user will be used."
79 if ! pquery "SELECT usename FROM pg_user WHERE usename = '${OPENERP_USER}'" | grep -q ${OPENERP_USER}; then
80 ebegin "Creating database user ${OPENERP_USER}"
81 createuser --username=postgres --createdb --no-adduser ${OPENERP_USER}
82 eend $? || die "Failed to create database user"
83 fi
84 }

  ViewVC Help
Powered by ViewVC 1.1.20