This article assumes you have internet access on your Tizen device, an OpenSSH daemon running and you can connect to it via a SSH client. If you don’t, please read the other articles in the series. If you do, read below on how to install various development tools on your RD-PQ device running Tizen 2.3.1 (and possibly, 2.3, though not tested).

Erlang/OTP

Erlang is a programming language used to build massively scalable soft real-time systems with requirements on high availability. Some of its uses are in telecoms, banking, e-commerce, computer telephony and instant messaging. Erlang’s runtime system has built-in support for concurrency, distribution and fault tolerance. Installing Erlang is as easy as one, two, three.

sh-1.4# wget http://erlang.org/download/otp_src_18.2.1.tar.gz
sh-1.4# tar -xzf otp_src_18.2.1.tar.gz
sh-1.4# ./configure --prefix=/usr/local
sh-1.4# make
sh-1.4# make install

Ruby

You can install Ruby 1.9.3 from the latest arm-wayland Tizen snapshot repo (2.5Mb), use the direct link or, in case the links change with new versions, just browse the repository for the Ruby rpm package. If you need any dependencies, install them from the same repo, skipping the original 2.3.1 repository (if you want to be safe, you can install the Ruby rpm package that is available in the master repo, but be aware the version is older. After you have the package, install it to the phone via sdb, uploading it via scp or just curl/wget it from the SSH console.

sh-1.4# wget https://download.tizen.org/snapshots/tizen/mobile/latest/repos/arm-wayland/packages/armv7l/ruby-1.9.3.p448-6.19.armv7l.rpm
sh-1.4# rpm -Uvh ruby-1.9.3.p448-6.19.armv7l.rpm

Perl

Although you will have a version of Perl installed, it won’t be the latest available for Tizen, so again, you can opt between the 2.3.1 repository with Perl 5.12.1 (13Mb) and the snapshot repo with Perl 5.20.0 (8Mb). Whatever package you decide on, install it using the same option as Ruby, after taking care of any needed dependencies.

sh-1.4# wget https://download.tizen.org/snapshots/tizen/mobile/latest/repos/arm-wayland/packages/armv7l/perl-5.20.0-7.28.armv7l.rpm
sh-1.4# rpm -Uvh perl-5.20.0-7.28.armv7l.rpm

Python

You will probably have a version of Python installed but in order to upgrade it, choose between the two repositories Tizen 2.3.1 with Python 2.7.1 (193Kb) or latest Tizen snapshot with Python 2.7.8 (4.3Mb) but you’ll need to install all the Python package rpms in the selected repo.

sh-1.4# wget https://download.tizen.org/snapshots/tizen/mobile/latest/repos/arm-wayland/packages/armv7l/python-2.7.8-7.18.armv7l.rpm
sh-1.4# rpm -Uvh python-2.7.8-7.18.armv7l.rpm

Java

Download Java SE Embedded from the Oracle website (you will need to create an account or login into an existing one prior to downloading the archive). Make sure you download the ARMv5/ARMv6/ARMv7 Linux - SoftFP ABI, Little Endian version. After download, extract the archive and install Java somewhere on your device, preferably /usr/lib/java.

sh-1.4# tar -xzf ejdk-8u65-linux-arm-sflt.tar.gz
sh-1.4# ejdk1.8.0_65/bin/jrecreate.sh --dest /usr/lib/java

Make sure you add JAVA_HOME to your /etc/profile file, like this:

sh-1.4# JAVA_HOME=/usr/lib/java
sh-1.4# export JAVA_HOME

Go

Installing Go 1.5 on Tizen is very easy, though you need a Go 1.4 compiler for it. We can adapt the tutorial for Raspberry Pi written by Dave Cheney for our Tizen device.

sh-1.4# cd /opt/usr
sh-1.4# curl http://dave.cheney.net/paste/go-linux-arm-bootstrap-c788a8e.tbz | tar xj
sh-1.4# curl https://storage.googleapis.com/golang/go1.5.src.tar.gz | tar xz
sh-1.4# cd /opt/usr/go/src
sh-1.4# env GOROOT_BOOTSTRAP=/opt/usr/go-linux-arm-bootstrap ./make.bash

The process should take about 5 minutes as opposed to more than half an hour on a Raspberry Pi, proving the power under the hood of the Tizen RD-PQ device. Once compiled, Go should be available under /opt/usr/go, you can remove the /opt/usr/go-linux-arm-bootstrap directory to save space. Make sure you add it to your path:

export PATH=$PATH:/opt/usr/go/bin

MySQL

I choosed to install MySQL over MariaDB, you can do the same with the latter with very little changes, the packages should compile by default provided you have enough swap space, MySQL compilation takes craploads of RAM (and swap space). Compiling MySQL requires cmake, diffutils (in addition to the default development tools, binutils, gcc and required libs). Make sure you download the rpms from your favorite Tizen repo and install them using the allready well-known methods. Download the package, extract, configure using cmake, compile and install.

sh-1.4# mkdir /opt/usr/src
sh-1.4# mkdir /opt/usr/mysql
sh-1.4# ln -s /opt/usr/mysql /usr/mysql
sh-1.4# cd /opt/usr/src
sh-1.4# wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.10.tar.gz
sh-1.4# tar -xzvf mysql-5.7.10.tar.gz
sh-1.4# cd mysql-5.7.10
sh-1.4# cmake . -DCMAKE_INSTALL_PREFIX=/usr/mysql -DWITH_BOOST=/usr/lib/boost -DDOWNLOAD_BOOST=1
sh-1.4# make
sh-1.4# make install
sh-1.4# groupadd mysql
sh-1.4# useradd -r -g mysql -s /bin/false mysql
sh-1.4# chown -R mysql:mysql /usr/mysql
sh-1.4# /usr/mysql/bin/mysqld --initialize --user=mysql
sh-1.4# /usr/mysql/bin/mysql_ssl_rsa_setup
sh-1.4# cp support-files/mysql.server /etc/init.d/mysqld

After this, you’ll have MySQL installed in /opt/usr/mysql symlinked to /usr/mysql. Start the server with this command:

sh-1.4# /etc/init.d/mysql start

Apache httpd

Compiling Apache httpd for ARMv7l is pretty straightforward, download the latest apache source archive, download apr and apr-util, configure, compile everything and install.

sh-1.4# mkdir /opt/usr/apache
sh-1.4# ln -s /opt/usr/apache /usr/apache
sh-1.4# cd /opt/usr/src
sh-1.4# wget https://archive.apache.org/dist/httpd/httpd-2.4.18.tar.gz
sh-1.4# tar -xzvf httpd/httpd-2.4.18.tar.gz
sh-1.4# cd httpd/httpd-2.4.18/srclib
sh-1.4# wget http://apache.javapipe.com/apr/apr-1.5.2.tar.gz
sh-1.4# tar -xzvf apr-1.5.2.tar.gz
sh-1.4# mv apr-1.5.2 apr
sh-1.4# wget http://apache.javapipe.com/apr/apr-util-1.5.4.tar.gz
sh-1.4# tar -xzvf apr-util-1.5.4.tar.gz
sh-1.4# mv apr-util-1.5.4 apr-util
sh-1.4# cd apr
sh-1.4# ./configure --prefix=/usr
sh-1.4# make
sh-1.4# make install
sh-1.4# cd ../apr-util/
sh-1.4# ./configure --prefix=/usr --with-apr=/usr
sh-1.4# make
sh-1.4# make install
sh-1.4# cd ../../
sh-1.4# LDFLAGS="-lpthread"
sh-1.4# ./configure --prefix=/usr/apache --with-pcre=/usr --with-apr=/usr --with-apr-util=/usr --enable-so --enable-cgi
sh-1.4# make
sh-1.4# make install

Apache will be installed in /opt/usr/apache symlinked to /usr/apache. Symlink apachectl to /etc/init.d if you want to use it old-style, and you can start the httpd server using that symlink or the apachectl script:

sh-1.4# ln -s /usr/apache/bin/apachectl /etc/init.d/httpd
sh-1.4# /etc/init.d/httpd start

PostgreSQL

PostgreSQL is very easy to compile and install, and strangely, is way lighter on RAM than MySQL, so it might be an alternative to it, depending on what you need.

sh-1.4# mkdir /opt/usr/postgres
sh-1.4# ln -s /opt/usr/postgres/usr/postgres
sh-1.4# cd /opt/usr/src
sh-1.4# wget https://ftp.postgresql.org/pub/source/v9.4.5/postgresql-9.4.5.tar.gz
sh-1.4#  tar -xzvf postgresql-9.4.5.tar.gz
sh-1.4# cd postgresql-9.4.5
sh-1.4# ./configure --prefix=/usr/postgres
sh-1.4# make
sh-1.4# make install
sh-1.4# groupadd postgres
sh-1.4# useradd -r -g postgres -s /bin/sh postgres
sh-1.4# mkdir /usr/postgres/data
sh-1.4# chown -R postgres:postgres /usr/postgres/data
sh-1.4# su - postgres
sh-1.4# /usr/postgres/bin/initdb -D /usr/postgres/data
sh-1.4# /usr/postgres/bin/pg_ctl -D /usr/postgres/data start
sh-1.4# /usr/postgres/bin/createdb test
sh-1.4# cp contrib/start-scripts/linux /etc/init.d/postgres

PostgreSQL should now be installed in /opt/usr/postgres, symlinked to /usr/postgres and you can start the server by issuing:

sh-1.4# /etc/init.d/postgres start

PHP

Installing PHP is a bit more complex depending on the modules you need because that will require installing additional dependencies. For example, adding the GD module requires the libgd library compiled, which in turn requires libpng, jpeg, libtiff and libXpm. I’ll show you how to compile basic support with mbstring, mysqli and pgsql modules.

sh-1.4# wget http://fr2.php.net/get/php-7.0.0.tar.gz/from/this/mirror -O php-7.0.0.tar.gz
sh-1.4# tar -xzvf php-7.0.0.tar.gz
sh-1.4# cd php-7.0.0
sh-1.4# ./configure --with-apxs2=/usr/apache/bin/apxs --with-mysqli=/usr/mysql/bin/mysql_config --enable-mbstring --with-pgsql=/usr/postgres --enable-mysqli --enable-opcache=no --prefix=/usr
sh-1.4# make
sh-1.4# make install

In conclusion, since we have a Linux flavor installed on our Tizen RD-PQ device, we can compile and install all kinds of software and turn the device into a full-featured development server. Stay tuned for the next chapters, where we’ll learn how to administer our new development server, tips and tricks regarding the Tizen platform.

Later edit

  • added Java.
  • added Erlang/OTP.