-
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: - Dependencies can now be built in static mode even with dynamic library - Remove occurence of INSTALL_DIR path in dhtnet.pc and dnc.service but only when option TRIM_PREFIX_PATH is turned On. Fix and replace previously-reverted review 28703 Replace change id (I2f2161d7c65241a35c4acbcc006ba27bfcc1f176) Change-Id: I5a80317d83791743ba6ee443fae7f89156e8013b
- Loading branch information
1 parent
08fcd48
commit 9edce5f
Showing
8 changed files
with
177 additions
and
7 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
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,77 @@ | ||
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 \ | ||
-DBUILD_DEPS_STATIC=ON \ | ||
-DTRIM_PREFIX_PATH=ON \ | ||
-DDNC_SYSTEMD=ON \ | ||
-DCMAKE_INSTALL_PREFIX=%{buildroot} \ | ||
-DCMAKE_INSTALL_BINDIR=%{buildroot}%{_bindir} \ | ||
-DCMAKE_INSTALL_MANDIR=%{buildroot}%{_mandir} \ | ||
-DCMAKE_INSTALL_DOCDIR=%{buildroot}%{_docdir}/dhtnet \ | ||
-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}/dhtnet/* | ||
%{_libdir}/* | ||
%{_includedir}/dhtnet/* | ||
%{_sysconfdir}/dhtnet/* | ||
/usr/lib/systemd/system/dnc.service | ||
/usr/lib/systemd/system-preset/dhtnet-dnc.preset | ||
|
||
%post | ||
mkdir -p /etc/dhtnet | ||
echo "====================" | ||
echo "dnc server installed." | ||
echo "To configure your dnc client and/or server, run:" | ||
echo " dhtnet-crtmgr --interactive" | ||
echo "Server configuration is in /etc/dhtnet/dnc.yaml" | ||
echo "After configuration, enable and start server with:" | ||
echo " systemctl enable dnc.service" | ||
echo " systemctl start dnc.service" | ||
echo "====================" | ||
|
||
%changelog | ||
%autochangelog |
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/ |