Skip to content

Commit

Permalink
Revert "packaging: Add Fedora 40 and 39 support"
Browse files Browse the repository at this point in the history
This reverts commit eab419d.

Reason for revert: should not have been merged

Change-Id: I4d3f4fea0681debf625be0e8e289baf2a236017e
  • Loading branch information
aberaud authored and Gerrit Code Review committed Oct 10, 2024
1 parent eab419d commit ff273fb
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 232 deletions.
58 changes: 8 additions & 50 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ set (VERSION ${CMAKE_PROJECT_VERSION})

option(DHTNET_PUPNP "Enable UPnP support" ON)
option(DHTNET_NATPMP "Enable NAT-PMP support" ON)
option(DHTNET_LLHTTP "Include llhttp in compilation" OFF)
option(DHTNET_TESTABLE "Enable API for tests" ON)
option(BUILD_TOOLS "Build tools" ON)
option(BUILD_BENCHMARKS "Build benchmarks" ON)
Expand Down Expand Up @@ -162,17 +161,13 @@ if (DNC_SYSTEMD AND BUILD_TOOLS AND NOT MSVC)
systemd/dnc.service
@ONLY
)
file(READ ${CMAKE_CURRENT_BINARY_DIR}/systemd/dnc.service FILE_CONTENTS)
string(REPLACE "${CMAKE_INSTALL_PREFIX}" "" FILE_CONTENTS "${FILE_CONTENTS}")
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/systemd/dnc.service "${FILE_CONTENTS}")

if (SYSTEMD_UNIT_INSTALL_DIR)
string(REGEX REPLACE "[ \t\n]+" "" SYSTEMD_UNIT_INSTALL_DIR "${SYSTEMD_UNIT_INSTALL_DIR}")
set (systemdunitdir "${CMAKE_INSTALL_PREFIX}${SYSTEMD_UNIT_INSTALL_DIR}")
set (systemdunitdir "${SYSTEMD_UNIT_INSTALL_DIR}")
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/systemd/dnc.service DESTINATION ${systemdunitdir})

string(REGEX REPLACE "[ \t\n]+" "" SYSTEMD_PRESET_INSTALL_DIR "${SYSTEMD_PRESET_INSTALL_DIR}")
set (systemdpresetdir "${CMAKE_INSTALL_PREFIX}${SYSTEMD_PRESET_INSTALL_DIR}")
set (systemdpresetdir "${SYSTEMD_PRESET_INSTALL_DIR}")
install (FILES tools/dnc/systemd/dhtnet-dnc.preset DESTINATION ${systemdpresetdir})

install (FILES tools/dnc/dnc.yaml DESTINATION ${sysconfdir}/dhtnet/)
Expand Down Expand Up @@ -288,12 +283,7 @@ target_include_directories(dhtnet PUBLIC
)

target_compile_definitions(dhtnet PRIVATE ${dhtnet_PRIVATE_DEFS})
if (DHTNET_LLHTTP)
target_link_libraries(dhtnet PRIVATE ${dhtnet_PRIVATELIBS} llhttp nettle)
else()
target_link_libraries(dhtnet PRIVATE ${dhtnet_PRIVATELIBS} nettle)
endif()

target_link_libraries(dhtnet PRIVATE ${dhtnet_PRIVATELIBS})
if (MSVC)
target_compile_definitions(dhtnet PRIVATE
_CRT_SECURE_NO_WARNINGS
Expand Down Expand Up @@ -322,9 +312,6 @@ if (BUILD_TESTING AND NOT MSVC)
endif()

configure_file(dhtnet.pc.in dhtnet.pc @ONLY)
file(READ ${CMAKE_CURRENT_BINARY_DIR}/dhtnet.pc FILE_CONTENTS)
string(REPLACE "${CMAKE_INSTALL_PREFIX}" "" FILE_CONTENTS "${FILE_CONTENTS}")
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/dhtnet.pc "${FILE_CONTENTS}")

# Install targets
install(TARGETS dhtnet)
Expand All @@ -337,12 +324,7 @@ if (BUILD_TOOLS AND NOT MSVC)
tools/dnc/dnc.cpp
tools/common.cpp
tools/dhtnet_crtmgr/dhtnet_crtmgr.cpp)
if (DHTNET_LLHTTP)
target_link_libraries(dnc PRIVATE dhtnet fmt::fmt yaml-cpp llhttp nettle)
else()
target_link_libraries(dnc PRIVATE dhtnet fmt::fmt yaml-cpp nettle)
endif()

target_link_libraries(dnc PRIVATE dhtnet fmt::fmt yaml-cpp)
target_include_directories(dnc PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tools)
install(TARGETS dnc RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})

Expand All @@ -351,13 +333,7 @@ if (BUILD_TOOLS AND NOT MSVC)
tools/dsh/dsh.cpp
tools/common.cpp
tools/dhtnet_crtmgr/dhtnet_crtmgr.cpp)

if (DHTNET_LLHTTP)
target_link_libraries(dsh PRIVATE dhtnet fmt::fmt yaml-cpp llhttp nettle)
else()
target_link_libraries(dsh PRIVATE dhtnet fmt::fmt yaml-cpp nettle)
endif()

target_link_libraries(dsh PRIVATE dhtnet fmt::fmt yaml-cpp)
target_include_directories(dsh PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tools)
install(TARGETS dsh RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})

Expand All @@ -368,13 +344,7 @@ if (BUILD_TOOLS AND NOT MSVC)
tools/dvpn/dvpn.cpp
tools/common.cpp
tools/dhtnet_crtmgr/dhtnet_crtmgr.cpp)

if (DHTNET_LLHTTP)
target_link_libraries(dvpn PRIVATE dhtnet fmt::fmt yaml-cpp llhttp nettle)
else()
target_link_libraries(dvpn PRIVATE dhtnet fmt::fmt yaml-cpp nettle)
endif()

target_link_libraries(dvpn PRIVATE dhtnet fmt::fmt yaml-cpp)
target_include_directories(dvpn PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tools)
install(TARGETS dvpn RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
Expand All @@ -394,25 +364,13 @@ if (BUILD_TOOLS AND NOT MSVC)
add_executable(dhtnet-crtmgr
tools/dhtnet_crtmgr/main.cpp
tools/dhtnet_crtmgr/dhtnet_crtmgr.cpp)

if (DHTNET_LLHTTP)
target_link_libraries(dhtnet-crtmgr PRIVATE dhtnet fmt::fmt yaml-cpp llhttp nettle)
else()
target_link_libraries(dhtnet-crtmgr PRIVATE dhtnet fmt::fmt yaml-cpp nettle)
endif()

target_link_libraries(dhtnet-crtmgr PRIVATE dhtnet fmt::fmt)
target_include_directories(dhtnet-crtmgr PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tools)
install(TARGETS dhtnet-crtmgr RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})

add_executable(peerDiscovery
tools/peerdiscovery/peerDiscovery.cpp)

if (DHTNET_LLHTTP)
target_link_libraries(peerDiscovery PRIVATE dhtnet fmt::fmt readline llhttp nettle)
else()
target_link_libraries(peerDiscovery PRIVATE dhtnet fmt::fmt readline nettle)
endif()

target_link_libraries(peerDiscovery PRIVATE dhtnet fmt::fmt readline)
target_include_directories(peerDiscovery PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tools/peerdiscovery)
install(TARGETS peerDiscovery RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})

Expand Down
7 changes: 4 additions & 3 deletions extras/packaging/.gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
gnu-linux/debian/dhtnet
gnu-linux/debian/.debhelper

**/*.deb
**/*.rpm
**/build-at-*
ubuntu-*/*.deb
ubuntu-*/build-at-*
**/build.log
debian-*/*.deb
debian-*/build-at-*
*dhtnet-*.tar.gz
36 changes: 2 additions & 34 deletions extras/packaging/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ pipeline {
cp -Rf "./gnu-linux/debian" "$FOLDER_NAME/debian"
tar -czf "deb-${FOLDER_NAME}.tar.gz" "$FOLDER_NAME"
rm -Rf "$FOLDER_NAME/debian"
# create fedora archive
tar -czf "rpm-${FOLDER_NAME}.tar.gz" "$FOLDER_NAME"
"""
}
}
Expand Down Expand Up @@ -130,43 +127,14 @@ pipeline {
}
}
}
stage('Fedora 39') {
steps {
dir('extras/packaging') {
sh """
target="fedora-39"
mkdir -p "\$target"
docker build -t "dhtnet-builder:\$target" -f "gnu-linux/\$target.Dockerfile" --build-arg PKG_NAME="$FOLDER_NAME" .
docker run --rm \
-v "\$(pwd)/\$target/":/build/artifacts \
-e PKG_NAME="$FOLDER_NAME" "dhtnet-builder:\$target"
"""
}
}
}
stage('Fedora 40') {
steps {
dir('extras/packaging') {
sh """
target="fedora-40"
mkdir -p "\$target"
docker build -t "dhtnet-builder:\$target" -f "gnu-linux/\$target.Dockerfile" --build-arg PKG_NAME="$FOLDER_NAME" .
docker run --rm \
-v "\$(pwd)/\$target/":/build/artifacts \
-e PKG_NAME="$FOLDER_NAME" "dhtnet-builder:\$target"
"""
}
}
}
}
}
}
post {
success {
dir('extras/packaging') {
archiveArtifacts artifacts: 'ubuntu-*/dhtnet_*.deb, debian-*/dhtnet_*.deb, fedora-*/dhtnet-*.rpm',
caseSensitive: false,
excludes: '**/*debug*'
archiveArtifacts artifacts: 'ubuntu-*/dhtnet_*.deb, debian-*/dhtnet_*.deb',
caseSensitive: false
}
}
}
Expand Down
33 changes: 0 additions & 33 deletions extras/packaging/build_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ build_debian=false
build_debian10=false
build_debian11=false
build_debian12=false
build_fedora=false
build_fedora39=false
build_fedora40=false

parse_args() {
while [ "$1" != "" ]; do
Expand Down Expand Up @@ -62,16 +59,6 @@ parse_args() {
-d12 | --debian12 ) build_debian12=true
build_debian=true
;;
-f | --fedora ) build_fedora=true
build_fedora39=true
build_fedora40=true
;;
-f40 | --fedora40 ) build_fedora40=true
build_fedora=true
;;
-f39 | --fedora39 ) build_fedora39=true
build_fedora=true
;;
-a | --all ) build_ubuntu=true
# not working: build_ubuntu20=true
build_ubuntu22=true
Expand All @@ -80,9 +67,6 @@ parse_args() {
# not working: build_debian10=true
# not working: build_debian11=true
build_debian12=true
build_fedora=true
build_fedora39=true
build_fedora40=true
;;
* ) echo "Argument '$1' is not recognized"
;;
Expand Down Expand Up @@ -112,14 +96,6 @@ if [ "$build_ubuntu" == true ] || [ "$build_debian" == true ]; then
rm -Rf "${FOLDER_NAME}/debian"
fi

if [ "$build_fedora" == true ]; then
# copy fedora conf
#cp -Rf "./gnu-linux/fedora" "${FOLDER_NAME}/fedora"

tar -czf "rpm-${PKG_NAME}-${PKG_VERSION}.tar.gz" "${FOLDER_NAME}"
#rm -Rf "${FOLDER_NAME}/fedora"
fi

rm -Rf "${FOLDER_NAME}"
echo "Archives <os>-${PKG_NAME}-${PKG_VERSION}.tar.gz are ready, starting builds... (will take few minutes)"

Expand Down Expand Up @@ -176,15 +152,6 @@ if [ "$build_debian10" == true ]; then
build_target "debian-10"
fi

# build Fedora package (rpm-*)
if [ "$build_fedora40" == true ]; then
build_target "fedora-40"
fi

if [ "$build_fedora39" == true ]; then
build_target "fedora-39"
fi


while [ $remainning_builds -gt 0 ]; do
time="$(date +%T)"
Expand Down
24 changes: 0 additions & 24 deletions extras/packaging/gnu-linux/fedora-39.Dockerfile

This file was deleted.

24 changes: 0 additions & 24 deletions extras/packaging/gnu-linux/fedora-40.Dockerfile

This file was deleted.

64 changes: 0 additions & 64 deletions extras/packaging/gnu-linux/fedora/dhtnet.spec

This file was deleted.

0 comments on commit ff273fb

Please sign in to comment.