summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile9
-rwxr-xr-xsrc/configure9
2 files changed, 16 insertions, 2 deletions
diff --git a/src/Makefile b/src/Makefile
index ebd4f71..9d29cb5 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -311,12 +311,16 @@ install-etc:
install-systemd:
$(INSTALL) -d $(DESTDIR)$(SYSTEMDDIR)
$(INSTALL) -m 644 ../usr/lib/systemd/system/anytun.service $(DESTDIR)$(SYSTEMDDIR)/anytun.service
- @ sed -e 's#/usr/local/lib/#$(LIBDIR)/#' ../usr/lib/systemd/system/anytun@.service > ../usr/lib/systemd/system/anytun@.service.bak
- @ sed -e 's#/usr/local/lib/#$(LIBDIR)/#' ../usr/lib/systemd/system/anytun-controld@.service > ../usr/lib/systemd/system/anytun-controld@.service.bak
+ @ sed -e 's#/usr/local/lib#$(LIBDIR)#' ../usr/lib/systemd/system/anytun@.service > ../usr/lib/systemd/system/anytun@.service.bak
+ @ sed -e 's#/usr/local/lib#$(LIBDIR)#' ../usr/lib/systemd/system/anytun-controld@.service > ../usr/lib/systemd/system/anytun-controld@.service.bak
$(INSTALL) -m 644 ../usr/lib/systemd/system/anytun@.service.bak $(DESTDIR)$(SYSTEMDDIR)/anytun@.service
$(INSTALL) -m 644 ../usr/lib/systemd/system/anytun-controld@.service.bak $(DESTDIR)$(SYSTEMDDIR)/anytun-controld@.service
rm -f ../usr/lib/systemd/system/anytun@.service.bak
rm -f ../usr/lib/systemd/system/anytun-controld@.service.bak
+ $(INSTALL) -d $(DESTDIR)$(SYSTEMDGENERATORDIR)
+ @ sed -e 's#/usr/local/etc#$(ETCDIR)#' ../usr/lib/systemd/system-generator/anytun-generator > ../usr/lib/systemd/system-generator/anytun-generator.bak
+ $(INSTALL) -m 755 ../usr/lib/systemd/system-generator/anytun-generator.bak $(DESTDIR)$(SYSTEMDGENERATORDIR)/anytun-generator
+ rm -f ../usr/lib/systemd/system-generator/anytun-generator.bak
$(INSTALL) -d $(DESTDIR)$(TMPFILESDDIR)
$(INSTALL) -m 644 ../usr/lib/tmpfiles.d/anytun.conf $(DESTDIR)$(TMPFILESDDIR)/anytun.conf
@@ -373,6 +377,7 @@ remove-systemd:
rm -f $(DESTDIR)$(SYSTEMDDIR)/anytun.service
rm -f $(DESTDIR)$(SYSTEMDDIR)/anytun@.service
rm -f $(DESTDIR)$(SYSTEMDDIR)/anytun-controld@.service
+ rm -f $(DESTDIR)$(SYSTEMDGENERATORDIR)/anytun-generator
rm -f $(DESTDIR)$(TMPFILESDDIR)/anytun.conf
remove-examples:
diff --git a/src/configure b/src/configure
index 203a68c..082e523 100755
--- a/src/configure
+++ b/src/configure
@@ -66,6 +66,7 @@ INSTALLMANPAGE=1
EXAMPLESDIR=''
INSTALLEXAMPLES=1
SYSTEMDDIR=''
+SYSTEMDGENERATORDIR=''
TMPFILESDDIR=''
INSTALLSYSTEMD=1
@@ -87,6 +88,7 @@ print_usage() {
echo " --examplesdir=<DIR> the path to the examples files (default: $PREFIX/share/examples)"
echo " --no-examples don't install example files"
echo " --systemddir=<DIR> the path to the systemd service unit directory (default: from pkg-config)"
+ echo " --systemdgeneratordir=<DIR> the path to the systemd generator directory (default: from pkg-config)"
echo " --tmpfilesddir=<DIR> the path to the systemd tmpfiles.d configuration file (default: from pkg-config)"
echo " --no-systemd don't install systemd units"
echo " --use-gcrypt use libgcrypt (this is the default)"
@@ -144,6 +146,9 @@ do
--systemddir=*)
SYSTEMDDIR=${arg#--systemddir=}
;;
+ --systemdgeneratordir=*)
+ SYSTEMDGENERATORDIR=${arg#--systemdgeneratordir=}
+ ;;
--tmpfilesddir=*)
TMPFILESDDIR=${arg#--tmpfilesddir=}
;;
@@ -350,6 +355,9 @@ if [ $INSTALLSYSTEMD -eq 1 ]; then
if [ -z "$SYSTEMDDIR" ]; then
SYSTEMDDIR=`pkg-config systemd --variable=systemdsystemunitdir`
fi
+ if [ -z "$SYSTEMDGENERATORDIR" ]; then
+ SYSTEMDGENERATORDIR=`pkg-config systemd --variable=systemdsystemgeneratordir`
+ fi
if [ -z "$TMPFILESDDIR" ]; then
TMPFILESDDIR=`pkg-config systemd --variable=tmpfilesdir`
fi
@@ -395,6 +403,7 @@ fi
if [ $INSTALLSYSTEMD -eq 1 ]; then
echo "SYSTEMDDIR := $SYSTEMDDIR" >> include.mk
+ echo "SYSTEMDGENERATORDIR := $SYSTEMDGENERATORDIR" >> include.mk
echo "TMPFILESDDIR := $TMPFILESDDIR" >> include.mk
echo "installing systemd units"
else