-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
packaging: Add Fedora 40 and 39 support
Add dhtnet.spec for RPM build and fedora-40,39 dockerfile for env build. Fix and changes was required in Cmake instruction in order to build: - Add `llhttp` and `neddle` library linking when building tools - `llhttp` liking is disabled by default for debian, enabled for fedora - Remove occurence of INSTALL_DIR path in dhtnet.pc and dnc.service Change-Id: I2f2161d7c65241a35c4acbcc006ba27bfcc1f176
- Loading branch information
1 parent
f6b2962
commit eab419d
Showing
7 changed files
with
232 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
gnu-linux/debian/dhtnet | ||
gnu-linux/debian/.debhelper | ||
|
||
ubuntu-*/*.deb | ||
ubuntu-*/build-at-* | ||
**/*.deb | ||
**/*.rpm | ||
**/build-at-* | ||
**/build.log | ||
debian-*/*.deb | ||
debian-*/build-at-* | ||
*dhtnet-*.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM fedora:39 | ||
|
||
WORKDIR /build | ||
|
||
RUN mkdir -p /build/artifacts && \ | ||
dnf install -y fedora-packager fedora-review git gcc g++ make cmake wget \ | ||
pkg-config dpkg-dev libtool autoconf automake systemd \ | ||
python3-devel python3-setuptools python3-build python3-virtualenv \ | ||
ncurses-devel readline-devel nettle-devel cppunit-devel \ | ||
gnutls-devel libuv-devel jsoncpp-devel libargon2-devel libunistring-devel \ | ||
openssl-devel fmt-devel asio-devel msgpack-devel yaml-cpp-devel \ | ||
http-parser-devel zlib-devel llhttp-devel \ | ||
libupnp-devel libnatpmp-devel | ||
|
||
COPY gnu-linux/fedora /build/fedora | ||
|
||
ARG PKG_NAME | ||
COPY rpm-${PKG_NAME}.tar.gz /build/fedora/${PKG_NAME}.tar.gz | ||
|
||
CMD cd /build/fedora && \ | ||
fedpkg --release f39 local && \ | ||
(fedpkg --release f39 lint || true) && \ | ||
cp /build/fedora/*.rpm /build/artifacts/ && \ | ||
cp /build/fedora/$(uname -m)/*.rpm /build/artifacts/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM fedora:40 | ||
|
||
WORKDIR /build | ||
|
||
RUN mkdir -p /build/artifacts && \ | ||
dnf install -y fedora-packager fedora-review git gcc g++ make cmake wget \ | ||
pkg-config dpkg-dev libtool autoconf automake systemd \ | ||
python3-devel python3-setuptools python3-build python3-virtualenv \ | ||
ncurses-devel readline-devel nettle-devel cppunit-devel \ | ||
gnutls-devel libuv-devel jsoncpp-devel libargon2-devel libunistring-devel \ | ||
openssl-devel fmt-devel asio-devel msgpack-devel yaml-cpp-devel \ | ||
http-parser-devel zlib-devel llhttp-devel \ | ||
libupnp-devel libnatpmp-devel | ||
|
||
COPY gnu-linux/fedora /build/fedora | ||
|
||
ARG PKG_NAME | ||
COPY rpm-${PKG_NAME}.tar.gz /build/fedora/${PKG_NAME}.tar.gz | ||
|
||
CMD cd /build/fedora && \ | ||
fedpkg --release f40 local && \ | ||
(fedpkg --release f40 lint || true) && \ | ||
cp /build/fedora/*.rpm /build/artifacts/ && \ | ||
cp /build/fedora/$(uname -m)/*.rpm /build/artifacts/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
Name: dhtnet | ||
Version: 0.3.0 | ||
Release: %autorelease | ||
Summary: DHTNet, a Lightweight Peer-to-Peer Communication Library | ||
License: GPL-2.0+ AND BSL-1.0 AND GPL-3.0+ AND BSD-3-Clause AND Apache-2.0 AND Expat AND LGPL-2.0+ | ||
URL: https://git.jami.net/savoirfairelinux/dhtnet | ||
Source: ./dhtnet-%{version}.tar.gz | ||
BuildRequires: gcc | ||
BuildRequires: g++ | ||
BuildRequires: make | ||
BuildRequires: cmake | ||
%global __requires_exclude pkgconfig\\((libpjproject|opendht)\\) | ||
|
||
%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. | ||
|
||
%prep | ||
%autosetup | ||
|
||
%build | ||
mkdir build | ||
cd build | ||
cmake .. -DBUILD_TESTING=OFF \ | ||
-DBUILD_BENCHMARKS=OFF \ | ||
-DBUILD_SHARED_LIBS=ON \ | ||
-DDHTNET_LLHTTP=ON \ | ||
-DDNC_SYSTEMD=ON \ | ||
-DCMAKE_INSTALL_PREFIX=%{buildroot} \ | ||
-DCMAKE_INSTALL_BINDIR=%{buildroot}%{_bindir} \ | ||
-DCMAKE_INSTALL_MANDIR=%{buildroot}%{_mandir} \ | ||
-DCMAKE_INSTALL_DOCDIR=%{buildroot}%{_docdir} \ | ||
-DCMAKE_INSTALL_LIBDIR=%{buildroot}%{_libdir} \ | ||
-DCMAKE_INSTALL_INCLUDEDIR=%{buildroot}%{_includedir} \ | ||
-DCMAKE_INSTALL_SYSCONFDIR=%{buildroot}%{_sysconfdir} \ | ||
-DDNC_SYSTEMD_UNIT_FILE_LOCATION=%{buildroot}/usr/lib/systemd/system \ | ||
-DDNC_SYSTEMD_PRESET_FILE_LOCATION=%{buildroot}/usr/lib/systemd/system-preset | ||
|
||
%install | ||
cd build | ||
make -j | ||
sudo make install | ||
|
||
%files | ||
%{_bindir}/dnc | ||
%{_bindir}/dvpn | ||
%{_bindir}/dsh | ||
%{_bindir}/peerDiscovery | ||
%{_bindir}/upnpctrl | ||
%{_bindir}/dhtnet-crtmgr | ||
%{_mandir}/man1/dnc.1.* | ||
%{_mandir}/man1/dsh.1.* | ||
%{_mandir}/man1/dvpn.1.* | ||
%{_mandir}/man1/dhtnet-crtmgr.1.* | ||
%{_docdir}/* | ||
%{_libdir}/* | ||
%{_includedir}/dhtnet/* | ||
%{_sysconfdir}/dhtnet/* | ||
/usr/lib/systemd/system/dnc.service | ||
/usr/lib/systemd/system-preset/dhtnet-dnc.preset | ||
|
||
%changelog | ||
%autochangelog |