How to install Profanity with OMEMO support on Slackware
Published: 2022-02-01 | Last Updated: 2022-02-01 | ~12 Minute Read
Table of Contents
Introduction
I have been wanting to use the profanity chat client with OMEMO support for a while now. While the client itself has a Slackbuild available, it does not build the client with OMEMO support.
Today I will be showing how to build the profanity chat client in order to add OMEMO support so you can use this feature if you so choose.
What is OMEMO
OMEMO is an encryption protocol for the XMPP messaging standard which is simple to use and offers a nice set of features.
This allows for better message security, however I do have to mention the obligatory word of caution and remind the reader that nothing is absolutely secure on the internet.
Initial trouble
I was pointed to OMEMO by a friend that hosts an XMPP server and wanted to try it out. My chat client of choice which is included in the full installation of Slackware is pidgin, but its OMEMO support is not yet ready.
Current client
I have used pidgin a lot in the past however upon looking at the different clients that support OMEMO I found that pidgin developers are still working on adding OMEMO support. A closer look at the issue shows that this has been in the works for 6 years with the latest update 3 years ago.
Development seems to be moving slow on pidgin’s side, although there is a bounty in case anyone is interested in making it happen.
From the list of OMEMO supporting clients I was most intrigued by profanity, I knew of it but had never installed it since pidgin fulfilled my chatting needs.
A new client
I decided to install profanity via its Slackbuild but noticed that the version resulting from that slackbuild is 0.5.1
. OMEMO support was officially added to profanity on version 0.7.0
so the slackbuild version would not include the required support.
Additionally the latest version for profanity provided upstream is 0.11.1
.
Dependency
The profanity client requires a single dependency on a full Slackware installation, libstrophe
. I checked the version suggested by the Slackbuild: 0.9.2
, but it too was behind from the upstream 0.11.0
.
Solution
I decided to install the latest version for both libstrophe
and profanity
since I’d like to take advantage of all the added features and fixes that were implemented since version 0.5.1
in profanity
.
Installing libstrophe
The installation process for libstrophe was pretty straight forward, since the method for building it has not changed since version 0.9.2
. I downloaded the source tarball and updated the Slackbuild appropriately.
Updated fields for the Slackbuild:
VERSION=${VERSION:-0.11.0}
With that the libstrophe
package for the latest version of the library built successfully.
Installing profanity
Installing the latest version of profanity was just as simple, however when checking the OMEMO support I noticed that it set to Disabled
:
bash-5.1$ profanity --version
Profanity, version 0.11.1
Copyright (C) 2012 - 2019 James Booth <boothj5web@gmail.com>.
Copyright (C) 2019 - 2021 Michael Vetter <jubalh@iodoru.org>.
License GPLv3+: GNU GPL version 3 or later <https://www.gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Build information:
XMPP library: libstrophe
Desktop notification support: Enabled
OTR support: Disabled
PGP support: Enabled (libgpgme 1.15.0)
OMEMO support: Disabled
C plugins: Enabled
Python plugins: Enabled (2.7.18)
GTK icons/clipboard: Enabled
If I was not interested in the OMEMO support this would have sufficed, however the point of installing the client was its OMEMO support so I took to the official documentation to find out what was missing.
Adding OMEMO Support
From the excellent official profanity User Guide, I took a look at its OMEMO documentation. The way to enable OMEMO at build time is to add the --enable-omemo
flag to the ./configure
script.
Once I tried to build profanity with the added flag, I was met with a missing dependency error, libsignal-protocol-c
is a requirement for OMEMO’s ratcheting forward secrecy. Upon looking for this dependency in the slackbuilds repository I was surprised to find nothing. It seems like no one has taken time to create a Slackbuild for this.
I looked around in linuxquestions.org and found a question that mentions this very scenario. A user suggests that he created a Slackbuild for the missing dependency, however I was not able to find that Slackbuild anywhere.
I decided to create the Slackbuild myself, I thought it was a good opportunity to become the maintainer of a Slackbuild and help others to get the OMEMO benefits in profanity as well.
libsignal-protocol-c Slackbuild
I had some trouble initially to get the libsignal-protocol-c
library built since it uses cmake instead of what I am more familiarized with which is make.
Once I read up a bit on how cmake
differs from make
I was able to create a Slackbuild that successfully compiled the library. There was a minor issue with the created library though, it was placed in /usr/local/lib
instead of the expected /usr/share/lib
path. I was able to solve this with a doinst.sh
script.
I then added the additionally required files to submit the Slackbuild, README
, libsignal-protocol-c.info
and slack-desc
, below are the final files:
libsignal-protocol-c.SlackBuild
:
bash-5.1$ cat libsignal-protocol-c.SlackBuild
#!/bin/bash
# Slackware build script for libsignal-protocol-c
# Copyright 2022 Eric Garcia, Mexico City, Mexico
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=libsignal-protocol-c
VERSION=${VERSION:-2.3.3}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
# the name of the created package would be, and then exit. This information
# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
fi
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
-o -perm 511 \) -exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
# Make the library
cmake .
make
make install DESTDIR=$PKG
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
libsignal-protocol-c.info
:
bash-5.1$ cat libsignal-protocol-c.info
PRGNAM="libsignal-protocol-c"
VERSION="2.3.3"
HOMEPAGE="https://github.com/signalapp/libsignal-protocol-c"
DOWNLOAD="https://github.com/signalapp/libsignal-protocol-c/archive/refs/tags/v2.3.3.tar.gz"
MD5SUM="68dae9b8da58f36dcbf9e10b0138d6f9"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
MAINTAINER="Eric Garcia"
EMAIL="nix@nixing.mx"
slack-desc
:
bash-5.1$ cat slack-desc
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.
# Line up the first '|' above the ':' following the base package name, and
# the '|' on the right side marks the last column you can put a character in.
# You must make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
libsignal-protocol-c: libsignal-protocol-c (ratcheting forward secrecy protocol)
libsignal-protocol-c:
libsignal-protocol-c: This is a ratcheting forward secrecy protocol that works in
libsignal-protocol-c: synchronous and asynchronous messaging environments.
libsignal-protocol-c:
libsignal-protocol-c: Homepage: https://github.com/signalapp/libsignal-protocol-c
libsignal-protocol-c:
libsignal-protocol-c:
libsignal-protocol-c:
libsignal-protocol-c:
libsignal-protocol-c:
README
:
bash-5.1$ cat README
libsignal-protocol-c (ratcheting forward secrecy protocol)
This is a ratcheting forward secrecy protocol that works in
synchronous and asynchronous messaging environments.
Homepage: https://github.com/signalapp/libsignal-protocol-c
Note: The dowloaded tarball is named differently from what
the SlackBuild expects. Before building run the following:
# mv v2.3.3.tar.gz libsignal-protocol-c.tar.gz
doinst.sh
:
bash-5.1$ cat doinst.sh
mv usr/local/lib/pkgconfig/libsignal-protocol-c.pc /usr/share/pkgconfig/
Installing profanity, again
With the previous work done I was able to build the profanity
package once again and this time everything went as expected. Once this is done the OMEMO support looks like so from profanity:
bash-5.1$ profanity --version
Profanity, version 0.11.1
Copyright (C) 2012 - 2019 James Booth <boothj5web@gmail.com>.
Copyright (C) 2019 - 2021 Michael Vetter <jubalh@iodoru.org>.
License GPLv3+: GNU GPL version 3 or later <https://www.gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Build information:
XMPP library: libstrophe
Desktop notification support: Enabled
OTR support: Disabled
PGP support: Enabled (libgpgme 1.15.0)
OMEMO support: Enabled
C plugins: Enabled
Python plugins: Enabled (2.7.18)
GTK icons/clipboard: Enabled
Launching and using profanity
with OMEMO support is now possible, I tested the OMEMO support and it works as expected.
Conclusion
In general this is the process that Slackware users would have to go through to install things, but the slackbuilds make this process much simpler. I was happy to work through this myself in order to provide the benefit and ease of installation of the profanity
client with OMEMO support for others.
I have emailed the profanity
/libstrophe
Slackbuild maintainer in order to see if these can be updated to the latest versions since the build process is pretty much the same apart from updating the version inside the Slackbuild.
I was looking forward to submitting my newly created slackbuild however submissions are not currently open due to the imminent release of Slackware 15. I will have to wait until Slackware 15 is released before submitting my Slackbuild to the slackbuilds.org project.
In case you would like to use the profanity
client with OMEMO support in the meantime you could simply copy/paste the provided examples here and it should build successfully, Enjoy!