Languages

How to build

mfaure's picture

Very first step

We assume you have already installed Tanaguru (to have all prerequesites ok).

Install Subversion

sudo aptitude install subversion

Fetch source code

Fetch source code as anonymous

mkdir Sources
cd Sources
svn checkout svn://svn.adullact.net/svnroot/tanaguru/Tags/<version>
mv <version> tanaguru
svn checkout svn://svn.adullact.net/svnroot/tanaguru-rules/Tags/<version>
mv <version> tanaguru-rules

Fetch source code authenticated

mkdir Sources
cd Sources
svn checkout svn+ssh://developername@svn.adullact.net/svnroot/tanaguru/Tags/<version>
mv <version> tanaguru
svn checkout svn+ssh://developername@svn.adullact.net/svnroot/tanaguru-rules/Tags/<version>
mv <version> tanaguru-rules

Install Maven

sudo aptitude install maven2

Add libraries to maven

cd Sources/tanaguru/engine/tanaguru-resources/src/main/resources/lib

mvn install:install-file -DgroupId=org.htmlcleaner -DartifactId=htmlcleaner -Dversion=2.2 -Dpackaging=jar -Dfile=htmlcleaner-2.2.jar
mvn install:install-file -DgroupId=org.archive -DartifactId=heritrix -Dversion=3.0.0 -Dpackaging=pom -Dfile=heritrix-3.0.0.pom
mvn install:install-file -DgroupId=org.archive.heritrix -DartifactId=heritrix-commons -Dversion=3.0.0 -Dpackaging=pom -Dfile=heritrix-commons-3.0.0.pom
mvn install:install-file -DgroupId=org.archive.heritrix -DartifactId=heritrix-commons -Dversion=3.0.0 -Dpackaging=jar -Dfile=heritrix-commons-3.0.0.jar
mvn install:install-file -DgroupId=org.archive.heritrix -DartifactId=heritrix-engine -Dversion=3.0.0 -Dpackaging=pom -Dfile=heritrix-engine-3.0.0.pom
mvn install:install-file -DgroupId=org.archive.heritrix -DartifactId=heritrix-engine -Dversion=3.0.0 -Dpackaging=jar -Dfile=heritrix-engine-3.0.0.jar
mvn install:install-file -DgroupId=org.archive.heritrix -DartifactId=heritrix-modules -Dversion=3.0.0 -Dpackaging=pom -Dfile=heritrix-modules-3.0.0.pom
mvn install:install-file -DgroupId=org.archive.heritrix -DartifactId=heritrix-modules -Dversion=3.0.0 -Dpackaging=jar -Dfile=heritrix-modules-3.0.0.jar
mvn install:install-file -DgroupId=org.archive.overlays -DartifactId=archive-overlay-commons-httpclient -Dversion=3.1 -Dpackaging=pom -Dfile=archive-overlay-commons-httpclient-3.1.pom
mvn install:install-file -DgroupId=org.archive.overlays -DartifactId=archive-overlay-commons-httpclient -Dversion=3.1 -Dpackaging=jar -Dfile=archive-overlay-commons-httpclient-3.1.jar
mvn install:install-file -DgroupId=org.archive.overlays -DartifactId=archive-overlay-commons-pool -Dversion=1.3 -Dpackaging=pom -Dfile=archive-overlay-commons-pool-1.3.pom
mvn install:install-file -DgroupId=org.archive.overlays -DartifactId=archive-overlay-commons-pool -Dversion=1.3 -Dpackaging=jar -Dfile=archive-overlay-commons-pool-1.3.jar
mvn install:install-file -DgroupId=org.seleniumhq.selenium.server -DartifactId=selenium-server -Dversion=1.0.3 -Dpackaging=jar -Dfile=selenium-server.jar

cd Source/tanaguru/web-app/tgol-resources/src/main/resource/lib
mvn install:install-file -DgroupId=cewolf -DartifactId=cewolf -Dversion=1.1.4 -Dpackaging=jar -Dfile=cewolf-1.1.4.jar

Install mysql test database (only needed  up to version 1.5.1)

Tanaguru needs a mysql test database to run its unit tests. To avoid this installation, you can go directly to the next step: skip unit tests

Edit tanaguru-test-10-create-user-and-base.sql file and replace all stars '*********' with the desired password for your tgTest mysql user.

cd Sources/tanaguru/tanaguru-resources/src/main/resources/sql/
vi tanaguru-test-10-create-user-and-base.sql

To install the mysql test database, run this sql script with mysql root user:

mysql -u root -p <tanaguru-test-10-create-user-and-base.sql

Create the /etc/tanaguru-test and copy tanaguru-test.conf to it :

sudo mkdir /etc/tanaguru-test
sudo chmod 655 /etc/tanaguru-test
sudo cp Sources/tanaguru/tanaguru-resources/src/main/resources/tanaguru-test-conf/tanaguru-test.conf /etc/tanaguru-test

Edit /etc/tanaguru-test/tanaguru-test.conf to adjust mysql username and password.

Skip Unit Tests (option)

You may skip the unit tests if you want to avoid the mysql test database installation or if you don't have internet connexion (needed to build the crawler component) by uncommenting the following lines in the Sources/tanaguru/pom.xml file :

<plugin>
<groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <configuration>
    <skipTests>true</skipTests>
    </configuration>
</plugin>

Build Tanaguru

From version 1.5.2, tanaguru embeds an in-memory database to deal with the unit tests of its persistence layer. The installation of the mysql database isn't needed anymore.

cd Sources/tanaguru/
mvn clean install

cd engine
mvn clean install

cd ../web-app
mvn clean install

cd ../cli
mvn clean install

The generated binary file can be found in Sources/tanaguru/cli/tanaguru-cli/target/tanaguru-<version>.<architecture>.tar.gz and Sources/tanaguru/web-app/tgol-web-app/target/tgol-web-app-<version>.war

Build Tanaguru-rules

cd Sources/tanaguru-rules/
mvn clean install

The generated binary file can be found in Sources/tanaguru-rules/tanaguru-rules/target/ and is named

tanaguru-rules-<version>.<architecture>.tar.gz

Installing Tanaguru

Once you've downloaded or build the packages, unpack them by entering the following the command line :
tar xzf tanaguru-<version>.<architecture>.tar.gz
tar xzf tanaguru-rules-<version>.<architecture>.tar.gz

Congratulations, you're done ! You may follow the last steps in the user installation documentation.