[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.
pull/1/merge^2
Temur Vibliani 10 years ago
parent d2225160f3
commit 3d76467a64

4
.gitignore vendored

@ -0,0 +1,4 @@
*~
*.swp
*.tmp
*.bak

@ -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) #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. #Set to true if you want to install it, false if you don't need it or have it already installed.
INSTALL_WKHTMLTOPDF="True" 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.) #Set the default Odoo port (you still have to use -c /etc/odoo-server.conf for example to use this.)
OE_PORT="8069" OE_PORT="8069"
@ -76,11 +84,17 @@ sudo apt-get install python-gevent -y
# Install Wkhtmltopdf if needed # Install Wkhtmltopdf if needed
#-------------------------------------------------- #--------------------------------------------------
if [ $INSTALL_WKHTMLTOPDF = "True" ]; then if [ $INSTALL_WKHTMLTOPDF = "True" ]; then
echo -e "\n---- Install wkhtml and place on correct place for ODOO 8 ----" echo -e "\n---- Install wkhtml and place shortcuts on correct place for ODOO 9 ----"
sudo wget http://download.gna.org/wkhtmltopdf/0.12/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb #pick up correct one from x64 & x32 versions:
sudo dpkg -i wkhtmltox-0.12.1_linux-trusty-amd64.deb if ((1<<32));then
sudo cp /usr/local/bin/wkhtmltopdf /usr/bin _url=$WKHTMLTOX_X64
sudo cp /usr/local/bin/wkhtmltoimage /usr/bin 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 else
echo "Wkhtmltopdf isn't installed due to the choice of the user!" echo "Wkhtmltopdf isn't installed due to the choice of the user!"
fi fi

Loading…
Cancel
Save