diff --git a/CMakeLists.txt b/CMakeLists.txt index 5bef6fd..85b7928 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,6 +82,18 @@ set(CUSTOM_TEST_DIR "${CMAKE_SOURCE_DIR}/test") set(CUSTOM_TEST_SCRIPTS_DIR "${CUSTOM_TEST_DIR}/scripts") set(CUSTOM_SHELL_SHABANG "#!/bin/sh -e") +# cpack variables +set(CPACK_GENERATOR "ZIP") +set(CPACK_STRIP_FILES true) +set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}") +set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${direwolf_VERSION}_${CMAKE_SYSTEM_PROCESSOR}") +set(CPACK_PACKAGE_CONTACT "https://github.com/wb2osz/direwolf") +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Dire Wolf is a software soundcard AX.25 packet modem/TNC and APRS encoder/decoder") +set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md") +set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md") +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE") +set(CPACK_SOURCE_IGNORE_FILES "${PROJECT_BINARY_DIR};/.git/;.gitignore;menu.yml;.travis.yml;.appveyor.yml;default.nix;.envrc;TODOs.org;/.scripts/") + # if we don't set build_type if(NOT DEFINED CMAKE_BUILD_TYPE OR "${CMAKE_BUILD_TYPE}" STREQUAL "") set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE) @@ -152,6 +164,23 @@ elseif (C_GCC) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmax-errors=1") endif() +# set installation directories +if (WIN32 OR CYGWIN) + set(INSTALL_BIN_DIR ".") + set(INSTALL_DOC_DIR "doc") + set(INSTALL_CONF_DIR ".") + set(INSTALL_SCRIPTS_DIR "scripts") + set(INSTALL_MAN_DIR "man") + set(INSTALL_DATA_DIR "data") +else() + set(INSTALL_BIN_DIR "bin") + set(INSTALL_DOC_DIR "share/doc/${CMAKE_PROJECT_NAME}") + set(INSTALL_CONF_DIR "${INSTALL_DOC_DIR}/conf") + set(INSTALL_SCRIPTS_DIR "${INSTALL_DOC_DIR}/scripts") + set(INSTALL_MAN_DIR "share/man/man1") + set(INSTALL_DATA_DIR "share/${PROJECT_NAME}") +endif(WIN32 OR CYGWIN) + # requirements set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) @@ -224,9 +253,9 @@ add_subdirectory(scripts) add_subdirectory(conf) # install basic docs -install(FILES ${CMAKE_SOURCE_DIR}/CHANGES.md DESTINATION share/doc/${CMAKE_PROJECT_NAME}) -install(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION share/doc/${CMAKE_PROJECT_NAME}) -install(FILES ${CMAKE_SOURCE_DIR}/external/LICENSE DESTINATION share/doc/${CMAKE_PROJECT_NAME}/external) +install(FILES ${CMAKE_SOURCE_DIR}/CHANGES.md DESTINATION ${INSTALL_DOC_DIR}) +install(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION ${INSTALL_DOC_DIR}) +install(FILES ${CMAKE_SOURCE_DIR}/external/LICENSE DESTINATION ${INSTALL_DOC_DIR}/external) add_subdirectory(doc) add_subdirectory(man) diff --git a/cmake/cpack/CMakeLists.txt b/cmake/cpack/CMakeLists.txt index ffc1ede..845c377 100644 --- a/cmake/cpack/CMakeLists.txt +++ b/cmake/cpack/CMakeLists.txt @@ -1 +1 @@ -# empty for the moment +include(CPack) diff --git a/conf/CMakeLists.txt b/conf/CMakeLists.txt index 2b34109..d4a229d 100644 --- a/conf/CMakeLists.txt +++ b/conf/CMakeLists.txt @@ -29,8 +29,8 @@ if(LINUX) install(FILES "${CUSTOM_CONF_DIR}/99-direwolf-cmedia.rules" DESTINATION /etc/udev/rules.d/) endif() -install(FILES "${CMAKE_BINARY_DIR}/direwolf.conf" DESTINATION share/doc/${CMAKE_PROJECT_NAME}/examples) -install(FILES "${CUSTOM_CONF_DIR}/sdr.conf" DESTINATION share/doc/${CMAKE_PROJECT_NAME}/examples) +install(FILES "${CMAKE_BINARY_DIR}/direwolf.conf" DESTINATION ${INSTALL_CONF_DIR}) +install(FILES "${CUSTOM_CONF_DIR}/sdr.conf" DESTINATION ${INSTALL_CONF_DIR}) # Put sample configuration & startup files in home directory. # This step would be done as ordinary user. diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index f15886a..9f7c40e 100644 --- a/data/CMakeLists.txt +++ b/data/CMakeLists.txt @@ -89,6 +89,6 @@ ExternalProject_Add(download_symbolsx add_custom_target(update-data) add_dependencies(update-data data_rename download_tocalls download_symbols-new download_symbolsx) -install(FILES "${CUSTOM_BINARY_DATA_DIR}/${TOCALLS_TXT}" DESTINATION share/${PROJECT_NAME}) -install(FILES "${CUSTOM_BINARY_DATA_DIR}/${SYMBOLS-NEW_TXT}" DESTINATION share/${PROJECT_NAME}) -install(FILES "${CUSTOM_BINARY_DATA_DIR}/${SYMBOLSX_TXT}" DESTINATION share/${PROJECT_NAME}) +install(FILES "${CUSTOM_BINARY_DATA_DIR}/${TOCALLS_TXT}" DESTINATION ${INSTALL_DATA_DIR}) +install(FILES "${CUSTOM_BINARY_DATA_DIR}/${SYMBOLS-NEW_TXT}" DESTINATION ${INSTALL_DATA_DIR}) +install(FILES "${CUSTOM_BINARY_DATA_DIR}/${SYMBOLSX_TXT}" DESTINATION ${INSTALL_DATA_DIR}) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 187924e..c768d5e 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -1,18 +1,18 @@ -install(FILES "${CUSTOM_DOC_DIR}/README.md" DESTINATION share/doc/${CMAKE_PROJECT_NAME}) -install(FILES "${CUSTOM_DOC_DIR}/2400-4800-PSK-for-APRS-Packet-Radio.pdf" DESTINATION share/doc/${CMAKE_PROJECT_NAME}) -install(FILES "${CUSTOM_DOC_DIR}/A-Better-APRS-Packet-Demodulator-Part-1-1200-baud.pdf" DESTINATION share/doc/${CMAKE_PROJECT_NAME}) -install(FILES "${CUSTOM_DOC_DIR}/A-Better-APRS-Packet-Demodulator-Part-2-9600-baud.pdf" DESTINATION share/doc/${CMAKE_PROJECT_NAME}) -install(FILES "${CUSTOM_DOC_DIR}/A-Closer-Look-at-the-WA8LMF-TNC-Test-CD.pdf" DESTINATION share/doc/${CMAKE_PROJECT_NAME}) -install(FILES "${CUSTOM_DOC_DIR}/APRS-Telemetry-Toolkit.pdf" DESTINATION share/doc/${CMAKE_PROJECT_NAME}) -install(FILES "${CUSTOM_DOC_DIR}/APRStt-Implementation-Notes.pdf" DESTINATION share/doc/${CMAKE_PROJECT_NAME}) -install(FILES "${CUSTOM_DOC_DIR}/APRStt-interface-for-SARTrack.pdf" DESTINATION share/doc/${CMAKE_PROJECT_NAME}) -install(FILES "${CUSTOM_DOC_DIR}/APRStt-Listening-Example.pdf" DESTINATION share/doc/${CMAKE_PROJECT_NAME}) -install(FILES "${CUSTOM_DOC_DIR}/Bluetooth-KISS-TNC.pdf" DESTINATION share/doc/${CMAKE_PROJECT_NAME}) -install(FILES "${CUSTOM_DOC_DIR}/Going-beyond-9600-baud.pdf" DESTINATION share/doc/${CMAKE_PROJECT_NAME}) -install(FILES "${CUSTOM_DOC_DIR}/Raspberry-Pi-APRS.pdf" DESTINATION share/doc/${CMAKE_PROJECT_NAME}) -install(FILES "${CUSTOM_DOC_DIR}/Raspberry-Pi-APRS-Tracker.pdf" DESTINATION share/doc/${CMAKE_PROJECT_NAME}) -install(FILES "${CUSTOM_DOC_DIR}/Raspberry-Pi-SDR-IGate.pdf" DESTINATION share/doc/${CMAKE_PROJECT_NAME}) -install(FILES "${CUSTOM_DOC_DIR}/Successful-APRS-IGate-Operation.pdf" DESTINATION share/doc/${CMAKE_PROJECT_NAME}) -install(FILES "${CUSTOM_DOC_DIR}/User-Guide.pdf" DESTINATION share/doc/${CMAKE_PROJECT_NAME}) -install(FILES "${CUSTOM_DOC_DIR}/WA8LMF-TNC-Test-CD-Results.pdf" DESTINATION share/doc/${CMAKE_PROJECT_NAME}) +install(FILES "${CUSTOM_DOC_DIR}/README.md" DESTINATION ${INSTALL_DOC_DIR}) +install(FILES "${CUSTOM_DOC_DIR}/2400-4800-PSK-for-APRS-Packet-Radio.pdf" DESTINATION ${INSTALL_DOC_DIR}) +install(FILES "${CUSTOM_DOC_DIR}/A-Better-APRS-Packet-Demodulator-Part-1-1200-baud.pdf" DESTINATION ${INSTALL_DOC_DIR}) +install(FILES "${CUSTOM_DOC_DIR}/A-Better-APRS-Packet-Demodulator-Part-2-9600-baud.pdf" DESTINATION ${INSTALL_DOC_DIR}) +install(FILES "${CUSTOM_DOC_DIR}/A-Closer-Look-at-the-WA8LMF-TNC-Test-CD.pdf" DESTINATION ${INSTALL_DOC_DIR}) +install(FILES "${CUSTOM_DOC_DIR}/APRS-Telemetry-Toolkit.pdf" DESTINATION ${INSTALL_DOC_DIR}) +install(FILES "${CUSTOM_DOC_DIR}/APRStt-Implementation-Notes.pdf" DESTINATION ${INSTALL_DOC_DIR}) +install(FILES "${CUSTOM_DOC_DIR}/APRStt-interface-for-SARTrack.pdf" DESTINATION ${INSTALL_DOC_DIR}) +install(FILES "${CUSTOM_DOC_DIR}/APRStt-Listening-Example.pdf" DESTINATION ${INSTALL_DOC_DIR}) +install(FILES "${CUSTOM_DOC_DIR}/Bluetooth-KISS-TNC.pdf" DESTINATION ${INSTALL_DOC_DIR}) +install(FILES "${CUSTOM_DOC_DIR}/Going-beyond-9600-baud.pdf" DESTINATION ${INSTALL_DOC_DIR}) +install(FILES "${CUSTOM_DOC_DIR}/Raspberry-Pi-APRS.pdf" DESTINATION ${INSTALL_DOC_DIR}) +install(FILES "${CUSTOM_DOC_DIR}/Raspberry-Pi-APRS-Tracker.pdf" DESTINATION ${INSTALL_DOC_DIR}) +install(FILES "${CUSTOM_DOC_DIR}/Raspberry-Pi-SDR-IGate.pdf" DESTINATION ${INSTALL_DOC_DIR}) +install(FILES "${CUSTOM_DOC_DIR}/Successful-APRS-IGate-Operation.pdf" DESTINATION ${INSTALL_DOC_DIR}) +install(FILES "${CUSTOM_DOC_DIR}/User-Guide.pdf" DESTINATION ${INSTALL_DOC_DIR}) +install(FILES "${CUSTOM_DOC_DIR}/WA8LMF-TNC-Test-CD-Results.pdf" DESTINATION ${INSTALL_DOC_DIR}) diff --git a/man/CMakeLists.txt b/man/CMakeLists.txt index 91af1fd..071db62 100644 --- a/man/CMakeLists.txt +++ b/man/CMakeLists.txt @@ -1,11 +1,13 @@ -install(FILES "${CUSTOM_MAN_DIR}/aclients.1" DESTINATION share/man/man1) -install(FILES "${CUSTOM_MAN_DIR}/atest.1" DESTINATION share/man/man1) -install(FILES "${CUSTOM_MAN_DIR}/decode_aprs.1" DESTINATION share/man/man1) -install(FILES "${CUSTOM_MAN_DIR}/direwolf.1" DESTINATION share/man/man1) -install(FILES "${CUSTOM_MAN_DIR}/gen_packets.1" DESTINATION share/man/man1) -install(FILES "${CUSTOM_MAN_DIR}/kissutil.1" DESTINATION share/man/man1) -install(FILES "${CUSTOM_MAN_DIR}/ll2utm.1" DESTINATION share/man/man1) -install(FILES "${CUSTOM_MAN_DIR}/log2gpx.1" DESTINATION share/man/man1) -install(FILES "${CUSTOM_MAN_DIR}/text2tt.1" DESTINATION share/man/man1) -install(FILES "${CUSTOM_MAN_DIR}/tt2text.1" DESTINATION share/man/man1) -install(FILES "${CUSTOM_MAN_DIR}/utm2ll.1" DESTINATION share/man/man1) +if(NOT (WIN32 OR CYGWIN)) + install(FILES "${CUSTOM_MAN_DIR}/aclients.1" DESTINATION ${INSTALL_MAN_DIR}) + install(FILES "${CUSTOM_MAN_DIR}/atest.1" DESTINATION ${INSTALL_MAN_DIR}) + install(FILES "${CUSTOM_MAN_DIR}/decode_aprs.1" DESTINATION ${INSTALL_MAN_DIR}) + install(FILES "${CUSTOM_MAN_DIR}/direwolf.1" DESTINATION ${INSTALL_MAN_DIR}) + install(FILES "${CUSTOM_MAN_DIR}/gen_packets.1" DESTINATION ${INSTALL_MAN_DIR}) + install(FILES "${CUSTOM_MAN_DIR}/kissutil.1" DESTINATION ${INSTALL_MAN_DIR}) + install(FILES "${CUSTOM_MAN_DIR}/ll2utm.1" DESTINATION ${INSTALL_MAN_DIR}) + install(FILES "${CUSTOM_MAN_DIR}/log2gpx.1" DESTINATION ${INSTALL_MAN_DIR}) + install(FILES "${CUSTOM_MAN_DIR}/text2tt.1" DESTINATION ${INSTALL_MAN_DIR}) + install(FILES "${CUSTOM_MAN_DIR}/tt2text.1" DESTINATION ${INSTALL_MAN_DIR}) + install(FILES "${CUSTOM_MAN_DIR}/utm2ll.1" DESTINATION ${INSTALL_MAN_DIR}) +endif(NOT (WIN32 OR CYGWIN)) diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 7f849d6..886e5b1 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -1,6 +1,6 @@ if(NOT (WIN32 OR CYGWIN)) - install(PROGRAMS "${CUSTOM_SCRIPTS_DIR}/dwespeak.sh" DESTINATION bin) - install(PROGRAMS "${CUSTOM_SCRIPTS_DIR}/dw-start.sh" DESTINATION share/doc/${CMAKE_PROJECT_NAME}/examples) + install(PROGRAMS "${CUSTOM_SCRIPTS_DIR}/dwespeak.sh" DESTINATION ${INSTALL_BIN_DIR}) + install(PROGRAMS "${CUSTOM_SCRIPTS_DIR}/dw-start.sh" DESTINATION ${INSTALL_SCRIPTS_DIR}) add_subdirectory(telemetry-toolkit) endif() diff --git a/scripts/telemetry-toolkit/CMakeLists.txt b/scripts/telemetry-toolkit/CMakeLists.txt index 2adc3e3..46f8e61 100644 --- a/scripts/telemetry-toolkit/CMakeLists.txt +++ b/scripts/telemetry-toolkit/CMakeLists.txt @@ -1,13 +1,13 @@ -install(PROGRAMS "${CUSTOM_TELEMETRY_DIR}/telem-balloon.pl" DESTINATION bin) -install(PROGRAMS "${CUSTOM_TELEMETRY_DIR}/telem-bits.pl" DESTINATION bin) -install(PROGRAMS "${CUSTOM_TELEMETRY_DIR}/telem-data.pl" DESTINATION bin) -install(PROGRAMS "${CUSTOM_TELEMETRY_DIR}/telem-data91.pl" DESTINATION bin) -install(PROGRAMS "${CUSTOM_TELEMETRY_DIR}/telem-eqns.pl" DESTINATION bin) -install(PROGRAMS "${CUSTOM_TELEMETRY_DIR}/telem-parm.pl" DESTINATION bin) -install(PROGRAMS "${CUSTOM_TELEMETRY_DIR}/telem-seq.sh" DESTINATION bin) -install(PROGRAMS "${CUSTOM_TELEMETRY_DIR}/telem-unit.pl" DESTINATION bin) -install(PROGRAMS "${CUSTOM_TELEMETRY_DIR}/telem-volts.py" DESTINATION bin) +install(PROGRAMS "${CUSTOM_TELEMETRY_DIR}/telem-balloon.pl" DESTINATION ${INSTALL_BIN_DIR}) +install(PROGRAMS "${CUSTOM_TELEMETRY_DIR}/telem-bits.pl" DESTINATION ${INSTALL_BIN_DIR}) +install(PROGRAMS "${CUSTOM_TELEMETRY_DIR}/telem-data.pl" DESTINATION ${INSTALL_BIN_DIR}) +install(PROGRAMS "${CUSTOM_TELEMETRY_DIR}/telem-data91.pl" DESTINATION ${INSTALL_BIN_DIR}) +install(PROGRAMS "${CUSTOM_TELEMETRY_DIR}/telem-eqns.pl" DESTINATION ${INSTALL_BIN_DIR}) +install(PROGRAMS "${CUSTOM_TELEMETRY_DIR}/telem-parm.pl" DESTINATION ${INSTALL_BIN_DIR}) +install(PROGRAMS "${CUSTOM_TELEMETRY_DIR}/telem-seq.sh" DESTINATION ${INSTALL_BIN_DIR}) +install(PROGRAMS "${CUSTOM_TELEMETRY_DIR}/telem-unit.pl" DESTINATION ${INSTALL_BIN_DIR}) +install(PROGRAMS "${CUSTOM_TELEMETRY_DIR}/telem-volts.py" DESTINATION ${INSTALL_BIN_DIR}) -install(FILES "${CUSTOM_TELEMETRY_DIR}/telem-m0xer-3.txt" DESTINATION share/doc/${CMAKE_PROJECT_NAME}/examples) -install(FILES "${CUSTOM_TELEMETRY_DIR}/telem-balloon.conf" DESTINATION share/doc/${CMAKE_PROJECT_NAME}/examples) -install(FILES "${CUSTOM_TELEMETRY_DIR}/telem-volts.conf" DESTINATION share/doc/${CMAKE_PROJECT_NAME}/examples) +install(FILES "${CUSTOM_TELEMETRY_DIR}/telem-m0xer-3.txt" DESTINATION ${INSTALL_CONF_DIR}) +install(FILES "${CUSTOM_TELEMETRY_DIR}/telem-balloon.conf" DESTINATION ${INSTALL_CONF_DIR}) +install(FILES "${CUSTOM_TELEMETRY_DIR}/telem-volts.conf" DESTINATION ${INSTALL_CONF_DIR}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 76c233d..b990605 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -455,18 +455,18 @@ if(WIN32 OR CYGWIN) target_link_libraries(ttcalc ws2_32) endif() -install(TARGETS direwolf DESTINATION bin) -install(TARGETS decode_aprs DESTINATION bin) -install(TARGETS text2tt DESTINATION bin) -install(TARGETS tt2text DESTINATION bin) -install(TARGETS ll2utm DESTINATION bin) -install(TARGETS utm2ll DESTINATION bin) -install(TARGETS aclients DESTINATION bin) -install(TARGETS log2gpx DESTINATION bin) -install(TARGETS gen_packets DESTINATION bin) -install(TARGETS atest DESTINATION bin) -install(TARGETS ttcalc DESTINATION bin) -install(TARGETS kissutil DESTINATION bin) +install(TARGETS direwolf DESTINATION ${INSTALL_BIN_DIR}) +install(TARGETS decode_aprs DESTINATION ${INSTALL_BIN_DIR}) +install(TARGETS text2tt DESTINATION ${INSTALL_BIN_DIR}) +install(TARGETS tt2text DESTINATION ${INSTALL_BIN_DIR}) +install(TARGETS ll2utm DESTINATION ${INSTALL_BIN_DIR}) +install(TARGETS utm2ll DESTINATION ${INSTALL_BIN_DIR}) +install(TARGETS aclients DESTINATION ${INSTALL_BIN_DIR}) +install(TARGETS log2gpx DESTINATION ${INSTALL_BIN_DIR}) +install(TARGETS gen_packets DESTINATION ${INSTALL_BIN_DIR}) +install(TARGETS atest DESTINATION ${INSTALL_BIN_DIR}) +install(TARGETS ttcalc DESTINATION ${INSTALL_BIN_DIR}) +install(TARGETS kissutil DESTINATION ${INSTALL_BIN_DIR}) if(UDEV_FOUND) - install(TARGETS cm108 DESTINATION bin) + install(TARGETS cm108 DESTINATION ${INSTALL_BIN_DIR}) endif() diff --git a/src/symbols.c b/src/symbols.c index 3893b17..448fbcc 100644 --- a/src/symbols.c +++ b/src/symbols.c @@ -265,6 +265,7 @@ static const struct { static const char *search_locations[] = { (const char *) "symbols-new.txt", + (const char *) "data/symbols-new.txt", (const char *) "../data/symbols-new.txt", #ifndef __WIN32__ (const char *) "/usr/local/share/direwolf/symbols-new.txt",