Skip to content
jkloetzke edited this page Oct 19, 2012 · 6 revisions

Currently there are no pre-build binary packages of PeerDrive available. But building it yourself shouldn’t be too difficult, at least on a decent Linux distribution.

Requirements

To build PeerDrive you need the following external packages:

Build OS file system binding

Depending on your target platform you either have to build fuserl (Unix) or erldokan (Windows). Note that both are optional but PeerDrive won’t be much fun when no application (expect PeerDrive aware ones) can access the files.

fuserl

Unfortunately fuserl, the FUSE Erlang binding is not available as package. Follow the build instructions given in the Wiki and make sure that you build and install fuserl with the same prefix as your Erlang installation.

erldokan

Pre-built packages of erldokan are available here. Just extract the contents of the archive into your Erlang installation’s “lib” directory, that is “%ERL_INSTALL_DIR%\lib”. If you instead want to build erldokan yourself you can clone the repository at https://github.com/jkloetzke/erldokan and follow the build instructions from the README.

In any case you must have the Dokan 0.6.0 library and driver installed on your system. The package does also install the header files to compile the erldokan binding.

Build PeerDrive

First clone the repository:

git clone git://github.com/jkloetzke/peerdrive.git

and then build everything with a simple

cd peerdrive
make

This should fetch any missing dependencies and build the PeerDrive server. While building PeerDrive the rebar script should detect the presence of fuserl or erldokan if they are installed correctly:

rebar.config.script: fuserl: enabled
rebar.config.script: erldokan: disabled

Running the PeerDrive server standalone

To run the PeerDrive server just execute ./peerdrive.sh resp. peerdrive.bat This will start the PeerDrive server in the foreground. To gracefully shut down the server type

q().

Installing PeerDrive as daemon/service

Instead of running the PeerDrive server manually every time you can also run it as daemon in the background.

Build server release

Generating an Erlang release of the PeerDrive application (server) creates a stand alone package that contains all necessary libraries and executables. The release can be kept anywhere in the system because it is self contained.

To build the release go into the server directory and generate the release:

cd server
rebar generate force=1

After this you will find the release in server/rel/peerdrive/. Copy the release to where you like (e.g. /usr/local/lib/peerdrive or C:\PeerDrive) in your system.

Register server as service on Windows

Just run bin/register-service.bat as administrator. This registers and starts the PeerDrive service. To de-register the service simply run bin/remove-service.bat.

Register PeerDrive as Linux daemon

There is a minimal installation script available: server/install.sh. Execute this script as root after you’ve built the server. The script will install the server to /usr/local/lib/peerdrive, place some template configuration files in /etc/peerdrive and install an init script starting the server in the default runlevels.

Clone this wiki locally