summaryrefslogtreecommitdiff
path: root/app-office/openerp
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /app-office/openerp
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'app-office/openerp')
-rw-r--r--app-office/openerp/Manifest12
-rw-r--r--app-office/openerp/files/openerp22
-rw-r--r--app-office/openerp/files/openerp-223
-rw-r--r--app-office/openerp/files/openerp-confd3
-rw-r--r--app-office/openerp/files/openerp-confd-23
-rw-r--r--app-office/openerp/files/openerp.cfg64
-rw-r--r--app-office/openerp/files/openerp.cfg.265
-rw-r--r--app-office/openerp/files/openerp.logrotate9
-rw-r--r--app-office/openerp/metadata.xml8
-rw-r--r--app-office/openerp/openerp-7.0.20140125.ebuild119
-rw-r--r--app-office/openerp/openerp-8.0.20140125.ebuild119
11 files changed, 447 insertions, 0 deletions
diff --git a/app-office/openerp/Manifest b/app-office/openerp/Manifest
new file mode 100644
index 000000000000..1c773c93073e
--- /dev/null
+++ b/app-office/openerp/Manifest
@@ -0,0 +1,12 @@
+AUX openerp 490 BLAKE2B 06e4119549cb672f48a504a721f8cce3dcb551ffdd2c1902d9aabb4db7417813f38cce7ef30b91fdf2199478baa522b2a3d24f443177bc204df697952affe06f SHA512 7dcf83cf71b0f1f1b315442ea08adfff5597c95fb1a088468c1d58630dc7e77c0a20a2ae20e751851bce97bafb8ff12340d137effdcba9be099aaef9cdd38af0
+AUX openerp-2 547 BLAKE2B a21effeaab99c4a3d9d7099852db25b88fa62ac027b3e7595f37ccd13aa7ef73db0bf6ad4824cd20f267d1e9108bad909d8c20d5140dfea299c799575f8e8f58 SHA512 2ad5cc1755ca1adce5b1ae5e6bd0a77d3699e04728fe8fe00d0421102d95883b6795c1ca7ca2dc677301d027b2f42768c3a37ec8c18bdf1660ec1562647b73da
+AUX openerp-confd 92 BLAKE2B c93917b9dad6afba0e361b58a2dce6f36e1d6a9dabd567ace3f9fe9559c686a0c7906fa7e49e13653c5b12669c9c2c127563f1f748ef104ee6413edf740d8b51 SHA512 8e1e47263247a340add6e97f45c11e2e629da564dfe600b31ba75f922f9a9311e3799f8896ac9eae53361cbe7f5e763bcff46ea52bc1884444457696f989e925
+AUX openerp-confd-2 88 BLAKE2B 1d6f6e05d496fd8111dc429b0616157f9eca45c4ed776294228221f436610e82ff580394676b1f69a5c9da2dbff66a7947683949acf8df4a29b8343a495ac48b SHA512 789db9fbfcc90e4302f98c8fb81438767bdd17dc3351d2d706cabeea7b1f92bbd9efce2deb570295798a2358fa4bafd8cdf9e1ab311e0673c943b36aabe50d15
+AUX openerp.cfg 1115 BLAKE2B 3032b1a82731217ecc40e9bba9a4a2bf8111cf15323c80be2437e92fba7c4e8752592fa44f68ca84870ed1676a34bb7b9be9e7615c61f94b17f473720d99307c SHA512 6ca4638ee2bc00d2572366416aa8107e7045b10c7f89b383efe1b782e7c6d9190f5423633884dce647944bd297431eeeb194b433a21955c4542b75ab7d820a66
+AUX openerp.cfg.2 1145 BLAKE2B 721f9e590086aa7cd64eb8231f1ac5fc6cc3e38049d8505c15a5eb131bddfdf8187895259ee5a69260ad30d6155fd4908287c26a592132746da922830a590801 SHA512 22194cc2b11380e8ff6f4ed691227d6580da560edaea9b368519261fb7b7d0e9547b0e0b3fe1b0b2b0410ee974b807039ecf559370583a32762373497560e245
+AUX openerp.logrotate 197 BLAKE2B 7788d082548a412032f8d16c94670b9afec10e1a8319a1c172c9417717bc726f7d7046f84ddfc2a1aa10773cd741b3b6e9d984db9b5b45a3f368f4eb6b392709 SHA512 7e6b1475985287bff9cd4a61f747f1dd9b5efdcecb1520dcf8efaf72b9200ce632760a458a6276e317e9d69907560ac187dfd0ecb24c7ff655edb0627967d2bd
+DIST openerp-7.0-20140125-002455.tar.gz 64214375 BLAKE2B 75d7e4294d243f2e02cd04b318fe2492fb553540604bd6ebb246299846d952530e13b847beb4c5e4e7859a714c35ca4a9a5801f7193bd0e4096fccb5d1fe94bf SHA512 a923fe3240cf44f6384f18bd37853d15fe132aab97494e713f095253cd4b72d32a89e33ba3623a523b81b9863da6d5bca24c4020b20829975e4185d6e5093b3e
+DIST openerp-8.0dev-20140125-000101.tar.gz 82648176 BLAKE2B a483bce41eb464ecb49a8f9572492871c649cd75075ea35ed24afeb14a2dec7c4a9232c6c072f42ff77fe878033a89f67b118bece76c95a1a101bcb80a9c1050 SHA512 560f0cd9aadfb010dfba1a114ca17ed8dc7b63fffdd93325811b87530e97a8e629c46442e777bd0c53fb38b1a985e769e3fb5f5edf66b9b45f21be3e8973aedd
+EBUILD openerp-7.0.20140125.ebuild 3730 BLAKE2B 1d3f503050cee5e0d03a9a575185744def25148d6c1bd2ce06b6a63c3ca31bdcf305b2923e0b05983d13a07c57cfad94cb712269be6c05f31a7885cfef8b49fe SHA512 37ab44dd9f38b002ea8a31bfc8e731dca272f8cb608dbb4d44176307041ce6620cac9de0c7412dff92ef068a5dcf4c2d8b584f2c45bb26b537552ea06b97a204
+EBUILD openerp-8.0.20140125.ebuild 3724 BLAKE2B fb18ff752fb53aaea190dc493c53a8319a9acd37cfd6c9affce516ec8c0c2ce808ab9a61c37d121d6d02361c833b9d88190f3c1374f22abd2f6265d1b062c051 SHA512 9d71d0dd2c72d6d55f3a60e4cc170022814609fcc0e2347d111d38a9826cd07acf8e1c2e72ccc2ba8c1c2e0c66e7603eb4a8f491a4baa2aac95d579582a24fac
+MISC metadata.xml 240 BLAKE2B bd240e0175a0c9b3a954ded560844811f58403fcf0fd6474dde32d571e7c3f22424ae8de719a4adad492b6d5f4df7d3198f5a5f65f2c21ca8f05274a9f979f85 SHA512 923a0a24ce7efb7b5c6e6561521def809a20d77a8dca21ca55c1bd8e0e34139c0d5d6ec683180f0b97ddb809ea124765eba82f1135abe08c93f4dfb353d18da8
diff --git a/app-office/openerp/files/openerp b/app-office/openerp/files/openerp
new file mode 100644
index 000000000000..3a8cd40fc713
--- /dev/null
+++ b/app-office/openerp/files/openerp
@@ -0,0 +1,22 @@
+#!/sbin/openrc-run
+
+# Additional options that are passed to the daemon.
+DAEMON_OPTS="-c ${CONFIGFILE}"
+
+depend() {
+ after postgresql
+}
+
+start() {
+ ebegin "Starting openerp server"
+ start-stop-daemon --start --quiet --pidfile "${PIDFILE}" --exec /usr/bin/openerp-server \
+ --make-pidfile --user "${USER}" --background -- ${DAEMON_OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping openerp server"
+ start-stop-daemon --stop --quiet --pidfile "${PIDFILE}" --signal 9
+ rm -f "${PIDFILE}"
+ eend $?
+}
diff --git a/app-office/openerp/files/openerp-2 b/app-office/openerp/files/openerp-2
new file mode 100644
index 000000000000..d1fedb1470d3
--- /dev/null
+++ b/app-office/openerp/files/openerp-2
@@ -0,0 +1,23 @@
+#!/sbin/openrc-run
+
+# Additional options that are passed to the daemon.
+DAEMON_OPTS="-c ${CONFIGFILE}"
+
+depend() {
+ after postgresql
+}
+
+start() {
+ checkpath -q -d -m 0755 -o openerp:openerp /run/openerp
+ ebegin "Starting openerp server"
+ start-stop-daemon --start --quiet --pidfile "${PIDFILE}" --exec /usr/bin/openerp-server \
+ --make-pidfile --user "${USER}" --background -- ${DAEMON_OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping openerp server"
+ start-stop-daemon --stop --quiet --pidfile "${PIDFILE}" --signal 9
+ rm -f "${PIDFILE}"
+ eend $?
+}
diff --git a/app-office/openerp/files/openerp-confd b/app-office/openerp/files/openerp-confd
new file mode 100644
index 000000000000..438f0ee154d4
--- /dev/null
+++ b/app-office/openerp/files/openerp-confd
@@ -0,0 +1,3 @@
+USER="openerp"
+CONFIGFILE="/etc/openerp/openerp.cfg"
+PIDFILE="/var/run/openerp/openerp.pid"
diff --git a/app-office/openerp/files/openerp-confd-2 b/app-office/openerp/files/openerp-confd-2
new file mode 100644
index 000000000000..5e84946046cd
--- /dev/null
+++ b/app-office/openerp/files/openerp-confd-2
@@ -0,0 +1,3 @@
+USER="openerp"
+CONFIGFILE="/etc/openerp/openerp.cfg"
+PIDFILE="/run/openerp/openerp.pid"
diff --git a/app-office/openerp/files/openerp.cfg b/app-office/openerp/files/openerp.cfg
new file mode 100644
index 000000000000..a760856a18a1
--- /dev/null
+++ b/app-office/openerp/files/openerp.cfg
@@ -0,0 +1,64 @@
+[options]
+
+# General options:
+admin_passwd = admin
+
+pidfile = /var/run/openerp/openerp-server.pid
+interface =
+port = 8069
+netinterface =
+netport = 8070
+netrpc = True
+xmlrpc = True
+init =
+without_demo = False
+demo = {}
+update =
+cache_timeout = 100000
+stop_after_init = False
+debug_mode = False
+assert_exit_level = warn
+price_accuracy = 2
+
+# SSL Configuration:
+secure = False
+secure_cert_file = server.cert
+secure_pkey_file = server.pkey
+
+# Logging Configuration:
+logfile = /var/log/openerp/openerp-server.log
+syslog = False
+log_level = debug
+
+# SMTP Configuration:
+email_from = False
+smtp = localhost
+smtp_port = 25
+smtp_ssl = False
+smtp_user = False
+smtp_password = False
+
+# pg_path points at local pg instance - please change as needed
+# Database related options:
+db_user = openerp
+db_password = change_this
+pg_path = /run/postgresql/.s.PGSQL.5432
+db_name = False
+db_host = False
+db_port = False
+db_maxconn = 64
+import_partial =
+
+# Internationalisation options:
+language =
+translate_out =
+translate_in =
+translate_modules = ['all']
+
+# Security-related options:
+list_db = True
+server_actions_allow_code = False
+
+
+
+
diff --git a/app-office/openerp/files/openerp.cfg.2 b/app-office/openerp/files/openerp.cfg.2
new file mode 100644
index 000000000000..e11184acb4f9
--- /dev/null
+++ b/app-office/openerp/files/openerp.cfg.2
@@ -0,0 +1,65 @@
+[options]
+
+# General options:
+admin_passwd = admin
+
+pidfile = /run/openerp/openerp-server.pid
+interface =
+port = 8069
+netinterface =
+netport = 8070
+netrpc = True
+xmlrpc = True
+init =
+without_demo = False
+demo = {}
+update =
+cache_timeout = 100000
+stop_after_init = False
+debug_mode = False
+assert_exit_level = warn
+price_accuracy = 2
+
+# SSL Configuration:
+secure = False
+secure_cert_file = server.cert
+secure_pkey_file = server.pkey
+
+# Logging Configuration:
+logfile = /var/log/openerp/openerp-server.log
+syslog = False
+log_level = debug
+
+# SMTP Configuration:
+email_from = False
+smtp = localhost
+smtp_port = 25
+smtp_ssl = False
+smtp_user = False
+smtp_password = False
+
+# pg_path points at local pg instance - please change as needed
+# Database related options:
+db_user = openerp
+db_password = change_this
+pg_path = /run/postgresql/.s.PGSQL.5432
+db_name = False
+db_host = False
+db_port = False
+db_maxconn = 64
+import_partial =
+
+# Internationalisation options:
+language =
+translate_out =
+translate_in =
+translate_modules = ['all']
+
+# Security-related options:
+list_db = True
+server_actions_allow_code = False
+
+addons_path = /usr/openerp/addons
+
+
+
diff --git a/app-office/openerp/files/openerp.logrotate b/app-office/openerp/files/openerp.logrotate
new file mode 100644
index 000000000000..b58737773a16
--- /dev/null
+++ b/app-office/openerp/files/openerp.logrotate
@@ -0,0 +1,9 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+/var/log/openerp/*.log {
+ monthly
+ create 660 openerp openerp
+ missingok
+ copytruncate
+}
diff --git a/app-office/openerp/metadata.xml b/app-office/openerp/metadata.xml
new file mode 100644
index 000000000000..4f503c94254e
--- /dev/null
+++ b/app-office/openerp/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>dlan@gentoo.org</email>
+ <name>Yixun Lan</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/app-office/openerp/openerp-7.0.20140125.ebuild b/app-office/openerp/openerp-7.0.20140125.ebuild
new file mode 100644
index 000000000000..f278f7474ac6
--- /dev/null
+++ b/app-office/openerp/openerp-7.0.20140125.ebuild
@@ -0,0 +1,119 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+PYTHON_COMPAT=( python2_7 )
+DISTUTILS_SINGLE_IMPL=1
+
+inherit eutils distutils-r1 user
+
+DESCRIPTION="Open Source ERP & CRM"
+HOMEPAGE="http://www.openerp.com/"
+MY_PV=${PV/7.0./7.0-}
+FNAME="${PN}-${MY_PV}-002455"
+SRC_URI="http://nightly.openerp.com/7.0/nightly/src/${FNAME}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86 ~amd64"
+IUSE="+postgres ldap ssl"
+
+CDEPEND="!app-office/openerp-web
+ postgres? ( dev-db/postgresql[server] )
+ dev-python/psutil[${PYTHON_USEDEP}]
+ dev-python/docutils[${PYTHON_USEDEP}]
+ dev-python/lxml[${PYTHON_USEDEP}]
+ dev-python/psycopg:2[${PYTHON_USEDEP}]
+ dev-python/pychart[${PYTHON_USEDEP}]
+ dev-python/pyparsing[${PYTHON_USEDEP}]
+ dev-python/reportlab[${PYTHON_USEDEP}]
+ dev-python/simplejson[${PYTHON_USEDEP}]
+ dev-python/pydot[${PYTHON_USEDEP}]
+ dev-python/vobject[${PYTHON_USEDEP}]
+ dev-python/mako[${PYTHON_USEDEP}]
+ dev-python/mock[${PYTHON_USEDEP}]
+ dev-python/pyyaml[${PYTHON_USEDEP}]
+ dev-python/Babel[${PYTHON_USEDEP}]
+ dev-python/gdata[${PYTHON_USEDEP}]
+ ldap? ( dev-python/python-ldap[${PYTHON_USEDEP}] )
+ dev-python/python-openid[${PYTHON_USEDEP}]
+ dev-python/werkzeug[${PYTHON_USEDEP}]
+ dev-python/xlwt[${PYTHON_USEDEP}]
+ dev-python/feedparser[${PYTHON_USEDEP}]
+ dev-python/python-dateutil[${PYTHON_USEDEP}]
+ dev-python/pywebdav[${PYTHON_USEDEP}]
+ ssl? ( dev-python/pyopenssl[${PYTHON_USEDEP}] )
+ dev-python/vatnumber[${PYTHON_USEDEP}]
+ dev-python/zsi[${PYTHON_USEDEP}]
+ dev-python/mock[${PYTHON_USEDEP}]
+ dev-python/unittest2[${PYTHON_USEDEP}]
+ dev-python/jinja[${PYTHON_USEDEP}]
+ dev-python/matplotlib[${PYTHON_USEDEP}]
+ dev-python/pillow[jpeg(+),${PYTHON_USEDEP}]
+ ${PYTHON_DEPS}
+ "
+
+RDEPEND="${CDEPEND}"
+DEPEND="${CDEPEND}"
+
+OPENERP_USER="openerp"
+OPENERP_GROUP="openerp"
+
+S="${WORKDIR}/${FNAME}"
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ newinitd "${FILESDIR}/${PN}-2" "${PN}"
+ newconfd "${FILESDIR}/openerp-confd-2" "${PN}"
+ keepdir /var/log/openerp
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/openerp.logrotate openerp
+ dodir /etc/openerp
+ insinto /etc/openerp
+ newins "${FILESDIR}"/openerp.cfg.2 openerp.cfg
+
+ # #453424 Fix error on /usr/openerp/import_xml.rng
+ dosym /usr/${PN}/import_xml.rng $(python_get_sitedir)/${PN}/import_xml.rng
+
+ # #453424 Fix error on /usr/openerp/addons/base/res/res_company_logo.png
+ dosym /usr/${PN}/addons/base/res/res_company_logo.png $(python_get_sitedir)/${PN}/addons/base/res/res_company_logo.png
+}
+
+pkg_preinst() {
+ enewgroup ${OPENERP_GROUP}
+ enewuser ${OPENERP_USER} -1 -1 -1 ${OPENERP_GROUP}
+
+ fowners -R ${OPENERP_USER}:${OPENERP_GROUP} /etc/openerp
+ fowners ${OPENERP_USER}:${OPENERP_GROUP} /var/log/openerp
+ fowners -R ${OPENERP_USER}:${OPENERP_GROUP} "$(python_get_sitedir)/${PN}/addons/"
+
+ fperms 0640 /etc/openerp/openerp.cfg
+
+ use postgres || sed -i '6,8d' "${D}/etc/init.d/openerp" || die "sed failed"
+}
+
+pkg_postinst() {
+ chown -R ${OPENERP_USER}:${OPENERP_GROUP} /etc/openerp
+ chown ${OPENERP_USER}:${OPENERP_GROUP} /var/log/openerp
+ chown -R ${OPENERP_USER}:${OPENERP_GROUP} "$(python_get_sitedir)/${PN}/addons/"
+
+ elog "In order to setup the initial database, run:"
+ elog " emerge --config =${CATEGORY}/${PF}"
+ elog "Be sure the database is started before"
+}
+
+psqlquery() {
+ psql -q -At -U postgres -d template1 -c "$@"
+}
+
+pkg_config() {
+ einfo "In the following, the 'postgres' user will be used."
+ if ! psqlquery "SELECT usename FROM pg_user WHERE usename = '${OPENERP_USER}'" | grep -q ${OPENERP_USER}; then
+ ebegin "Creating database user ${OPENERP_USER}"
+ createuser --username=postgres --createdb --no-adduser ${OPENERP_USER}
+ eend $? || die "Failed to create database user"
+ fi
+}
diff --git a/app-office/openerp/openerp-8.0.20140125.ebuild b/app-office/openerp/openerp-8.0.20140125.ebuild
new file mode 100644
index 000000000000..cebc58dc92c2
--- /dev/null
+++ b/app-office/openerp/openerp-8.0.20140125.ebuild
@@ -0,0 +1,119 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+PYTHON_COMPAT=( python2_7 )
+DISTUTILS_SINGLE_IMPL=1
+
+inherit eutils distutils-r1 user
+
+DESCRIPTION="Open Source ERP & CRM"
+HOMEPAGE="http://www.openerp.com/"
+MY_PV=${PV/8.0./8.0dev-}
+FNAME="${PN}-${MY_PV}-000101"
+SRC_URI="http://nightly.openerp.com/trunk/nightly/src/${FNAME}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+IUSE="+postgres ldap ssl"
+
+CDEPEND="!app-office/openerp-web
+ postgres? ( dev-db/postgresql[server] )
+ dev-python/psutil[${PYTHON_USEDEP}]
+ dev-python/docutils[${PYTHON_USEDEP}]
+ dev-python/lxml[${PYTHON_USEDEP}]
+ dev-python/psycopg:2[${PYTHON_USEDEP}]
+ dev-python/pychart[${PYTHON_USEDEP}]
+ dev-python/pyparsing[${PYTHON_USEDEP}]
+ dev-python/reportlab[${PYTHON_USEDEP}]
+ dev-python/simplejson[${PYTHON_USEDEP}]
+ dev-python/pydot[${PYTHON_USEDEP}]
+ dev-python/vobject[${PYTHON_USEDEP}]
+ dev-python/mako[${PYTHON_USEDEP}]
+ dev-python/mock[${PYTHON_USEDEP}]
+ dev-python/pyyaml[${PYTHON_USEDEP}]
+ dev-python/Babel[${PYTHON_USEDEP}]
+ dev-python/gdata[${PYTHON_USEDEP}]
+ ldap? ( dev-python/python-ldap[${PYTHON_USEDEP}] )
+ dev-python/python-openid[${PYTHON_USEDEP}]
+ dev-python/werkzeug[${PYTHON_USEDEP}]
+ dev-python/xlwt[${PYTHON_USEDEP}]
+ dev-python/feedparser[${PYTHON_USEDEP}]
+ dev-python/python-dateutil[${PYTHON_USEDEP}]
+ dev-python/pywebdav[${PYTHON_USEDEP}]
+ ssl? ( dev-python/pyopenssl[${PYTHON_USEDEP}] )
+ dev-python/vatnumber[${PYTHON_USEDEP}]
+ dev-python/zsi[${PYTHON_USEDEP}]
+ dev-python/mock[${PYTHON_USEDEP}]
+ dev-python/unittest2[${PYTHON_USEDEP}]
+ dev-python/jinja[${PYTHON_USEDEP}]
+ dev-python/matplotlib[${PYTHON_USEDEP}]
+ dev-python/pillow[jpeg(+),${PYTHON_USEDEP}]
+ ${PYTHON_DEPS}
+ "
+
+RDEPEND="${CDEPEND}"
+DEPEND="${CDEPEND}"
+
+OPENERP_USER="openerp"
+OPENERP_GROUP="openerp"
+
+S="${WORKDIR}/${FNAME}"
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ newinitd "${FILESDIR}/${PN}-2" "${PN}"
+ newconfd "${FILESDIR}/openerp-confd-2" "${PN}"
+ keepdir /var/log/openerp
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/openerp.logrotate openerp
+ dodir /etc/openerp
+ insinto /etc/openerp
+ newins "${FILESDIR}"/openerp.cfg.2 openerp.cfg
+
+ # #453424 Fix error on /usr/openerp/import_xml.rng
+ dosym /usr/${PN}/import_xml.rng $(python_get_sitedir)/${PN}/import_xml.rng
+
+ # #453424 Fix error on /usr/openerp/addons/base/res/res_company_logo.png
+ dosym /usr/${PN}/addons/base/res/res_company_logo.png $(python_get_sitedir)/${PN}/addons/base/res/res_company_logo.png
+}
+
+pkg_preinst() {
+ enewgroup ${OPENERP_GROUP}
+ enewuser ${OPENERP_USER} -1 -1 -1 ${OPENERP_GROUP}
+
+ fowners -R ${OPENERP_USER}:${OPENERP_GROUP} /etc/openerp
+ fowners ${OPENERP_USER}:${OPENERP_GROUP} /var/log/openerp
+ fowners -R ${OPENERP_USER}:${OPENERP_GROUP} "$(python_get_sitedir)/${PN}/addons/"
+
+ fperms 0640 /etc/openerp/openerp.cfg
+
+ use postgres || sed -i '6,8d' "${D}/etc/init.d/openerp" || die "sed failed"
+}
+
+pkg_postinst() {
+ chown -R ${OPENERP_USER}:${OPENERP_GROUP} /etc/openerp
+ chown ${OPENERP_USER}:${OPENERP_GROUP} /var/log/openerp
+ chown -R ${OPENERP_USER}:${OPENERP_GROUP} "$(python_get_sitedir)/${PN}/addons/"
+
+ elog "In order to setup the initial database, run:"
+ elog " emerge --config =${CATEGORY}/${PF}"
+ elog "Be sure the database is started before"
+}
+
+psqlquery() {
+ psql -q -At -U postgres -d template1 -c "$@"
+}
+
+pkg_config() {
+ einfo "In the following, the 'postgres' user will be used."
+ if ! psqlquery "SELECT usename FROM pg_user WHERE usename = '${OPENERP_USER}'" | grep -q ${OPENERP_USER}; then
+ ebegin "Creating database user ${OPENERP_USER}"
+ createuser --username=postgres --createdb --no-adduser ${OPENERP_USER}
+ eend $? || die "Failed to create database user"
+ fi
+}