Aller au contenu
qbox4u

Setup Entware-ng for graphviz and webdot

Messages recommandés

qbox4u    0

ipkg died, so i needed to start from scratch again:angry::angry:

regards

qbox4u.com

=References=
*[https://wiki.openwrt.org/doc/techref/opkg opkg]
*[http://www.qnapclub.eu/index.php?act=cat&id=4 Overvieuw availabe download opkg]
*[http://www.webgraphviz.com/ webgraphviz example]

=Setup Entware-ng=
Install [https://github.com/Entware-ng/Entware-ng/wiki/Install-on-QNAP-NAS Entware-ng] on QNAP TS 459 PRO II

In Detail

* Download [http://pkg.entware.net/binaries/other/Entware-ng_0.97.qpkg Entware-ng_0.97.qpkg]
* Login in the QNAP TS 459 PRO II as Admin 
* Select '''App Center'''
* install Pyton V 2.7.3
* Press on the right top icon '''Settings'''
* Select in <code>Install manually</code> with the button <code>Browse </code> the downloaded file <code>Entware-ng_0.97.qpkg </code>
* Press the button <code>Install</code>
* [[Login with Putty]]
* Type the following commands
<pre>
[~] # opkg update
[~] # opkg upgrade
[~] # opkg install gnuplot
[~] # opkg install busybox
[~] # opkg install sudo
[~] # opkg install nano
[~] # opkg install ldd 
[~] # opkg install make 
[~] # opkg install gawk
[~] # opkg install sed
[~] # opkg install gcc
[~] # opkg install grep
[~] # opkg install findutils
[~] # opkg install tar
[~] # opkg install tcl

temporal fix ..... [~] # opkg install http://pkg.entware.net/binaries/x86-64/test/tcl_8.5.18-1a_x86-64.ipk

[~] # opkg install patch
[~] # opkg install diffutils
[~] # opkg install coreutils-install
[~] # opkg install libncurses 
[~] # opkg install gnutls-utils
[~] # opkg install pkg-config
[~] # opkg install libjpeg 
[~] # opkg install libpng
[~] # opkg install libfreetype
[~] # opkg install libexpat
[~] # opkg install libgnutls
[~] # opkg install gnutls-utils
[~] # opkg install git
[~] # opkg install curl
[~] # opkg install fontconfig
[~] # opkg install libpoppler
[~] # opkg install poppler-utils
[~] # opkg install ghostscript
[~] # opkg install ghostscript-fonts-std
[~] # opkg install ghostscript-gnu-gs-fonts-other
</pre>

<pre>
[~] # wget -qO- http://pkg.entware.net/binaries/x86-64/include/include.tar.gz | tar xvz -C /opt/include
[~] #
[~] # more /opt/bin/gcc_env.sh
#!/bin/sh
export LDFLAGS="-Wl,-rpath=/opt/lib -Wl,--dynamic-linker=/opt/lib/ld-linux-x86-64.so.2 -L/opt/lib"
export CFLAGS="-O2 -pipe -fomit-frame-pointer -fno-caller-saves "

</pre>

=Create sudo=
'''Verified ..'''

[~] # nano /etc/passwd
 copy admin:x:0:0:administrator:/share/homes/admin:/bin/sh
 to
 root:x:0:0:administrator:/share/homes/admin:/bin/sh
 save file

[~] # nano /etc/shadow
 copy admin:$1$$oAGEgbHGHDVAua2mvwKPI/:14233:0:99999:7:::
 to
 root:$1$$oAGEgbHGHDVAua2mvwKPI/:14233:0:99999:7:::
 save file

[~] # EDITOR=nano

 find
 ##
 ## User privilege specification
 ##
 root ALL=(ALL) ALL
[~] # visudo
 add.... admin ALL=(ALL) ALL
 Hit esc to exit insert-mode.
 Type ":x" to save and exit.

=libgd-2.2.3=
'''verified ....'''
 download '''libgd-2.2.3.tar.xz''' from https://github.com/libgd/libgd/releases
<pre>
[~] # cp /share/MD0_DATA/Web/libgd-2.2.3.tar.xz  /share/MD0_DATA/.qpkg/Entware-ng/lib
[~] # cd /share/MD0_DATA/.qpkg/Entware-ng/lib
[/share/MD0_DATA/.qpkg/Entware-ng/lib] # tar -xvf libgd-2.2.3.tar.xz
[/share/MD0_DATA/.qpkg/Entware-ng/lib] # cd libgd-2.2.3
[/share/MD0_DATA/.qpkg/Entware-ng/lib/libgd-2.2.3] # source /opt/bin/gcc_env.sh
[/share/MD0_DATA/.qpkg/Entware-ng/lib/libgd-2.2.3] # ./configure --prefix=/opt --disable-werror
[/share/MD0_DATA/.qpkg/Entware-ng/lib/libgd-2.2.3] # make
[/share/MD0_DATA/.qpkg/Entware-ng/lib/libgd-2.2.3] # make install
</pre>

=freetype-2.7=
'''verified''' 
 download http://download.savannah.gnu.org/releases/freetype/freetype-2.7.tar.gz
<pre>
[~] # cp /share/MD0_DATA/Web/freetype-2.7.tar.gz  /share/MD0_DATA/.qpkg/Entware-ng/lib
[~] # cd /share/MD0_DATA/.qpkg/Entware-ng/lib
[/share/MD0_DATA/.qpkg/Entware-ng/lib] # tar -xvf freetype-2.7.tar.gz
[/share/MD0_DATA/.qpkg/Entware-ng/lib] # cd freetype-2.7
[/share/MD0_DATA/.qpkg/Entware-ng/lib/freetype-2.7] # source /opt/bin/gcc_env.sh
[/share/MD0_DATA/.qpkg/Entware-ng/lib/freetype-2.7] # ./configure --prefix=/opt
[/share/MD0_DATA/.qpkg/Entware-ng/lib/freetype-2.7] # make 
[/share/MD0_DATA/.qpkg/Entware-ng/lib/freetype-2.7] # make install
</pre>

=expat=
'''verified'''
 Download https://sourceforge.net/projects/expat/files/expat/2.2.0/
<pre>
[~] # cp /share/MD0_DATA/Web/expat-2.2.0.tar.bz2  /share/MD0_DATA/.qpkg/Entware-ng/lib
[~] # cd /share/MD0_DATA/.qpkg/Entware-ng/lib
[/share/MD0_DATA/.qpkg/Entware-ng/lib] # tar -xvf expat-2.2.0.tar.bz2
[/share/MD0_DATA/.qpkg/Entware-ng/lib] # cd expat-2.2.0
[/share/MD0_DATA/.qpkg/Entware-ng/lib/expat-2.2.0] # source /opt/bin/gcc_env.sh
[/share/MD0_DATA/.qpkg/Entware-ng/lib/expat-2.2.0] # ./configure --prefix=/opt
[/share/MD0_DATA/.qpkg/Entware-ng/lib/expat-2.2.0] # make
[/share/MD0_DATA/.qpkg/Entware-ng/lib/expat-2.2.0] # make install
</pre>

=fontconfig=
'''verified'''
 Downoad https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.12.0.tar.gz
<pre>
[~] # cp /share/MD0_DATA/Web/fontconfig-2.12.0.tar.gz  /share/MD0_DATA/.qpkg/Entware-ng/lib
[~] # cd /share/MD0_DATA/.qpkg/Entware-ng/lib
[/share/MD0_DATA/.qpkg/Entware-ng/lib] # tar -xvf fontconfig-2.12.0.tar.gz
[/share/MD0_DATA/.qpkg/Entware-ng/lib] # cd fontconfig-2.12.0
[/share/MD0_DATA/.qpkg/Entware-ng/lib/fontconfig-2.12.0] # source /opt/bin/gcc_env.sh
[/share/MD0_DATA/.qpkg/Entware-ng/lib/fontconfig-2.12.0] # ./configure --prefix=/opt 
[/share/MD0_DATA/.qpkg/Entware-ng/lib/fontconfig-2.12.0] # make
[/share/MD0_DATA/.qpkg/Entware-ng/lib/fontconfig-2.12.0] # make install
</pre>

 TEMPORAL FIX
 THE DEFAULT LOOKS TO /usr/share/fonts
 CHANGE THE FOLLOWING

<pre>
[/opt/share/fonts] # find / -name fonts.conf
/share/MD0_DATA/.qpkg/Entware-ng/etc/fonts/fonts.conf
/share/MD0_DATA/.qpkg/Entware-ng/lib/fontconfig-2.12.0/fonts.conf

change inside both 
<!-- Font directory list -->
        <dir>/usr/share/fonts</dir>

to
    <dir>/opt/share/fonts</dir>
</pre>
 Check
<pre>
[/opt/share/fonts] # fc-cache -vf /opt/share/
[/opt/share/fonts] # fc-list : file
[/opt/share/fonts] # fc-cat
</pre>

=libffi-3.2.1=
'''verified'''
 Download ftp://sourceware.org/pub/libffi/libffi-3.2.1.tar.gz
<pre>
[~] # cp /share/MD0_DATA/Web/libffi-3.2.1.tar.gz  /share/MD0_DATA/.qpkg/Entware-ng/lib
[~] # cd /share/MD0_DATA/.qpkg/Entware-ng/lib
[/share/MD0_DATA/.qpkg/Entware-ng/lib] # tar -xvf libffi-3.2.1.tar.gz
[/share/MD0_DATA/.qpkg/Entware-ng/lib] # cd libffi-3.2.1
[/share/MD0_DATA/.qpkg/Entware-ng/lib/libffi-3.2.1] # source /opt/bin/gcc_env.sh
[/share/MD0_DATA/.qpkg/Entware-ng/lib/libffi-3.2.1] # ./configure --prefix=/opt 
[/share/MD0_DATA/.qpkg/Entware-ng/lib/libffi-3.2.1] # make
[/share/MD0_DATA/.qpkg/Entware-ng/lib/libffi-3.2.1] # make install
</pre>

=gettext-0.19.8=
'''verified'''
 Download http://ftp.gnu.org/pub/gnu/gettext/gettext-0.19.8.tar.gz
<pre>
[~] # cp /share/MD0_DATA/Web/gettext-0.19.8.tar.gz  /share/MD0_DATA/.qpkg/Entware-ng/lib
[~] # cd /share/MD0_DATA/.qpkg/Entware-ng/lib
[/share/MD0_DATA/.qpkg/Entware-ng/lib] # tar -xvf gettext-0.19.8.tar.gz
[/share/MD0_DATA/.qpkg/Entware-ng/lib] # cd gettext-0.19.8
[/share/MD0_DATA/.qpkg/Entware-ng/lib/gettext-0.19.8] # source /opt/bin/gcc_env.sh
[/share/MD0_DATA/.qpkg/Entware-ng/lib/gettext-0.19.8] # ./configure --prefix=/opt 
[/share/MD0_DATA/.qpkg/Entware-ng/lib/gettext-0.19.8] # make
[/share/MD0_DATA/.qpkg/Entware-ng/lib/gettext-0.19.8] # make install
</pre>

=pcre-8.38=
'''verified'''
 Download http://ftp.cs.stanford.edu/pub/exim/pcre/pcre-8.38.tar.bz2
<pre>
[~] # cp /share/MD0_DATA/Web/pcre-8.38.tar.bz2  /share/MD0_DATA/.qpkg/Entware-ng/lib
[~] # cd /share/MD0_DATA/.qpkg/Entware-ng/lib
[/share/MD0_DATA/.qpkg/Entware-ng/lib] # tar -xvf pcre-8.38.tar.bz2
[/share/MD0_DATA/.qpkg/Entware-ng/lib] # cd pcre-8.38
[/share/MD0_DATA/.qpkg/Entware-ng/lib/pcre-8.38] # source /opt/bin/gcc_env.sh
[/share/MD0_DATA/.qpkg/Entware-ng/lib/pcre-8.38] # ./configure --prefix=/opt 
[/share/MD0_DATA/.qpkg/Entware-ng/lib/pcre-8.38] # make
[/share/MD0_DATA/.qpkg/Entware-ng/lib/pcre-8.38] # make install
</pre>

=glib-2.49.6=
'''verified'''
 Downoad http://ftp.gnome.org/pub/gnome/sources/glib/2.49/glib-2.49.6.tar.xz

 glib-2.50.2: /opt/bin/ld: cannot find -lmount collect2: error: ld returned 1 exit status
<pre>
[~] # cp /share/MD0_DATA/Web/glib-2.49.6.tar.xz  /share/MD0_DATA/.qpkg/Entware-ng/lib
[~] # cd /share/MD0_DATA/.qpkg/Entware-ng/lib
[/share/MD0_DATA/.qpkg/Entware-ng/lib] # tar -xvf glib-2.49.6.tar.xz
[/share/MD0_DATA/.qpkg/Entware-ng/lib] # cd glib-2.49.6
[/share/MD0_DATA/.qpkg/Entware-ng/lib/glib-2.49.6] # source /opt/bin/gcc_env.sh
[/share/MD0_DATA/.qpkg/Entware-ng/lib/glib-2.49.6] # ./configure --prefix=/opt --with-pcre=system
[/share/MD0_DATA/.qpkg/Entware-ng/lib/glib-2.49.6] # make
[/share/MD0_DATA/.qpkg/Entware-ng/lib/glib-2.49.6] # make install
</pre>

=tcsh-6.20.00=
'''verified'''
 Download ftp://ftp.astron.com/pub/tcsh/tcsh-6.20.00.tar.gz
<pre>
[~] # cp /share/MD0_DATA/Web/tcsh-6.20.00.tar.gz  /share/MD0_DATA/.qpkg/Entware-ng/lib
[~] # cd /share/MD0_DATA/.qpkg/Entware-ng/lib
[/share/MD0_DATA/.qpkg/Entware-ng/lib] # tar -xvf tcsh-6.20.00.tar.gz
[/share/MD0_DATA/.qpkg/Entware-ng/lib] # cd tcsh-6.20.00
[/share/MD0_DATA/.qpkg/Entware-ng/lib/tcsh-6.20.00] # source /opt/bin/gcc_env.sh
[/share/MD0_DATA/.qpkg/Entware-ng/lib/tcsh-6.20.00] # ./configure --prefix=/opt
[/share/MD0_DATA/.qpkg/Entware-ng/lib/tcsh-6.20.00] # make
[/share/MD0_DATA/.qpkg/Entware-ng/lib/tcsh-6.20.00] # make install
</pre>

=pixman-0.34.0=
'''verified'''
 Download https://www.cairographics.org/releases/pixman-0.34.0.tar.gz
<pre> 
[~] # cp /share/MD0_DATA/Web/pixman-0.34.0.tar.gz  /share/MD0_DATA/.qpkg/Entware-ng/lib
[~] # cd /share/MD0_DATA/.qpkg/Entware-ng/lib
[/share/MD0_DATA/.qpkg/Entware-ng/lib] # tar -xvf pixman-0.34.0.tar.gz
[/share/MD0_DATA/.qpkg/Entware-ng/lib] # cd pixman-0.34.0
[/share/MD0_DATA/.qpkg/Entware-ng/lib/pixman-0.34.0] # ./configure --prefix=/opt
[/share/MD0_DATA/.qpkg/Entware-ng/lib/pixman-0.34.0] # make
[/share/MD0_DATA/.qpkg/Entware-ng/lib/pixman-0.34.0] # make install
</pre>

=libpng-1.6.26=
'''verified'''

https://sourceforge.net/projects/libpng/files/libpng16/1.6.26/libpng-1.6.26.tar.xz/download?use_mirror=nchc&download=
<pre>
[~] # cp /share/MD0_DATA/Web/libpng-1.6.26.tar.xz  /share/MD0_DATA/.qpkg/Entware-ng/lib
[~] # cd /share/MD0_DATA/.qpkg/Entware-ng/lib
[/share/MD0_DATA/.qpkg/Entware-ng/lib] # tar -xvf libpng-1.6.26.tar.xz
[/share/MD0_DATA/.qpkg/Entware-ng/lib] # cd libpng-1.6.26
[/share/MD0_DATA/.qpkg/Entware-ng/lib/libpng-1.6.26] # source /opt/bin/gcc_env.sh
[/share/MD0_DATA/.qpkg/Entware-ng/lib/libpng-1.6.26] # ./configure --prefix=/opt
[/share/MD0_DATA/.qpkg/Entware-ng/lib/libpng-1.6.26] # make
[/share/MD0_DATA/.qpkg/Entware-ng/lib/libpng-1.6.26] # make install
</pre>

=cairo-1.14.8.tar.xz=
'''verified'''
* ref [https://github.com/bonzini/cairo/blob/master/INSTALL]
 download https://www.cairographics.org/releases/cairo-1.14.8.tar.xz
 
<pre>
[~] # cp /share/MD0_DATA/Web/cairo-1.14.8.tar.xz  /share/MD0_DATA/.qpkg/Entware-ng/lib
[~] # cd /share/MD0_DATA/.qpkg/Entware-ng/lib
[/share/MD0_DATA/.qpkg/Entware-ng/lib] # tar -xvf cairo-1.14.8.tar.xz
[/share/MD0_DATA/.qpkg/Entware-ng/lib] # cd cairo-1.14.8
[/share/MD0_DATA/.qpkg/Entware-ng/lib/cairo-1.14.8] # ./configure --prefix=/opt
[/share/MD0_DATA/.qpkg/Entware-ng/lib/cairo-1.14.8] # make
[/share/MD0_DATA/.qpkg/Entware-ng/lib/cairo-1.14.8] # make install
</pre>

=jpegsrc.v6b.tar=
'''verified'''
 download http://www.ijg.org/files/jpegsrc.v9b.tar.gz
<pre>
[~] # cp /share/MD0_DATA/Web/jpegsrc.v6b.tar.gz  /share/MD0_DATA/.qpkg/Entware-ng/lib
[~] # cd /share/MD0_DATA/.qpkg/Entware-ng/lib
[/share/MD0_DATA/.qpkg/Entware-ng/lib] # tar -xvf jpegsrc.v6b.tar.gz
[/share/MD0_DATA/.qpkg/Entware-ng/lib] # cd jpeg-6b
[/share/MD0_DATA/.qpkg/Entware-ng/lib/jpeg-6b] # source /opt/bin/gcc_env.sh

create 2 extra directories in /opt
[/opt] # mkdir man
[/opt] # cd  man
[/opt] # mkdir man1

[/share/MD0_DATA/.qpkg/Entware-ng/lib/jpeg-6b] # ./configure --prefix=/opt --with-jpeg-dir=/opt/lib 
[/share/MD0_DATA/.qpkg/Entware-ng/lib/jpeg-6b] # make
[/share/MD0_DATA/.qpkg/Entware-ng/lib/jpeg-6b] # make install
</pre>

=libgd-2.2.3.tar=
'''verified'''
 Downoad https://github.com/libgd/libgd/releases/tag/gd-2.2.3
<pre>
[~] # cp /share/MD0_DATA/Web/libgd-2.2.3.tar.gz  /share/MD0_DATA/.qpkg/Entware-ng/lib
[~] # cd /share/MD0_DATA/.qpkg/Entware-ng/lib
[/share/MD0_DATA/.qpkg/Entware-ng/lib] # tar -xvf libgd-2.2.3.tar.gz
[/share/MD0_DATA/.qpkg/Entware-ng/lib] # cd libgd-2.2.3
[/share/MD0_DATA/.qpkg/Entware-ng/lib/libgd-2.2.3] # source /opt/bin/gcc_env.sh
[/share/MD0_DATA/.qpkg/Entware-ng/lib/libgd-2.2.3] # ./configure --prefix=/opt
[/share/MD0_DATA/.qpkg/Entware-ng/lib/libgd-2.2.3] # make
[/share/MD0_DATA/.qpkg/Entware-ng/lib/libgd-2.2.3] # make install
</pre>

=ttf files=
 Download http://www.graphviz.org/Misc/fonts.tgz
unzip and copy the ttf folder to /opt/share/fonts
<pre>
[/opt/share/fonts] # cp -R /share/Web/ttf /opt/share/fonts
[/opt/share/fonts] # fc-cache -vf /opt/share/fonts/ttf
check by
[/opt/share/fonts] #fc-list : file
</pre>
=webdot-2.30=
Download [http://www.graphviz.org/pub/graphviz/stable/SOURCES/webdot-2.30.tar.gz  webdot-2.30]
<pre>
[~] # cp /share/MD0_DATA/Web/webdot-2.30.tar.gz  /share/MD0_DATA/.qpkg/Entware-ng/lib
[~] # cd /share/MD0_DATA/.qpkg/Entware-ng/lib
[/share/MD0_DATA/.qpkg/Entware-ng/lib] # tar -xvf webdot-2.30.tar.gz
[/share/MD0_DATA/.qpkg/Entware-ng/lib] # cd /share/MD0_DATA/.qpkg/Entware-ng/bin
</pre>
 check if tclsh exist, otherwise do this
 [/share/MD0_DATA/.qpkg/Entware-ng/bin] # ln -s /share/MD0_DATA/.qpkg/Entware-ng/bin/tclsh8.5* tclsh
<pre>
[~] # cd /share/MD0_DATA/.qpkg/Entware-ng/lib/webdot-2.30
[/share/MD0_DATA/.qpkg/Entware-ng/lib/webdot-2.30] # source /opt/bin/gcc_env.sh
[/share/MD0_DATA/.qpkg/Entware-ng/lib/webdot-2.30] # ./configure --prefix=/opt
[/share/MD0_DATA/.qpkg/Entware-ng/lib/webdot-2.30] # nano Makefile
</pre>
 change HTTPD-USER-GROUP=apache:apache
 to
 HTTPD-USER-GROUP=admin
<pre>
[/share/MD0_DATA/.qpkg/Entware-ng/lib/webdot-2.30] # make
[/share/MD0_DATA/.qpkg/Entware-ng/lib/webdot-2.30] # make install
</pre>

=graphviz-2.38.0=
download [http://www.graphviz.org/pub/graphviz/stable/SOURCES/graphviz-2.38.0.tar.gz graphviz-2.38.0]
<pre>
[~] # cp /share/MD0_DATA/Web/graphviz-2.38.0.tar.gz  /share/MD0_DATA/.qpkg/Entware-ng/lib
[~] # cd /share/MD0_DATA/.qpkg/Entware-ng/lib
[/share/MD0_DATA/.qpkg/Entware-ng/lib] # tar -xvf graphviz-2.38.0.tar.gz
[/share/MD0_DATA/.qpkg/Entware-ng/lib] # cd graphviz-2.38.0
[/share/MD0_DATA/.qpkg/Entware-ng/lib/graphviz-2.38.0] # source /opt/bin/gcc_env.sh
[/share/MD0_DATA/.qpkg/Entware-ng/lib/graphviz-2.38.0] # ./configure --prefix=/opt
[/share/MD0_DATA/.qpkg/Entware-ng/lib/graphviz-2.38.0] # make
[/share/MD0_DATA/.qpkg/Entware-ng/lib/graphviz-2.38.0] # make install
</pre>
 Test

 create an test file test1.dot
<pre>
digraph G {
    one -> two;
    one -> three;
    one -> four;
    four -> five -> six;
    five -> one;
    six -> two;
}
</pre>

 create an test file test2.dot
<pre>
digraph dummy { 
  abcdefghi -> babcdefghi -> cabcdefghi -> dabcdefghi -> eabcdefghi -> fabcdefghi -> gabcdefghi -> habcdefghi -> iabcdefghi;
  aabcdefghi [fontname="LiberationMono-Regular.ttf"]
  babcdefghi [fontname="LiberationSans-Italic.ttf"]
  cabcdefghi [fontname="LiberationMono-BoldItalic.ttf"]
  dabcdefghi [fontname="LiberationSerif-BoldItalic.ttf"]
  eabcdefghi [fontname="LiberationMono-Italic.ttf"]
  fabcdefghi [fontname="LiberationSerif-Italic.ttf"]
  gabcdefghi [fontname="LiberationSerif-Bold.ttf"]
  habcdefghi [fontname="LiberationSerif-Bold.ttf"]
  iabcdefghi [fontname="LiberationSerif-Bold.ttf"]
}
</pre>
<pre>
[/opt/bin] # dot -Tpng  /share/Web/test1.dot  >  /share/Web/output.png
[/opt/bin] # dot -Tpng  /share/Web/test2.dot  >  /share/Web/output.png
[/opt/bin] # dot -Tsvg  /share/Web/test1.dot  >  /share/Web/output.svg
</pre>
 

Partager ce message


Lien à poster
Partager sur d’autres sites

Créer un compte ou se connecter pour commenter

Vous devez être membre afin de pouvoir déposer un commentaire

Créer un compte

Créez un compte sur notre communauté. C’est facile !

Créer un nouveau compte

Se connecter

Vous avez déjà un compte ? Connectez-vous ici.

Connectez-vous maintenant


×