Skip to content

Commit

Permalink
Last part in windows support, director on windows.
Browse files Browse the repository at this point in the history
This patch adds the things needed to cross-compile the director using
MINGW on Linux. It adds the build infrastructure for building the
database backend infrastructure (catalog) and the actual director and
dbcheck for windows. It also adds the bsmtp binary in tools and the
changes needed to the installer to install all new stuff.

It does however not supply the database (postgresql or sqlite3) you
need to install those before running the bareos-installer.

Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
  • Loading branch information
pstorz authored and Marco van Wieringen committed Feb 17, 2015
1 parent b8deed1 commit 01e39cc
Show file tree
Hide file tree
Showing 43 changed files with 1,280 additions and 166 deletions.
22 changes: 20 additions & 2 deletions platforms/win32/fillup.sed
Expand Up @@ -9,5 +9,23 @@ s#@sd_password@#XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX#g
s#@dir_port@#9101#g
s#@fd_port@#9102#g
s#@sd_port@#9103#g
s#@plugindir@#"C:/Program Files/Bareos/Plugins"#g
s#@archivedir@#"C:/bareos-storage"#g
s#@plugindir@#C:/Program Files/Bareos/Plugins#g
s#@archivedir@#C:/bareos-storage#g
s#@scriptdir@#C:/Program Files/Bareos#g
s#@working_dir@#C:/ProgramData/Bareos/working#g
s#@logdir@#C:/ProgramData/Bareos/logs#g
s#@sbindir@#C:/Program Files/Bareos#g
s#@sysconfdir@#C:/ProgramData/Bareos#g
s/@uncomment_dbi/#/g
s#@db_name@#bareos#g
s#@db_user@#bareos#g
s#/tmp/bareos-restores#"C:/temp/bareos-restores"#g
s#@db_password@#XXX_REPLACE_WITH_DB_PASSWORD_XXX#g
s#@smtp_host@#XXX_REPLACE_WITH_SMTP_HOST_XXX#g
s#@job_email@#XXX_REPLACE_WITH_JOB_EMAIL_XXX#g
s#@DEFAULT_DB_TYPE@#XXX_REPLACE_WITH_DEFAULT_DB_TYPE_XXX#g
s#@db_port@#XXX_REPLACE_WITH_DB_PORT_XXX#g

# ddl sql files
s#@DB_PASS@#XXX_REPLACE_WITH_DB_PASSWORD_XXX#g
s#@DB_USER@#XXX_REPLACE_WITH_DB_USER_XXX#g
48 changes: 48 additions & 0 deletions platforms/win32/mingw-debugsrc-devel.spec
@@ -0,0 +1,48 @@
#
# spec file for package mingw-debugsrc-devel
#
# Copyright (c) 2014 Bareos GmbH & Co. KG
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.bareos.org
#
#!BuildIgnore: post-build-checks

Name: mingw-debugsrc-devel
Version: 14.1.0
Release: 0
Summary: bareos
License: LGPLv2+
Group: Development/Libraries
URL: http://bareos.org
Source0: bareos-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch

%description

%prep
%setup -q -n bareos-%{version}

%build

%install
cp -av ../bareos-* $RPM_BUILD_ROOT/

%post

%postun

%files
%defattr(-,root,root)
/bareos-*

%changelog
6 changes: 3 additions & 3 deletions platforms/win32/tray-monitor-conf-fd-sd.patch
@@ -1,6 +1,6 @@
diff -ruN bareos-13.4.0.git.1383814247.orig/src/qt-tray-monitor/tray-monitor.conf.in bareos-13.4.0.git.1383814247/src/qt-tray-monitor/tray-monitor.conf.in
--- bareos-13.4.0.git.1383814247.orig/src/qt-tray-monitor/tray-monitor.conf.in 2013-11-07 12:57:00.625086539 +0100
+++ bareos-13.4.0.git.1383814247/src/qt-tray-monitor/tray-monitor.conf.in 2013-11-07 13:06:42.082575296 +0100
diff -ruN bareos-13.4.0.git.1383814247.orig/src/qt-tray-monitor/tray-monitor.fd-sd-dir.conf.in bareos-13.4.0.git.1383814247/src/qt-tray-monitor/tray-monitor.fd-sd-dir.conf.in
--- bareos-13.4.0.git.1383814247.orig/src/qt-tray-monitor/tray-monitor.fd-sd-dir.conf.in 2013-11-07 12:57:00.625086539 +0100
+++ bareos-13.4.0.git.1383814247/src/qt-tray-monitor/tray-monitor.fd-sd-dir.conf.in 2013-11-07 13:06:42.082575296 +0100
@@ -22,8 +22,8 @@
Password = "@mon_sd_password@" # password for StorageDaemon
}
Expand Down
6 changes: 3 additions & 3 deletions platforms/win32/tray-monitor-conf.patch
@@ -1,6 +1,6 @@
diff -ruN bareos-12.11.orig/src/qt-tray-monitor/tray-monitor.conf.in bareos-12.11/src/qt-tray-monitor/tray-monitor.conf.in
--- bareos-12.11.orig/src/qt-tray-monitor/tray-monitor.conf.in 2012-11-12 11:28:21.000000000 +0100
+++ bareos-12.11/src/qt-tray-monitor/tray-monitor.conf.in 2012-11-17 00:59:17.000000000 +0100
diff -ruN bareos-12.11.orig/src/qt-tray-monitor/tray-monitor.fd-sd-dir.conf.in bareos-12.11/src/qt-tray-monitor/tray-monitor.fd-sd-dir.conf.in
--- bareos-12.11.orig/src/qt-tray-monitor/tray-monitor.fd-sd-dir.conf.in 2012-11-12 11:28:21.000000000 +0100
+++ bareos-12.11/src/qt-tray-monitor/tray-monitor.fd-sd-dir.conf.in 2012-11-17 00:59:17.000000000 +0100
@@ -15,15 +15,15 @@
Password = "@mon_fd_password@" # password for FileDaemon
}
Expand Down
107 changes: 86 additions & 21 deletions platforms/win32/winbareos-nsi.spec
Expand Up @@ -6,6 +6,10 @@
%define __os_install_post %{_mingw64_debug_install_post} \
%{_mingw64_install_post}

# If versionstring contains debug, enable debug during build
%define WIN_DEBUG %(echo %version | grep debug >/dev/null 2>&1 && echo "yes" || echo "no")


#!BuildIgnore: post-build-checks
Name: winbareos-nsi
Version: 14.1.0
Expand All @@ -21,18 +25,40 @@ BuildRequires: mingw32-filesystem
BuildRequires: mingw64-filesystem
BuildRequires: mingw64-cross-nsis

BuildRequires: mingw32-openssl
#mingw32-libopenssl mingw32-libgcc mingw32-openssl mingw32-libstdc++ mingw32-pthreads mingw32-libqt4 mingw32-libqt4-win32 mingw32-zlib mingw32-libpng
BuildRequires: mingw64-openssl
BuildRequires: mingw32-sed
BuildRequires: mingw64-sed
BuildRequires: mingw32-openssl
BuildRequires: mingw64-openssl
BuildRequires: mingw32-sed
BuildRequires: mingw64-sed


BuildRequires: sed
BuildRequires: vim, procps, bc

BuildRequires: mingw32-winbareos = %{version}
BuildRequires: mingw64-winbareos = %{version}
BuildRequires: mingw-debugsrc-devel = %{version}


BuildRequires: mingw32-libgcc
BuildRequires: mingw64-libgcc

BuildRequires: mingw32-readline
BuildRequires: mingw64-readline

BuildRequires: mingw32-libstdc++
BuildRequires: mingw64-libstdc++

BuildRequires: mingw32-pthreads
BuildRequires: mingw64-pthreads

BuildRequires: mingw32-libqt4
BuildRequires: mingw64-libqt4

BuildRequires: mingw32-lzo
BuildRequires: mingw64-lzo

BuildRequires: mingw32-libfastlz
BuildRequires: mingw64-libfastlz

Source1: winbareos.nsi
Source2: clientdialog.ini
Expand Down Expand Up @@ -63,35 +89,73 @@ mkdir -p $RPM_BUILD_ROOT/nsisplugins
cp %SOURCE5 $RPM_BUILD_ROOT/nsisplugins # KillProcWMI
cp %SOURCE7 $RPM_BUILD_ROOT/nsisplugins # AccessControl

mkdir $RPM_BUILD_ROOT/release32
mkdir $RPM_BUILD_ROOT/release64
mkdir $RPM_BUILD_ROOT/release32
mkdir $RPM_BUILD_ROOT/release64

# copy the sql ddls over
cp -av /etc/mingw32-winbareos/ddl $RPM_BUILD_ROOT/release32
cp -av /etc/mingw64-winbareos/ddl $RPM_BUILD_ROOT/release64

# copy the sources over if we create debug package
%if %{WIN_DEBUG} == "yes"
cp -av /bareos-*debug* $RPM_BUILD_ROOT/release32
cp -av /bareos-*debug* $RPM_BUILD_ROOT/release64
%endif



for file in \
bareos-tray-monitor.exe bat.exe bareos-fd.exe bconsole.exe \
bareos-sd.exe btape.exe bls.exe bextract.exe bpipe-fd.dll \
mssqlvdi-fd.dll autoxflate-sd.dll libbareos.dll libbareosfind.dll \
libcrypto-*.dll libgcc_s_*-1.dll libhistory6.dll \
libreadline6.dll libssl-*.dll libstdc++-6.dll \
libtermcap-0.dll pthreadGCE2.dll zlib1.dll \
QtCore4.dll QtGui4.dll liblzo2-2.dll libfastlz.dll \
libpng15-15.dll openssl.exe sed.exe; do
cp %{_mingw32_bindir}/$file $RPM_BUILD_ROOT/release32
cp %{_mingw64_bindir}/$file $RPM_BUILD_ROOT/release64
bareos-fd.exe \
bareos-sd.exe \
bareos-dir.exe \
dbcheck.exe \
bconsole.exe \
bsmtp.exe \
btape.exe \
bls.exe \
bextract.exe \
bareos-tray-monitor.exe \
bat.exe \
bpipe-fd.dll \
mssqlvdi-fd.dll \
autoxflate-sd.dll \
libbareos.dll \
libbareosfind.dll \
libbareoscats*.dll \
libcrypto-*.dll \
libgcc_s_*-1.dll \
libhistory6.dll \
libreadline6.dll \
libssl-*.dll \
libstdc++-6.dll \
libtermcap-0.dll \
pthreadGCE2.dll \
zlib1.dll \
QtCore4.dll \
QtGui4.dll \
liblzo2-2.dll \
libfastlz.dll \
libpng15-15.dll \
openssl.exe \
sed.exe;\
do
cp %{_mingw32_bindir}/$file $RPM_BUILD_ROOT/release32
cp %{_mingw64_bindir}/$file $RPM_BUILD_ROOT/release64
done

for cfg in /etc/mingw32-winbareos/*.conf; do
cp $cfg $RPM_BUILD_ROOT/release32
cp $cfg $RPM_BUILD_ROOT/release32
done

for cfg in /etc/mingw64-winbareos/*.conf; do
cp $cfg $RPM_BUILD_ROOT/release64
cp $cfg $RPM_BUILD_ROOT/release64
done

cp %SOURCE1 %SOURCE2 %SOURCE3 %SOURCE4 %SOURCE5 %SOURCE6 %SOURCE7 %_sourcedir/LICENSE $RPM_BUILD_ROOT/release32
cp %SOURCE1 %SOURCE2 %SOURCE3 %SOURCE4 %SOURCE5 %SOURCE6 %SOURCE7 %_sourcedir/LICENSE $RPM_BUILD_ROOT/release64

makensis -DPRODUCT_VERSION=%version-%release -DBIT_WIDTH=32 $RPM_BUILD_ROOT/release32/winbareos.nsi
makensis -DPRODUCT_VERSION=%version-%release -DBIT_WIDTH=64 $RPM_BUILD_ROOT/release64/winbareos.nsi
makensis -DVERSION=%version -DPRODUCT_VERSION=%version-%release -DBIT_WIDTH=32 -DWIN_DEBUG=%{WIN_DEBUG} $RPM_BUILD_ROOT/release32/winbareos.nsi
makensis -DVERSION=%version -DPRODUCT_VERSION=%version-%release -DBIT_WIDTH=64 -DWIN_DEBUG=%{WIN_DEBUG} $RPM_BUILD_ROOT/release64/winbareos.nsi

%install
mkdir -p $RPM_BUILD_ROOT%{_mingw32_bindir}
Expand All @@ -103,6 +167,7 @@ cp $RPM_BUILD_ROOT/release64/Bareos*.exe $RPM_BUILD_ROOT/winbareos-%version-64-b
rm -R $RPM_BUILD_ROOT/release32
rm -R $RPM_BUILD_ROOT/release64
rm -R $RPM_BUILD_ROOT/nsisplugins
#rm -R $RPM_BUILD_ROOT/bareos-*

%clean
rm -rf $RPM_BUILD_ROOT
Expand Down

0 comments on commit 01e39cc

Please sign in to comment.