Skip to content

Commit

Permalink
Move to CMake build system - create users and runtime directories
Browse files Browse the repository at this point in the history
  • Loading branch information
jiri-pinkava committed Nov 20, 2022
1 parent b94a136 commit d823a90
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 189 deletions.
17 changes: 17 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ add_compile_options(-funsafe-math-optimizations -march=native -O3 -Wall)
add_compile_definitions(_GNU_SOURCE=1 NDEBUG=1)

include(GNUInstallDirs)
set(VARDIR "${CMAKE_INSTALL_PREFIX}${CMAKE_INSTALL_LOCALSTATEDIR}/${CMAKE_PROJECT_NAME}")

set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
Expand Down Expand Up @@ -277,4 +278,20 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
install(FILES airspy-blacklist.conf DESTINATION "/${CMAKE_INSTALL_SYSCONFDIR}/modprobe.d")
install(FILES 98-sockbuf.conf DESTINATION "/${CMAKE_INSTALL_SYSCONFDIR}/sysctl.d")
install(FILES start-ka9q-horus.sh DESTINATION ${CMAKE_INSTALL_SBINDIR})

install(CODE
"execute_process(
COMMAND_ERROR_IS_FATAL ANY
COMMAND_ECHO STDERR
COMMAND mkdir -p /etc/fftw /etc/radio ${VARDIR}
COMMAND /usr/sbin/adduser --quiet --system --group radio
COMMAND /usr/sbin/adduser --quiet --system --ingroup radio airspy
COMMAND /usr/sbin/adduser --quiet --system --ingroup radio funcube
COMMAND /usr/sbin/adduser --quiet --system --ingroup radio recordings
COMMAND /usr/sbin/adduser --quiet --system --ingroup radio aprsfeed
COMMAND chgrp radio /etc/fftw /etc/radio ${VARDIR}
COMMAND chmod g+ws /etc/fftw /etc/radio ${VARDIR}
COMMAND systemctl daemon-reload
)"
)
endif()
66 changes: 0 additions & 66 deletions Makefile.debug

This file was deleted.

61 changes: 0 additions & 61 deletions Makefile.linux

This file was deleted.

62 changes: 0 additions & 62 deletions Makefile.osx

This file was deleted.

0 comments on commit d823a90

Please sign in to comment.