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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

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

1 elvanor 1.1 # Copyright 1999-2012 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 zmedico 1.2 # $Header: /var/cvsroot/gentoo-x86/app-office/openerp-server/openerp-server-5.0.16.ebuild,v 1.1 2012/05/27 09:36:59 elvanor Exp $
4 elvanor 1.1
5     EAPI="3"
6     PYTHON_DEPEND="2"
7    
8 zmedico 1.2 inherit distutils user
9 elvanor 1.1
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/egenix-mx-base
21     dev-python/lxml
22     dev-python/psycopg
23     dev-python/pychart
24     dev-python/pytz
25     dev-python/pyxml
26     dev-python/pyopenssl
27     dev-python/reportlab
28     media-gfx/pydot
29     dev-libs/libxslt[python]
30     dev-libs/libxml2[python]"
31    
32     RDEPEND="${CDEPEND}"
33     DEPEND="${CDEPEND}"
34    
35     OPENERP_USER="openerp"
36     OPENERP_GROUP="openerp"
37    
38     pkg_setup() {
39     python_set_active_version 2
40     python_pkg_setup
41     }
42    
43     src_install() {
44     distutils_src_install
45    
46     doinitd "${FILESDIR}/${PN}"
47     newconfd "${FILESDIR}/openerp-server-confd" "${PN}"
48     keepdir /var/run/openerp
49     keepdir /var/log/openerp
50    
51     rm "${D}/usr/bin/openerp-server"
52    
53     insinto /etc/logrotate.d
54     newins "${FILESDIR}"/openerp-server.logrotate openerp-server || die
55     dodir /etc/openerp
56     insinto /etc/openerp
57     newins "${FILESDIR}"/openerp-server.cfg openerp-server.cfg || die
58     }
59    
60     pkg_preinst() {
61     enewgroup ${OPENERP_GROUP}
62     enewuser ${OPENERP_USER} -1 -1 -1 ${OPENERP_GROUP}
63    
64     fowners ${OPENERP_USER}:${OPENERP_GROUP} /var/run/openerp
65     fowners ${OPENERP_USER}:${OPENERP_GROUP} /var/log/openerp
66     }
67    
68     pkg_postinst() {
69     elog "In order to setup the initial database, run:"
70     elog " emerge --config =${CATEGORY}/${PF}"
71     elog "Be sure the database is started before"
72     }
73    
74     pquery() {
75     psql -q -At -U postgres -d template1 -c "$@"
76     }
77    
78     pkg_config() {
79     einfo "In the following, the 'postgres' user will be used."
80     if ! pquery "SELECT usename FROM pg_user WHERE usename = '${OPENERP_USER}'" | grep -q ${OPENERP_USER}; then
81     ebegin "Creating database user ${OPENERP_USER}"
82     createuser --username=postgres --createdb --no-adduser ${OPENERP_USER}
83     eend $? || die "Failed to create database user"
84     fi
85     }

  ViewVC Help
Powered by ViewVC 1.1.20