Step by step guide for PtokaX compile and setup on FreeBSD
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Step by step guide for PtokaX compile and setup on FreeBSD

Started by PPK, 13 September, 2009, 22:32:15

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

PPK

First important note. It is looks long, it is looks hard, but it is easy and everything can be done in less than 5 minutes  ;)

This guide was tested on clean installation of FreeBSD 7.2. Everything is done from command line, that means that everything can be done over ssh on remote server.

In my case was only base system installed, that means that after startup and login i was already in command line and working directory was my home directory. If you are not in command line then you need to go here some way (ie if gnome is installed then open terminal).

1. First thing needed for PtokaX compile is source, you will download it with this command:
wget http://www.PtokaX.org/files/0.4.1.1-posix-src.tgz

Result should looks similar to this:


In my case wget command was unknown, to install wget i'm used:
pkg_add -r wget

Result should looks similar to this:


To decompress source use this command:
tar -xf 0.4.1.1-posix-src.tgz


2. Next thing needed for PtokaX compile is tinyxml, for that you need to go to PtokaX source tinyxml directory.
Use these to commands to change working directory:
cd PtokaX
cd tinyxml

Result looks like this:

Download tinyxml source with this command:
wget http://downloads.sourceforge.net/project/tinyxml/tinyxml/2.5.3/tinyxml_2_5_3.tar.gz

Result should looks similar to this:

To decompress tinyxml source use this command:
tar -xf tinyxml_2_5_3.tar.gz


Because my makefile want tinyxml source in src subdir (now is empty) and tinyxml was unpacked to tinyxml remove that src directory with this command:
rmdir src

And rename tinyxml directory to src with this command:
mv tinyxml src


3. Before we can start tinyxml compile we need gmake package. We can install it using pkg_add command.
To install gmake package use this command:
pkg_add -r gmake

Result can looks similar to this:


4. Now we can compile tinyxml, use this command:
gmake

Result should looks similar to this:


5. Now when tinyxml is compiled we can prepare things for PtokaX compile.
First change directory from tinyxml sub dir to PtokaX root, use this command:
cd ..


Again we use pkg_add to get lua package needed for compile.

Install Lua 5.1 with this command:
pkg_add -r lua51

Result can looks similar to this:


6. Because FreeBSD have some different things related to lua library we need to make three moddifications to makefile.
Open makefile in text editor with this command:
vim makefile


Use cursor keys on keyboard to move in that file. To start editing press Insert key on keyboard.

Search for this line:
INCLUDE = -Itinyxml/src -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1

And change it to:
INCLUDE = -Itinyxml/src -I/usr/include -I/usr/local/include -I/usr/local/include/lua51 -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1


Search for this line:
$(CXX) -lpthread -lz -llua5.1 -lrt -o PtokaX \

And change it to:
$(CXX) -lpthread -lz -lrt -o PtokaX \


Search for this line:
$(CURDIR)/tinyxml/tinyxml.a

And change it to:
$(CURDIR)/tinyxml/tinyxml.a /usr/local/lib/lua51/liblua.a


To end editing press Esc key on keyboard.

To save file use this:
:w


And to quit editor use this:
:q


7. Now we can start PtokaX compile.
Use this command:
gmake

Result should on end looks similar to this  (image not posted here because is big ;D)

8. If everything was ok you now have PtokaX executable. Before you run it you should do atleast basic setup.
In source we have config examples, we use them to setup your PtokaX hub.
First we rename cfg.example directory to cfg with this command:
mv cfg.example cfg


Go to cfg dir with this command:
cd cfg


To be able to run PtokaX we need to set atleast hubname and hub address.

Open Setting.xml in text editor with this command:
vim Settings.xml


Search for this line:
<String Name="HubName">&lt;Enter hub name here&gt;</String><!-- Hub name. Min length 1, max 256. -->

And change this:
&lt;Enter hub name here&gt;

To your hubname. For example like that:
<String Name="HubName">PtokaX test</String><!-- Hub name. Min length 1, max 256. -->


Search for this line:
<String Name="HubAddress">&lt;Enter hub address here&gt;</String><!-- Hub address. Min length 1, max 256. -->

And change this:
&lt;Enter hub address here&gt;

To your hub address. For example like that:
<String Name="HubAddress">192.168.0.13</String><!-- Hub address. Min length 1, max 256. -->


End editing, save file and quit editor like before with makefile.

9. This part is not needed, but is good to create registered user for yourself.

Open RegisteredUsers.xml in text editor with this command:
vim RegisteredUsers.xml


Search for this line:
<Nick>Example_Nick</Nick>

And change this:
Example_Nick

To your nick name. For example like that:
<Nick>PPK</Nick>


Search for this line:
<Password>Example_Password</Password>

And change this:
Example_Password

To your password. For example like that:
<Password>test</Password>


Search for this line:
<Profile>3</Profile><!-- 0 for master, 1 for operator, 2 for vip, 3 for reg -->

And change this:
3

To your profile. For example like that:
<Password><Profile>0</Profile><!-- 0 for master, 1 for operator, 2 for vip, 3 for reg --></Password>


End editing, save file and quit editor like before with makefile and Settings.

10. Now you can run PtokaX.
Change from cfg directory to PtokaX root with this command:
cd ..


And run PtokaX with this command:
./PtokaX

Result should looks like this:

And from client similar to this:
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

PPK

"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

SMF spam blocked by CleanTalk