Re: [Openvpn-devel] [PATCH 1/1] Clean up plugin path handling

2016-12-09 Thread Christian Hesse
David Sommerseth  on Fri, 2016/12/09 23:40:
> On 09/12/16 22:54, Christian Hesse wrote:
> > David Sommerseth  on Fri, 2016/12/09
> > 22:37:  
> >> On 29/11/16 12:07, Christian Hesse wrote:  
> >>> From: Christian Hesse 
> >>>
> >>> Drop --with-plugindir, instead use an environment variable PLUGINDIR
> >>> to specify the plugin directory.
> >>>
> >>> This always defines PLUGIN_LIBDIR and enables plugin search path.
> >>>
> >>> Signed-off-by: Christian Hesse 
> >>> ---
> >>>  configure.ac| 14 ++
> >>>  src/openvpn/Makefile.am |  3 ++-
> >>>  2 files changed, 8 insertions(+), 9 deletions(-)
> >>>
> >>> diff --git a/configure.ac b/configure.ac
> >>> index f4073d0..5fe652e 100644
> >>> --- a/configure.ac
> >>> +++ b/configure.ac
> >>> @@ -301,13 +301,12 @@ AC_ARG_WITH(
> >>>   [with_crypto_library="openssl"]
> >>>  )
> >>>  
> >>> -AC_ARG_WITH(
> >>> - [plugindir],
> >>> - [AS_HELP_STRING([--with-plugindir], [plugin directory
> >>> @<:@default=LIBDIR/openvpn@:>@])],
> >>> - ,
> >>> - [with_plugindir="\$(libdir)/openvpn/plugins"]
> >>> -)
> >>> -
> >>> +AC_ARG_VAR([PLUGINDIR], [Path of plug-in directory
> >>> @<:@default=LIBDIR/openvpn/plugins@:>@]) +if test -n "${PLUGINDIR}";
> >>> then
> >>> + plugindir="${PLUGINDIR}"
> >>> +else
> >>> + plugindir="\${libdir}/openvpn/plugins"
> >>> +fi
> >>
> >> Finally had some time to dig into this one.  I like the idea here, I
> >> think it makes sense.  But I'm not sure ${libdir} is correct by default.
> >>  I think that should be /usr/local/lib64 by default on a 64bit system.
> >>
> >> My google-foo isn't helpful for me today ... This is somewhat related,
> >> especially towards the end of this doc page:
> >> 
> >>
> >> But I believe there are better ways to do this.
> >>
> >> I haven't checked this in detail what happens with 'make install'.  We
> >> should ensure that the plug-ins we ship (./src/plugins) which are built
> >> are installed as well into this directory.  
> > 
> > ${libdir} is where plugins are installed to... That's why I choose it. ;)
> > 
> > Installing anything to $prefix/lib64/ does not make sense imho. Never.  
> 
> Well, that is the default for Fedora/RHEL families.  32bit systems uses
> /usr/lib, 64bit uses /usr/lib64.
> 
> $ uname -m
> x86_64
> $ cat /etc/redhat-release
> Red Hat Enterprise Linux Server release 7.3 (Maipo)
> $ rpm --eval '%{_libdir}'
> /usr/lib64
> 
> I've tested this on Fedora 24 and Scientific Linux 6 and 7 as well, with
> the same result.
> 
> And you'll find the same in openSUSE too:
> 
> 
> Unless it has changed in Debian/Ubuntu, it is a similar policy there too.

Uh, interesting... Probably I did not look at these distributions for too
long... (And/or relied on the package manager.)

For Arch Linux we use /usr/lib/, though /usr/lib64/ is provided by a symlink
to lib nowadays.
-- 
main(a){char*c=/*Schoene Gruesse */"B?IJj;MEH"
"CX:;",b;for(a/*Best regards my address:*/=0;b=c[a++];)
putchar(b-1/(/*Chriscc -ox -xc - && ./x*/b/42*2-3)*42);}


pgpFNF7JacsGA.pgp
Description: OpenPGP digital signature
--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


Re: [Openvpn-devel] [PATCH 1/1] Clean up plugin path handling

2016-12-09 Thread David Sommerseth
On 09/12/16 22:54, Christian Hesse wrote:
> David Sommerseth  on Fri, 2016/12/09 22:37:
>> On 29/11/16 12:07, Christian Hesse wrote:
>>> From: Christian Hesse 
>>>
>>> Drop --with-plugindir, instead use an environment variable PLUGINDIR
>>> to specify the plugin directory.
>>>
>>> This always defines PLUGIN_LIBDIR and enables plugin search path.
>>>
>>> Signed-off-by: Christian Hesse 
>>> ---
>>>  configure.ac| 14 ++
>>>  src/openvpn/Makefile.am |  3 ++-
>>>  2 files changed, 8 insertions(+), 9 deletions(-)
>>>
>>> diff --git a/configure.ac b/configure.ac
>>> index f4073d0..5fe652e 100644
>>> --- a/configure.ac
>>> +++ b/configure.ac
>>> @@ -301,13 +301,12 @@ AC_ARG_WITH(
>>> [with_crypto_library="openssl"]
>>>  )
>>>  
>>> -AC_ARG_WITH(
>>> -   [plugindir],
>>> -   [AS_HELP_STRING([--with-plugindir], [plugin directory
>>> @<:@default=LIBDIR/openvpn@:>@])],
>>> -   ,
>>> -   [with_plugindir="\$(libdir)/openvpn/plugins"]
>>> -)
>>> -
>>> +AC_ARG_VAR([PLUGINDIR], [Path of plug-in directory
>>> @<:@default=LIBDIR/openvpn/plugins@:>@]) +if test -n "${PLUGINDIR}"; then
>>> +   plugindir="${PLUGINDIR}"
>>> +else
>>> +   plugindir="\${libdir}/openvpn/plugins"
>>> +fi  
>>
>> Finally had some time to dig into this one.  I like the idea here, I
>> think it makes sense.  But I'm not sure ${libdir} is correct by default.
>>  I think that should be /usr/local/lib64 by default on a 64bit system.
>>
>> My google-foo isn't helpful for me today ... This is somewhat related,
>> especially towards the end of this doc page:
>> 
>>
>> But I believe there are better ways to do this.
>>
>> I haven't checked this in detail what happens with 'make install'.  We
>> should ensure that the plug-ins we ship (./src/plugins) which are built
>> are installed as well into this directory.
> 
> ${libdir} is where plugins are installed to... That's why I choose it. ;)
> 
> Installing anything to $prefix/lib64/ does not make sense imho. Never.

Well, that is the default for Fedora/RHEL families.  32bit systems uses
/usr/lib, 64bit uses /usr/lib64.

$ uname -m
x86_64
$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.3 (Maipo)
$ rpm --eval '%{_libdir}'
/usr/lib64

I've tested this on Fedora 24 and Scientific Linux 6 and 7 as well, with
the same result.

And you'll find the same in openSUSE too:


Unless it has changed in Debian/Ubuntu, it is a similar policy there too.


-- 
kind regards,

David Sommerseth
OpenVPN Technologies, Inc




signature.asc
Description: OpenPGP digital signature
--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


Re: [Openvpn-devel] [PATCH 1/1] Clean up plugin path handling

2016-12-09 Thread Christian Hesse
David Sommerseth  on Fri, 2016/12/09 22:37:
> On 29/11/16 12:07, Christian Hesse wrote:
> > From: Christian Hesse 
> > 
> > Drop --with-plugindir, instead use an environment variable PLUGINDIR
> > to specify the plugin directory.
> > 
> > This always defines PLUGIN_LIBDIR and enables plugin search path.
> > 
> > Signed-off-by: Christian Hesse 
> > ---
> >  configure.ac| 14 ++
> >  src/openvpn/Makefile.am |  3 ++-
> >  2 files changed, 8 insertions(+), 9 deletions(-)
> > 
> > diff --git a/configure.ac b/configure.ac
> > index f4073d0..5fe652e 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -301,13 +301,12 @@ AC_ARG_WITH(
> > [with_crypto_library="openssl"]
> >  )
> >  
> > -AC_ARG_WITH(
> > -   [plugindir],
> > -   [AS_HELP_STRING([--with-plugindir], [plugin directory
> > @<:@default=LIBDIR/openvpn@:>@])],
> > -   ,
> > -   [with_plugindir="\$(libdir)/openvpn/plugins"]
> > -)
> > -
> > +AC_ARG_VAR([PLUGINDIR], [Path of plug-in directory
> > @<:@default=LIBDIR/openvpn/plugins@:>@]) +if test -n "${PLUGINDIR}"; then
> > +   plugindir="${PLUGINDIR}"
> > +else
> > +   plugindir="\${libdir}/openvpn/plugins"
> > +fi  
> 
> Finally had some time to dig into this one.  I like the idea here, I
> think it makes sense.  But I'm not sure ${libdir} is correct by default.
>  I think that should be /usr/local/lib64 by default on a 64bit system.
> 
> My google-foo isn't helpful for me today ... This is somewhat related,
> especially towards the end of this doc page:
> 
> 
> But I believe there are better ways to do this.
> 
> I haven't checked this in detail what happens with 'make install'.  We
> should ensure that the plug-ins we ship (./src/plugins) which are built
> are installed as well into this directory.

${libdir} is where plugins are installed to... That's why I choose it. ;)

Installing anything to $prefix/lib64/ does not make sense imho. Never.

32bit systems install to $prefix/lib/, 64bit system install to $prefix/lib/.
The only valid extra is $prefix/lib32/ for multilib on 64bit systemd.
-- 
main(a){char*c=/*Schoene Gruesse */"B?IJj;MEH"
"CX:;",b;for(a/*Best regards my address:*/=0;b=c[a++];)
putchar(b-1/(/*Chriscc -ox -xc - && ./x*/b/42*2-3)*42);}


pgpYJbsIcTxRu.pgp
Description: OpenPGP digital signature
--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


Re: [Openvpn-devel] [PATCH 1/1] Clean up plugin path handling

2016-12-09 Thread David Sommerseth
On 29/11/16 12:07, Christian Hesse wrote:
> From: Christian Hesse 
> 
> Drop --with-plugindir, instead use an environment variable PLUGINDIR
> to specify the plugin directory.
> 
> This always defines PLUGIN_LIBDIR and enables plugin search path.
> 
> Signed-off-by: Christian Hesse 
> ---
>  configure.ac| 14 ++
>  src/openvpn/Makefile.am |  3 ++-
>  2 files changed, 8 insertions(+), 9 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index f4073d0..5fe652e 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -301,13 +301,12 @@ AC_ARG_WITH(
>   [with_crypto_library="openssl"]
>  )
>  
> -AC_ARG_WITH(
> - [plugindir],
> - [AS_HELP_STRING([--with-plugindir], [plugin directory 
> @<:@default=LIBDIR/openvpn@:>@])],
> - ,
> - [with_plugindir="\$(libdir)/openvpn/plugins"]
> -)
> -
> +AC_ARG_VAR([PLUGINDIR], [Path of plug-in directory 
> @<:@default=LIBDIR/openvpn/plugins@:>@])
> +if test -n "${PLUGINDIR}"; then
> + plugindir="${PLUGINDIR}"
> +else
> + plugindir="\${libdir}/openvpn/plugins"
> +fi

Finally had some time to dig into this one.  I like the idea here, I
think it makes sense.  But I'm not sure ${libdir} is correct by default.
 I think that should be /usr/local/lib64 by default on a 64bit system.

My google-foo isn't helpful for me today ... This is somewhat related,
especially towards the end of this doc page:


But I believe there are better ways to do this.

I haven't checked this in detail what happens with 'make install'.  We
should ensure that the plug-ins we ship (./src/plugins) which are built
are installed as well into this directory.


-- 
kind regards,

David Sommerseth
OpenVPN Technologies, Inc




signature.asc
Description: OpenPGP digital signature
--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


Re: [Openvpn-devel] [PATCH 1/1] Clean up plugin path handling

2016-11-29 Thread Christian Hesse
Christian Hesse  on Tue, 2016/11/29 12:07:
> From: Christian Hesse 
> 
> Drop --with-plugindir, instead use an environment variable PLUGINDIR
> to specify the plugin directory.
> 
> This always defines PLUGIN_LIBDIR and enables plugin search path.
> 
> Signed-off-by: Christian Hesse 
> ---
>  configure.ac| 14 ++
>  src/openvpn/Makefile.am |  3 ++-
>  2 files changed, 8 insertions(+), 9 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index f4073d0..5fe652e 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -301,13 +301,12 @@ AC_ARG_WITH(
>   [with_crypto_library="openssl"]
>  )
>  
> -AC_ARG_WITH(
> - [plugindir],
> - [AS_HELP_STRING([--with-plugindir], [plugin directory
> @<:@default=LIBDIR/openvpn@:>@])],
> - ,
> - [with_plugindir="\$(libdir)/openvpn/plugins"]
> -)
> -
> +AC_ARG_VAR([PLUGINDIR], [Path of plug-in directory
> @<:@default=LIBDIR/openvpn/plugins@:>@]) +if test -n "${PLUGINDIR}"; then
> + plugindir="${PLUGINDIR}"
> +else
> + plugindir="\${libdir}/openvpn/plugins"
> +fi
>  
>  AC_DEFINE_UNQUOTED([TARGET_ALIAS], ["${host}"], [A string representing our
> host]) case "$host" in
> @@ -1245,7 +1244,6 @@ AM_CONDITIONAL([ENABLE_PLUGIN_AUTH_PAM], [test
> "${enable_plugin_auth_pam}" = "ye AM_CONDITIONAL([ENABLE_PLUGIN_DOWN_ROOT],
> [test "${enable_plugin_down_root}" = "yes"])
> AM_CONDITIONAL([ENABLE_CRYPTO], [test "${enable_crypto}" = "yes"]) 
> -plugindir="${with_plugindir}"
>  sampledir="\$(docdir)/sample"
>  AC_SUBST([plugindir])
>  AC_SUBST([sampledir])
> diff --git a/src/openvpn/Makefile.am b/src/openvpn/Makefile.am
> index 4c18449..188834a 100644
> --- a/src/openvpn/Makefile.am
> +++ b/src/openvpn/Makefile.am
> @@ -27,7 +27,8 @@ AM_CFLAGS = \
>   $(OPTIONAL_CRYPTO_CFLAGS) \
>   $(OPTIONAL_LZO_CFLAGS) \
>   $(OPTIONAL_LZ4_CFLAGS) \
> - $(OPTIONAL_PKCS11_HELPER_CFLAGS)
> + $(OPTIONAL_PKCS11_HELPER_CFLAGS) \
> + -DPLUGIN_LIBDIR=\"${plugindir}\"
>  if WIN32
>  # we want unicode entry point but not the macro
>  AM_CFLAGS += -municode -UUNICODE

The alternative would look something like this:

--- a/configure.ac
+++ b/configure.ac
@@ -301,13 +301,13 @@ AC_ARG_WITH(
[with_crypto_library="openssl"]
 )
 
-AC_ARG_WITH(
-   [plugindir],
-   [AS_HELP_STRING([--with-plugindir], [plugin directory 
@<:@default=LIBDIR/openvpn@:>@])],
-   ,
-   [with_plugindir="\$(libdir)/openvpn/plugins"]
-)
-
+AC_ARG_VAR([PLUGINDIR], [Path of plug-in directory 
@<:@default=LIBDIR/openvpn/plugins@:>@])
+if test -n "${PLUGINDIR}"; then
+   plugindir="${PLUGINDIR}"
+   AC_DEFINE_UNQUOTED([PLUGIN_LIBDIR], ["${PLUGINDIR}"], [Path of plug-in 
search directory])
+else
+   plugindir="\${libdir}/openvpn/plugins"
+fi
 
 AC_DEFINE_UNQUOTED([TARGET_ALIAS], ["${host}"], [A string representing our 
host])
 case "$host" in
@@ -1245,7 +1245,6 @@ AM_CONDITIONAL([ENABLE_PLUGIN_AUTH_PAM], [test 
"${enable_plugin_auth_pam}" = "ye
 AM_CONDITIONAL([ENABLE_PLUGIN_DOWN_ROOT], [test "${enable_plugin_down_root}" = 
"yes"])
 AM_CONDITIONAL([ENABLE_CRYPTO], [test "${enable_crypto}" = "yes"])
 
-plugindir="${with_plugindir}"
 sampledir="\$(docdir)/sample"
 AC_SUBST([plugindir])
 AC_SUBST([sampledir])

However you *have* to give PLUGINDIR this way to enable the search path. I
would like to avoid that. And I did not find a way to move
AC_DEFINE_UNQUOTED() below the condition due to the nested variables in
$libdir.
-- 
main(a){char*c=/*Schoene Gruesse */"B?IJj;MEH"
"CX:;",b;for(a/*Best regards my address:*/=0;b=c[a++];)
putchar(b-1/(/*Chriscc -ox -xc - && ./x*/b/42*2-3)*42);}


pgp65zxVT78KU.pgp
Description: OpenPGP digital signature
--
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel