From 3d76467a64803c9ecaf5294ee3949db9249f2a8e Mon Sep 17 00:00:00 2001 From: Temur Vibliani Date: Tue, 22 Sep 2015 20:21:13 +0400 Subject: [PATCH] [IMP] select wkhtml2pdf between x64 & x32 versions - Automatically choose between wkhtml2pdf x64 and x32 versions, according of host architecture. - Replaced "dpkg -i" with "gdebi --n", in order to have installed all wkhtml2pdf dependencies automatically, if any of them is missing from the system. - Make shortcuts in /usr/bin directory, instead of copying actual binary files that are part of installed wkthml2pdf package. - Added .gitignore in order to prevent garbage file upload to the repository. --- .gitignore | 4 ++++ V9/odoo_install.sh | 24 +++++++++++++++++++----- 2 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f56ec4b --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*~ +*.swp +*.tmp +*.bak diff --git a/V9/odoo_install.sh b/V9/odoo_install.sh index 684a182..2de10ad 100644 --- a/V9/odoo_install.sh +++ b/V9/odoo_install.sh @@ -24,6 +24,14 @@ OE_HOME_EXT="/$OE_USER/${OE_USER}-server" #The default port where this Odoo instance will run under (provided you use the command -c in the terminal) #Set to true if you want to install it, false if you don't need it or have it already installed. INSTALL_WKHTMLTOPDF="True" +## +### WKHTMLTOPDF download links +## === Ubuntu Trusty x64 & x32 === (for other distributions please replace these two links, +## in order to have correct version of wkhtmltox installed, for a danger note refer to +## https://www.odoo.com/documentation/8.0/setup/install.html#deb ): +WKHTMLTOX_X64=http://download.gna.org/wkhtmltopdf/0.12/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb +WKHTMLTOX_X32=http://download.gna.org/wkhtmltopdf/0.12/0.12.1/wkhtmltox-0.12.1_linux-trusty-i386.deb + #Set the default Odoo port (you still have to use -c /etc/odoo-server.conf for example to use this.) OE_PORT="8069" @@ -76,11 +84,17 @@ sudo apt-get install python-gevent -y # Install Wkhtmltopdf if needed #-------------------------------------------------- if [ $INSTALL_WKHTMLTOPDF = "True" ]; then -echo -e "\n---- Install wkhtml and place on correct place for ODOO 8 ----" -sudo wget http://download.gna.org/wkhtmltopdf/0.12/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb -sudo dpkg -i wkhtmltox-0.12.1_linux-trusty-amd64.deb -sudo cp /usr/local/bin/wkhtmltopdf /usr/bin -sudo cp /usr/local/bin/wkhtmltoimage /usr/bin + echo -e "\n---- Install wkhtml and place shortcuts on correct place for ODOO 9 ----" + #pick up correct one from x64 & x32 versions: + if ((1<<32));then + _url=$WKHTMLTOX_X64 + else + _url=$WKHTMLTOX_X32 + fi + sudo wget $_url + sudo gdebi --n `basename $_url` + sudo ln -s /usr/local/bin/wkhtmltopdf /usr/bin + sudo ln -s /usr/local/bin/wkhtmltoimage /usr/bin else echo "Wkhtmltopdf isn't installed due to the choice of the user!" fi