From 301c580b56b6a5682db9b2882f2d3d3e168608bb Mon Sep 17 00:00:00 2001 From: Davide Gerhard Date: Wed, 22 May 2019 17:16:06 +0200 Subject: [PATCH] move to debhelper tool to create debian package --- .travis.yml | 12 +++++-- CMakeLists.txt | 6 +++- cmake/cpack/CMakeLists.txt | 7 +++- cmake/travis-ci/build_sdrangel.sh | 29 ++++++++++------- debian/changelog | 1 + debian/compat | 1 + debian/control | 53 +++++++++++++++++++++++++++++++ debian/copyright | 11 +++++++ debian/rules | 13 ++++++++ debian/source/format | 1 + 10 files changed, 117 insertions(+), 17 deletions(-) create mode 120000 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/rules create mode 100644 debian/source/format diff --git a/.travis.yml b/.travis.yml index 032b48050..b825de30b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,9 +22,15 @@ language: cpp addons: apt: update: true - # not needed: build-essential cmake git - # need per distro + # TODO need packages per distro packages: + # needed by debuild + - build-essential + - cmake + - git + - devscripts + - fakeroot + - debhelper - libfftw3-dev - qtbase5-dev - libqt5opengl5-dev @@ -80,4 +86,4 @@ deploy: repo: sdrangel-travis-ci project_name: SDRangel email: rainbow@irh.it - name: rainbow \ No newline at end of file + name: rainbow diff --git a/CMakeLists.txt b/CMakeLists.txt index 6547f6c83..43a30a05d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,7 +92,8 @@ set(CPACK_SOURCE_GENERATOR "ZIP;TGZ") # if we don't set build_type if(NOT DEFINED CMAKE_BUILD_TYPE OR "${CMAKE_BUILD_TYPE}" STREQUAL "" OR - "${CMAKE_BUILD_TYPE}" STREQUAL "MacPorts") + "${CMAKE_BUILD_TYPE}" STREQUAL "MacPorts" OR + "${CMAKE_BUILD_TYPE}" STREQUAL "None") set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE) endif() message(STATUS "Build type set to: ${CMAKE_BUILD_TYPE}") @@ -403,6 +404,9 @@ endif() # TODO maybe install readme for every plugins if (LINUX OR APPLE) install(FILES ${CMAKE_SOURCE_DIR}/Readme.md DESTINATION ${INSTALL_DOC_DIR}) +endif() + +if(APPLE) install(FILES ${CMAKE_SOURCE_DIR}/CHANGELOG DESTINATION ${INSTALL_DOC_DIR}) install(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION ${INSTALL_DOC_DIR}) endif() diff --git a/cmake/cpack/CMakeLists.txt b/cmake/cpack/CMakeLists.txt index 6de9935b1..f320170b1 100644 --- a/cmake/cpack/CMakeLists.txt +++ b/cmake/cpack/CMakeLists.txt @@ -107,8 +107,11 @@ Plugins = ../PlugIns # TODO: code/dmg signature # see https://github.com/cjcliffe/CubicSDR +# NOTE: only as reference; remove in future elseif(LINUX AND BUNDLE) + # NOTE: moved to debhelper tool (debian/ folder) + # useful for the moment to maintain dependencies list per distro find_program (DPKG_BUILDER dpkg-buildpackage DOC "Debian package builder") if (DPKG_BUILDER) # @@ -151,11 +154,13 @@ elseif(LINUX AND BUNDLE) endif() # needed before cmake 2.8.3 - # maybe we can move back to debian/ set(CPACK_SET_DESTDIR true) endif (DPKG_BUILDER) + # NOTE: moved to distro tool + # for fedora see https://docs.fedoraproject.org/en-US/quick-docs/creating-rpm-packages/ + # https://docs.fedoraproject.org/en-US/packaging-guidelines/CMake/ find_program (RPMBUILDER rpmbuild DOC "RPM package builder") if (RPMBUILDER) list(APPEND CPACK_GENERATOR "RPM") diff --git a/cmake/travis-ci/build_sdrangel.sh b/cmake/travis-ci/build_sdrangel.sh index 2e2873442..aa7a9b630 100644 --- a/cmake/travis-ci/build_sdrangel.sh +++ b/cmake/travis-ci/build_sdrangel.sh @@ -1,21 +1,26 @@ #!/bin/sh -if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then +if [ "${TRAVIS_OS_NAME}" == "osx" ]; then JOBS=$(sysctl -n hw.ncpu) -elif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then +elif [ "${TRAVIS_OS_NAME}" == "linux" ]; then JOBS=$(nproc --all) else JOBS=1 fi -mkdir build && cd build -cmake .. "${CMAKE_CUSTOM_OPTIONS}" -case "${CMAKE_CUSTOM_OPTIONS}" in - *BUNDLE=ON*) - make -j${JOBS} package - ;; - *) - make -j${JOBS} - ;; -esac +if [ "${TRAVIS_OS_NAME}" == "linux" ]; then + debuild -i -us -uc -b +else + mkdir build && cd build + cmake .. "${CMAKE_CUSTOM_OPTIONS}" + + case "${CMAKE_CUSTOM_OPTIONS}" in + *BUNDLE=ON*) + make -j${JOBS} package + ;; + *) + make -j${JOBS} + ;; + esac +fi diff --git a/debian/changelog b/debian/changelog new file mode 120000 index 000000000..a53599471 --- /dev/null +++ b/debian/changelog @@ -0,0 +1 @@ +../CHANGELOG \ No newline at end of file diff --git a/debian/compat b/debian/compat new file mode 100644 index 000000000..9a037142a --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +10 \ No newline at end of file diff --git a/debian/control b/debian/control new file mode 100644 index 000000000..d54d7c384 --- /dev/null +++ b/debian/control @@ -0,0 +1,53 @@ +Source: sdrangel +Maintainer: Edouard Griffiths, F4EXB +Section: hamradio +Priority: optional +Standards-Version: 3.9.2 +Homepage: https://github.com/f4exb/sdrangel +Build-Depends: debhelper (>= 9), + libfftw3-dev, + qtbase5-dev, + libqt5opengl5-dev, + qttools5-dev, + qttools5-dev-tools, + qtmultimedia5-dev, + libqt5multimedia5-plugins, + libusb-1.0-0-dev, + libboost-all-dev, + librtlsdr-dev, + libasound2-dev, + libopencv-dev, + libopencv-dev, + libsqlite3-dev, + libxml2-dev, + bison, + flex, + ffmpeg, + libavcodec-dev, + libavformat-dev, + libopus-dev, + libcodec2-dev, + libairspy-dev, + libhackrf-dev, + librtlsdr-dev +# TODO: +# - more dependencies based on version; newer has more devices +# - manage dependencies not present upstream + +Package: sdrangel +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: SDR/Analyzer/Generator front-end for various hardware + SDR/Analyzer/Generator front-end for Airspy, BladeRF, HackRF, + RTL-SDR, FunCube, LimeSDR, PlutoSDR. + Also File source and sink for I/Q samples, network I/Q sources with + remote instance. + Based on Qt5 framework and OpenGL for the spectrum and scope rendering. + Builds on Linux, Windows and Mac O/S + Reception modes supported: + Analog: AM, ATV, NFM, WFM, SSB, broadcast FM + Digital: D-Star, Yaesu SF, DMR, dPMR, LoRa + Analyzer: Generic channel + Transmission modes supported: + Analog: AM, ATV, NFM, SSB, WFM +Homepage: https://github.com/f4exb/sdrangel diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 000000000..77ffd4b3e --- /dev/null +++ b/debian/copyright @@ -0,0 +1,11 @@ +# probably need to be expanded + +Files: * +Copyright: 2012 maintech GmbH +License: GPL-3.0 + +Copyright: 2013 Dimitri Stolnikov +License: GPL-3.0 + +Copyright: 2015-2019 Edouard Griffiths F4EXB +License: GPL-3.0 diff --git a/debian/rules b/debian/rules new file mode 100644 index 000000000..6b878de2c --- /dev/null +++ b/debian/rules @@ -0,0 +1,13 @@ +#!/usr/bin/make -f +%: + dh $@ --parallel + +# FORCE_SSE41 will be not accepted upstream +override_dh_auto_configure: + dh_auto_configure -- -DFORCE_SSE41=ON + +# permit the packaging with /usr/local/lib libraries (from `make install`) +# you can also use `export DEB_DH_SHLIBDEPS_ARGS_ALL=--dpkg-shlibdeps-params=--ignore-missing-info` +# not a good idea! +override_dh_shlibdeps: + dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 000000000..46ebe0266 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) \ No newline at end of file