coturn for Ubuntu Jammy (22.04 LTS)

· 173 words · 1 minute read

Today I had to install coturn on Ubuntu 22.04 (Jammy Jellyfish). It doesn’t have package available because of a bug. But there’s a solution on the bugtracker, so I decided to build my own package. It has been a while since I last did it, so here are the steps for reference:

  1. Install Ubuntu Jammy (I had it installed anyway)
  2. Make sure you have deb-src sources for both jammy and impish in sources.list
  3. Install tools: apt-get build-dep dpkg-dev quilt build-essential
  4. Install build dependencies: apt-get build-dep coturn
  5. Get sources: apt-get source coturn
  6. Patches for the package are managed using quilt
  7. quilt push -a
  8. quilt new jammy.patch
  9. quilt add src/client/ns_turn_msg.c
  10. $EDITOR src/client/ns_turn_msg.c and change the one line
  11. quilt refresh
  12. quilt pop -a
  13. dpkg-buildpackage -us -uc
  14. dpkg -i coturn*.deb
  15. apt-get -f install

This produced the quilt patch below:

Index: coturn-4.5.2/src/client/ns_turn_msg.c
--- coturn-4.5.2.orig/src/client/ns_turn_msg.c
+++ coturn-4.5.2/src/client/ns_turn_msg.c
@@ -256,7 +256,7 @@ int stun_produce_integrity_key_str(const
 		unsigned int keylen = 0;
 		EVP_MD_CTX *ctx = EVP_MD_CTX_new();
+#if defined FIPS_MODE
 		if (FIPS_mode()) {