From 386cf93eb12fcb50fc9496710aca4e9f9fa603b2 Mon Sep 17 00:00:00 2001 From: Jared Szechy Date: Thu, 28 Jun 2018 23:03:12 -0400 Subject: [PATCH] Add debian packaging --- CMakeLists.txt | 18 ++++++- debian/changelog | 7 +++ debian/compat | 1 + debian/control | 20 ++++++++ debian/copyright | 106 ++++++++++++++++++++++++++++++++++++++++++ debian/dsd.install | 2 + debian/rules | 9 ++++ debian/source/format | 1 + debian/source/options | 2 + src/dsd_main.c | 9 ++-- test/CMakeLists.txt | 7 +-- 11 files changed, 172 insertions(+), 10 deletions(-) create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/dsd.install create mode 100755 debian/rules create mode 100644 debian/source/format create mode 100644 debian/source/options diff --git a/CMakeLists.txt b/CMakeLists.txt index 2fa8fa8..1486a87 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,22 @@ endif(PORTAUDIO_FOUND) ADD_EXECUTABLE(dsd ${SRCS} ${HEADERS}) TARGET_LINK_LIBRARIES(dsd ${LIBS}) -install(TARGETS dsd DESTINATION bin) +include(GNUInstallDirs) +install(TARGETS dsd DESTINATION ${CMAKE_INSTALL_BINDIR}) + +# man page +find_program(HELP2MAN_FOUND help2man) +if (HELP2MAN_FOUND) + add_custom_command(TARGET dsd POST_BUILD + COMMAND help2man + ARGS -n "Digital Speech Decoder" + --version-string=${GIT_TAG} + -o ${CMAKE_CURRENT_BINARY_DIR}/dsd.1 + --no-info + $ + ) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/dsd.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) +endif() # uninstall target configure_file( @@ -49,5 +64,6 @@ add_custom_target(uninstall option(DISABLE_TEST "Disable building of test framework." OFF) if (NOT DISABLE_TEST) + enable_testing() add_subdirectory(test) endif() diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..ca1b0ba --- /dev/null +++ b/debian/changelog @@ -0,0 +1,7 @@ +dsd (1.7.0~1) bionic; urgency=medium + + ** SNAPSHOT build ** + + * Initial upload! + + -- Jared Szechy Thu, 28 Jun 2018 23:00:00 -0400 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..f11c82a --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 \ No newline at end of file diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..58239bc --- /dev/null +++ b/debian/control @@ -0,0 +1,20 @@ +Source: dsd +Section: hamradio +Priority: optional +Maintainer: Jared Szechy +Build-Depends: debhelper (>= 9), libmbe-dev, libitpp-dev, libsndfile1-dev, + portaudio19-dev, cmake, git, help2man +Standards-Version: 4.1.4 +Homepage: https://github.com/szechyjs/dsd +Vcs-Git: https://github.com/szechyjs/dsd.git +Vcs-Browser: https://github.com/szechyjs/dsd + +Package: dsd +Section: hamradio +Architecture: any +Multi-Arch: foreign +Pre-Depends: ${misc:Pre-Depends} +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Digital Speech Decoder + DSD is able to decode several digital voice formats from discriminator tap + audio and synthesize the decoded speech. \ No newline at end of file diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..898cf45 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,106 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: DSD +Upstream-Contact: Jared Szechy +Source: https://github.com/szechyjs/dsd + +Files: * +Copyright: Copyright (C) 2010 DSD Author +License: ISC + +Files: debian/* cmake/* CMakeLists.txt +Copyright: Copyright (C) 2018 Jared Szechy, K8JSS +License: ISC + +Files: cmake/git_revision.cmake* +Copyright: 2009-2010 Ryan Pavlik + Iowa State University 2009-2010 +License: BSL-1.0 + +Files: src/dstar_header.c include/dstar_header.h include/fcs.h +Copyright: Copyright (C) 2010 by Kristoff Bonne, ON1ARF +License: GPL-2 + +Files: include/descramble.h +Copyright: Copyright (C) 2011 by Jonathan Naylor, G4KLX +License: GPL-2 + +Files: test/gtest/* test/gmock/* +Copyright: Copyright 2008, Google Inc. +License: BSD-3-Clause + +License: GPL-2 + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + On Debian systems, the complete text of the GNU General + Public License can be found in `/usr/share/common-licenses/GPL-2'. + +License: ISC + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + . + THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + +License: BSD-3-Clause + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + . + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + . + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + . + * Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +License: BSL-1.0 + Boost Software License - Version 1.0 - August 17th, 2003 + . + Permission is hereby granted, free of charge, to any person or organization + obtaining a copy of the software and accompanying documentation covered by + this license (the "Software") to use, reproduce, display, distribute, + execute, and transmit the Software, and to prepare derivative works of the + Software, and to permit third-parties to whom the Software is furnished to + do so, all subject to the following: + . + The copyright notices in the Software and this entire statement, including + the above license grant, this restriction and the following disclaimer, + must be included in all copies of the Software, in whole or in part, and + all derivative works of the Software, unless such copies or derivative + works are solely in the form of machine-executable object code generated by + a source language processor. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT + SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE + FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/debian/dsd.install b/debian/dsd.install new file mode 100644 index 0000000..4cdb914 --- /dev/null +++ b/debian/dsd.install @@ -0,0 +1,2 @@ +usr/bin/* +usr/share/man/man1/* \ No newline at end of file diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..39930d8 --- /dev/null +++ b/debian/rules @@ -0,0 +1,9 @@ +#!/usr/bin/make -f + +%: + dh $@ + +# debhelper defaults to running make install DESTDIR=debian/$(PACKAGE) +# when the source package builds only one binary package. +override_dh_auto_install: + dh_auto_install --destdir=$(CURDIR)/debian/tmp \ No newline at end of file diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..9f67427 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) \ No newline at end of file diff --git a/debian/source/options b/debian/source/options new file mode 100644 index 0000000..e6b8df4 --- /dev/null +++ b/debian/source/options @@ -0,0 +1,2 @@ +tar-ignore = samples +tar-ignore = build \ No newline at end of file diff --git a/src/dsd_main.c b/src/dsd_main.c index e353dd8..4069ce0 100644 --- a/src/dsd_main.c +++ b/src/dsd_main.c @@ -249,10 +249,9 @@ void usage () { printf ("\n"); - printf ("Usage:\n"); - printf (" dsd [options] Live scanner mode\n"); - printf (" dsd [options] -r Read/Play saved mbe data from file(s)\n"); - printf (" dsd -h Show help\n"); + printf ("Usage: dsd [options] Live scanner mode\n"); + printf (" or: dsd [options] -r Read/Play saved mbe data from file(s)\n"); + printf (" or: dsd -h Show help\n"); printf ("\n"); printf ("Display Options:\n"); printf (" -e Show Frame Info and errorbars (default)\n"); @@ -308,6 +307,8 @@ usage () printf (" (default=36)\n"); printf (" -M Min/Max buffer size for QPSK decision point tracking\n"); printf (" (default=15)\n"); + printf ("\n"); + printf ("Report bugs to: https://github.com/szechyjs/dsd/issues\n"); exit (0); } diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index e7f4c10..dc734d5 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -10,10 +10,7 @@ include_directories( ${PROJECT_SOURCE_DIR}/gmock/include ) -add_custom_target(test - DEPENDS dsdtest - COMMAND dsdtest -) - ADD_EXECUTABLE(dsdtest ${SRCS}) TARGET_LINK_LIBRARIES(dsdtest gmock gtest) + +add_test(gtest dsdtest)