diff options
author | Tobias Brunner <tobias@strongswan.org> | 2012-06-19 17:12:53 +0200 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2012-06-25 16:53:38 +0200 |
commit | bc6d9447058c946b199daf0defc8869bea92ba5e (patch) | |
tree | d73c02e2c5bdd496df348dbe815758246366fb8d /src/ipsec | |
parent | d86cf32b4be46039a25986224a56fd7b03c84718 (diff) | |
download | strongswan-bc6d9447058c946b199daf0defc8869bea92ba5e.tar.bz2 strongswan-bc6d9447058c946b199daf0defc8869bea92ba5e.tar.xz |
Added an option to rename the ipsec script during installation
Also rename the man page and adjust all references in the script, the
man page and other files.
Closes #194.
Diffstat (limited to 'src/ipsec')
-rw-r--r-- | src/ipsec/.gitignore | 4 | ||||
-rw-r--r-- | src/ipsec/Makefile.am | 27 | ||||
-rw-r--r-- | src/ipsec/ipsec.8.in | 33 | ||||
-rw-r--r-- | src/ipsec/ipsec.in | 29 |
4 files changed, 55 insertions, 38 deletions
diff --git a/src/ipsec/.gitignore b/src/ipsec/.gitignore index 8517fc4f9..6eca7ddba 100644 --- a/src/ipsec/.gitignore +++ b/src/ipsec/.gitignore @@ -1,2 +1,2 @@ -ipsec -ipsec.8 +_ipsec +_ipsec.8 diff --git a/src/ipsec/Makefile.am b/src/ipsec/Makefile.am index bbf009721..29e710533 100644 --- a/src/ipsec/Makefile.am +++ b/src/ipsec/Makefile.am @@ -1,22 +1,35 @@ -sbin_SCRIPTS = ipsec -CLEANFILES = ipsec ipsec.8 -dist_man8_MANS = ipsec.8 +sbin_SCRIPTS = _ipsec +CLEANFILES = _ipsec _ipsec.8 +dist_man8_MANS = _ipsec.8 EXTRA_DIST = ipsec.in ipsec.8.in Android.mk -ipsec.8 : ipsec.8.in +_ipsec.8 : ipsec.8.in sed \ -e "s:@IPSEC_VERSION@:$(PACKAGE_VERSION):" \ - $(srcdir)/$@.in > $@ + -e "s:@IPSEC_SCRIPT@:$(ipsec_script):g" \ + -e "s:@IPSEC_SCRIPT_UPPER@:$(ipsec_script_upper):g" \ + $< > $@ -ipsec : ipsec.in +_ipsec : ipsec.in sed \ -e "s:@IPSEC_SHELL@:/bin/sh:" \ -e "s:@IPSEC_VERSION@:$(PACKAGE_VERSION):" \ -e "s:@IPSEC_NAME@:$(PACKAGE_NAME):" \ -e "s:@IPSEC_DISTRO@::" \ -e "s:@IPSEC_DIR@:$(ipsecdir):" \ + -e "s:@IPSEC_SCRIPT@:$(ipsec_script):" \ -e "s:@IPSEC_SBINDIR@:$(sbindir):" \ -e "s:@IPSEC_CONFDIR@:$(sysconfdir):" \ -e "s:@IPSEC_PIDDIR@:$(piddir):" \ - $(srcdir)/$@.in > $@ + $< > $@ chmod +x $@ + +install-exec-hook: + mv $(DESTDIR)$(sbindir)/_ipsec $(DESTDIR)$(sbindir)/$(ipsec_script) + +install-data-hook: + mv $(DESTDIR)$(man8dir)/_ipsec.8 $(DESTDIR)$(man8dir)/$(ipsec_script).8 + +uninstall-hook: + rm -f $(DESTDIR)$(sbindir)/$(ipsec_script) + rm -f $(DESTDIR)$(man8dir)/$(ipsec_script).8 diff --git a/src/ipsec/ipsec.8.in b/src/ipsec/ipsec.8.in index ba8df4fc7..41c6ff8d2 100644 --- a/src/ipsec/ipsec.8.in +++ b/src/ipsec/ipsec.8.in @@ -1,13 +1,13 @@ -.TH IPSEC 8 "2010-05-30" "@IPSEC_VERSION@" "strongSwan" +.TH @IPSEC_SCRIPT_UPPER@ 8 "2012-06-19" "@IPSEC_VERSION@" "strongSwan" .SH NAME -ipsec \- invoke IPsec utilities +@IPSEC_SCRIPT@ \- invoke IPsec utilities .SH SYNOPSIS -.B ipsec +.B @IPSEC_SCRIPT@ \fIcommand\fP [ \fIarguments\fP ] [ \fIoptions\fP ] .PP .SH DESCRIPTION The -.B ipsec +.B @IPSEC_SCRIPT@ utility invokes any of several utilities involved in controlling and monitoring the IPsec encryption/authentication system, running the specified \fIcommand\fP with the specified \fIarguments\fP and \fIoptions\fP as if it had been invoked @@ -18,7 +18,7 @@ All the commands described in this manual page are built-in and are used to control and monitor IPsec connections as well as the IKE daemons. .PP For other commands -.I ipsec +.I @IPSEC_SCRIPT@ supplies the invoked .I command with a suitable PATH environment variable, @@ -226,7 +226,9 @@ purges all cached OCSP information records. .SS INFO COMMANDS .TP .B "\-\-help" -returns the usage information for the ipsec command. +returns the usage information for the +.B @IPSEC_SCRIPT@ +command. .PP .TP .B "\-\-version" @@ -260,19 +262,20 @@ returns the \fISYSCONFDIR\fP directory as defined by the configure options. The following environment variables control where strongSwan finds its components. The -.B ipsec +.B @IPSEC_SCRIPT@ command sets them if they are not already set. .nf .na -IPSEC_DIR directory containing ipsec programs and utilities -IPSEC_SBINDIR directory containing \fBipsec\fP command -IPSEC_CONFDIR directory containing configuration files -IPSEC_PIDDIR directory containing PID files -IPSEC_NAME name of ipsec distribution -IPSEC_VERSION version numer of ipsec userland and kernel -IPSEC_STARTER_PID PID file for ipsec starter -IPSEC_CHARON_PID PID file for IKE keying daemon +IPSEC_DIR directory containing ipsec programs and utilities +IPSEC_SBINDIR directory containing \fBipsec\fP command +IPSEC_CONFDIR directory containing configuration files +IPSEC_PIDDIR directory containing PID files +IPSEC_SCRIPT name of the ipsec script +IPSEC_NAME name of ipsec distribution +IPSEC_VERSION version numer of ipsec userland and kernel +IPSEC_STARTER_PID PID file for ipsec starter +IPSEC_CHARON_PID PID file for IKE keying daemon .ad .fi .SH SEE ALSO diff --git a/src/ipsec/ipsec.in b/src/ipsec/ipsec.in index a2d77b6d9..2acf5a3f6 100644 --- a/src/ipsec/ipsec.in +++ b/src/ipsec/ipsec.in @@ -28,6 +28,7 @@ IPSEC_DIR="@IPSEC_DIR@" IPSEC_SBINDIR="@IPSEC_SBINDIR@" IPSEC_CONFDIR="@IPSEC_CONFDIR@" IPSEC_PIDDIR="@IPSEC_PIDDIR@" +IPSEC_SCRIPT="@IPSEC_SCRIPT@" IPSEC_STARTER_PID="${IPSEC_PIDDIR}/starter.pid" IPSEC_CHARON_PID="${IPSEC_PIDDIR}/charon.pid" @@ -35,21 +36,21 @@ IPSEC_CHARON_PID="${IPSEC_PIDDIR}/charon.pid" IPSEC_STROKE="${IPSEC_DIR}/stroke" IPSEC_STARTER="${IPSEC_DIR}/starter" -export IPSEC_DIR IPSEC_SBINDIR IPSEC_CONFDIR IPSEC_PIDDIR IPSEC_VERSION IPSEC_NAME IPSEC_STARTER_PID IPSEC_CHARON_PID +export IPSEC_DIR IPSEC_SBINDIR IPSEC_CONFDIR IPSEC_PIDDIR IPSEC_SCRIPT IPSEC_VERSION IPSEC_NAME IPSEC_STARTER_PID IPSEC_CHARON_PID IPSEC_DISTRO="Institute for Internet Technologies and Applications\nUniversity of Applied Sciences Rapperswil, Switzerland" case "$1" in '') - echo "Usage: ipsec command argument ..." - echo "Use --help for list of commands, or see ipsec(8) manual page" - echo "or the $IPSEC_NAME documentation for names of the common ones." - echo "Most have their own manual pages, e.g. ipsec_auto(8)." + echo "Usage: $IPSEC_SCRIPT command argument ..." + echo "Use --help for list of commands, or see $IPSEC_SCRIPT(8) manual " + echo "page or the $IPSEC_NAME documentation for names of the common " + echo "ones." echo "See <http://www.strongswan.org> for more general info." exit 0 ;; --help) - echo "Usage: ipsec command argument ..." + echo "Usage: $IPSEC_SCRIPT command argument ..." echo "where command is one of:" echo " start|restart arguments..." echo " update|reload|stop" @@ -94,7 +95,7 @@ down) shift if [ "$#" -ne 1 ] then - echo "Usage: ipsec down <connection name>" + echo "Usage: $IPSEC_SCRIPT down <connection name>" exit 2 fi rc=7 @@ -109,7 +110,7 @@ down-srcip) shift if [ "$#" -lt 1 ] then - echo "Usage: ipsec down-srcip <start> [<end>]" + echo "Usage: $IPSEC_SCRIPT down-srcip <start> [<end>]" exit 2 fi rc=7 @@ -183,10 +184,10 @@ reload) exit "$rc" ;; restart) - $IPSEC_SBINDIR/ipsec stop + $IPSEC_SBINDIR/$IPSEC_SCRIPT stop sleep 2 shift - exec $IPSEC_SBINDIR/ipsec start "$@" + exec $IPSEC_SBINDIR/$IPSEC_SCRIPT start "$@" ;; route|unroute) op="$1" @@ -194,7 +195,7 @@ route|unroute) shift if [ "$#" -ne 1 ] then - echo "Usage: ipsec $op <connection name>" + echo "Usage: $IPSEC_SCRIPT $op <connection name>" exit 2 fi if [ -e $IPSEC_CHARON_PID ] @@ -282,7 +283,7 @@ up) shift if [ "$#" -ne 1 ] then - echo "Usage: ipsec up <connection name>" + echo "Usage: $IPSEC_SCRIPT up <connection name>" exit 2 fi rc=7 @@ -307,7 +308,7 @@ update) version|--version) printf "$OS_NAME $IPSEC_NAME $IPSEC_VERSION\n" printf "$IPSEC_DISTRO\n" - printf "See 'ipsec --copyright' for copyright information.\n" + printf "See '$IPSEC_SCRIPT --copyright' for copyright information.\n" exit 0 ;; --*) @@ -326,7 +327,7 @@ then path="$IPSEC_DIR/$cmd" if [ ! -x "$path" ] then - echo "$0: unknown IPsec command \`$cmd' (\`ipsec --help' for list)" >&2 + echo "$0: unknown IPsec command \`$cmd' (\`$IPSEC_SCRIPT --help' for list)" >&2 exit 2 fi fi |