Skip to content

Commit

Permalink
[FIX] packaging: allow install on fedora29
Browse files Browse the repository at this point in the history
Fedora 29 switched to python 3.7. It seems that there is no official
way to build a RPM package that could works with 3.6 and 3.7.
Building two different packages for each version could open the pandora
box of packaging.

With this commit an ugly hack is used: if python3.7 is found, the odoo
directory is symlinked into its site-packages dir.

fixes odoo#30579

closes odoo#30618
d-fence committed Jan 29, 2019
1 parent 317884b commit 7eec6b3
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ requires =
nodejs-less
pychart
pyparsing
python(abi) = 3.6
python(abi) >= 3.6
python3-babel
python3-decorator
python3-docutils
6 changes: 6 additions & 0 deletions setup/redhat/postinstall.sh
Original file line number Diff line number Diff line change
@@ -10,6 +10,12 @@ ODOO_LOG_DIR=/var/log/odoo
ODOO_LOG_FILE=$ODOO_LOG_DIR/odoo-server.log
ODOO_USER="odoo"

if [ -d /usr/lib/python3.7 ]; then
SITE_PACK_DIR37=/usr/lib/python3.7/site-packages
[[ ! -d ${SITE_PACK_DIR37} ]] && mkdir -p ${SITE_PACK_DIR37}
ln -s /usr/lib/python3.6/site-packages/odoo ${SITE_PACK_DIR37}/odoo
fi

if ! getent passwd | grep -q "^odoo:"; then
groupadd $ODOO_GROUP
adduser --system --no-create-home $ODOO_USER -g $ODOO_GROUP

0 comments on commit 7eec6b3

Please sign in to comment.