Changeset 8ca172f for configure


Ignore:
Timestamp:
2022-12-04T17:09:00Z (23 months ago)
Author:
GitHub <noreply@…>
Branches:
master
Children:
2bd8f39
Parents:
7e90c03
git-author:
Björn Bidar <bjorn.bidar@…> (04-12-22 17:09:00)
git-committer:
GitHub <noreply@…> (04-12-22 17:09:00)
Message:

Systemd Enhancements: Create user and directory automatically (#163)

  • configure: Simplify check for systemd, allow to request systemd support

Signed-off-by: Björn Bidar <bjorn.bidar@…>

  • configure: Add helper to be compatible with old and new systemd pc vars

Re:
https://github.com/systemd/systemd/commit/4908de44b0a0409f84a7cdc5641b114d6ce8ba03

Signed-off-by: Björn Bidar <bjorn.bidar@…>

  • systemd: Support systemd-sysusers.d

Signed-off-by: Björn Bidar <bjorn.bidar@…>

  • systemd: Define StateDirectory, create biltbee directory automatically

Signed-off-by: Björn Bidar <bjorn.bidar@…>

  • systemd: Also listen to /run/bitlbee/socket

Signed-off-by: Björn Bidar <bjorn.bidar@…>

  • systemd: Create RuntimeDirectory automatically

Signed-off-by: Björn Bidar <bjorn.bidar@…>

  • systemd: Also run regular systemd service as user

Signed-off-by: Björn Bidar <bjorn.bidar@…>

Signed-off-by: Björn Bidar <bjorn.bidar@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • configure

    r7e90c03 r8ca172f  
    1919includedir='$prefix/include/bitlbee/'
    2020systemdsystemunitdir=''
     21sysusersdir=''
    2122libevent='/usr/'
    2223pidfile='/var/run/bitlbee.pid'
     
    5556
    5657pie=1
     58
     59systemd=auto
    5760
    5861arch=$(uname -s)
     
    129132--plugindir=...                                         $plugindir
    130133--systemdsystemunitdir=...                              $systemdsystemunitdir
     134--sysusersdir                       $sysusersdir
    131135--pidfile=...                                           $pidfile
    132136--config=...                                            $config
     
    157161                                                        $ssl
    158162--external_json_parser=0/1/auto Use External JSON parser $external_json_parser
     163--systemd=0/1  Enable/disable systemd support $systemd
    159164
    160165
     
    750755fi
    751756
    752 if [ -z "$systemdsystemunitdir" ]; then
    753         if $PKG_CONFIG --exists systemd; then
    754                 systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
    755         fi
    756 fi
    757 if [ -n "$systemdsystemunitdir" ]; then
    758         if [ "$systemdsystemunitdir" != "no" ]; then
    759                 echo "SYSTEMDSYSTEMUNITDIR=$systemdsystemunitdir" >> Makefile.settings
    760         fi
     757if [ ! "$systemd" = 0 ]; then
     758    if ! $PKG_CONFIG --exists systemd ; then
     759        if [ -n "$systemdsystemunitdir" ] || [ "$systemd" -eq 1 ]; then
     760            echo "systemd requested but not found"
     761            exit 1
     762        else
     763            systemd=0
     764        fi
     765    fi
     766fi
     767
     768pkgconf_systemd_var() {
     769    # First try deprecated variable, use newer variable if not found
     770    if $PKG_CONFIG --print-variables systemd | grep -q $1 ; then
     771        $PKG_CONFIG --variable=$1 systemd
     772    else
     773        $PKG_CONFIG --variable=$2 systemd
     774    fi
     775}
     776
     777if [ "$systemd" -eq 1 ]; then
     778        if [ -z "$systemdsystemunitdir" ]; then
     779                systemdsystemunitdir=$(pkgconf_systemd_var systemdsystemunitdir systemd_system_unit_dir)
     780        fi
     781    if [ -z "$tmpfiles_dir" ] ; then
     782        tmpfilesdir=$(pkgconf_systemd_var tmpfilesdir tmpfiles_dir)
     783    fi
     784    if [ -z "$sysusersdir" ] ; then
     785        sysusersdir=$(pkgconf_systemd_var sysusersdir sysusers_dir)
     786    fi
     787
     788        echo "SYSTEMDSYSTEMUNITDIR=$systemdsystemunitdir" >> Makefile.settings
     789    echo "SYSUSERSDIR=$sysusersdir" >> Makefile.settings
    761790fi
    762791
     
    10051034fi
    10061035
    1007 if [ -n "$systemdsystemunitdir" ]; then
     1036if [ "$systemd" -eq 1 ]; then
    10081037        echo '  systemd enabled.'
    10091038else
Note: See TracChangeset for help on using the changeset viewer.