summaryrefslogtreecommitdiffstats
path: root/src/plugins/down-root
diff options
context:
space:
mode:
authorAlon Bar-Lev <alon.barlev@gmail.com>2012-05-15 01:42:03 +0300
committerDavid Sommerseth <davids@redhat.com>2012-06-26 11:29:02 +0200
commitce8271f5d435be963c79945f8d7eb6ea2e4369fa (patch)
tree65882d5da0481522320cb0133564db70bfce72b9 /src/plugins/down-root
parent8acdb7291c4cc62134624c3a61049f2ec12e3ad9 (diff)
downloadopenvpn-ce8271f5d435be963c79945f8d7eb6ea2e4369fa.tar.gz
openvpn-ce8271f5d435be963c79945f8d7eb6ea2e4369fa.tar.xz
openvpn-ce8271f5d435be963c79945f8d7eb6ea2e4369fa.zip
build: integrate plugins build into core build
As disucssed[1], keep plugins in repository. 1, Proper automake/libtool build. 2. Move example plugins to samples/sample-plugins. 3. Plugins are installed at LIBDIR/openvpn/plugins. [1] http://comments.gmane.org/gmane.network.openvpn.devel/6436 Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Acked-by: David Sommerseth <davids@redhat.com> Message-Id: 1337035323-27465-1-git-send-email-alon.barlev@gmail.com URL: http://article.gmane.org/gmane.network.openvpn.devel/6591 Signed-off-by: David Sommerseth <davids@redhat.com>
Diffstat (limited to 'src/plugins/down-root')
-rwxr-xr-xsrc/plugins/down-root/Makefile18
-rw-r--r--src/plugins/down-root/Makefile.am23
-rw-r--r--src/plugins/down-root/README.down-root (renamed from src/plugins/down-root/README)0
-rw-r--r--src/plugins/down-root/down-root.c6
-rw-r--r--src/plugins/down-root/down-root.exports4
5 files changed, 32 insertions, 19 deletions
diff --git a/src/plugins/down-root/Makefile b/src/plugins/down-root/Makefile
deleted file mode 100755
index e66c99a..0000000
--- a/src/plugins/down-root/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Build the OpenVPN down-root plugin module.
-#
-
-# This directory is where we will look for openvpn-plugin.h
-CPPFLAGS=-I../../../include
-
-CC=gcc
-CFLAGS=-O2 -Wall
-
-down-root.so : down-root.o
- $(CC) $(CFLAGS) -fPIC -shared $(LDFLAGS) -Wl,-soname,openvpn-down-root.so -o openvpn-down-root.so down-root.o -lc
-
-down-root.o : down-root.c
- $(CC) $(CPPFLAGS) $(CFLAGS) -fPIC -c down-root.c
-
-clean :
- -rm -f *.o *.so
diff --git a/src/plugins/down-root/Makefile.am b/src/plugins/down-root/Makefile.am
new file mode 100644
index 0000000..064aa30
--- /dev/null
+++ b/src/plugins/down-root/Makefile.am
@@ -0,0 +1,23 @@
+#
+# OpenVPN (TM) Down Root Plugin -- OpenVPN Plugin
+#
+# Copyright (C) 2012 Alon Bar-Lev <alon.barlev@gmail.com>
+#
+
+MAINTAINERCLEANFILES = \
+ $(srcdir)/Makefile.in
+
+AM_CFLAGS = \
+ -I$(top_srcdir)/include
+
+if ENABLE_PLUGIN_DOWN_ROOT
+plugin_LTLIBRARIES = openvpn-plugin-down-root.la
+dist_doc_DATA = README.down-root
+endif
+
+openvpn_plugin_down_root_la_SOURCES = \
+ down-root.c \
+ down-root.exports
+openvpn_plugin_down_root_la_LDFLAGS = $(AM_LDFLAGS) \
+ -export-symbols "$(srcdir)/down-root.exports" \
+ -module -shared -avoid-version -no-undefined
diff --git a/src/plugins/down-root/README b/src/plugins/down-root/README.down-root
index d337ffe..d337ffe 100644
--- a/src/plugins/down-root/README
+++ b/src/plugins/down-root/README.down-root
diff --git a/src/plugins/down-root/down-root.c b/src/plugins/down-root/down-root.c
index fced23b..d51d0e5 100644
--- a/src/plugins/down-root/down-root.c
+++ b/src/plugins/down-root/down-root.c
@@ -26,6 +26,10 @@
* OpenVPN plugin module to do privileged down-script execution.
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stdio.h>
#include <string.h>
#include <unistd.h>
@@ -37,7 +41,7 @@
#include <signal.h>
#include <syslog.h>
-#include "openvpn-plugin.h"
+#include <openvpn-plugin.h>
#define DEBUG(verb) ((verb) >= 7)
diff --git a/src/plugins/down-root/down-root.exports b/src/plugins/down-root/down-root.exports
new file mode 100644
index 0000000..b07937c
--- /dev/null
+++ b/src/plugins/down-root/down-root.exports
@@ -0,0 +1,4 @@
+openvpn_plugin_open_v1
+openvpn_plugin_func_v1
+openvpn_plugin_close_v1
+openvpn_plugin_abort_v1