Skip to content

Commit

Permalink
Merge branch 'pullrequest-61-mvwieringen' into bareos-17.2
Browse files Browse the repository at this point in the history
  • Loading branch information
pstorz committed Oct 12, 2017
2 parents cba1c1f + 43e1d05 commit 4721dab
Show file tree
Hide file tree
Showing 44 changed files with 3,161 additions and 570 deletions.
53 changes: 18 additions & 35 deletions .travis.yml
@@ -1,8 +1,10 @@
os:
- linux
dist: trusty
sudo: required
language: cpp
compiler:
- gcc
- clang
sudo: required

# This project also uses Coverity Scan https://scan.coverity.com/
# However, the Travis coverity scan addon (as of 19.02.2014) does not fit our needs,
Expand All @@ -29,47 +31,28 @@ env:
- COVERITY_SCAN_BUILD="curl -s $COVERITY_SCAN_BUILD_URL | bash"
# -- END Coverity Scan ENV

matrix:
- DB=postgresql
- DB=mysql
- DB=sqlite3
- DB=postgresql COVERITY_SCAN=1

matrix:
# covertiy scan should only run once and it might fail,
# because the number of times its runs is limited per week.
# We only check when compiled with gcc.
exclude:
- compiler: clang
env: DB=postgresql COVERITY_SCAN=1
allow_failures:
- env: DB=postgresql COVERITY_SCAN=1
include:
- env: DB=postgresql
- env: DB=mysql
- env: DB=sqlite3
- env: DB=postgresql COVERITY_SCAN=1
- env: DB=postgresql
compiler: clang
allow_failures:
- env: DB=postgresql COVERITY_SCAN=1



before_install:
# install build dependencies
# use files instead of shell variables, because travis has some problems supporting variables
- sudo apt-get -qq update
- dpkg-checkbuilddeps 2> /tmp/dpkg-builddeps || true
- cat /tmp/dpkg-builddeps
- sed -e "s/^.*:.*:\s//" -e "s/\s([^)]*)//g" /tmp/dpkg-builddeps > /tmp/build_depends
- echo "additional packages required for building:"; cat /tmp/build_depends
- yes "" | sudo xargs --arg-file /tmp/build_depends apt-get -q --assume-no install fakeroot
- dpkg -l
- test/travis_before_install.sh

before_script:
# changelog file is required (and normally generated by OBS)
- cp -a platforms/packaging/bareos.changes debian/changelog
# build Debian packages
- if [ -z "${COVERITY_SCAN}" ]; then fakeroot debian/rules binary; else debian/rules override_dh_auto_configure; eval "$COVERITY_SCAN_BUILD"; fi
# create Debian package repository
- cd ..
- if [ -z "${COVERITY_SCAN}" ]; then dpkg-scanpackages . /dev/null | gzip > Packages.gz; fi
- if [ -z "${COVERITY_SCAN}" ]; then printf 'deb file:%s /\n' $PWD > /tmp/bareos.list; fi
- if [ -z "${COVERITY_SCAN}" ]; then sudo cp /tmp/bareos.list /etc/apt/sources.list.d/bareos.list; fi
- cd -
# install Bareos packages
- if [ -z "${COVERITY_SCAN}" ]; then sudo apt-get -qq update; fi
- if [ -z "${COVERITY_SCAN}" ]; then sudo apt-get install -y --force-yes bareos bareos-database-$DB; fi
# build and install Bareos packages
- test/travis_before_script.sh

script:
# run test script
Expand Down
5 changes: 4 additions & 1 deletion autoconf/config.h.in
Expand Up @@ -580,7 +580,7 @@
/* Define to 1 if you have the `mempcpy' function. */
#undef HAVE_MEMPCPY

/* Define to 1 if you have a working `mmap' system call. */
/* Define to 1 if you have the `mmap' function. */
#undef HAVE_MMAP

/* Define to 1 if you have the <mtio.h> header file. */
Expand Down Expand Up @@ -886,6 +886,9 @@
/* Define to 1 if you have the <sys/ioctl.h> header file. */
#undef HAVE_SYS_IOCTL_H

/* Define to 1 if you have the <sys/mman.h> header file. */
#undef HAVE_SYS_MMAN_H

/* Define to 1 if you have the <sys/mtio.h> header file. */
#undef HAVE_SYS_MTIO_H

Expand Down
12 changes: 7 additions & 5 deletions autoconf/configure.in
Expand Up @@ -860,9 +860,10 @@ AC_HEADER_DIRENT
AC_CHECK_HEADER(glob.h, [AC_DEFINE(HAVE_GLOB_H, 1, [Define to 1 if you have the <glob.h> header file.])] , )
AC_CHECK_HEADER(poll.h, [AC_DEFINE(HAVE_POLL_H, 1, [Define to 1 if you have the <poll.h> header file.])] , )
AC_CHECK_HEADER(sys/poll.h, [AC_DEFINE(HAVE_SYS_POLL_H, 1, [Define to 1 if you have the <sys/poll.h> header file.])] , )
AC_CHECK_HEADER(sys/mman.h, [AC_DEFINE(HAVE_SYS_MMAN_H, 1, [Define to 1 if you have the <sys/mman.h> header file.])] , )
AC_CHECK_FUNCS(glob strcasecmp select poll setenv putenv tcgetattr)
AC_CHECK_FUNCS(lstat lchown lchmod utimes lutimes futimes futimens fchmod fchown)
AC_CHECK_FUNCS(nanosleep nl_langinfo)
AC_CHECK_FUNCS(mmap nanosleep nl_langinfo)
AC_CHECK_HEADERS(varargs.h)


Expand Down Expand Up @@ -4551,14 +4552,18 @@ AC_SUBST_FILE(DEBIAN_CONTROL_STORAGE_PYTHON_PLUGIN)
AC_SUBST_FILE(DEBIAN_CONTROL_DIRECTOR_PYTHON_PLUGIN)

dnl build a list of storage backends we need to build.
BUILD_SD_BACKENDS=""
if test x$use_libtool != xno; then
BUILD_SD_BACKENDS="libbareossd-fifo.la libbareossd-gentape.la libbareossd-tape.la"
BUILD_SD_BACKENDS="${BUILD_SD_BACKENDS} libbareossd-fifo.la"
BUILD_SD_BACKENDS="${BUILD_SD_BACKENDS} libbareossd-gentape.la"
BUILD_SD_BACKENDS="${BUILD_SD_BACKENDS} libbareossd-tape.la"

if test X"$have_glusterfs" = "Xyes" ; then
BUILD_SD_BACKENDS="${BUILD_SD_BACKENDS} libbareossd-gfapi.la"
fi

if test X"$have_droplet" = "Xyes" ; then
BUILD_SD_BACKENDS="${BUILD_SD_BACKENDS} libbareossd-chunked.la"
BUILD_SD_BACKENDS="${BUILD_SD_BACKENDS} libbareossd-object.la"
fi

Expand All @@ -4573,13 +4578,10 @@ if test x$use_libtool != xno; then
if test X"$have_elasto" = "Xyes" ; then
BUILD_SD_BACKENDS="${BUILD_SD_BACKENDS} libbareossd-elasto.la"
fi
else
BUILD_SD_BACKENDS=""
fi

AC_SUBST(BUILD_SD_BACKENDS)


dnl Insanity check
if test "x${subsysdir}" = "x${sbindir}" ; then
echo " "
Expand Down
19 changes: 14 additions & 5 deletions configure
Expand Up @@ -23559,6 +23559,14 @@ $as_echo "#define HAVE_SYS_POLL_H 1" >>confdefs.h
fi


ac_fn_c_check_header_mongrel "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default"
if test "x$ac_cv_header_sys_mman_h" = xyes; then :

$as_echo "#define HAVE_SYS_MMAN_H 1" >>confdefs.h

fi


for ac_func in glob strcasecmp select poll setenv putenv tcgetattr
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
Expand All @@ -23583,7 +23591,7 @@ _ACEOF
fi
done

for ac_func in nanosleep nl_langinfo
for ac_func in mmap nanosleep nl_langinfo
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
Expand Down Expand Up @@ -33805,14 +33813,18 @@ fi



BUILD_SD_BACKENDS=""
if test x$use_libtool != xno; then
BUILD_SD_BACKENDS="libbareossd-fifo.la libbareossd-gentape.la libbareossd-tape.la"
BUILD_SD_BACKENDS="${BUILD_SD_BACKENDS} libbareossd-fifo.la"
BUILD_SD_BACKENDS="${BUILD_SD_BACKENDS} libbareossd-gentape.la"
BUILD_SD_BACKENDS="${BUILD_SD_BACKENDS} libbareossd-tape.la"

if test X"$have_glusterfs" = "Xyes" ; then
BUILD_SD_BACKENDS="${BUILD_SD_BACKENDS} libbareossd-gfapi.la"
fi

if test X"$have_droplet" = "Xyes" ; then
BUILD_SD_BACKENDS="${BUILD_SD_BACKENDS} libbareossd-chunked.la"
BUILD_SD_BACKENDS="${BUILD_SD_BACKENDS} libbareossd-object.la"
fi

Expand All @@ -33827,13 +33839,10 @@ if test x$use_libtool != xno; then
if test X"$have_elasto" = "Xyes" ; then
BUILD_SD_BACKENDS="${BUILD_SD_BACKENDS} libbareossd-elasto.la"
fi
else
BUILD_SD_BACKENDS=""
fi




if test "x${subsysdir}" = "x${sbindir}" ; then
echo " "
echo " "
Expand Down
30 changes: 30 additions & 0 deletions platforms/packaging/bareos.spec
Expand Up @@ -43,6 +43,7 @@ Vendor: The Bareos Team
%define build_sqlite3 1
%define check_cmocka 1
%define glusterfs 0
%define objectstorage 0
%define have_git 1
%define ceph 0
%define install_suse_fw 0
Expand Down Expand Up @@ -121,6 +122,10 @@ BuildRequires: systemd-rpm-macros
%{?systemd_requires}
%endif

%if 0%{?objectstorage}
BuildRequires: libdroplet-devel
%endif

%if 0%{?glusterfs}
BuildRequires: glusterfs-devel glusterfs-api-devel
%endif
Expand Down Expand Up @@ -305,6 +310,15 @@ Requires(pre): shadow-utils
Requires: bareos-tools
%endif

%if 0%{?objectstorage}
%package storage-object
Summary: Object Storage support for the Bareos Storage daemon
Group: Productivity/Archiving/Backup
Requires: %{name}-common = %{version}
Requires: %{name}-storage = %{version}
Requires: libdroplet-common
%endif

%if 0%{?glusterfs}
%package storage-glusterfs
Summary: GlusterFS support for the Bareos Storage daemon
Expand Down Expand Up @@ -565,6 +579,13 @@ This package contains the Storage Daemon
This package contains the Storage Daemon tape support
(Bareos service to read and write data from/to tape media)

%if 0%{?objectstorage}
%description storage-object
%{dscr}

This package contains the Storage backend for Object Storage.
%endif

%if 0%{?glusterfs}
%description storage-glusterfs
%{dscr}
Expand Down Expand Up @@ -991,6 +1012,15 @@ echo "This is a meta package to install a full bareos system" > %{buildroot}%{_d
%attr(0640, %{director_daemon_user}, %{daemon_group}) %{_sysconfdir}/bareos/bareos-dir.d/storage/NULL.conf.example
%attr(0640, %{storage_daemon_user}, %{daemon_group}) %{_sysconfdir}/bareos/bareos-sd.d/device/NULL.conf.example

%if 0%{?objectstorage}
%files storage-object
%defattr(-, root, root)
%{backend_dir}/libbareossd-chunked*.so
%{backend_dir}/libbareossd-object*.so
%{_sysconfdir}/bareos/bareos-dir.d/storage/Object.conf.example
%{_sysconfdir}/bareos/bareos-sd.d/device/ObjectStorage.conf.example
%endif

%if 0%{?glusterfs}
%files storage-glusterfs
%defattr(-, root, root)
Expand Down

0 comments on commit 4721dab

Please sign in to comment.