Skip to content

Commit

Permalink
Move build instructions to bottom of README
Browse files Browse the repository at this point in the history
  • Loading branch information
thevindu-w committed Jun 4, 2024
1 parent 04bacce commit 04a49ef
Showing 1 changed file with 151 additions and 149 deletions.
300 changes: 151 additions & 149 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,16 @@ or from <a href="https://github.com/thevindu-w/clip_share_client/releases">GitHu

## Table of Contents

- [Build](#build)
- [How to Use](#how-to-use)
- [Install dependencies](#install-dependencies)
- [Run the server](#run-the-server)
- [Allow through firewall](#allow-through-firewall)
- [Connect the client application](#connect-the-client-application)
- [Installation](#Installation) (optional)
- [Create SSL/TLS certificate and key files](#create-ssltls-certificate-and-key-files) (optional)
- [Command line options](#command-line-options)
- [Configuration](#configuration)
- [Build from Source](#build-from-source)
- [Build tools](#build-tools)
- [Linux](#linux)
- [Windows](#windows)
Expand All @@ -47,153 +56,8 @@ or from <a href="https://github.com/thevindu-w/clip_share_client/releases">GitHu
- [Windows](#windows-1)
- [macOS](#macos-1)
- [Compiling](#compiling)
- [How to Use](#how-to-use)
- [Install dependencies](#install-dependencies)
- [Run the server](#run-the-server)
- [Allow through firewall](#allow-through-firewall)
- [Connect the client application](#connect-the-client-application)
- [Installation](#Installation)
- [Create SSL/TLS certificate and key files](#create-ssltls-certificate-and-key-files)
- [Command line options](#command-line-options)
- [Configuration](#configuration)

<br>

## Build

**Note:** If you prefer using the pre-built binaries from [Releases](https://github.com/thevindu-w/clip_share_server/releases), you may skip this section and start from the [How to Use](#how-to-use) section.

### Build tools

This needs the following tools,

* gcc
* make

#### Linux

On Linux, these tools can be installed with the following command:

* On Debian-based or Ubuntu-based distros,
```bash
sudo apt-get install gcc make
```

* On Redhat-based or Fedora-based distros,
```bash
sudo yum install gcc make
```

* On Arch-based distros,
```bash
sudo pacman -S gcc make
```

#### Windows

On Windows, these tools can be installed with [MinGW](https://www.mingw-w64.org/).<br>
In an [MSYS2](https://www.msys2.org/) environment, these tools can be installed using pacman with the following command:
```bash
pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-make
```
You may need to rename (or copy) the `<MSYS2 directory>/mingw64/bin/mingw32-make.exe` to `<MSYS2 directory>/mingw64/bin/make.exe` before running the command `make`

#### macOS

On macOS, these tools are installed with Xcode Command Line Tools.

<br>

### Dependencies

#### Linux

The following development libraries are required.

* libc
* libx11
* libxmu
* libxcb-randr
* libpng
* libssl
* libunistring

They can be installed with the following command:

* On Debian-based or Ubuntu-based distros,
```bash
sudo apt-get install libc6-dev libx11-dev libxmu-dev libxcb-randr0-dev libpng-dev libssl-dev libunistring-dev
```

* On Redhat-based or Fedora-based distros,
```bash
sudo yum install glibc-devel libX11-devel libXmu-devel libpng-devel openssl-devel libunistring-devel
```

* On Arch-based distros,
```bash
sudo pacman -S libx11 libxmu libpng openssl libunistring
```

glibc should already be available on Arch distros. But you may need to upgrade it with the following command. (You need to do this only if the build fails)

```bash
sudo pacman -S glibc
```

(You may refer to docker/Dockerfile.\* to see how to install the dependencies on various Linux distros)

#### Windows

The following development libraries are required.

* [libz](https://packages.msys2.org/package/mingw-w64-x86_64-libzip?repo=mingw64)
* [libpng16](https://packages.msys2.org/package/mingw-w64-x86_64-libpng?repo=mingw64)
* [libssl](https://packages.msys2.org/package/mingw-w64-x86_64-openssl?repo=mingw64) (provided by OpenSSL)
* [libunistring](https://packages.msys2.org/package/mingw-w64-x86_64-libunistring?repo=mingw64)

In an [MSYS2](https://www.msys2.org/) environment, these tools can be installed using pacman with the following command:
```bash
pacman -S mingw-w64-x86_64-openssl mingw-w64-x86_64-libpng mingw-w64-x86_64-libunistring
```

#### macOS

The following development libraries are required.

* [openssl](https://formulae.brew.sh/formula/openssl@3)
* [libpng](https://formulae.brew.sh/formula/libpng)
* [libunistring](https://formulae.brew.sh/formula/libunistring)

These tools can be installed using [Homebrew](https://brew.sh) with the following command:
```bash
brew install openssl@3 libpng libunistring
```

<br>

### Compiling

1. Open a terminal / command prompt / Powershell in the project directory

This can be done using the GUI or the `cd` command.

1. Run the following command to make the executable file

```bash
make
```
This will generate the executable named clip_share (or clip_share.exe on Windows).

**Note**: The web version is deprecated.<br>
To compile with the web server enabled, (Currently, this is tested only on Linux)
```bash
make web
```
This will generate the web server enabled executable named clip_share_web.

<br>
<br>

## How to Use

Expand Down Expand Up @@ -264,7 +128,8 @@ To install the server to run on startup, use the corresponding installer script
# on Linux
chmod +x install-linux.sh
./install-linux.sh
```
```bash
# on macOS
chmod +x install-mac.sh
./install-mac.sh
Expand Down Expand Up @@ -292,7 +157,8 @@ You may use the helper script `keygen.sh` in the [helper_tools/](https://github.
# If you download/clone the repository and run the script from the repository root,
chmod +x helper_tools/keygen.sh
helper_tools/keygen.sh
```
```bash
# If you download the script separately and run the script from within the same directory,
chmod +x keygen.sh
./keygen.sh
Expand Down Expand Up @@ -402,4 +268,140 @@ Note that all the lines in the configuration file are optional. You may omit som

You may change these values. But it is recommended to keep the port numbers unchanged. If the port numbers are changed, client application configurations may also need to be changed as appropriate to connect to the server.
<br>
If you changed the configuration file, you must restart the server to apply the changes.
If you changed the configuration file, you must restart the server to apply the changes.

<br>
<br>

## Build from Source

**Note:** If you prefer using the pre-built binaries from [Releases](https://github.com/thevindu-w/clip_share_server/releases), you can ignore this section and follow the instructions in the [How to Use](#how-to-use) section.

### Build tools

Compiling ClipShare needs the following tools,

* gcc
* make

#### Linux

On Linux, these tools can be installed with the following command:

* On Debian-based or Ubuntu-based distros,
```bash
sudo apt-get install gcc make
```

* On Redhat-based or Fedora-based distros,
```bash
sudo yum install gcc make
```

* On Arch-based distros,
```bash
sudo pacman -S gcc make
```

#### Windows

On Windows, these tools can be installed with [MinGW](https://www.mingw-w64.org/).<br>
In an [MSYS2](https://www.msys2.org/) environment, these tools can be installed using pacman with the following command:
```bash
pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-make
```
You may need to rename (or copy) the `<MSYS2 directory>/mingw64/bin/mingw32-make.exe` to `<MSYS2 directory>/mingw64/bin/make.exe` before running the command `make`

#### macOS

On macOS, these tools are installed with Xcode Command Line Tools.

<br>

### Dependencies

#### Linux

The following development libraries are required.

* libc
* libx11
* libxmu
* libxcb-randr
* libpng
* libssl
* libunistring

They can be installed with the following command:

* On Debian-based or Ubuntu-based distros,
```bash
sudo apt-get install libc6-dev libx11-dev libxmu-dev libxcb-randr0-dev libpng-dev libssl-dev libunistring-dev
```

* On Redhat-based or Fedora-based distros,
```bash
sudo yum install glibc-devel libX11-devel libXmu-devel libpng-devel openssl-devel libunistring-devel
```

* On Arch-based distros,
```bash
sudo pacman -S libx11 libxmu libpng openssl libunistring
```

glibc should already be available on Arch distros. But you may need to upgrade it with the following command. (You need to do this only if the build fails)

```bash
sudo pacman -S glibc
```

(You may refer to docker/Dockerfile.\* to see how to install the dependencies on various Linux distros)

#### Windows

The following development libraries are required.

* [libz](https://packages.msys2.org/package/mingw-w64-x86_64-libzip?repo=mingw64)
* [libpng16](https://packages.msys2.org/package/mingw-w64-x86_64-libpng?repo=mingw64)
* [libssl](https://packages.msys2.org/package/mingw-w64-x86_64-openssl?repo=mingw64) (provided by OpenSSL)
* [libunistring](https://packages.msys2.org/package/mingw-w64-x86_64-libunistring?repo=mingw64)

In an [MSYS2](https://www.msys2.org/) environment, these tools can be installed using pacman with the following command:
```bash
pacman -S mingw-w64-x86_64-openssl mingw-w64-x86_64-libpng mingw-w64-x86_64-libunistring
```

#### macOS

The following development libraries are required.

* [openssl](https://formulae.brew.sh/formula/openssl@3)
* [libpng](https://formulae.brew.sh/formula/libpng)
* [libunistring](https://formulae.brew.sh/formula/libunistring)

These tools can be installed using [Homebrew](https://brew.sh) with the following command:
```bash
brew install openssl@3 libpng libunistring
```

<br>

### Compiling

1. Open a terminal / command prompt / Powershell in the project directory

This can be done using the GUI or the `cd` command.

1. Run the following command to make the executable file

```bash
make
```
This will generate the executable named clip_share (or clip_share.exe on Windows).

**Note**: The web version is deprecated.<br>
To compile with the web server enabled, (Currently, this is tested only on Linux)
```bash
make web
```
This will generate the web server enabled executable named clip_share_web.

0 comments on commit 04a49ef

Please sign in to comment.