Skip to content
Snippets Groups Projects
Commit 80bb7b17 authored by Louis Maillard's avatar Louis Maillard
Browse files

pkg-ubuntu: add build pipeline Ubuntu 22.04, 24.04

This commit add necessary files for building debian .deb package and
shell script to build for Ubuntu 22.04 and 24.04. You can use it by
running `extras/packaging/build_packages.sh` script.

Change-Id: I91ba97cbe932ff4207072dcb2f9d2b2887de236a
parent 2da6725e
No related branches found
No related tags found
No related merge requests found
Showing
with 11253 additions and 1 deletion
#!/bin/bash
PKG_NAME=dhtnet
PKG_VERSION=0.2.0
FOLDER_NAME="${PKG_NAME}-${PKG_VERSION}"
rm -Rf "${FOLDER_NAME}"
rm -f "${PKG_NAME}-${PKG_VERSION}.tar.gz"
mkdir -p "${FOLDER_NAME}"
git submodule update --init --recursive
# copy source code
cp -Rf dependencies "${FOLDER_NAME}/dependencies"
cp -Rf include "${FOLDER_NAME}/include"
cp -Rf src "${FOLDER_NAME}/src"
cp -Rf tools "${FOLDER_NAME}/tools"
cp -Rf CMakeLists.txt "${FOLDER_NAME}/CMakeLists.txt"
cp -Rf COPYING "${FOLDER_NAME}/COPYING"
cp -Rf dhtnet.pc.in "${FOLDER_NAME}/dhtnet.pc.in"
cp -Rf README.md "${FOLDER_NAME}/README.md"
# copy debian conf
cp -Rf "extras/packaging/gnu-linux/debian" "${FOLDER_NAME}/debian"
tar -czf "${PKG_NAME}-${PKG_VERSION}.tar.gz" "${FOLDER_NAME}"
echo "Archive ${PKG_NAME}-${PKG_VERSION}.tar.gz is ready"
echo "Use tar -xzf ${PKG_NAME}-${PKG_VERSION}.tar.gz to unzip this file and package it with debuild"
......@@ -3,7 +3,7 @@ exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: dhtnet
Description: C++ peer to peer networking library
Description: Lightweight Peer-to-Peer Communication Library which manages peer discovery and connectivity establishment, including NAT traversal.
Version: @VERSION@
Libs: -L${libdir} -ldhtnet
Libs.private: @libsprivate@
......
gnu-linux/debian/dhtnet
gnu-linux/debian/.debhelper
ubuntu-*/*.deb
ubuntu-*/build-at-*
dhtnet-*.tar.gz
#!/bin/bash
set -e
PKG_NAME=dhtnet
PKG_VERSION=0.2.0
FOLDER_NAME="${PKG_NAME}-${PKG_VERSION}"
# move pwd to the directory of this script (extras/packaging)
cd "$(dirname "$0")" || exit 1
rm -Rf "${FOLDER_NAME}"
rm -f "${PKG_NAME}-${PKG_VERSION}.tar.gz"
mkdir -p "${FOLDER_NAME}"
rm -Rf "../../dependencies/msgpack"
rm -Rf "../../dependencies/opendht"
rm -Rf "../../dependencies/pjproject"
rm -Rf "../../dependencies/restinio"
(cd ../.. && git submodule update --init --recursive)
# copy source code
cp -Rf ../../dependencies "${FOLDER_NAME}/dependencies"
cp -Rf ../../include "${FOLDER_NAME}/include"
cp -Rf ../../src "${FOLDER_NAME}/src"
cp -Rf ../../tools "${FOLDER_NAME}/tools"
cp -Rf ../../CMakeLists.txt "${FOLDER_NAME}/CMakeLists.txt"
cp -Rf ../../COPYING "${FOLDER_NAME}/COPYING"
cp -Rf ../../dhtnet.pc.in "${FOLDER_NAME}/dhtnet.pc.in"
cp -Rf ../../README.md "${FOLDER_NAME}/README.md"
# copy debian conf
cp -Rf "./gnu-linux/debian" "${FOLDER_NAME}/debian"
tar -czf "${PKG_NAME}-${PKG_VERSION}.tar.gz" "${FOLDER_NAME}"
rm -Rf "${FOLDER_NAME}"
echo "Archive ${PKG_NAME}-${PKG_VERSION}.tar.gz is ready, starting builds... (will take few minutes)"
#######################
# build deb package
docker build -t dhtnet-builder:ubuntu24 -f gnu-linux/ubuntu-24.Dockerfile --build-arg PKG_NAME="$FOLDER_NAME" .
docker run --rm -v "$(pwd)/ubuntu-24/":/build/debs -e PKG_NAME="$FOLDER_NAME" dhtnet-builder:ubuntu24
rm -f ubuntu-24/build-at-*
echo "Ubuntu 24.04 package built at $(date)" > "ubuntu-24/build-at-$(date +%F-%R)"
docker build -t dhtnet-builder:ubuntu22 -f gnu-linux/ubuntu-22.Dockerfile --build-arg PKG_NAME="$FOLDER_NAME" .
docker run --rm -v "$(pwd)/ubuntu-22/":/build/debs -e PKG_NAME="$FOLDER_NAME" dhtnet-builder:ubuntu22
rm -f ubuntu-22/build-at-*
echo "Ubuntu 22.04 package built at $(date)" > "ubuntu-22/build-at-$(date +%F-%R)"
DHTNet - Lightweight Peer-to-Peer Communication Library
DHTNet is a C++17 library designed to serve as a network overlay that provides an IP network abstraction. Its main objective is to establish secure peer-to-peer connections using public-key authentication.
Dhtnet allows you to connect with a device simply by knowing its public key and efficiently manages peer discovery and connectivity establishment, including NAT traversal.
Features:
- Connection Management:
DHTNet simplifies the establishment and management of connections to peers, streamlining the communication process.
- Multiplexed Sockets:
It provides multiplexed sockets that allow multiple channels for data transmission, optimizing network resources.
- UPnP Integration:
DHTNet seamlessly integrates with UPnP, enabling automatic port mapping and enhanced network connectivity.
- Server TURN Support:
DHTNet includes support for server TURN, used as a fallback for connections if the NAT block all possible connections.
-- Louis Maillard <louis.maillard@savoirfairelinux.com> Wed, 17 Jul 2024 09:27:39 -0400
dhtnet (0.2.0-1) UNRELEASED; urgency=low
* Initial release.
-- Louis Maillard <louis.maillard@savoirfairelinux.com> Wed, 17 Jul 2024 09:27:39 -0400
Source: dhtnet
Section: net
Priority: optional
Maintainer: Louis Maillard <louis.maillard@savoirfairelinux.com>
Build-Depends: cmake, debhelper-compat (= 12)
Standards-Version: 4.5.0
Homepage: https://git.jami.net/savoirfairelinux/dhtnet
Vcs-Git: https://git.jami.net/savoirfairelinux/dhtnet.git
Package: dhtnet
Architecture: any
Multi-Arch: foreign
Depends: ${misc:Depends}, ${shlibs:Depends}
Conflicts: dsh
Description: DHTNet, a Lightweight Peer-to-Peer Communication Library,
allows you to connect with a device simply by knowing its public key and
efficiently manages peer discovery and connectivity establishment, including NAT traversal.
This diff is collapsed.
dhtnet
# Automatically added by dh_installsystemd/13.6ubuntu1
if [ "$1" = remove ] && [ -d /run/systemd/system ] ; then
systemctl --system daemon-reload >/dev/null || true
fi
# End automatically added section
# Automatically added by dh_installsystemd/13.6ubuntu1
if [ "$1" = "remove" ]; then
if [ -x "/usr/bin/deb-systemd-helper" ]; then
deb-systemd-helper mask 'dnc.service' >/dev/null || true
fi
fi
if [ "$1" = "purge" ]; then
if [ -x "/usr/bin/deb-systemd-helper" ]; then
deb-systemd-helper purge 'dnc.service' >/dev/null || true
deb-systemd-helper unmask 'dnc.service' >/dev/null || true
fi
fi
# End automatically added section
shlibs:Depends=libargon2-1 (>= 0~20171227), libc6 (>= 2.34), libfmt8 (>= 8.1.1+ds1), libgcc-s1 (>= 3.3.1), libgnutls30 (>= 3.7.3), libixml10 (>= 1:1.8.0), libjsoncpp25 (>= 1.9.5), libnatpmp1 (>= 20150609), libnettle8, libreadline8 (>= 6.0), libssl3 (>= 3.0.0~~alpha1), libstdc++6 (>= 12), libupnp13 (>= 1:1.8.3), libyaml-cpp0.7 (>= 0.7.0)
misc:Depends=
misc:Pre-Depends=
dhtnet-dbgsym_0.1.0-1_amd64.ddeb debug optional automatic=yes
dhtnet_0.1.0-1_amd64.buildinfo net optional
dhtnet_0.1.0-1_amd64.deb net optional
#!/bin/sh
set -e
umask 022
create_server_keys() {
mkdir -p /etc/dhtnet/id
if [ ! -f /etc/dhtnet/id/id-server.crt ] && [ ! -f /etc/dhtnet/id/id-server.pem ]; then
echo "Generating server keys..."
dhtnet-crtmgr --setup -o /etc/dhtnet/
dhtnet-crtmgr -g -c /etc/dhtnet/id/id-server.crt -p /etc/dhtnet/id/id-server.pem
disable_dnc_service
fi
}
# reload_dnc_service() {
# status=$(systemctl is-active dnc.service || true)
# if [ "$status" = "failed" ]; then
# echo "dnc.service failed to start, try a restart after keys was created..."
# systemctl restart dnc.service
# fi
# }
disable_dnc_service() {
systemctl stop dnc.service
systemctl disable dnc.service
}
create_server_keys
#!/usr/bin/make -f
export DH_VERBOSE = 1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
# export JAVA_HOME=/usr/lib/jvm/default-java
# export CLASSPATH=/usr/share/java/csv.jar:/usr/share/java/debug-disable.jar:/usr/share/java/itext.jar
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
%:
dh $@
# dh $@ --with javahelper
override_dh_auto_configure:
dh_auto_configure -- \
-DCMAKE_LIBRARY_ARCHITECTURE="$(DEB_TARGET_MULTIARCH)" \
-DBUILD_TESTING=OFF
3.0 (quilt)
#abort-on-upstream-changes
#unapply-patches
version=3
FROM ubuntu:22.04
WORKDIR /build
ARG PKG_NAME
ENV EMAIL="contact@savoirfairelinux.com"
ENV DEBFULLNAME="Savoir-faire Linux"
RUN apt-get update && \
echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections && \
apt-get install -y \
dialog apt-utils make devscripts build-essential debmake lintian \
&& apt-get clean && \
mkdir -p /build/debs
RUN apt-get update && apt-get install -y \
build-essential pkg-config cmake dpkg-dev gcc g++ git wget \
libtool autotools-dev autoconf automake sbuild autopkgtest debhelper debhelper-compat \
cython3 python3-dev python3-setuptools python3-build python3-virtualenv \
libncurses5-dev libreadline-dev nettle-dev libcppunit-dev \
libgnutls28-dev libuv1-dev libjsoncpp-dev libargon2-dev libunistring-dev \
libssl-dev libfmt-dev libasio-dev libmsgpack-dev libyaml-cpp-dev \
systemd \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /var/cache/apt/*
COPY ${PKG_NAME}.tar.gz /build/
CMD tar -xzf ${PKG_NAME}.tar.gz && \
cd ${PKG_NAME} && \
debmake -b "dhtnet:bin" -y && \
debuild && \
cd .. && \
rm -Rf ${PKG_NAME} ${PKG_NAME}.tar.gz && \
cp /build/*.deb /build/debs/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment