From 9b405cb08bcf2127ea8e9188997824098ec7c2dd Mon Sep 17 00:00:00 2001 From: Bernhard Tittelbach Date: Fri, 16 Jan 2015 04:23:22 +0000 Subject: configure sytemd path as required by systemd man-page --- src/Makefile | 7 +++---- src/configure | 62 ++++++++++++++++++++++++++++++++++------------------------- 2 files changed, 39 insertions(+), 30 deletions(-) diff --git a/src/Makefile b/src/Makefile index f460a72..275e5ff 100644 --- a/src/Makefile +++ b/src/Makefile @@ -310,12 +310,11 @@ install-etc: rm -f ../etc/init.d/anytun.bak install-systemd: - $(INSTALL) -d $(DESTDIR)/lib/systemd/system/ @ sed -e 's#/usr/bin/#$(DESTDIR)$(BINDIR)/#' ../usr/lib/systemd/system/anytun@.service > ../usr/lib/systemd/system/anytun@.service.bak @ sed -e 's#/usr/bin/#$(DESTDIR)$(BINDIR)/#' ../usr/lib/systemd/system/anytun-control@.service > ../usr/lib/systemd/system/anytun-control@.service.bak - $(INSTALL) ../usr/lib/systemd/system/anytun@.service.bak $(DESTDIR)/usr/lib/systemd/system/anytun@.service - $(INSTALL) ../usr/lib/systemd/system/anytun-control@.service.bak $(DESTDIR)/usr/anytun-control@.service - $(INSTALL) ../etc/tmpfiles.d/anytun.conf $(DESTDIR)$(ETCDIR)/tmpfiles.d/anytun.conf + $(INSTALL) ../usr/lib/systemd/system/anytun@.service.bak $(DESTDIR)$(SYSTEMD_SYSTEMUNITDIR)/anytun@.service + $(INSTALL) ../usr/lib/systemd/system/anytun-control@.service.bak $(DESTDIR)$(SYSTEMD_SYSTEMUNITDIR)/anytun-control@.service + $(INSTALL) ../etc/tmpfiles.d/anytun.conf $(DESTDIR)$(SYSTEMD_TMPFILESDIR)/anytun.conf install-examples: $(INSTALL) -d $(DESTDIR)$(EXAMPLESDIR)/anytun diff --git a/src/configure b/src/configure index c318121..ee3a3ae 100755 --- a/src/configure +++ b/src/configure @@ -71,31 +71,33 @@ NETTLE_PREFIX='' OPENSSL_PREFIX='' print_usage() { - echo "configure --help print this" - echo " --target= build target i.e. Linux (default: autodetect)" - echo " --prefix= the installation prefix (default: /usr/local)" - echo " --bindir= the path to the bin directory (default: $PREFIX/bin)" - echo " --sbindir= the path to the sbin directory (default: $PREFIX/sbin)" - echo " --sysconfdir= the path to the system configuration directory (default: $PREFIX/etc" - echo " --mandir= the path to the system man pages (default: $PREFIX/share/man)" - echo " --no-manpage dont't install manpages" - echo " --examplesdir= the path to the examples files (default: $PREFIX/share/examples)" - echo " --no-examples dont't install example files" - echo " --use-gcrypt use libgcrypt (this is the default)" - echo " --use-nettle use libnettle instead of libgcrypt" - echo " --use-ssl-crypto use openssl crypto library instead of libgcrypt" - echo " --no-crypto disable crypto at all (only NULL cipher)" - echo " --disable-passphrase disable master key and salt passphrase" - echo " --enable-passphrase enable master key and salt passphrase" - echo " --disable-routing disable built-in routing capability" - echo " --enable-routing enable built-in routing capability" - echo " --cross-prefix= add PREFIX to compiler calls" - echo " --with-boost= don't use systemwide boost" - echo " --with-gcrypt= don't use systemwide gcrypt" - echo " --with-nettle= don't use systemwide nettle" - echo " --with-openssl= don't use systemwide openssl" - echo " --with-systemd install systemd unit descriptions" - echo " --use-clang use clang/llvm as compiler/linker" + echo "configure --help print this" + echo " --target= build target i.e. Linux (default: autodetect)" + echo " --prefix= the installation prefix (default: /usr/local)" + echo " --bindir= the path to the bin directory (default: $PREFIX/bin)" + echo " --sbindir= the path to the sbin directory (default: $PREFIX/sbin)" + echo " --sysconfdir= the path to the system configuration directory (default: $PREFIX/etc" + echo " --mandir= the path to the system man pages (default: $PREFIX/share/man)" + echo " --no-manpage dont't install manpages" + echo " --examplesdir= the path to the examples files (default: $PREFIX/share/examples)" + echo " --no-examples dont't install example files" + echo " --use-gcrypt use libgcrypt (this is the default)" + echo " --use-nettle use libnettle instead of libgcrypt" + echo " --use-ssl-crypto use openssl crypto library instead of libgcrypt" + echo " --no-crypto disable crypto at all (only NULL cipher)" + echo " --disable-passphrase disable master key and salt passphrase" + echo " --enable-passphrase enable master key and salt passphrase" + echo " --disable-routing disable built-in routing capability" + echo " --enable-routing enable built-in routing capability" + echo " --cross-prefix= add pREFIX to compiler calls" + echo " --with-boost= don't use systemwide boost" + echo " --with-gcrypt= don't use systemwide gcrypt" + echo " --with-nettle= don't use systemwide nettle" + echo " --with-openssl= don't use systemwide openssl" + echo " --use-clang use clang/llvm as compiler/linker" + echo " --with-systemd install systemd unit descriptions" + echo " --with-systemdsystemunitdir= target for unit files" + echo " --with-systemdtmpfilesdir= target for tmpfile creation info" } for arg @@ -173,8 +175,16 @@ do --with-openssl=*) OPENSSL_PREFIX=${arg#--with-openssl=} ;; - --with-systemd=*) + --with-systemd) SYSTEMD=1 + [[ -z $SYSTEMD_SYSTEMUNITDIR ]] && SYSTEMD_SYSTEMUNITDIR="$(pkg-config systemd --variable=systemdsystemconfdir)" + [[ -z $SYSTEMD_TMPFILESDIR ]] && SYSTEMD_TMPFILESDIR="$(pkg-config systemd --variable=tmpfilesdir)" + ;; + --with-systemdsystemunitdir=*) + SYSTEMD_SYSTEMUNITDIR=${arg#--with-systemdsystemunitdir=} + ;; + --with-tmpfilesdir=*) + SYSTEMD_TMPFILESDIR=${arg#--with-tmpfilesdir=} ;; --help) print_usage -- cgit v1.2.3