From 533fb1772dc6298b6196a6be93a746d9e15a6d59 Mon Sep 17 00:00:00 2001 From: van Hauser Date: Fri, 5 Feb 2016 10:38:46 +0100 Subject: [PATCH] ./configure --fhs support --- CHANGES | 1 + Makefile.am | 2 +- configure | 25 ++++++++++++++++++++++--- hydra.c | 4 ++-- 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 567201c..e74e7a5 100644 --- a/CHANGES +++ b/CHANGES @@ -15,6 +15,7 @@ Release 8.2-pre * Fixed an out of memory bug in http-form * Fixed imap PLAIN method * Added warning if HYDRA_PROXY_CONNECT environment is detected, that is an outdated setting +* Added --fhs switch to configure (for Linux distribution usage) * ... your patch? diff --git a/Makefile.am b/Makefile.am index a5c00be..f340e8b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,5 @@ # -# Makefile for Hydra - (c) 2001-2014 by van Hauser / THC +# Makefile for Hydra - (c) 2001-2016 by van Hauser / THC # OPTS=-I. -O3 # -Wall -g -pedantic diff --git a/configure b/configure index fc1f417..2b72924 100755 --- a/configure +++ b/configure @@ -6,6 +6,7 @@ if [ "$1" = "-h" -o "$1" = "--help" ]; then echo Options: echo " --prefix=path path to install hydra and its datafiles to" + echo " --fhs install according to the File System Hierarchy Standard" echo " --with-oracle=prefix prefix for oracle include dir" echo " --with-oracle-lib=prefix prefix for oracle lib dir" echo " --with-ssl=prefix prefix for SSL headers" @@ -17,6 +18,7 @@ if [ "$1" = "-h" -o "$1" = "--help" ]; then exit 0 fi +FHS="" SIXFOUR="" DEBUG="" PREFIX="" @@ -72,6 +74,12 @@ if [ '!' "X" = "X$*" ]; then NOSTRIP="yes" fi fi + if [ "X" = "X$FHS" ]; then + FHS_TMP=`echo "$1"|sed 's/.*--fhs//'` + if [ -z "$FHS_TMP" ]; then + FHS="yes" + fi + fi if [ "X" = "X$DEBUG" ]; then DEBUG_TMP=`echo "$1"|sed 's/.*--debug//'` if [ -z "$DEBUG_TMP" ]; then @@ -1191,9 +1199,16 @@ else XHYDRA_SUPPORT="xhydra" fi -echo "Hydra will be installed into .../bin of: $PREFIX" -echo " (change this by running ./configure --prefix=path)" -echo +if [ "X" != "X$FHS" ]; then + PREFIX=/usr + echo "Hydra will be installed into .../bin of: $PREFIX" + echo " (according to the File System Hierarchy Standard)" + echo +else + echo "Hydra will be installed into .../bin of: $PREFIX" + echo " (change this by running ./configure --prefix=path)" + echo +fi if [ "X" != "X$DEBUG" ]; then echo DEBUG: XDEFINES=$XDEFINES $MATH @@ -1206,6 +1221,10 @@ if [ "X" != "X$DEBUG" ]; then fi echo "Writing Makefile.in ..." +if [ "X" != "X$FHS" ]; then + echo "MANDIR = /share/man/man1" >> Makefile.in + echo "DATADIR = /share/hydra" >> Makefile.in +fi echo "XDEFINES=$XDEFINES $MATH" >> Makefile.in echo "XLIBS=$XLIBS" >> Makefile.in echo "XLIBPATHS=$XLIBPATHS" >> Makefile.in diff --git a/hydra.c b/hydra.c index acfb2cd..d39f683 100644 --- a/hydra.c +++ b/hydra.c @@ -1,5 +1,5 @@ /* - * hydra (c) 2001-2014 by van Hauser / THC + * hydra (c) 2001-2016 by van Hauser / THC * http://www.thc.org * * Parallized network login hacker. @@ -2173,7 +2173,7 @@ int main(int argc, char *argv[]) { struct sockaddr_in6 *ipv6 = NULL; struct sockaddr_in *ipv4 = NULL; - printf("%s %s (c) 2014 by %s - Please do not use in military or secret service organizations, or for illegal purposes.\n\n", PROGRAM, VERSION, AUTHOR); + printf("%s %s (c) 2016 by %s - Please do not use in military or secret service organizations, or for illegal purposes.\n\n", PROGRAM, VERSION, AUTHOR); #ifndef LIBPOSTGRES SERVICES = hydra_string_replace(SERVICES, "postgres ", ""); strcat(unsupported, "postgres ");