Add systemd configure option. Closes #921.

This commit is contained in:
sledgehammer999 2015-04-05 15:12:36 +03:00
parent 26404e2cc4
commit 6b3555bd90
3 changed files with 53 additions and 0 deletions

28
configure vendored
View file

@ -717,6 +717,7 @@ with_geoip_database_embedded
with_qtsingleapplication
enable_debug
enable_gui
enable_systemd
enable_webui
enable_qt_dbus
with_boost
@ -1369,6 +1370,7 @@ Optional Features:
--enable-debug Enable debug build
--disable-gui Disable the GUI for headless running. Disables
QtDBus and the GeoIP Database.
--enable-systemd Install the systemd service file (GUI only).
--disable-webui Disable the WebUI.
--disable-qt-dbus Disable use of QtDBus (GUI only)
@ -4201,6 +4203,14 @@ else
fi
# Check whether --enable-systemd was given.
if test "${enable_systemd+set}" = set; then :
enableval=$enable_systemd;
else
enable_systemd=no
fi
# Check whether --enable-webui was given.
if test "${enable_webui+set}" = set; then :
enableval=$enable_webui;
@ -4380,6 +4390,7 @@ case "x$enable_gui" in #(
"xyes") :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
enable_systemd=no
QBT_REMOVE_CONFIG="$QBT_REMOVE_CONFIG nogui" ;; #(
"xno") :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@ -4393,6 +4404,23 @@ $as_echo "$enable_gui" >&6; }
as_fn_error $? "Unknown option \"$enable_gui\". Use either \"yes\" or \"no\"." "$LINENO" 5 ;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to install the systemd service file" >&5
$as_echo_n "checking whether to install the systemd service file... " >&6; }
case "x$enable_systemd" in #(
"xyes") :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
QBT_ADD_CONFIG="$QBT_ADD_CONFIG systemd" ;; #(
"xno") :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
QBT_REMOVE_CONFIG="$QBT_REMOVE_CONFIG systemd" ;; #(
*) :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_systemd" >&5
$as_echo "$enable_systemd" >&6; }
as_fn_error $? "Unknown option \"$enable_systemd\". Use either \"yes\" or \"no\"." "$LINENO" 5 ;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the WebUI" >&5
$as_echo_n "checking whether to enable the WebUI... " >&6; }
case "x$enable_webui" in #(

View file

@ -42,6 +42,12 @@ AC_ARG_ENABLE(gui,
[],
[enable_gui=yes])
AC_ARG_ENABLE(systemd,
[AS_HELP_STRING([--enable-systemd],
[Install the systemd service file (GUI only).])],
[],
[enable_systemd=no])
AC_ARG_ENABLE(webui,
[AS_HELP_STRING([--disable-webui],
[Disable the WebUI.])],
@ -84,6 +90,7 @@ AC_MSG_CHECKING([whether to enable the GUI])
AS_CASE(["x$enable_gui"],
["xyes"],
[AC_MSG_RESULT([yes])
enable_systemd=[no]
QBT_REMOVE_CONFIG="$QBT_REMOVE_CONFIG nogui"],
["xno"],
[AC_MSG_RESULT([no])
@ -93,6 +100,17 @@ AS_CASE(["x$enable_gui"],
[AC_MSG_RESULT([$enable_gui])
AC_MSG_ERROR([Unknown option "$enable_gui". Use either "yes" or "no".])])
AC_MSG_CHECKING([whether to install the systemd service file])
AS_CASE(["x$enable_systemd"],
["xyes"],
[AC_MSG_RESULT([yes])
QBT_ADD_CONFIG="$QBT_ADD_CONFIG systemd"],
["xno"],
[AC_MSG_RESULT([no])
QBT_REMOVE_CONFIG="$QBT_REMOVE_CONFIG systemd"],
[AC_MSG_RESULT([$enable_systemd])
AC_MSG_ERROR([Unknown option "$enable_systemd". Use either "yes" or "no".])])
AC_MSG_CHECKING([whether to enable the WebUI])
AS_CASE(["x$enable_webui"],
["xyes"],

View file

@ -31,6 +31,13 @@ INSTALLS += man
DIST_PATH = ../dist/unix
# Systemd Service file
nogui:systemd {
systemdService.files = $$DIST_PATH/systemd/qbittorrent-nox.service
systemdService.path = $$PREFIX/lib/systemd/system/
INSTALLS += systemdService
}
# Menu Icon
!nogui {
menuicon.files = icons/qBittorrent.desktop