Skip to content

Commit

Permalink
Build all python plugins on windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco van Wieringen committed Jun 23, 2015
1 parent 51c3926 commit fdcab57
Show file tree
Hide file tree
Showing 9 changed files with 125 additions and 11 deletions.
3 changes: 3 additions & 0 deletions platforms/win32/winbareos-nsi.spec
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,10 @@ do
bat.exe \
bpipe-fd.dll \
mssqlvdi-fd.dll \
python-fd.dll \
autoxflate-sd.dll \
python-sd.dll \
python-dir.dll \
libbareos.dll \
libbareosfind.dll \
libbareoslmdb.dll \
Expand Down
8 changes: 5 additions & 3 deletions platforms/win32/winbareos.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,7 @@ SectionIn 1 2 3
SetOverwrite ifnewer
File "bpipe-fd.dll"
File "mssqlvdi-fd.dll"
File "python-fd.dll"
SectionEnd

Section "Open Firewall for File Daemon" SEC_FIREWALL_FD
Expand Down Expand Up @@ -606,6 +607,7 @@ SectionIn 2
SetOutPath "$INSTDIR\Plugins"
SetOverwrite ifnewer
File "autoxflate-sd.dll"
File "python-sd.dll"
SectionEnd


Expand Down Expand Up @@ -746,18 +748,18 @@ SectionIn 2
FileWrite $R1 'REM this script deletes the db dump $\r$\n'
FileWrite $R1 'del $APPDATA\${PRODUCT_NAME}\working\bareos.sql $\r$\n'
FileClose $R1


SectionEnd


Section /o "Director Plugins " SEC_DIRPLUGINS
SectionIn 2
SetShellVarContext all
SetOutPath "$INSTDIR\Plugins"
SetOverwrite ifnewer
# File "autoxflate-sd.dll"
File "python-dir.dll"
SectionEnd


Section "Open Firewall for Director" SEC_FIREWALL_DIR
SectionIn 2
SetShellVarContext current
Expand Down
4 changes: 3 additions & 1 deletion platforms/win32/winbareos32.spec
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ BuildRequires: bareos-addons
%define SIGNCERT ia.p12
%define SIGNPWFILE signpassword


Source1: fillup.sed
Patch1: tray-monitor-conf.patch
Patch2: tray-monitor-conf-fd-sd.patch
Expand Down Expand Up @@ -209,7 +208,10 @@ for flavor in `echo "%flavors"`; do
lmdb/libbareoslmdb.dll \
plugins/filed/bpipe-fd.dll \
plugins/filed/mssqlvdi-fd.dll \
plugins/filed/python-fd.dll \
plugins/stored/autoxflate-sd.dll \
plugins/stored/python-sd.dll \
plugins/dird/python-dir.dll \
$RPM_BUILD_ROOT%{_mingw32_bindir}/$flavor

for cfg in ../qt-tray-monitor/tray-monitor.fd.conf.in \
Expand Down
3 changes: 3 additions & 0 deletions platforms/win32/winbareos64.spec
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,10 @@ for flavor in `echo "%flavors"`; do
lmdb/libbareoslmdb.dll \
plugins/filed/bpipe-fd.dll \
plugins/filed/mssqlvdi-fd.dll \
plugins/filed/python-fd.dll \
plugins/stored/autoxflate-sd.dll \
plugins/stored/python-sd.dll \
plugins/dird/python-dir.dll \
$RPM_BUILD_ROOT%{_mingw64_bindir}/$flavor

for cfg in ../qt-tray-monitor/tray-monitor.fd.conf.in \
Expand Down
3 changes: 1 addition & 2 deletions src/plugins/filed/python-fd.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
* Marco van Wieringen, August 2012
*/
#define BUILD_PLUGIN
#define BUILDING_DLL /* required for Windows plugin */

#include "bareos.h"
#include "fd_plugins.h"
Expand Down Expand Up @@ -193,7 +192,7 @@ bRC DLL_IMP_EXP loadPlugin(bInfo *lbinfo,
/*
* Plugin called here when it is unloaded, normally when Bareos is going to exit.
*/
bRC unloadPlugin()
bRC DLL_IMP_EXP unloadPlugin()
{
/*
* Terminate Python
Expand Down
2 changes: 1 addition & 1 deletion src/win32/plugins/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
#
all_subdirs = filed stored
all_subdirs = filed stored dird

all:
@for I in ${all_subdirs}; \
Expand Down
75 changes: 75 additions & 0 deletions src/win32/plugins/dird/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#
# BAREOS® - Backup Archiving REcovery Open Sourced
#
# Copyright (C) 2014-2014 Bareos GmbH & Co. KG
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of version three of the GNU Affero General Public
# License as published by the Free Software Foundation and included
# in the file LICENSE.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
#
VPATH = .:../../../plugins/dird

include ../../Makefile.inc

ifeq ($(WIN_VERSION),32)
INCLUDES = -I../../.. \
-I../../../include \
-I../../../dird \
-I../../../plugins/dird \
-I../../include \
-I../../compat/include
else
INCLUDES = -I../../.. \
-I../../../include \
-I../../../dird \
-I../../../plugins/dird \
-I../../include \
-I../../compat/include
endif
PYTHON_INCLUDES = -I../python/include
LDLIBS = ../../lib/libbareos.dll \
$(MINGW_LIB)/libpthreadGCE2.a \
$(MINGW_LIB)/libz.dll.a \
$(MINGW_LIB)/libfastlz.dll.a \
$(WINSOCKLIB) -lole32 -loleaut32 -luuid

ifeq ($(WIN_DEBUG),yes)
OPT_CXXFLAGS = $(CXXFLAGS) -O2
else
OPT_CXXFLAGS = $(CXXFLAGS)
endif

all: python-dir.dll

ifeq ($(WIN_VERSION),64)
python-dir.o: CXXFLAGS += -DMS_WIN64
endif
python-dir.o: python-dir.c
@echo "Compiling $<"
$(CXX) $(DLL_USAGE) $(OPT_CXXFLAGS) $(PYTHON_INCLUDES) -c -o $@ $<

python-dir.dll: DLL_USAGE = -DBUILDING_DLL
python-dir.dll: python-dir.o
$(CXX) $(LDFLAGS_DLL) -Wl,--out-implib,$@.a python-dir.o $(LDLIBS) ../python/lib/$(WIN_VERSION)/python27.dll -o $@

clean:
rm -f *.o

distclean:: clean
rm -f python-dir.dll python-dir.dll.a

# inference rules
.c.o:
@echo "Compiling $<"
$(CXX) $(DLL_USAGE) $(CXXFLAGS) -c -o $@ $<
16 changes: 14 additions & 2 deletions src/win32/plugins/filed/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ INCLUDES = -I../../.. \
-I../../include \
-I../../compat/include
VDI_INCLUDES = -I../../vdi/include
PYTHON_INCLUDES = -I../python/include
LDLIBS = ../../lib/libbareos.dll \
$(MINGW_LIB)/libpthreadGCE2.a \
$(MINGW_LIB)/libz.dll.a \
Expand All @@ -40,7 +41,7 @@ else
OPT_CXXFLAGS = $(CXXFLAGS)
endif

all: bpipe-fd.dll mssqlvdi-fd.dll
all: bpipe-fd.dll mssqlvdi-fd.dll python-fd.dll

bpipe-fd.dll: DLL_USAGE = -DBUILDING_DLL
bpipe-fd.dll: bpipe-fd.o
Expand All @@ -55,11 +56,22 @@ mssqlvdi-fd.dll: DLL_USAGE = -DBUILDING_DLL
mssqlvdi-fd.dll: mssqlvdi-fd.o
$(CXX) $(LDFLAGS_DLL) -Wl,--out-implib,$@.a mssqlvdi-fd.o $(LDLIBS) -o $@

ifeq ($(WIN_VERSION),64)
python-fd.o: CXXFLAGS += -DMS_WIN64
endif
python-fd.o: python-fd.c
@echo "Compiling $<"
$(CXX) $(DLL_USAGE) $(OPT_CXXFLAGS) $(PYTHON_INCLUDES) -c -o $@ $<

python-fd.dll: DLL_USAGE = -DBUILDING_DLL
python-fd.dll: python-fd.o
$(CXX) $(LDFLAGS_DLL) -Wl,--out-implib,$@.a python-fd.o $(LDLIBS) ../python/lib/$(WIN_VERSION)/python27.dll -o $@

clean:
rm -f *.o

distclean:: clean
rm -f bpipe-fd.dll mssqlvdi-fd.dll
rm -f bpipe-fd.dll mssqlvdi-fd.dll python-fd.dll bpipe-fd.dll.a mssqlvdi-fd.dll.a python-fd.dll.a

# inference rules
.c.o:
Expand Down
22 changes: 20 additions & 2 deletions src/win32/plugins/stored/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,41 @@ INCLUDES = -I../../.. \
-I../../include \
-I../../compat/include
endif
PYTHON_INCLUDES = -I../python/include
LDLIBS = ../../lib/libbareos.dll \
$(MINGW_LIB)/libpthreadGCE2.a \
$(MINGW_LIB)/libz.dll.a \
$(MINGW_LIB)/libfastlz.dll.a \
$(WINSOCKLIB) -lole32 -loleaut32 -luuid

all: autoxflate-sd.dll
ifeq ($(WIN_DEBUG),yes)
OPT_CXXFLAGS = $(CXXFLAGS) -O2
else
OPT_CXXFLAGS = $(CXXFLAGS)
endif

all: autoxflate-sd.dll python-sd.dll

autoxflate-sd.dll: DLL_USAGE = -DBUILDING_DLL
autoxflate-sd.dll: autoxflate-sd.o
$(CXX) $(LDFLAGS_DLL) -Wl,--out-implib,$@.a autoxflate-sd.o $(LDLIBS) -o $@

ifeq ($(WIN_VERSION),64)
python-sd.o: CXXFLAGS += -DMS_WIN64
endif
python-sd.o: python-sd.c
@echo "Compiling $<"
$(CXX) $(DLL_USAGE) $(OPT_CXXFLAGS) $(PYTHON_INCLUDES) -c -o $@ $<

python-sd.dll: DLL_USAGE = -DBUILDING_DLL
python-sd.dll: python-sd.o
$(CXX) $(LDFLAGS_DLL) -Wl,--out-implib,$@.a python-sd.o $(LDLIBS) ../python/lib/$(WIN_VERSION)/python27.dll -o $@

clean:
rm -f *.o

distclean:: clean
rm -f autoxflate-sd.dll
rm -f autoxflate-sd.dll python-sd.dll autoxflate-sd.dll.a python-sd.dll.a

# inference rules
.c.o:
Expand Down

0 comments on commit fdcab57

Please sign in to comment.