由于项目cnexpat中需要用到pdf2htmlex,先在虚拟机上捣鼓了好久,最后才在服务器上安装成功。
因为是linux 初学,所有整个安装过程很苦逼了
1. 升级gcc,要求GCC >= 4.6.3
Wget http://people.centos.org/tru/devtools-2/devtools-2.repo-O /etc/yum.repos.d/devtools-2.repo
yum install devtoolset-2-gcc devtoolset-2-binutils devtoolset-2-gcc-c++
mv /usr/bin/gcc /usr/bin/gcc.backup
ln -s /opt/rh/devtoolset-2/root/usr/bin/gcc /usr/bin/gcc
mv /usr/bin/g++ /usr/bin/g++.backup
ln -s /opt/rh/devtoolset-2/root/usr/bin/g++ /usr/bin/g++
2. 安装pkg-config-0.28
a). yum install zlib-devel.x86_64 glib2-devel.x86_64 –y
b). 安装pkg-config
tar –xzvf pkg-config-0.28.tar.gz
cd pkg-config-0.28
./configure
make && make install
mv /usr/bin/pkg-config/usr/bin/pkg-configbak
ln –s /usr/local/bin/pkg-config/usr/bin/pkg-config
pkg-config --version
3. 安装autoconf-2.69
xz –d autoconf-2.69.tar.zx
tar –xvf autoconf-2.69.tar
cd autoconf-2.9
./configure –prefix=/usr
make && make install
4. exportPKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/lib/pkgconfig
export LD_LIBRARY_PATH=/usr/lib64:/usr/lib
exportpng_REQUIRES="libpng"
5. 安装freetype-2.5.2
yum install libtool-ltdl-devel.x86_64 libtool patch gettext.x86_64fontconfig fontconfig-devel poppler-glib-devel.x86_64 libpng-devel.x86_64 –y
tar -zxvf freetype-2.5.2.tar.gz
cd freetype-2.5.2
./configure --prefix=/usr
make && make install
6. 安装cairo-1.12.2
a. yum install libspectre libspectre-devel
b. 安装pixman
wgethttp://cairographics.org/releases/pixman-0.32.4.tar.gz
tar -zxvf pixman-0.32.4.tar.gz
cd pixman-0.32.4
./configure
make
make install
c. 安装cairo-1.12.2
xz –d cairo-1.12.2.tar.xz
tar xvf cairo-1.12.2.tar
cd cairo-1.12.2
./configure
make && make install
7. 安装fontforge
a). yum install libjpeg-turbo.x86_64libjpeg-turbo-devel libjpeg-turbo-devel.x86_64 libtiff.x86_64 libtiff-devel openjpeg-devel.x86_64 openjpeg giflibgiflib-devel libxml2.x86_64 libxml2-devel libspiro.x86_64 libspiro-devel libuninameslist-devel.x86_64 –y
b). 安装libunicodenames
xz –d libunicodenames-1.0.1.tar.xz
tar xf libunicodenames-1.0.1.tar
cd libunicodenames-1.0.1
./configure –prefix=/usr
make && make install
c). 安装readline-6.3
d). fontforge
unzip fontforge-pdf2htmlEX.zip
cd fontforge-pdf2htmlEX
./autogen.sh
./configure –prefix=/usr --without-libzmq --without-x--without-iconv --disable-Python-scripting --disable-python-extension
make && make install
8. 安装poppler
a). 安装fontconfig-2.2.3(这个似乎不用装了)
yum install expat expat-devel
wget http://down1.chinaunix.net/distfiles/fontconfig-2.2.3.tar.gz
tar –xvzf fontconfig-2.2.3.tar.gz
cd fontconfig-2.2.3
./configure –prefix=/usr
make && make install
b).cp /usr/lib/pkgconfig/cairo*.pc /usr/lib64/pkgconfig
cp /usr/lib/libcairo* /usr/lib64
xz –d poppler-0.41.0.tar.xz
tar xf poppler-0.41.0.tar
cd poppler-0.41.0
./configure –prefix=/usr --enable-xpdf-headers
make && make install
cp /usr/lib/pkgconfig/poppler*.pc /usr/lib64/pkgconfig
cp /usr/lib/libpoppler*.so /usr/lib64
9. 安装Pdf2htmlEx
yum install cmake –y
yum install java-1.8.0-openjdk
unzip pdf2htmlEX-master.zip
cd pdf2htmlEX-master
cmake -DENABLE_SVG=OFF .
make && make install
ln -s /usr/local/lib/pdf2htmlEX/usr/bin/pdf2htmlEX