Skip to content

Commit

Permalink
adapted for ubuntu, some improvements on packaging
Browse files Browse the repository at this point in the history
Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
  • Loading branch information
joergsteffens authored and Marco van Wieringen committed Feb 17, 2015
1 parent 2719192 commit 64a3cfd
Show file tree
Hide file tree
Showing 17 changed files with 73 additions and 35 deletions.
1 change: 1 addition & 0 deletions debian/bareos-common.dirs
@@ -1 +1,2 @@
/var/lib/bareos
/var/log/bareos
1 change: 1 addition & 0 deletions debian/bareos-common.postinst
Expand Up @@ -23,6 +23,7 @@ daemon_group=bareos
permissions()
{
chown ${daemon_user}:${daemon_group} /var/lib/bareos/
chown ${daemon_user}:${daemon_group} /var/log/bareos/
}

case "$1" in
Expand Down
2 changes: 1 addition & 1 deletion debian/bareos-director.install
@@ -1,5 +1,6 @@
/etc/bareos/bareos-dir.conf
/etc/logrotate.d/bareos-dir
/etc/init.d/bareos-dir
/usr/lib/bareos/scripts/delete_catalog_backup
/usr/lib/bareos/scripts/make_catalog_backup
/usr/lib/bareos/scripts/make_catalog_backup.pl
Expand All @@ -9,4 +10,3 @@
/usr/share/man/man1/bsmtp.1.gz
/usr/share/man/man8/bareos-dir.8.gz
/usr/share/man/man8/bareos.8.gz
platforms/debian/bareos-dir /etc/init.d/
2 changes: 1 addition & 1 deletion debian/bareos-filedaemon.install
@@ -1,6 +1,6 @@
/etc/bareos/bareos-fd.conf
/etc/init.d/bareos-fd
/usr/sbin/bareos-fd
/usr/lib/bareos/plugins/bpipe-fd.so
/usr/lib/bareos/plugins/python-fd.so
/usr/share/man/man8/bareos-fd.8.gz
platforms/debian/bareos-fd /etc/init.d/
1 change: 1 addition & 0 deletions debian/bareos-storage.dirs
@@ -0,0 +1 @@
/var/lib/bareos/storage
2 changes: 1 addition & 1 deletion debian/bareos-storage.install
@@ -1,5 +1,6 @@
/etc/bareos/bareos-sd.conf
/etc/bareos/mtx-changer.conf
/etc/init.d/bareos-sd
/usr/sbin/bscrypto
/usr/lib/bareos/plugins/python-sd.so
/usr/lib/bareos/plugins/scsicrypto-sd.so
Expand All @@ -10,4 +11,3 @@
/usr/share/man/man8/bareos-sd.8.gz
/usr/share/man/man8/btape.8.gz
/usr/sbin/btape
platforms/debian/bareos-sd /etc/init.d/
1 change: 1 addition & 0 deletions debian/bareos-storage.postinst
Expand Up @@ -29,6 +29,7 @@ storage_daemon_group=$daemon_group
permissions()
{
chown ${storage_daemon_user}:${daemon_group} /etc/bareos/bareos-sd.conf
chown ${storage_daemon_user}:${daemon_group} /var/lib/bareos/storage/
}

case "$1" in
Expand Down
1 change: 1 addition & 0 deletions debian/control
Expand Up @@ -15,6 +15,7 @@ Build-Depends: autotools-dev, debhelper (>= 7.0.50~),
libcap-dev,
libssl-dev,
liblzo2-dev,
lsb-release,
ncurses-dev
# removed to be compliant with Ubuntu:
# libsqlite0-dev,
Expand Down
9 changes: 7 additions & 2 deletions debian/rules
Expand Up @@ -30,12 +30,13 @@ override_dh_auto_configure:
dh_auto_configure -- \
--with-sbin-perm=755 \
--sysconfdir=/etc/bareos \
--docdir=\${_docdir}/bareos \
--htmldir=\${_docdir}/bareos/html \
--with-archivedir=/var/lib/bareos/storage \
--with-scriptdir=/usr/lib/bareos/scripts \
--with-plugindir=/usr/lib/bareos/plugins \
--with-working-dir=/var/lib/bareos \
--with-pid-dir=/var/lib/bareos \
--with-bsrdir=/var/lib/bareos \
--with-logdir=/var/log/bareos \
--with-subsys-dir=/var/lock \
--enable-smartalloc \
--disable-conio \
Expand Down Expand Up @@ -68,6 +69,10 @@ override_dh_auto_configure:
--with-hostname="XXX_REPLACE_WITH_LOCAL_HOSTNAME_XXX" \
--enable-includes

# --docdir="\${_docdir}/bareos" \
# --htmldir="\${_docdir}/bareos/html" \

override_dh_fixperms:
# all files in /etc/bareos
dh_fixperms \
Expand Down
2 changes: 1 addition & 1 deletion platforms/deb/bareos-Debian_6.0.dsc
Expand Up @@ -6,6 +6,6 @@ Version: 12.4.1
Maintainer: Joerg Steffens <joerg.steffens@bareos.com>
Homepage: http://www.bareos.org/
Standards-Version: 3.8.4
Build-Depends: autotools-dev, debhelper (>= 7.0.50~), po-debconf (>= 0.8.2), hostname, zlib1g-dev, libreadline-dev, libjconv-dev, libsqlite3-dev, libmysqlclient-dev, libpq-dev (>= 8.4), postgresql-server-dev-8.4, libwrap0-dev, python-dev, libgtk2.0-dev (>= 2.10), libgnome2-dev, libacl1-dev, libkrb5-dev, libgnomeui-dev, libx11-dev, mtx, bc, libxt-dev, dpkg-dev (>= 1.13.19), libqt4-dev, acl-dev, libcap-dev, libssl-dev, liblzo2-dev, ncurses-dev
Build-Depends: autotools-dev, debhelper (>= 7.0.50~), po-debconf (>= 0.8.2), hostname, zlib1g-dev, libreadline-dev, libjconv-dev, libsqlite3-dev, libmysqlclient-dev, libpq-dev (>= 8.4), postgresql-server-dev-8.4, libwrap0-dev, python-dev, libgtk2.0-dev (>= 2.10), libgnome2-dev, libacl1-dev, libkrb5-dev, libgnomeui-dev, libx11-dev, mtx, bc, libxt-dev, dpkg-dev (>= 1.13.19), libqt4-dev, acl-dev, libcap-dev, libssl-dev, liblzo2-dev, lsb-release, ncurses-dev
Build-Conflicts: python2.2-dev, python2.3, python2.4, qt3-dev-tools
Files:
2 changes: 1 addition & 1 deletion platforms/deb/bareos-xUbuntu_12.04.dsc
Expand Up @@ -6,7 +6,7 @@ Version: 12.4.1
Maintainer: Joerg Steffens <joerg.steffens@bareos.com>
Homepage: http://www.bareos.org/
Standards-Version: 3.8.4
Build-Depends: autotools-dev, debhelper (>= 7.0.50~), po-debconf (>= 0.8.2), hostname, zlib1g-dev, libreadline-dev, libsqlite3-dev, libmysqlclient-dev, libpq-dev (>= 8.4), postgresql-server-dev-9.1, libwrap0-dev, python-dev, libgtk2.0-dev (>= 2.10), libgnome2-dev, libacl1-dev, libkrb5-dev, libgnomeui-dev, libx11-dev, mtx, bc, libxt-dev, dpkg-dev (>= 1.13.19), libqt4-dev, acl-dev, libcap-dev, libssl-dev, liblzo2-dev, ncurses-dev
Build-Depends: autotools-dev, debhelper (>= 7.0.50~), po-debconf (>= 0.8.2), hostname, zlib1g-dev, libreadline-dev, libsqlite3-dev, libmysqlclient-dev, libpq-dev (>= 8.4), postgresql-server-dev-9.1, libwrap0-dev, python-dev, libgtk2.0-dev (>= 2.10), libgnome2-dev, libacl1-dev, libkrb5-dev, libgnomeui-dev, libx11-dev, mtx, bc, libxt-dev, dpkg-dev (>= 1.13.19), libqt4-dev, acl-dev, libcap-dev, libssl-dev, liblzo2-dev, lsb-release, ncurses-dev
# libjconv-dev,
Build-Conflicts: python2.2-dev, python2.3, python2.4, qt3-dev-tools
Files:
24 changes: 15 additions & 9 deletions platforms/debian/bareos-dir.in
Expand Up @@ -48,25 +48,31 @@ if [ "x${BUSER}" != "x" ]; then
fi
fi

# define LSB functions.
. /lib/lsb/init-functions

case "$1" in
start)
echo -n "Starting ${DESC}: "
start-stop-daemon --start --quiet --pidfile ${PIDFILE} ${USERGRP} --exec ${DAEMON} -- ${BOPTIONS}
RETVAL=$?
echo "${NAME}"
;;
stop)
start)
log_daemon_msg "Starting $DESC" "$NAME"
start-stop-daemon --start --quiet --pidfile ${PIDFILE} ${USERGRP} --exec ${DAEMON} -- ${BOPTIONS}
log_end_msg $?
sleep 2
;;
stop)
echo -n "Stopping ${DESC}: "
start-stop-daemon --oknodo --stop --quiet ${USERGRP} --exec ${DAEMON} -- ${BOPTIONS}
RETVAL=$?
echo "${NAME}"
;;
restart|force-reload)
restart|force-reload)
$0 stop
sleep 5
$0 start
;;
*)
status)
status_of_proc -p ${PIDFILE} ${DAEMON} ${NAME} && exit 0 || exit $?
;;
*)
echo "Usage: /etc/init.d/${NAME} {start|stop|restart|force-reload}" >&2
exit 1
;;
Expand Down
4 changes: 4 additions & 0 deletions platforms/rpms/bareos.spec
Expand Up @@ -48,6 +48,7 @@ Vendor: The Bareos Team
%define script_dir /usr/lib/bareos/scripts
%define working_dir /var/lib/bareos
%define pid_dir /var/lib/bareos
%define bsr_dir /var/lib/bareos
# TODO: use /run ?
%define _subsysdir /var/lock

Expand Down Expand Up @@ -426,10 +427,13 @@ export MTX=/usr/sbin/mtx
--mandir=%{_mandir} \
--docdir=%{_docdir}/%{name} \
--htmldir=%{_docdir}/%{name}/html \
--with-archivedir=/var/lib/bareos/storage \
--with-scriptdir=%{script_dir} \
--with-working-dir=%{working_dir} \
--with-plugindir=%{plugin_dir} \
--with-pid-dir=%{pid_dir} \
--with-bsrdir=%{bsr_dir} \
--with-logdir=%{_logdir}/bareos \
--with-subsys-dir=%{_subsysdir} \
--enable-smartalloc \
--disable-conio \
Expand Down
40 changes: 23 additions & 17 deletions platforms/ubuntu/bareos-dir.in
Expand Up @@ -10,13 +10,13 @@
#

### BEGIN INIT INFO
# Provides: bareos-dir
# Required-Start: $local_fs $remote_fs $network $time
# Required-Stop: $local_fs $remote_fs $network $time
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Bareos Director
# Description: Bareos is a network backup and restore program
# Provides: bareos-dir
# Required-Start: $local_fs $remote_fs $network $time
# Required-Stop: $local_fs $remote_fs $network $time
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Bareos Director
# Description: Bareos is a network backup and restore program
### END INIT INFO


Expand Down Expand Up @@ -56,25 +56,31 @@ if [ "x${BUSER}" != "x" ]; then
fi
fi

# define LSB functions.
. /lib/lsb/init-functions

case "$1" in
start)
echo -n "Starting ${DESC}: "
start-stop-daemon --start --quiet --pidfile ${PIDFILE} ${USERGRP} --exec ${DAEMON} -- ${BOPTIONS}
RETVAL=$?
echo "${NAME}"
;;
stop)
start)
log_daemon_msg "Starting $DESC" "$NAME"
start-stop-daemon --start --quiet --pidfile ${PIDFILE} ${USERGRP} --exec ${DAEMON} -- ${BOPTIONS}
log_end_msg $?
sleep 2
;;
stop)
echo -n "Stopping ${DESC}: "
start-stop-daemon --oknodo --stop --quiet ${USERGRP} --exec ${DAEMON} -- ${BOPTIONS}
start-stop-daemon --oknodo --stop --quiet ${USERGRP} --exec ${DAEMON} -- ${BOPTIONS}
RETVAL=$?
echo "${NAME}"
;;
restart|force-reload)
restart|force-reload)
$0 stop
sleep 5
$0 start
;;
*)
status)
status_of_proc -p ${PIDFILE} ${DAEMON} ${NAME} && exit 0 || exit $?
;;
*)
echo "Usage: /etc/init.d/${NAME} {start|stop|restart|force-reload}" >&2
exit 1
;;
Expand Down
6 changes: 6 additions & 0 deletions platforms/ubuntu/bareos-fd.in
Expand Up @@ -56,6 +56,9 @@ if [ "x${BUSER}" != "x" ]; then
fi
fi

# define LSB functions.
. /lib/lsb/init-functions

case "$1" in
start)
echo -n "Starting ${DESC}: "
Expand All @@ -74,6 +77,9 @@ case "$1" in
sleep 5
$0 start
;;
status)
status_of_proc -p ${PIDFILE} ${DAEMON} ${NAME} && exit 0 || exit $?
;;
*)
echo "Usage: /etc/init.d/${NAME} {start|stop|restart|force-reload}" >&2
exit 1
Expand Down
6 changes: 6 additions & 0 deletions platforms/ubuntu/bareos-sd.in
Expand Up @@ -56,6 +56,9 @@ if [ "x${BUSER}" != "x" ]; then
fi
fi

# define LSB functions.
. /lib/lsb/init-functions

case "$1" in
start)
echo -n "Starting ${DESC}: "
Expand All @@ -74,6 +77,9 @@ case "$1" in
sleep 5
$0 start
;;
status)
status_of_proc -p ${PIDFILE} ${DAEMON} ${NAME} && exit 0 || exit $?
;;
*)
echo "Usage: /etc/init.d/${NAME} {start|stop|restart|force-reload}" >&2
exit 1
Expand Down
4 changes: 2 additions & 2 deletions scripts/bareos-config 100644 → 100755
Expand Up @@ -197,7 +197,7 @@ replace()
init()
{
initialize_local_hostname
initialize_director_hostname
#initialize_director_hostname
initialize_passwords
initialize_database_driver
}
Expand All @@ -206,7 +206,7 @@ init()
args=$#

# without parameter, nothing is done.
# this allows thsi script to be sourced
# this allows this script to be sourced
# to use its functions
if [ $args -ge 1 ]; then
# executes given arguments
Expand Down

0 comments on commit 64a3cfd

Please sign in to comment.