diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2020-10-25 23:31:54 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2020-10-26 12:03:59 +0100 |
commit | e672e51267ff87405700cbb80807aa6a678a06a5 (patch) | |
tree | 1fbce8d79376d671010533fe5045475464b3ec64 /data | |
parent | d720a7987adee52f4da1d316270be5188331d6f8 (diff) | |
download | ayatana-indicator-bluetooth-e672e51267ff87405700cbb80807aa6a678a06a5.tar.gz ayatana-indicator-bluetooth-e672e51267ff87405700cbb80807aa6a678a06a5.tar.bz2 ayatana-indicator-bluetooth-e672e51267ff87405700cbb80807aa6a678a06a5.zip |
Port from autotools to CMake.
Diffstat (limited to 'data')
-rw-r--r-- | data/CMakeLists.txt | 76 | ||||
-rw-r--r-- | data/Makefile.am | 40 | ||||
-rw-r--r-- | data/ayatana-indicator-bluetooth.desktop.in | 2 | ||||
-rw-r--r-- | data/ayatana-indicator-bluetooth.service.in | 2 |
4 files changed, 78 insertions, 42 deletions
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt new file mode 100644 index 0000000..a423f5b --- /dev/null +++ b/data/CMakeLists.txt @@ -0,0 +1,76 @@ + +find_package(GSettings) + +########################### +# Indicator service +########################### + +set( + INDICATOR_DIR + "${CMAKE_INSTALL_DATADIR}/ayatana/indicators" + CACHE FILEPATH "Ayatana Indicators Directory" +) + +install( + FILES "org.ayatana.indicator.bluetooth" + DESTINATION "${INDICATOR_DIR}" +) + +########################### +# Systemd Job +########################### + +pkg_check_modules(SYSTEMD systemd) +if (${SYSTEMD_FOUND}) + + # where to install + pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir) + message (STATUS "${SYSTEMD_USER_DIR} is the systemd user unit file install dir") + + set (SYSTEMD_USER_NAME "${CMAKE_PROJECT_NAME}.service") + set (SYSTEMD_USER_FILE "${CMAKE_CURRENT_BINARY_DIR}/${SYSTEMD_USER_NAME}") + set (SYSTEMD_USER_FILE_IN "${CMAKE_CURRENT_SOURCE_DIR}/${SYSTEMD_USER_NAME}.in") + + # build it + set (pkglibexecdir "${CMAKE_INSTALL_FULL_PKGLIBEXECDIR}") + configure_file ("${SYSTEMD_USER_FILE_IN}" "${SYSTEMD_USER_FILE}") + + # install it + install (FILES "${SYSTEMD_USER_FILE}" + DESTINATION "${SYSTEMD_USER_DIR}") +endif() + +########################### +# XDG Autostart +########################### + +set( + INDICATOR_BLUETOOTH_XDG_AUTOSTART + "${CMAKE_CURRENT_BINARY_DIR}/ayatana-indicator-bluetooth.desktop" +) + +configure_file( + "ayatana-indicator-bluetooth.desktop.in" + ${INDICATOR_BLUETOOTH_XDG_AUTOSTART} + @ONLY +) + +install( + FILES "${INDICATOR_BLUETOOTH_XDG_AUTOSTART}" + DESTINATION "/etc/xdg/autostart" +) + +########################### +# GSettings +########################### + +set (SCHEMA_NAME "org.ayatana.indicator.bluetooth.gschema.xml") +set (SCHEMA_FILE "${CMAKE_CURRENT_BINARY_DIR}/${SCHEMA_NAME}") +set (SCHEMA_FILE_IN "${CMAKE_CURRENT_SOURCE_DIR}/${SCHEMA_NAME}.in") + +# generate the .xml file using intltool +set (ENV{LC_ALL} "C") +execute_process (COMMAND intltool-merge -quiet --xml-style --utf8 --no-translations "${SCHEMA_FILE_IN}" "${SCHEMA_FILE}") + +# let UseGSettings do the rest +add_schema (${SCHEMA_NAME}) diff --git a/data/Makefile.am b/data/Makefile.am deleted file mode 100644 index e9ef0b9..0000000 --- a/data/Makefile.am +++ /dev/null @@ -1,40 +0,0 @@ -BUILT_SOURCES = -EXTRA_DIST = -CLEANFILES = - -# the indicator bus file -indicatorsdir = $(datadir)/ayatana/indicators -dist_indicators_DATA = org.ayatana.indicator.bluetooth - -# the systemd unit file -systemddir = $(SYSTEMD_USERDIR) -systemd_DATA = ayatana-indicator-bluetooth.service -systemd_in = $(systemd_DATA:.service=.service.in) -$(systemd_DATA): $(systemd_in) - $(AM_V_GEN) $(SED) -e "s|\@pkglibexecdir\@|$(pkglibexecdir)|" $< > $@ -BUILT_SOURCES += $(systemd_DATA) -EXTRA_DIST += $(systemd_in) -CLEANFILES += $(systemd_DATA) - -# the xdg autostart job file -xdg_autostartdir = /etc/xdg/autostart -xdg_autostart_DATA = ayatana-indicator-bluetooth.desktop -xdg_autostart_in = $(xdg_autostart_DATA:.desktop=.desktop.in) -$(xdg_autostart_DATA): $(xdg_autostart_in) - $(AM_V_GEN) $(SED) -e "s|\@pkglibexecdir\@|$(pkglibexecdir)|" $< > $@ -BUILT_SOURCES += $(xdg_autostart_DATA) -EXTRA_DIST += $(xdg_autostart_in) -CLEANFILES += $(xdg_autostart_DATA) - -# the gsettings schema -gsettings_SCHEMAS = org.ayatana.indicator.bluetooth.gschema.xml -@INTLTOOL_XML_NOMERGE_RULE@ -@GSETTINGS_RULES@ - -EXTRA_DIST += \ - org.ayatana.indicator.bluetooth.gschema.xml.in \ - ayatana-indicator-bluetooth.desktop.in - -CLEANFILES += \ - $(dbus_services_DATA) \ - $(gsettings_SCHEMAS) diff --git a/data/ayatana-indicator-bluetooth.desktop.in b/data/ayatana-indicator-bluetooth.desktop.in index 8eb5e1f..871e80a 100644 --- a/data/ayatana-indicator-bluetooth.desktop.in +++ b/data/ayatana-indicator-bluetooth.desktop.in @@ -1,7 +1,7 @@ [Desktop Entry] Type=Application Name=Ayatana Indicator Bluetooth -Exec=@pkglibexecdir@/ayatana-indicator-bluetooth/ayatana-indicator-bluetooth-service +Exec=@CMAKE_INSTALL_FULL_LIBEXECDIR@/ayatana-indicator-bluetooth/ayatana-indicator-bluetooth-service NoDisplay=true StartupNotify=false Terminal=false diff --git a/data/ayatana-indicator-bluetooth.service.in b/data/ayatana-indicator-bluetooth.service.in index 92344c8..aa513b6 100644 --- a/data/ayatana-indicator-bluetooth.service.in +++ b/data/ayatana-indicator-bluetooth.service.in @@ -4,7 +4,7 @@ PartOf=graphical-session.target PartOf=ayatana-indicators.target [Service] -ExecStart=@pkglibexecdir@/ayatana-indicator-bluetooth/ayatana-indicator-bluetooth-service +ExecStart=@CMAKE_INSTALL_FULL_LIBEXECDIR@/ayatana-indicator-bluetooth/ayatana-indicator-bluetooth-service Restart=on-failure [Install] |