Hi everyone,
since like many i have had troubles trying to install Indy on a linux machine, i thought i would write this little tutorial, which i hope will help the most people here.
I am running Lazarus 0.9.24 beta on Fedora 8, and the version of Indy i have installed is 10.2.0.3.
The steps i am going to describe here will, i believe, work with different version of Lazarus and/or different versions of Indy and or different linux distributions, although i haven't tested that yet.
Ok, getting down to it :
Step 1- Download and install Indy 10
So first things first, we're going to download Indy. To my knowledge, Indy has not yet been made available in RPM, so we will try to download it as a tarball from the site indyproject.org.
Download indy-10.2.0.3.tar.gz
here Your Lazarus components folder should be at
/usr/lib/lazarus/components
or
/usr/lib64/lazarus/components
if you have a 64bits computer
So now, copy your freshly downloaded indy-10.2.0.3.tar.gz file to your lazarus component folder, untar it and navigate to indy folder :
#cp /path_to_your_indy_tarball /path_to_your_lazarus_component_folder
#tar -xvzf indy-10.2.0.3.tar.gz
#cd indy-10.2.0.3
Step 2- Do a bit of shuffling with Indy files
Now that we're in the Indy folder, we're going to create a new directory called backup
#mkdir backup
Then we're going to copy all files from the /indy-10.2.0.3/lazarus folder to the newly created folder 'backup'. So we need first to navigate to the lazarus folder :
#cd lazarusand to then to copy all files to the saved directory :
#cp * ../backupNow we need to enter the fpc folder and copy all the files there to the lazarus folder :
#cd ../
#cd fpc
#cp * ../lazarus
At this point you will be asked if you wish to overwrite files. You need to say yes, just type Y and return
So now we need to move back again and copy all files from our backup folder back to the lazarus folder. You will be prompted for yes/no overwriting files confirmation, but you have to answer NO each time, that is to say to type N.
#cd ../
#cd backup
#cp * ../lazarus
Ok, now you may delete the backup folder :
#cd ../
rm -rf backup
Step 3- Now heading to Lazarus IDE, we are going to add our component 'graphically':)
So first launch Lazarus IDE, and go to Components -> Open package file (.lpk)
Navigate to the /indy-10.2.0.3/lazarus folder and select the file called indylaz.lpk
Validate and and on the new dialog box choose 'Compile'. Once you have done this, you have to wait until the compiling process is over. It takes a minute or two, depending on your machine.
And now you're ready to hit 'Install'. This done, Lazarus is going to try and rebuild itself.
This is when you may get a message saying that it cannot find IdStreamVCL.pas in /lazarus/ide.
So at this point, all you'd have to do is not to panic and just click on Add->Add Unit and then 'select an existing file'. Once the file opener dialog box has opened, just navigate to the /indy-10.2.0.3/lazarus folder and select IdStreamVCL.pas.
Validate by clicking on Add Unit situated at the bottom and relaunch building process by clicking on 'Install' again.
You don't even have to restart Lazarus afterwards as it will do it itself.
If this final installation process does not fail, after Lazarus has restarted itself, you will get a nice bunch of Indy Controls that you can drag and drop to your forms, according to your needs.
Writing about how to use Indy is beyond the scope of this tutorial, although googling for a while will get you started in no time on this subject.
Now having installed and used Indy 10 on a windows machine as well, i can confidently say that most of the time when Indy doesn't install right, it's because of a .pas file that it cannot find at the right place, so one only needs to manually point to the missing file, which can always be found at least in Indy setup directory files.
That's it!)
Any comments or suggestions welcome. I really hope this will help the most people out there, because the information that can be found on the internet on this topic did not always seem very clear to me:)
SuperKitten