Skip to content

Commit ea93fcd

Browse files
committed
udev rules location
1 parent 22c1042 commit ea93fcd

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ if (C_CLANG OR C_GCC)
210210
# TODO:
211211
# Try error checking -fsanitize=bounds-strict -fsanitize=leak
212212
# Requires libubsan and liblsan, respectively.
213+
# Maybe -fstack-protector-all, -fstack-check
213214

214215
###set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wvla -ffast-math -ftree-vectorize -D_XOPEN_SOURCE=600 -D_DEFAULT_SOURCE ${EXTRA_FLAGS}")
215216
if(FREEBSD)

conf/CMakeLists.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,15 @@ file(WRITE "${CMAKE_BINARY_DIR}/direwolf.conf" "${file_content}")
2828
# There are two locations. The one in /etc/udev/rules.d is meant for local customization and
2929
# takes precedence for the same name.
3030
# https://sources.debian.org/src/direwolf/1.7+dfsg-2/debian/patches/lib-udev-rules/
31-
# says that we should use the /usr/lib/udev/rules.d location.
31+
# says that we should use the /usr/lib/udev/rules.d location when building a package.
32+
# TODO: I think the proper solution is to select the location based on whether
33+
# the application installation location is /usr/local or /usr.
3234
if(LINUX)
33-
#install(FILES "${CUSTOM_CONF_DIR}/99-direwolf-cmedia.rules" DESTINATION /etc/udev/rules.d/)
34-
install(FILES "${CUSTOM_CONF_DIR}/99-direwolf-cmedia.rules" DESTINATION /usr/lib/udev/rules.d/)
35+
if (CMAKE_INSTALL_PREFIX STREQUAL "/usr/local")
36+
install(FILES "${CUSTOM_CONF_DIR}/99-direwolf-cmedia.rules" DESTINATION /etc/udev/rules.d/)
37+
else()
38+
install(FILES "${CUSTOM_CONF_DIR}/99-direwolf-cmedia.rules" DESTINATION /usr/lib/udev/rules.d/)
39+
endif()
3540
endif()
3641

3742
install(FILES "${CMAKE_BINARY_DIR}/direwolf.conf" DESTINATION ${INSTALL_CONF_DIR})

0 commit comments

Comments
 (0)