# Signet
The user documentation is located at
[hax0rbana.org/signet](https://hax0rbana.org/signet), the man page is at
[signet.md](signet.md), and the build instructions are below.

The PGP fingerprint of the [Hax0rbana Signet signing key](signet.pub) is:

```
741E F6C7 5913 9E2D C30C F6BC F48E AC51 91E5 3074
```

### Get submodules

If you got this source from a Git repository then before you can build you must get the repositores submodules:

```sh
git submodule update --init
```

If you downloaded the source from an archive then the submodules are already included.

### GNU/Linux build steps

If you are running a Debian-based system (Ubuntu, Linux Mint, etc.) then run the following command to install Signet's build dependencies

```sh
./build-dependencies.sh
```

If you are not on a Debian based system, build or install the equivalent libraries for Qt5 (with Websockets and x11extras), zlib, libX11, and libgcrypt.

To build simply run qmake and then make:

```sh
qmake client/client.pro CONFIG+=release
make
```

To install:

```sh
sudo make install
```

If you want to run the executable from the current directory instead of
installing it to your path, you can do so, but you will need a udev rule
before the signet software will see the hardware. To do so:

```sh
sudo cp signet-base/signetdev/host/linux/50-signet.rules /etc/udev/rules.d
```

### Mac OS build steps

To install Signet's build dependencies first install [Brew](https://brew.sh)

Once you have Brew, run:

```sh
brew install qt5 libgcrypt libgpg-error zlib
```

To build Signet run:

```sh
/usr/local/opt/qt5/bin/qmake client/client.pro CONFIG+=release
make
```

The build will create a `signet.app` folder that you can move or copy anywhere. For example:

```sh
cp -r signet.app ~/Desktop
```

To package up the application into a .dmg file:

1. Package it up so it'll run without brew libraries installed: `macdeployqt signet.app`
2. Create a folder (e.g. `mkdir signet-0.9.18`)
3. Copy the .app folder into the newly created folder (e.g. `cp -R signet.app signet-0.9.18/`)
4. Open Disk Utility
5. Select File -> New Image -> From Folder...
6. Select the folder you made (e.g. signet-0.9.18)
7. Give the .dmg file a name (e.g. signet-0.9.18.dmg) and save it

### Windows build steps

First install [MSYS2](http://www.msys2.org). MSYS2 will provide a build environment and a package manager to download Signet's dependencies. Once MSYS2 is installed, launch the MSYS2/MinGW-64 shell and run:

```
pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-make
pacman -S mingw-w64-x86_64-qt5-static mingw-w64-x86_64-zlib mingw-w64-x86_64-libgcrypt
pacman -S mingw-w64-x86_64-jasper mingw-w64-x86_64-openssl
pacman -S mingw-w64-x86_64-dbus mingw-w64-x86_64-libwebp
```

Now you can build:

```
export PATH=/mingw64/qt5-static/bin:$PATH
qmake client/client.pro CONFIG+=release
mingw32-make
```

This will build `Signet.exe` in the `release` subdirectory. This executable should be self contained and you can copy it anywhere and run it.

## Release process
The process for cutting a new release is to:

- Make sure there are release-notes that cover every change
- Update version number in client/signetapplication.h
- Update version number everywhere in .gitlab-ci.yml
- Update the version string in client/macos/Info.plist
- Ensure the CI jobs all succeed
- After changes are merged into the default branch, tag it
- Sign and publish the CI builds (source, Linux executables) to the website
- Update the signet-deb repo to build the new version
- Sign and publish the .deb packages to the website
- Copy .deb packages to apt repo, update Packages.gz and Releases files, then
  sign the Releases file
- Build .app on a Mac, package it into a .dmg, sign and publish
- Build .exe on a Windows machine, sign and publish
