From b8b70dcad547c941ce77cede5e98f8c96e4e32c5 Mon Sep 17 00:00:00 2001 From: Fancy Zhang Date: Sun, 5 Jul 2020 17:41:41 +0800 Subject: [PATCH] build deb and rpm static prefered --- pack/CMakeLists.txt | 4 ++-- readme.md | 32 ++++++++++++++++++++------------ 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/pack/CMakeLists.txt b/pack/CMakeLists.txt index cce547e..b59297a 100644 --- a/pack/CMakeLists.txt +++ b/pack/CMakeLists.txt @@ -6,7 +6,7 @@ set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "cgproxy will transparent proxy anything r ## deb pack set(CPACK_DEBIAN_PACKAGE_NAME "cgproxy") set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64") -set(CPACK_DEBIAN_PACKAGE_DEPENDS "systemd, libbpf0") +set(CPACK_DEBIAN_PACKAGE_DEPENDS "systemd") set(CPACK_DEBIAN_PACKAGE_SECTION "network") set(CPACK_DEBIAN_PACKAGE_PRIORITY "Optional") set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/springzfx/cgproxy") @@ -15,7 +15,7 @@ set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/postinst;${C ## rpm pack set(CPACK_RPM_PACKAGE_ARCHITECTURE, "x86_64") -set(CPACK_RPM_PACKAGE_REQUIRES "systemd, libbpf") +set(CPACK_RPM_PACKAGE_REQUIRES "systemd") set(CPACK_RPM_PACKAGE_GROUP "network") set(CPACK_RPM_PACKAGE_URL "https://github.com/springzfx/cgproxy") set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/postinst") diff --git a/readme.md b/readme.md index 3ec5da6..705029e 100644 --- a/readme.md +++ b/readme.md @@ -53,25 +53,33 @@ Main feature: ubuntu 16.04, debian 9, fedora 27 and later are desired -## How to install +## How to build and install -### main depency +### distro install -| os | build depency | runtime depency | download | -| --------- | ------------------------------------------------------------ | ----------------------------------------------------- | ------------------------------------------------------------ | -| Archlinux | clang, nlohmann-json, libbpf | libbpf | [archlinux AUR](https://aur.archlinux.org/packages/?K=cgproxy) | -| Ubuntu | clang, nlohmann-json, [libbpf-dev](https://packages.ubuntu.com/groovy/libbpf-dev) | [libbpf0](https://packages.ubuntu.com/groovy/libbpf0) | [Release page](https://github.com/springzfx/cgproxy/releases) | -| Fedora | clang, nlohmann-json,[libbpf](https://src.fedoraproject.org/rpms/libbpf) | [libbpf](https://src.fedoraproject.org/rpms/libbpf) | [Release page](https://github.com/springzfx/cgproxy/releases) | +- For debian and redhat series, download from [Release page](https://github.com/springzfx/cgproxy/releases) -tested in arch and ubuntu 20.04. +- For archlinux series, see[archlinux AUR](https://aur.archlinux.org/packages/?K=cgproxy) + +- Already tested on Archlinux, fedora 32, ubuntu 20.04, deepin v20 beta ### build +- before build, install depencies: clang, nlohmann-json, libbpf +- then cmake standard build + ```bash -# -mkdir build && cd build -# cmake -cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr .. && make install +# ready build dir +mkdir build +cd build +# generate +cmake -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -Dbuild_execsnoop_dl=ON \ + -Dbuild_static=OFF \ + .. +# compile +make ``` ## Default usage