Note: I was a bit confused because there is a csync2 package for Ubuntu. But it seems that this is a totally different project and not related to csync.
resolving dependencies
csync has a few dependencies which are listed in the INSTALL file. They
include:
- CMake
- check
- log47
- sqlite3
- libiniparser
- libsmbclient
- libssh
So lets install these dependecies first:
sudo aptitude install cmake check liblog4c3 liblog4c-dev libsqlite3-0 libsqlite3-dev libsmbclient-dev libssh-dev
installing libiniparser
Only libiniparser is not available through aptitude so we must also download and compile it from source.
wget http://ndevilla.free.fr/iniparser/iniparser3.0b.tar.gz
tar xf iniparser3.0b.tar.gz
cd iniparser3.0b
make
These commands will download, extract and build the iniparser library. You
will see that you now have the files libiniparser.a and libiniparser.so.0
in your current directory. Copy them to /usr/lib to make them available for
other programs:
sudo cp libiniparser.* /usr/lib
download and configure csync
Now we can actually start to compile csync. Download your prefered release
from the download page and extract it:
wget http://www.csync.org/files/csync-0.44.0.tar.gz
tar xf csync-0.44.0.tar.gz
cd csync-0.44.0
csync also wants us to build the project in a seperate directory. So lets
create it:
mkdir build
cd build
Now we can run cmake to configure the environment. For me the first try
raised an error which read like this:
CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files:
INIPARSER_INCLUDE_DIR
So we need to tell cmake which value the INIPARSER_INCLUDE_DIR option
should have:
cmake -DINIPARSER_INCLUDE_DIR=/path/to/iniparser3.0b/src ..
Please note the .. at the end of the command. This tells cmake where to
find the extracted source tarball.
build and install csync
Now we can try to build and install csync. On all Unix systems you usually
do a make install which also should work with csync. But make install
simply ignores Ubuntu's package system. We don't want that and use
checkinstall instead to build and install a .deb package. So make sure
checkinstall is available:
sudo aptitude install checkinstall
Before we compile the package we need to prevent an error which hit me on the
first try. Copy the source files from the iniparser package to the build
directory:
cp /path/to/iniparser3.0b/src/* .
Now you can run checkinstall from the build directory in which you
configured csync:
sudo checkinstall
This will call a wizard which leads you through the process of creating the
.deb package. Usually you can use the defaults to install the packages by
hitting your return key several times. But since checkinstall uses the name
of your current directory as package name and you don't want to have the
package named build you need to change this default while going through
checkinstall's wizard.
have fun!
Now everything should be installed and ready to use. I hope this helped you
going through the few steps that are necessary to compile csync from source.
Please note that the urls I use with wget are just pointing to the current
releases of csync and libiniparser. So maybe you want to check their
websites before going through this tutorial if they have released newer
versions.
Comment below if you have issues with this howto or suggestions how to make it better. Thanks!

Comments ¶
blog comments powered by Disqus