Permalink
Browse files

webui: adapt BareosBSock.php to current console protocol

 - regress-config-webui: removed unneeded cmake settings
 - webui/CMakeLists.txt accept FULLVERSION as parameter,
   try to extract from version.h if not given.

 - removed version.txt, instead added version.php which is included
   and contains full and short version
  • Loading branch information...
pstorz committed Jan 11, 2019
1 parent 2df054c commit d620c4a6b02a4889b40498a3e407421e4eb151ae
@@ -20,46 +20,19 @@ else
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_INSTALL_PREFIX:PATH=${1}/usr \
-DCMAKE_INSTALL_LIBDIR:PATH=${1}/usr/lib \
-DINCLUDE_INSTALL_DIR:PATH=${1}/usr/include \
-DLIB_INSTALL_DIR:PATH=${1}/usr/lib \
-DSYSCONF_INSTALL_DIR:PATH=${1}/etc \
-DSHARE_INSTALL_PREFIX:PATH=${1}/usr/share \
-DBUILD_SHARED_LIBS:BOOL=ON \
-Dbindir=${1}/bin \
-Dsbindir=${1}/bin \
-Dlibdir=${1}/bin \
-Dsysconfdir=${1}/bin \
-Dscriptdir=${1}/bin \
-Dconfdir=${1}/bin \
-Dwebuiconfdir=${1}/bin \
-Dmandir=${1}/bin \
-Ddocdir=${1}/bin/html \
-Dhtmldir=${1}/bin/html \
-Dlogdir=${1}/working \
-Dpiddir=${1}/working \
-Dsubsys-dir=${1}/working \
-Dplugindir=${1}/bin/plugins \
-Dsmartalloc=yes\
-Dlockmgr=yes \
-Dconio=no \
-Dworkingdir=${1}/working \
-Darchivedir=${1}/tmp \
-Ddump_email=${EMAIL} \
-Djob_email=${EMAIL} \
-Dsmtp_host=${SMTP_HOST} \
-Ddb_name=regress \
-Ddb_user=regress \
${PASSWD} \
${OPENSSL} \
${TCPWRAPPERS} \
${SCSICRYPTO} \
${TESTPLUGIN} \
${WHICHDB} \
-Dbaseport=${BASEPORT}\
${DEVELOPER}\
${COVERAGE} \
-Ddynamic-cats-backends=yes \
-Ddynamic-storage-backends=yes \
${TRAYMON}

fi
@@ -1,6 +1,6 @@
# BAREOS�� - Backup Archiving REcovery Open Sourced
#
# Copyright (C) 2018-2016 Bareos GmbH & Co. KG
# Copyright (C) 2018-2019 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
@@ -21,6 +21,19 @@ project(bareos-webui)

INCLUDE(GNUInstallDirs)

set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
${PROJECT_SOURCE_DIR}/cmake)

IF (NOT DEFINED FULLVERSION)
# try to get version info from version.h
INCLUDE(BareosExtractVersionInfo)
ELSE()
# we got FULLVERSION from cmake commandline
string(REGEX MATCH [0-9.]+ VERSION ${FULLVERSION})
ENDIF()


find_program(apxs APXS)

# set defaults
@@ -49,6 +62,9 @@ set(WEBUICONFDIR "${webuiconfdir}")
MESSAGE(" Install system config files: ${sysconfdir} ")
MESSAGE(" Install Bareos config dir: ${confdir} ")
MESSAGE(" Install BareosWebui configdir:${webuiconfdir} ")
MESSAGE(" Version is ${VERSION} ")
STRING(REGEX REPLACE "\"" "" FULLVERSION ${FULLVERSION} )
MESSAGE(" FullVersion is ${FULLVERSION} ")


IF (EXISTS ${sysconfdir}/httpd/conf.d)
@@ -70,10 +86,9 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config/autoload/global.php.in ${CMAKE
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/install/directors.ini.in ${CMAKE_CURRENT_SOURCE_DIR}/install/directors.ini @ONLY)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/install/configuration.ini.in ${CMAKE_CURRENT_SOURCE_DIR}/install/configuration.ini @ONLY)

CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/version.php.in ${CMAKE_CURRENT_SOURCE_DIR}/version.php @ONLY)



INSTALL(FILES version.txt init_autoloader.php DESTINATION ${SHARE_INSTALL_PREFIX}/bareos-webui)
INSTALL(FILES version.php init_autoloader.php DESTINATION ${SHARE_INSTALL_PREFIX}/bareos-webui)
INSTALL(DIRECTORY config data module public vendor DESTINATION ${SHARE_INSTALL_PREFIX}/bareos-webui)

INSTALL(FILES install/bareos/bareos-dir.d/console/admin.conf.example DESTINATION ${confdir}/bareos-dir.d/console/)
@@ -0,0 +1,25 @@
# BAREOS�� - Backup Archiving REcovery Open Sourced
#
# Copyright (C) 2017-2019 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.


# extract version number from version.h
file(STRINGS ${CMAKE_SOURCE_DIR}/../core/src/include/version.h VERSION_INFO REGEX define.*VERSION.*)
string(REGEX MATCH [0-9.]+ VERSION ${VERSION_INFO})
string(REGEX MATCH [0-9]+ SOVERSION ${VERSION_INFO})
string(REGEX MATCH \".*\" FULLVERSION ${VERSION_INFO})
@@ -10,7 +10,7 @@
# Modified to make a template file for a multi-binary package with separated
# build-arch and build-indep targets by Bill Allombert 2001

BAREOS_VERSION := $(shell dpkg-parsechangelog | egrep '^Version:' | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' )
BAREOS_VERSION := $(shell dpkg-parsechangelog | egrep '^Version:' | sed 's/Version: //g')

# Uncomment this to turn on verbose mode.
export DH_VERBOSE = 1
@@ -19,11 +19,9 @@ export DH_VERBOSE = 1
export DH_OPTIONS = -v

override_dh_auto_configure:
dh_auto_configure -- -DSHARE_INSTALL_PREFIX:PATH=/usr/share -Dsysconfdir=/etc -Dconfdir=/etc/bareos -Dwebuiconfdir=/etc/bareos-webui

dh_auto_configure -- -DSHARE_INSTALL_PREFIX:PATH=/usr/share -Dsysconfdir=/etc -Dconfdir=/etc/bareos -Dwebuiconfdir=/etc/bareos-webui -DFULLVERSION=$(BAREOS_VERSION)

override_dh_install:
echo $(BAREOS_VERSION) > ./debian/bareos-webui/usr/share/bareos-webui/version.txt
dh_install

%:
@@ -63,19 +63,15 @@ echo $this->doctype();
<body>

<?php
$version = "";
$vfp = "version.txt";
if(is_readable($vfp)) {
$version = "Version " . file_get_contents($vfp);
}
include 'version.php';
?>

<div class="container text-center">
<img src="<?php echo $this->basePath() . '/img/bareos.png'; ?>" />
<br /><br /><br />
<?php echo $this->content; ?>
<br />
<p class="text-muted">Bareos WebUI <?php echo $version; ?> &copy; 2013 - <?php echo date('Y') ?> <a href="http://www.bareos.com/" target="_blank">Bareos GmbH &amp; Co. KG</a>,<br />GNU Affero General Public License Version 3</p>
<p class="text-muted">Bareos WebUI <?php echo $bareos_version_long; ?> &copy; 2013 - <?php echo date('Y') ?> <a href="http://www.bareos.com/" target="_blank">Bareos GmbH &amp; Co. KG</a>,<br />GNU Affero General Public License Version 3</p>
</div>

<?php echo $this->inlineScript() ?>
@@ -108,16 +108,14 @@ cmake . \
-DBUILD_SHARED_LIBS:BOOL=ON \
-Dsysconfdir=%{_sysconfdir} \
-Dconfdir=%{_sysconfdir}/bareos \
-Dwebuiconfdir=%{_sysconfdir}/bareos-webui
-Dwebuiconfdir=%{_sysconfdir}/bareos-webui \
-DFULLVERSION=%version

make

%install
make DESTDIR=%{buildroot} install

# write version to version file
echo %version | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' > %{buildroot}/%_datadir/%name/version.txt

# With the introduction of config subdirectories (bareos-16.2)
# some config files have been renamed (or even splitted into multiple files).
# However, bareos is still able to work with the old config files,
@@ -5,7 +5,7 @@
* bareos-webui - Bareos Web-Frontend
*
* @link https://github.com/bareos/bareos-webui for the canonical source repository
* @copyright Copyright (c) 2014-2016 Bareos GmbH & Co. KG
* @copyright Copyright (c) 2014-2019 Bareos GmbH & Co. KG
* @license GNU Affero General Public License (http://www.gnu.org/licenses/)
*
* This program is free software: you can redistribute it and/or modify
@@ -601,9 +601,11 @@ public function disconnect()
*/
private function login()
{
include 'version.php';
if(isset($this->config['console_name'])) {
$bashed_console_name = self::bash_spaces($this->config['console_name']);
$DIR_HELLO = "Hello " . $bashed_console_name . " calling\n";
$DIR_HELLO = "Hello " . $bashed_console_name . " calling version $bareos_version_short\n";
} else {
$DIR_HELLO = "Hello *UserAgent* calling\n";
}
@@ -0,0 +1,4 @@
<?php
$bareos_version_long = "@FULLVERSION@";
$bareos_version_short = "@VERSION@";
?>

This file was deleted.

Oops, something went wrong.

0 comments on commit d620c4a

Please sign in to comment.