Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:ecsos:Backup
bacula
bacula.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bacula.spec of Package bacula
# # spec file for package bacula (Version 5.2.x) # Copyright (c) 2011 Bruno Friedmann (irc:tigerfoot) (Ioda-Net) and Philipp Storz (dassIT) # # Redesign of the bacula specfile: goals (initiated 2011-09-22) # # @WARNING : notice to reviewer or contributors # We know this is a long spec, and a complex software in a complex world :-) # We've try to comment a lot of things, especially if we differe from "standard" # We spend almost a year to get it running on almost all architecture present on OBS # And the factory and stable version has been running on tests during that time. # # # * only support platforms that are available in OBS # * activate all options available (if reasonable) # * have an automatic run of the regression tests # * single-dir-install is not supported # * use special group (bconsole) for users that can access bconsole # * Split bacula into small packages to respect the modularity concept of Bacula # and let admins free to choose their infrastructure organisation. # * bacula-bconsole : the bconsole utility package # * bacula-dir : the director daemon + bsmtp tool # * bacula-sd : the storage daemon + non db linked tools (bls, btape, bcopy, bextract) # * bacula-fd : the file daemon (client + bpipe plugin) # * bacula-catalog-{sqlite,postgresql,mysql} : libs + bscan and dbcheck tools, sql script make_database/tables/grant rights # * bacula-sql : common abstract sql libraries (without real db link) # * bacula-updatedb : Bunch of sql script to upgrade older installation than rev-1 # * bacula-libs : common libraries (without link to sql or db) # * bacula-tools : tools without link to db libs (bwild, bregex) # * bacula-bat : the primary gui # * tray monitor : bacula-tray-monitor-qt, bacula-tray-monitor-gtk ( small tray utility ) # * bacula-doc : documentation (html & pdf in its own .spec see bacula-doc package) # * bacula-regress : the regression tests suite in its own .spec see bacula-regress package) # to be done # * bacula-web # * webacula # * bweb # # For openSUSE/SUSE we install the /usr/sbin/rcscript and the firewall basics rules # # Notice about shlib name policy : # libbaccats* are explicitly rename to bacula-catalog-db_engine & libbacsql to bacula-sql (done 20111205) # None of those could be shared, nor can be used by a different version. # # @TODOS : # Recheck the rights (kern give only 0750) : what we choose group or 0755 (the conf file is not readable) # check with fedora if using /usr/lib(64)/ for script is okay # We can also place query.sql (the only non lib/script) in /usr/share/bacula # See what Simone Caronni <negativo17@gmail.com> do at http://repos.fedorapeople.org/repos/slaanesh/bacula/ # Fix the build for Mandriva (help by Mageia/Mandriva needed) # Add bacula group & user to base system for openSUSE # Create a wiki page en.openSUSE.org/Bacula which should explain how,who,what,when,why we package it and report back all the information here + document some use case # # @Question & Answer : # Q : Should we call it bacula-community (clear distinction with the enterprise ?) and use obsolete to ride off all packaging # A : Nope bacula-enterprise come after, and they clearly call their product bacula-enterprise # Q : Use of /var/log/bacula ? (important change compared to upstream way) # A : It seems done by each other distribution: now implemented 2012-04-09 will fix also logrotate new policy # Q : bacula-regression did we keep it here ? # A: added as a separate package bacula-regress # # Publishing : # Archiving:Backup:Factory is devel project for all # Those build are extremly discouraged in production use # Archiving:Backup is released software and devel project for factory # Archiving:Backup is tested, and are production ready release # # Patching rules : # Bacula upstream git is somewhat updated, and a new version release fixing bugs could take a long time to appear # We use the patch from there to have bugfixes includes in our builds # The series formated 0001-0499 is for upstream patches # If we have patches that are not yet included upstream they are formated 1000-2000 series # If we have patches that will never end upstream they are formated 0500-0999 # # # Please submit bugfixes or comments via http://bugs.opensuse.org/ or obs web interface Summary: The Network Backup Solution Name: bacula Version: 5.2.13 Release: 1.0 Group: Productivity/Archiving/Backup License: AGPL-3.0 BuildRoot: %{_tmppath}/%{name}-root URL: http://www.bacula.org/ Vendor: The Bacula Team # automagically build the libversion %define _libversion %(echo "%{version}" | %__sed 's/\\./_/g') %define script_dir %_libdir/bacula %define working_dir /var/lib/bacula %define log_dir /var/log/bacula %define pid_dir /var/run/bacula %define _subsysdir /var/lock %define director_daemon_user bacula %define storage_daemon_user bacula %define file_daemon_user root %define daemon_group bacula %define storage_daemon_group bacula # suse 113 and lower doesn't have group "tape" nor new openSUSE version? %if 0%{?suse_version} < 1140 || 0%{?suse_version} > 1220 %define storage_daemon_additional_groups disk %else %define storage_daemon_additional_groups disk,tape %endif %define build_bat 1 %define build_qt_monitor 1 %define build_gtk_monitor 1 %define build_sqlite3 1 %define systemd 0 # firewall installation %define install_suse_fw 0 %define _fwdefdir %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services %if 0%{?suse_version} > 1010 %define install_suse_fw 1 %endif %if 0%{?suse_version} > 1140 || 0%{?fedora_version} > 14 %define systemd_support 1 %endif # centos/rhel 5 : segfault when building qt monitor %if 0%{?centos_version} == 505 || 0%{?rhel_version} == 505 %define build_bat 0 %define build_qt_monitor 0 %endif %if 0%{?sles_version} == 10 %define build_bat 0 %define build_qt_monitor 0 %define build_gtk_monitor 0 %define build_sqlite3 0 %endif %if 0%{?systemd_support} BuildRequires: systemd %{?systemd_requires} %endif #Unfortunately upstream didn't want to push it as tar.bz2 and use tar.gz Source0: http://www.prdownloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz Source6: bacula-dir.fw Source7: bacula-fd.fw Source8: bacula-sd.fw # script to manually create and add random passwords into all unconfigured local files Source9: bacula-password-setup.sh # External non upstream series Patch500: 0500-wrong-script-interpreter.patch Patch501: 0501-mtxchangerconf.patch Patch502: 0502-mtx-changer-shebang.patch Patch503: 0503-fix-full-path-in-bacula-tray-monitor.desktop.patch # # Here the patch list upstream provide fixes and improvement # compared to the released tarball Patch0: 0000-allow-lower-qt-version.patch # Not yet upstream : # systemd mostly the database dependency are softly invoke now # patch for removing obsolete syslog.target Patch1000: 1000-Remove-obsolete-syslog.target.patch Patch1001: 1001-Added-su-option-mandatory-on-new-SuSE-RedHat-Debian.patch BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: make BuildRequires: glibc BuildRequires: glibc-devel BuildRequires: ncurses-devel BuildRequires: perl BuildRequires: readline-devel BuildRequires: libstdc++-devel BuildRequires: zlib-devel BuildRequires: openssl-devel BuildRequires: libacl-devel BuildRequires: pkgconfig BuildRequires: lzo-devel %if 0%{?build_sqlite3} BuildRequires: sqlite-devel %endif BuildRequires: mysql-devel BuildRequires: postgresql-devel BuildRequires: libqt4-devel BuildRequires: openssl BuildRequires: libcap-devel # Added to fix wrong env in mtx-changer BuildRequires: mtx # Avoid implicit dependencies could be need in patching upstream configure BuildRequires: libtool BuildRequires: autoconf # only for old tray monitor %if 0%{?build_gtk_monitor} BuildRequires: gtk2-devel %endif %if 0%{?suse_version} # link identical files BuildRequires: fdupes BuildRequires: termcap BuildRequires: pwdutils BuildRequires: tcpd-devel BuildRequires: update-desktop-files # for suse version we need /etc/suse-release or opensuse-release # one day God will fix distribution-release for sle and we will be # able to clean that crap %if !0%{sles_version} BuildRequires: openSUSE-release %else %if 0%{?sles_version} && !0%{?sled_version} BuildRequires: sles-release %else BuildRequires: sled-release %endif %endif %else BuildRequires: qt4-devel BuildRequires: libtermcap-devel BuildRequires: passwd BuildRequires: tcp_wrappers %endif %if 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600 || 0%{?fedora_version} >= 14 BuildRequires: tcp_wrappers-devel %endif # rh-based distris: we need /etc/redhat-release %if 0%{?fedora_version} BuildRequires: generic-release %endif %if 0%{?rhel_version} || 0%{?centos_version} BuildRequires: redhat-release %endif %define dscr Bacula - The Leading Open Source Backup Solution.\ Bacula is a set of computer programs that permit you (or the system\ administrator) to manage backup, recovery, and verification of computer\ data across a network of computers of different kinds. In technical terms,\ it is a network client/server based backup program. Bacula is relatively\ easy to use and efficient, while offering many advanced storage management\ features that make it easy to find and recover lost or damaged files.\ Bacula source code has been released under the AGPL version 3 license. %description %{dscr} # Notice : Don't try to change the order of package declaration # You will have side effect with PreReq # Meta packages for compatibility with the old package names %package postgresql # contains bconsole, fd, sd, dir, libbaccats-postgresql Summary: Meta-All-In-One package (dir,sd,fd) for postgresql Group: Productivity/Archiving/Backup Requires: openssl Requires: %{name}-bconsole = %{version} Requires: %{name}-fd = %{version} Requires: %{name}-sd = %{version} Requires: %{name}-dir = %{version} Requires: %{name}-tools = %{version} Requires: %{name}-libs = %{version} Requires: %{name}-sql = %{version} Requires: %{name}-catalog-postgresql = %{version} Conflicts: %{name}-mysql Conflicts: %{name}-sqlite3 %if 0%{?suse_version} # Let that if Fedora & others don't know this tag # If a user want a all-in-one, he certainly want the # corresponding DB Recommends: %{name}-updatedb Recommends: postgresql-server %endif %package mysql # contains bconsole, fd, sd, dir, tools, libs, libbaccats-mysql Summary: Meta-All-In-One package (dir,sd,fd) for mysql Group: Productivity/Archiving/Backup Requires: openssl Requires: %{name}-bconsole = %{version} Requires: %{name}-fd = %{version} Requires: %{name}-sd = %{version} Requires: %{name}-dir = %{version} Requires: %{name}-tools = %{version} Requires: %{name}-libs = %{version} Requires: %{name}-sql = %{version} Requires: %{name}-catalog-mysql = %{version} Conflicts: %{name}-postgresql Conflicts: %{name}-sqlite3 %if 0%{?suse_version} # Let that if Fedora & others don't know this tag # If a user want a all-in-one, he certainly want the # corresponding DB # Notice starting with 12.1 mysql = mariadb ! Recommends: %{name}-updatedb Recommends: mysql %endif %if 0%{?build_sqlite3} %package sqlite3 # contains bconsole, fd, sd, dir, tools, libs, libbaccats-sqlite Summary: Meta-All-In-One package (dir,sd,fd) for sqlite3 Group: Productivity/Archiving/Backup Requires: openssl Requires: %{name}-bconsole = %{version} Requires: %{name}-fd = %{version} Requires: %{name}-sd = %{version} Requires: %{name}-dir = %{version} Requires: %{name}-tools = %{version} Requires: %{name}-libs = %{version} Requires: %{name}-sql = %{version} Requires: %{name}-catalog-sqlite3 = %{version} Conflicts: %{name}-mysql Conflicts: %{name}-postgresql %if 0%{?suse_version} # Let that if Fedora & others don't know this tag # If a user want a all-in-one, he certainly want the # corresponding DB Recommends: %{name}-updatedb Recommends: sqlite3 %endif %endif %package client # contains bconsole, fd, libs Summary: Meta-All-In-One package client package Group: Productivity/Archiving/Backup Conflicts: %{name}-mysql Conflicts: %{name}-sqlite3 Conflicts: %{name}-postgresql Requires: %{name}-bconsole = %{version} Requires: %{name}-fd = %{version} Requires: %{name}-libs = %{version} # Real packages %package bconsole Summary: Provide ncurse administration console Group: Productivity/Archiving/Backup Requires: %{name}-libs = %{version} %package dir Summary: Provide bacula director daemon Group: Productivity/Archiving/Backup Requires: %{name}-libs = %{version} Requires: aaa_base %if 0%{?suse_version} # Let that if Fedora & others don't know this tag Recommends: logrotate %endif %package sd Summary: Provide bacula storage daemon Group: Productivity/Archiving/Backup Requires: %{name}-libs = %{version} Requires: mtx Requires: aaa_base %package fd Summary: Provide bacula file daemon service Group: Productivity/Archiving/Backup Requires: %{name}-libs = %{version} Requires: aaa_base %package libs Summary: Generic libs needed by every package Group: Productivity/Archiving/Backup %package sql Summary: Generic abstration lib for the sql catalog Group: Productivity/Archiving/Backup Requires: %{name}-dir %package updatedb Summary: Sql scripts to update your catalog to current version Group: Productivity/Archiving/Backup PreReq: %{name}-dir = %{version} PreReq: %{name}-sql = %{version} %if 0%{?build_sqlite3} # Notice : PreReq are mandatory %package catalog-sqlite3 Summary: Libs & tools for sqlite3 catalog Group: Productivity/Archiving/Backup PreReq: %{name}-dir = %{version} PreReq: %{name}-sql = %{version} # We need sqlite3 as tool for managing the DB Requires: sqlite3 Conflicts: %{name}-catalog-mysql Conflicts: %{name}-catalog-postgresql %ifarch x86_64 Provides: libbaccats-%{version}.so()(64bit) %else Provides: libbaccats-%{version}.so %endif %endif # We don't require the db server # the db can be another hosts %package catalog-mysql Summary: Libs & tools for mysql catalog Group: Productivity/Archiving/Backup PreReq: %{name}-dir = %{version} PreReq: %{name}-sql = %{version} Conflicts: %{name}-catalog-postgresql Conflicts: %{name}-catalog-sqlite3 %ifarch x86_64 Provides: libbaccats-%{version}.so()(64bit) %else Provides: libbaccats-%{version}.so %endif %package catalog-postgresql Summary: Libs & tools for postgresql catalog Group: Productivity/Archiving/Backup PreReq: %{name}-dir = %{version} PreReq: %{name}-sql = %{version} Conflicts: %{name}-catalog-mysql Conflicts: %{name}-catalog-sqlite3 %ifarch x86_64 Provides: libbaccats-%{version}.so()(64bit) %else Provides: libbaccats-%{version}.so %endif %package tools Summary: Provide bcopy, bextract, bls, bregex, bwild Group: Productivity/Archiving/Backup %if 0%{build_qt_monitor} %package tray-monitor-qt Summary: Qt based tray monitor Group: Productivity/Archiving/Backup # Added to by pass the 09 checker rules (conflit with bacula-tray-monitor.conf) # This is mostly wrong cause the two binaries can use it! Conflicts: %{name}-tray-monitor-gtk %endif %if 0%{build_gtk_monitor} %package tray-monitor-gtk Summary: Gtk based tray monitor Group: Productivity/Archiving/Backup # Added to by pass the 09 checker rules (conflit with bacula-tray-monitor.conf) # This is mostly wrong cause the two binaries can use it! Conflicts: %{name}-tray-monitor-qt %endif %if 0%{?build_bat} %package bat Summary: Provide Bacula Admin Tool gui Group: Productivity/Archiving/Backup %endif %package devel Summary: Devel headers Group: Development/Languages/C and C++ Requires: %{name}-libs = %{version}, %{name}-sql = %{version} Requires: tcpd-devel Requires: zlib-devel Requires: libmysqlclient-devel Requires: postgresql-devel %if 0%{?build_sqlite3} Requires: sqlite3-devel %endif Requires: libopenssl-devel Requires: libcap-devel # Meta packages for compatibility with the old package names %description postgresql %{dscr} This package is a meta package requiring the packages for a Bacula Server with postgresql as catalog db. Contain also the client part. %description mysql %{dscr} This package is a meta package requiring the packages for a Bacula Server with mysql as catalog db. Contain also the client part. %if 0%{?build_sqlite3} %description sqlite3 %{dscr} This package is a meta package requiring the packages for a Bacula Server with sqlite as catalog db. Contain also the client part. %endif %description client %{dscr} This package is a meta package requiring the packages for compatiblity with the old client Package, containing the fd and the console. This is for client only installation. %description bconsole %{dscr} This package contains the bconsole (the CLI interface program) %description dir %{dscr} This package contains the Director Service (Bacula main service daemon) %description sd %{dscr} This package contains the Storage Daemon (Bacula service to read and write data from/to media) %description fd %{dscr} This package contains the File Daemon (Baculas client daemon to read/write data from the backed up computer) %if 0%{?build_sqlite3} %description catalog-sqlite3 %{dscr} This package contains the shared library to use sqlite as catalog db. %endif %description catalog-mysql %{dscr} This package contains the shared library to use mysql as catalog db. %description catalog-postgresql %{dscr} This package contains the shared library to access postgresql as catalog db. %description sql %{dscr} This package contains the shared library that abstracts sql queries. %description libs %{dscr} This package contains the shared libraries that are used by multiple daemons and tools. %description tools %{dscr} This package contains baculas tools. %if 0%{?build_qt_monitor} %description tray-monitor-qt %{dscr} This package contains the new tray monitor that uses qt. %endif %if 0%{?build_gtk_monitor} %description tray-monitor-gtk %{dscr} This package contains the old tray monitor that uses gtk. %endif %if 0%{?build_bat} %description bat %{dscr} This package contains the Bacula Admin Tool (BAT). Bat is a graphical interface for bacula. %endif %description updatedb %{dscr} This package contains scripts to update the Catalog DB to the newest version. %description devel %{dscr} This package contains bacula development files. %prep %setup #-q #setup -D -T -a 5 # The bunch of fixes and improvement we get from git %patch0 -p2 # Stack of non upstream patches #bacula-5.0.0-wrong-script-interpreter.patch %patch500 #bacula-5.0.3-mtxchangerconf.patch %patch501 #mtx-changer-shebang.patch %patch502 -p1 #bacula-5.2.0-fix-full-path-in-bacula-tray-monitor.desktop.patch %patch503 # The bunch of script not upstream yet %patch1000 -p2 %patch1001 -p2 # Keep as example how to do it %if 0%{?systemd_support} # Recreate ./configure only for systemd ready distributions cd autoconf %__autoconf -o ../configure %endif %build %if %{undefined suse_version} export PATH=$PATH:/usr/lib64/qt4/bin:/usr/lib/qt4/bin %endif export MTX=/usr/sbin/mtx # Notice keep the upstream order of ./configure --help %configure \ --prefix=%{_prefix} \ --sbindir=%{_sbindir} \ --with-sbin-perm=755 \ --sysconfdir=%{_sysconfdir}/bacula \ --mandir=%{_mandir} \ --docdir=%{_docdir}/bacula \ --with-scriptdir=%{script_dir} \ --with-working-dir=%{working_dir} \ --with-plugindir=%{script_dir} \ --with-pid-dir=%{pid_dir} \ --with-subsys-dir=%{_subsysdir} \ --with-logdir=%{log_dir} \ --enable-smartalloc \ --disable-gnome \ --disable-bwx-console \ %if 0%{?build_gtk_monitor} --enable-tray-monitor \ %endif --disable-conio \ --enable-readline \ %if 0%{?build_bat} --enable-bat \ %endif --with-mysql \ --with-postgresql \ %if 0%{?build_sqlite3} --with-sqlite3 \ %endif --with-tcp-wrappers \ --with-dir-user=%{director_daemon_user} \ --with-dir-group=%{daemon_group} \ --with-sd-user=%{storage_daemon_user} \ --with-sd-group=%{storage_daemon_group} \ --with-fd-user=%{file_daemon_user} \ --with-fd-group=%{daemon_group} \ --with-dir-password="XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX" \ --with-fd-password="XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX" \ --with-sd-password="XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX" \ --with-mon-dir-password="XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX" \ --with-mon-fd-password="XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX" \ --with-mon-sd-password="XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX" \ --with-openssl \ --with-basename="XXX_REPLACE_WITH_LOCAL_HOSTNAME_XXX" \ %if 0%{?systemd_support} --with-systemd \ %endif --enable-includes #Add flags %__make CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags}; %if 0%{?build_qt_monitor} # build and tray-monitor manually, as this is not build and installed by make cd src/qt-console/tray-monitor qmake tray-monitor.pro %__make CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags} cd - %endif %if 0%{?build_gtk_monitor} # build old tray monitor cd src/tray-monitor %__make CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags}; cd - %endif %install %if 0%{?suse_version} ## %%make_install macro does not work on SLE_11 install -d 755 %{buildroot}%{_sysconfdir}/init.d %makeinstall DESTDIR=%{buildroot} install-autostart %else install -d 755 %{buildroot}%{_sysconfdir}/rc.d/init.d make DESTDIR=%{buildroot} install install-autostart # Autostart are handled by hand due to systemd/sysinitv fight #install-autostart %endif # Supplemental system service files # install systemd service files %if 0%{?systemd_support} # if systemd exist, we only use native service install -d -m 755 %{buildroot}%{_unitdir} install -m 644 platforms/systemd/bacula-dir.service %{buildroot}%{_unitdir} install -m 644 platforms/systemd/bacula-fd.service %{buildroot}%{_unitdir} install -m 644 platforms/systemd/bacula-sd.service %{buildroot}%{_unitdir} # tmpfiles.d for /var/run/bacula needed for each daemon # goes to system wide /usr/lib/tmpfiles.d and we don't have macro for that install -d -m 755 %{buildroot}/usr/lib/tmpfiles.d install -m 644 platforms/systemd/bacula.conf %{buildroot}/usr/lib/tmpfiles.d # Cleanup what upstream platforms script think it's right to have # Finally we decide to only support systemd on 12.1 %if 0%{?suse_version} test -d %{buildroot}%{_sysconfdir}/init.d && %__rm -fr %{buildroot}%{_sysconfdir}/init.d %else test -d %{buildroot}%{_sysconfdir}/rc.d/init.d && %__rm -fr %{buildroot}%{_sysconfdir}/rc.d/init.d %endif %endif #Startup script (complicated due to 12.1 supporting systemd & sysinitv %if 0%{?suse_version} %if 0%{?suse_version} >= 1230 #Install openSUSE/SUSE specific start link with the patched service script ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcbacula-fd ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcbacula-sd ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcbacula-dir %else %if 0%{?suse_version} == 1220 #Install openSUSE/SUSE specific start link with the patched service script # but not from /usr ln -sf /sbin/service %{buildroot}%{_sbindir}/rcbacula-fd ln -sf /sbin/service %{buildroot}%{_sbindir}/rcbacula-sd ln -sf /sbin/service %{buildroot}%{_sbindir}/rcbacula-dir %endif %if !0%{?systemd_support} #Install openSUSE/SUSE specific start link for openSUSE 12.1 and below ln -sf ../../etc/init.d/bacula-fd %{buildroot}%{_sbindir}/rcbacula-fd ln -sf ../../etc/init.d/bacula-sd %{buildroot}%{_sbindir}/rcbacula-sd ln -sf ../../etc/init.d/bacula-dir %{buildroot}%{_sbindir}/rcbacula-dir %endif %endif %endif install -d 755 %{buildroot}/usr/share/applications install -d 755 %{buildroot}/usr/share/pixmaps install -d 755 %{buildroot}%{working_dir} #Install openSUSE/SUSE specific Firewall rules %if 0%{?install_suse_fw} install -d 755 %{buildroot}/%{_fwdefdir} install -m 644 %{S:6} %{buildroot}%{_fwdefdir}/bacula-dir install -m 644 %{S:7} %{buildroot}%{_fwdefdir}/bacula-fd install -m 644 %{S:8} %{buildroot}%{_fwdefdir}/bacula-sd %endif #Cleaning # Special remove about the libbaccats # We remove this one (actually a wrong .so build with the last DB engine # We install it as a %%ghost file and symlink it with the right # db package for F in \ %{_libdir}/bacula/bacula_config \ %{_libdir}/bacula/btraceback.dbx \ %{_libdir}/bacula/btraceback.mdb \ %{_libdir}/bacula/bacula \ %{_libdir}/bacula/bacula-ctl-dir \ %{_libdir}/bacula/bacula-ctl-fd \ %{_libdir}/bacula/bacula-ctl-sd \ %{_libdir}/libbaccats-mysql.so \ %{_libdir}/libbaccats-postgresql.so \ %{_libdir}/libbaccats-sqlite3.so \ %{_libdir}/libbaccats.so \ %{_libdir}/libbaccats-%{version}.so \ %{_mandir}/man1/bacula-bwxconsole.1.gz \ %{_docdir}/bacula/INSTALL \ %{_sbindir}/bacula \ %{_libdir}/libbaccats-%{version}.so do rm -f "%{buildroot}/$F" done # looks like on CentOS5, ghost files must exist so we create the .so file install -d 755 %{buildroot}/%{_libdir} touch %{buildroot}%{_libdir}/libbaccats-%{version}.so # remove .la files # @TODO if not explain why ? : # -> 20111129 needed to resolv dependencies ??? # but we get message that they should be removed ??? WTF rm %{buildroot}/%{_libdir}/libbacfind.la rm %{buildroot}/%{_libdir}/libbaccats.la rm %{buildroot}/%{_libdir}/libbacsql.la rm %{buildroot}/%{_libdir}/libbac.la rm %{buildroot}/%{_libdir}/libbaccfg.la rm %{buildroot}/%{_libdir}/libbaccats-mysql.la rm %{buildroot}/%{_libdir}/libbaccats-postgresql.la rm %{buildroot}/%{_libdir}/libbaccats-sqlite3.la # install tray monitor %if 0%{?build_qt_monitor} install -m 755 src/qt-console/tray-monitor/.libs/bacula-tray-monitor %{buildroot}%{_sbindir}/bacula-tray-monitor-qt install -m 644 src/tray-monitor/tray-monitor.conf %{buildroot}%{_sysconfdir}/bacula/ %endif #install gtk tray monitor %if 0%{?build_gtk_monitor} mv %{buildroot}%{_sbindir}/bacula-tray-monitor %{buildroot}%{_sbindir}/bacula-tray-monitor-gtk %endif # install updatedb scripts install -d 755 %{buildroot}%{script_dir}/updatedb/ install -m 754 updatedb/* %{buildroot}%{script_dir}/updatedb/ rm %{buildroot}%{script_dir}/updatedb/*.in chmod -x %{buildroot}%{script_dir}/updatedb/README %if 0%{?build_bat} # install bat install -m 755 src/qt-console/.libs/bat %{buildroot}%{_sbindir} install -m 640 src/qt-console/bat.conf %{buildroot}%{_sysconfdir}/bacula/bat.conf install -m 644 src/qt-console/images/bat_icon.png %{buildroot}/usr/share/pixmaps/bat_icon.png %if 0%{?suse_version} > 1010 %suse_update_desktop_file -c bat bat "bacula the network backup solution - BAT Bacula Admin Tool" bat bat_icon System Backup %suse_update_desktop_file -i bat System Backup %else install -m 644 scripts/bat.desktop %{buildroot}/usr/share/applications/ %endif %endif # end build_bat %if 0%{build_qt_monitor} || 0%{build_gtk_monitor} # tray monitor desktop file install -d 755 %{buildroot}/etc/xdg/autostart install -m 644 scripts/bacula-tray-monitor.desktop %{buildroot}/usr/share/applications/ %if 0%{?suse_version} > 1010 %suse_update_desktop_file -i -r bacula-tray-monitor System Backup %endif # copy to autostart directory install -m 644 %{buildroot}/usr/share/applications/bacula-tray-monitor.desktop %{buildroot}/etc/xdg/autostart # tray monitor icon install -m 644 src/tray-monitor/generic.xpm %{buildroot}/usr/share/pixmaps/bacula-tray-monitor.xpm %endif # end build tray monitor # install the sample-query.sql file as default query file # Notice : install -m 644 examples/sample-query.sql %{buildroot}%{script_dir}/query.sql # use of %%ghost ! # we create that for SLES & RHEL5 install -d 755 %{buildroot}/%{log_dir} touch %{buildroot}%{log_dir}/log chmod 0640 %{buildroot}%{log_dir}/log # remove man page if bat is not built %if !0%{?build_bat} rm %{buildroot}%{_mandir}/man1/bat.1.gz %endif # remove man page if qt tray monitor is not built %if !0%{?build_qt_monitor} rm %{buildroot}%{_mandir}/man1/bacula-tray-monitor.1.gz %endif # install logrotate script # Use this one if you want to auto-create /var/log/bacula/ # and change the configuration for dir/fd install -m 644 -D scripts/logrotate %{buildroot}%{_sysconfdir}/logrotate.d/%{name}-dir # Create the Readme files for the meta packages echo "This meta package emulates the former bacula-client package" > %{buildroot}%{_docdir}/bacula/README.bacula-client echo "This meta package emulates the former bacula-mysql package" > %{buildroot}%{_docdir}/bacula/README.bacula-mysql echo "This meta package emulates the former bacula-postgresql package" > %{buildroot}%{_docdir}/bacula/README.bacula-postgresql %if 0%{build_sqlite3} echo "This meta package emulates the former bacula-sqlite package" > %{buildroot}%{_docdir}/bacula/README.bacula-sqlite %endif # script for password generation install -m 700 %{SOURCE9} %{buildroot}%{script_dir}/ # replace # XXX_REPLACE_WITH_LOCAL_HOSTNAME_XXX-dir # by XXX_REPLACE_WITH_DIRECTOR_HOSTNAME_XXX-dir # in bacula-sd.conf, bacula-dir.conf, bacula-fd.conf, bconsole.conf, bat.conf # BF 20120127 added shutup the echo for conf in bacula-sd.conf bacula-dir.conf bacula-fd.conf bconsole.conf bat.conf; do if [ -e %{buildroot}%{_sysconfdir}/bacula/${conf} ] ; then # echo replacing XXX_REPLACE_WITH_LOCAL_HOSTNAME_XXX-dir with XXX_REPLACE_WITH_DIRECTOR_HOSTNAME_XXX-dir in ${conf} sed -i'' "s#XXX_REPLACE_WITH_LOCAL_HOSTNAME_XXX-dir#XXX_REPLACE_WITH_DIRECTOR_HOSTNAME_XXX-dir#g" \ %{buildroot}%{_sysconfdir}/bacula/${conf} fi done # Meta Packages %files client %defattr(-, root, root) %dir %{_docdir}/%{name} %{_docdir}/%{name}/README.bacula-client %files postgresql %defattr(-, root, root) %dir %{_docdir}/%{name} %{_docdir}/%{name}/README.bacula-postgresql %files mysql %defattr(-, root, root) %{_docdir}/%{name}/README.bacula-mysql %if 0%{?build_sqlite3} %files sqlite3 %defattr(-, root, root) %dir %{_docdir}/%{name} %{_docdir}/%{name}/README.bacula-sqlite %endif # Real packages %files bconsole # * console package %defattr(-, root, %{daemon_group}) %dir %{_sysconfdir}/bacula %config(noreplace) %{_sysconfdir}/bacula/bconsole.conf %{_libdir}/bacula/bconsole %{_sbindir}/bconsole %{_mandir}/man8/bconsole.8.gz %files dir # * dir package ( bsmtp ) %defattr(-, root, %{daemon_group}) %dir %{_libdir}/bacula %dir %{_sysconfdir}/bacula %if 0%{?systemd_support} %{_unitdir}/bacula-dir.service %else %if 0%{?suse_version} %{_sysconfdir}/init.d/bacula-dir %else %{_sysconfdir}/rc.d/init.d/bacula-dir %endif %endif # There's no way for 12.1 ... %if 0%{?suse_version} && 0%{?suse_version} != 1210 %{_sbindir}/rcbacula-dir %endif %if 0%{?suse_version} # use noreplace if user has adjusted its list of IP %if 0%{?install_suse_fw} %attr(0644,root,root) %config(noreplace) %{_fwdefdir}/bacula-dir %endif %endif %config(noreplace) %{_sysconfdir}/bacula/bacula-dir.conf %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}-dir %{_libdir}/bacula/delete_catalog_backup %{_libdir}/bacula/make_catalog_backup %{_libdir}/bacula/make_catalog_backup.pl %{_sbindir}/bacula-dir %{_sbindir}/bsmtp #%%{_docdir}/bacula # We specify files by files to keep things clean %defattr(-, root, root) %dir %{_docdir}/%{name} %{_docdir}/bacula/ChangeLog %{_docdir}/bacula/LICENSE %{_docdir}/bacula/README %{_docdir}/bacula/ReleaseNotes %{_docdir}/bacula/technotes %{_docdir}/bacula/VERIFYING %{_mandir}/man1/bsmtp.1.gz %{_mandir}/man8/bacula-dir.8.gz %{_mandir}/man8/bacula.8.gz # The troubleweed lib %attr(755, root, root) %ghost %{_libdir}/libbaccats-%{version}.so # See later in post the update alternative # This is not a config file, but we need what %%config is able to do # the query.sql can be personalized by end user. # a rpmlint rule is add to filter the warning %config(noreplace) %{script_dir}/query.sql %attr(-, %{director_daemon_user}, %{daemon_group}) %dir %{working_dir} %attr(750, root, %{daemon_group}) %dir %{log_dir} %attr(640, %{director_daemon_user}, %{daemon_group}) %ghost %{log_dir}/log %files sd # * sd package ( bls + btape + bcopy + bextract ) %defattr(-, root, %{daemon_group}) %dir %{_sysconfdir}/bacula %config(noreplace) %{_sysconfdir}/bacula/bacula-sd.conf %if 0%{?systemd_support} %{_unitdir}/bacula-sd.service %else %if 0%{?suse_version} %{_sysconfdir}/init.d/bacula-sd %else %{_sysconfdir}/rc.d/init.d/bacula-sd %endif %endif # There's no way for 12.1 ... %if 0%{?suse_version} && 0%{?suse_version} != 1210 %{_sbindir}/rcbacula-sd %endif %if 0%{?suse_version} # use noreplace if user has adjusted its list of IP %if 0%{?install_suse_fw} %attr(0644,root,root) %config(noreplace) %{_fwdefdir}/bacula-sd %endif %endif %{_libdir}/bacula/disk-changer %{_libdir}/bacula/dvd-handler %{_libdir}/bacula/mtx-changer %config(noreplace) %{_sysconfdir}/bacula/mtx-changer.conf %{_sbindir}/bacula-sd %{_mandir}/man8/bacula-sd.8.gz %{_mandir}/man8/btape.8.gz %{_sbindir}/btape %attr(-, %{storage_daemon_user}, %{daemon_group}) %dir %{working_dir} %files fd # * fd package ( ) %defattr(-, root, %{daemon_group}) %dir %{_sysconfdir}/bacula %config(noreplace) %{_sysconfdir}/bacula/bacula-fd.conf %if 0%{?systemd_support} %{_unitdir}/bacula-fd.service %else %if 0%{?suse_version} %{_sysconfdir}/init.d/bacula-fd %else %{_sysconfdir}/rc.d/init.d/bacula-fd %endif %endif # There's no way for 12.1 ... %if 0%{?suse_version} && 0%{?suse_version} != 1210 %{_sbindir}/rcbacula-fd %endif %if 0%{?suse_version} # use noreplace if user has adjusted its list of IP %if 0%{?install_suse_fw} %attr(0644,root,root) %config(noreplace) %{_fwdefdir}/bacula-fd %endif %endif %{_sbindir}/bacula-fd %{_libdir}/bacula/bpipe-fd.so %{_mandir}/man8/bacula-fd.8.gz %attr(-, %{storage_daemon_user} , %{daemon_group}) %dir %{working_dir} # * tray monitor %if 0%{?build_sqlite3} %files catalog-sqlite3 # * bacula-libbaccats-{sqlite,postgresql,mysql} (libs and bscan and dbcheck) (make_database/tables/grant rights) # libbaccats-sqlite %defattr(-, root, root) %{_libdir}/bacula/create_sqlite3_database %{_libdir}/bacula/drop_sqlite3_database %{_libdir}/bacula/drop_sqlite3_tables %{_libdir}/bacula/grant_sqlite3_privileges %{_libdir}/bacula/make_sqlite3_tables %{_libdir}/bacula/update_sqlite3_tables %{_libdir}/libbaccats-sqlite3-%{version}.so %attr(755, root, root) %ghost %{_libdir}/libbaccats-%{version}.so %endif %files catalog-mysql # libbaccats-mysql %defattr(-, root, root) %{_libdir}/bacula/create_mysql_database %{_libdir}/bacula/drop_mysql_database %{_libdir}/bacula/drop_mysql_tables %{_libdir}/bacula/grant_mysql_privileges %{_libdir}/bacula/make_mysql_tables %{_libdir}/bacula/update_mysql_tables %{_libdir}/libbaccats-mysql-%{version}.so %attr(755, root, root) %ghost %{_libdir}/libbaccats-%{version}.so %files catalog-postgresql # libbaccats-postgresql %defattr(-, root, bacula) %{_libdir}/bacula/create_postgresql_database %{_libdir}/bacula/drop_postgresql_database %{_libdir}/bacula/drop_postgresql_tables %{_libdir}/bacula/grant_postgresql_privileges %{_libdir}/bacula/make_postgresql_tables %{_libdir}/bacula/update_postgresql_tables %{_libdir}/libbaccats-postgresql-%{version}.so %attr(755, root, root) %ghost %{_libdir}/libbaccats-%{version}.so %files sql %defattr(-, root, bacula) %{_libdir}/libbacsql-%{version}.so %{_libdir}/libbacsql.so %{_libdir}/bacula/create_bacula_database %{_libdir}/bacula/drop_bacula_database %{_libdir}/bacula/drop_bacula_tables %{_libdir}/bacula/grant_bacula_privileges %{_libdir}/bacula/make_bacula_tables %{_sbindir}/dbcheck %{_sbindir}/bscan %{_mandir}/man8/dbcheck.8.gz %{_mandir}/man8/bscan.8.gz %files libs # * common libraries (without db) %defattr(-, root, bacula) %{_libdir}/libbac-%{version}.so %{_libdir}/libbac.so %{_libdir}/libbaccfg-%{version}.so %{_libdir}/libbaccfg.so %{_libdir}/libbacfind-%{version}.so %{_libdir}/libbacfind.so %{_libdir}/libbacpy-%{version}.so %{_libdir}/libbacpy.so %{_sbindir}/btraceback %{_libdir}/bacula/btraceback.gdb %{_mandir}/man8/btraceback.8.gz %if 0%{?systemd_support} %dir /usr/lib/tmpfiles.d/ /usr/lib/tmpfiles.d/bacula.conf %endif %files tools # * tools without link to db libs ( bwild, bregex) #%%defattr(-, root, %%{daemon_group}) %defattr(-, root, bacula) %{_sbindir}/bcopy %{_sbindir}/bextract %{_sbindir}/bls %{_sbindir}/bregex %{_sbindir}/bwild %{_mandir}/man8/bcopy.8.gz %{_mandir}/man8/bextract.8.gz %{_mandir}/man8/bls.8.gz %{_mandir}/man8/bwild.8.gz %{_mandir}/man8/bregex.8.gz %{script_dir}/bacula-password-setup.sh %if 0%{?build_qt_monitor} %files tray-monitor-qt %defattr(-,root, root) %attr(-, root, %{daemon_group}) %dir %{_sysconfdir}/bacula %attr(-, root, %{daemon_group}) %config(noreplace) %{_sysconfdir}/bacula/tray-monitor.conf %{_sbindir}/bacula-tray-monitor-qt %{_mandir}/man1/bacula-tray-monitor.1.gz %config %{_sysconfdir}/xdg/autostart/bacula-tray-monitor.desktop /usr/share/applications/bacula-tray-monitor.desktop /usr/share/pixmaps/bacula-tray-monitor.xpm %endif %if 0%{?build_gtk_monitor} %files tray-monitor-gtk %defattr(-,root, root) %attr(-, root, %{daemon_group}) %dir %{_sysconfdir}/bacula %attr(-, root, %{daemon_group}) %config(noreplace) %{_sysconfdir}/bacula/tray-monitor.conf %{_sbindir}/bacula-tray-monitor-gtk %config %{_sysconfdir}/xdg/autostart/bacula-tray-monitor.desktop /usr/share/applications/bacula-tray-monitor.desktop /usr/share/pixmaps/bacula-tray-monitor.xpm %endif %if 0%{?build_bat} %files bat %defattr(-, root, root) %attr(-, root, %{daemon_group}) %{_sbindir}/bat %attr(-, root, %{daemon_group}) %dir %{_sysconfdir}/bacula %attr(640, root, %{daemon_group}) %config(noreplace) %{_sysconfdir}/bacula/bat.conf %{_prefix}/share/pixmaps/bat_icon.png %{_prefix}/share/applications/bat.desktop %{_mandir}/man1/bat.1.gz %defattr(-, root, root) %dir %{_docdir}/%{name} %{_docdir}/bacula/clients.html %{_docdir}/bacula/console.html %{_docdir}/bacula/filesets.html %{_docdir}/bacula/index.html %{_docdir}/bacula/joblist.html %{_docdir}/bacula/jobplot.html %{_docdir}/bacula/jobs.html %{_docdir}/bacula/restore.html %{_docdir}/bacula/status.png %{_docdir}/bacula/storage.html %{_docdir}/bacula/mail-message-new.png %{_docdir}/bacula/media.html %endif %files updatedb #%%defattr(-, root, %%{daemon_group}) %defattr(-, root, bacula) %dir %{script_dir}/updatedb %{script_dir}/updatedb/* %{_libdir}/bacula/update_bacula_tables %files devel %defattr(-, root, bacula) %dir /usr/include/bacula %{_libdir}/*.la /usr/include/bacula/* %define fix_generic_db_scripts # update the generic scripts to use the right default_db_type\ for SCRIPT in grant_bacula_privileges create_bacula_database make_bacula_tables drop_bacula_tables drop_bacula_database; \ do \ echo "setting ${DEFAULT_DB_TYPE} as default_db_type in %{_libdir}/bacula/${SCRIPT}"\ if [ -f %{_libdir}/bacula/${SCRIPT} ]; then \ sed -i'' "s#default_db_type=.*#default_db_type=${DEFAULT_DB_TYPE}#g" %{_libdir}/bacula/${SCRIPT} \ fi \ done\ #%%if 0%%{?suse_version} #%%define do_update_alternatives update-alternatives #%%else #%%define do_update_alternatives alternatives #%%endif #@FIXME : # Need also a patch to add in init.d script the Require Start for the right db # Think about upgrade and change of default db # For the troubleweed libbaccats move it only if it's not a symlink # otherwise perhaps another db exist before # Could it be a candidate for update-alternative ?? %post catalog-mysql DEFAULT_DB_TYPE=mysql #PRIO=50 %fix_generic_db_scripts echo "running ldconfig for libbaccats-${DEFAULT_DB_TYPE}-%{version}.so" ldconfig %post catalog-postgresql DEFAULT_DB_TYPE=postgresql #PRIO=50 %fix_generic_db_scripts echo "running ldconfig for libbaccats-${DEFAULT_DB_TYPE}-%{version}.so" ldconfig %if 0%{?build_sqlite3} %post catalog-sqlite3 DEFAULT_DB_TYPE=sqlite3 %endif #PRIO=50 %fix_generic_db_scripts echo "running ldconfig for libbaccats-${DEFAULT_DB_TYPE}-%{version}.so" ldconfig # replace the hostname placeholder "XXX_REPLACE_WITH_LOCAL_HOSTNAME_XXX" with local hostname () # this is done in every package %define add_actual_hostname # put actual short hostname in configuration files\ if [ -d %{_sysconfdir}/bacula ]; then\ cd %{_sysconfdir}/bacula;\ # try to get short hostname\ hname=`hostname -s`\ if [ -z $hname ]\ then\ # try to get long hostname\ hname=`hostname|sed 's/\\..*//g'`\ if [ -z $hname ]\ then \ # set to "localhost"\ hname='localhost'\ fi\ fi\ echo "replacing placeholder XXX_REPLACE_WITH_LOCAL_HOSTNAME_XXX in .conf file with hostname \'${hname}\'";\ for file in *.conf; do\ if grep XXX_REPLACE_WITH_LOCAL_HOSTNAME_XXX $file >/dev/null;\ then \ sed -i'' "s#XXX_REPLACE_WITH_LOCAL_HOSTNAME_XXX#${hname}#g" $file;\ fi\ done\ fi # replace the hostname placeholder "XXX_REPLACE_WITH_DIRECTOR_HOSTNAME_XXX" with local hostname () # this is done only in the bacula-postgresql, -mysql, sqlite3 meta packages %define add_actual_hostname_as_director # put actual short hostname in configuration files\ if [ -d %{_sysconfdir}/bacula ]; then\ cd %{_sysconfdir}/bacula;\ # try to get short hostname\ hname=`hostname -s`\ if [ -z $hname ]\ then\ # try to get long hostname\ hname=`hostname|sed 's/\\..*//g'`\ if [ -z $hname ]\ then \ # set to "localhost"\ hname='localhost'\ fi\ fi\ echo "replacing placeholder XXX_REPLACE_WITH_DIRECTOR_HOSTNAME_XXX in .conf file with hostname \'${hname}\'";\ for file in *.conf; do\ if grep XXX_REPLACE_WITH_DIRECTOR_HOSTNAME_XXX $file >/dev/null;\ then \ sed -i'' "s#XXX_REPLACE_WITH_DIRECTOR_HOSTNAME_XXX#${hname}#g" $file;\ fi\ done\ fi %define warn_hot_upgrade \ echo <<WARNME \ ********** WARNING **************************\ We're trying to restart tmpfiles service, if it \ fail, run as root the following command \ systemctl restart systemd-tmpfiles-setup.service \ This will ensure that %{pid_dir} is created.\ \ --- Check your configuration to be sure that \ PID Directory parameter point to %{pid_dir} \ WARNME\ [ -x /bin/systemctl ] && /bin/systemctl try-restart systemd-tmpfiles-setup.service || : %post mysql %add_actual_hostname_as_director %{script_dir}/bacula-password-setup.sh %post postgresql %add_actual_hostname_as_director %{script_dir}/bacula-password-setup.sh %if 0%{?build_sqlite3} %post sqlite3 %add_actual_hostname_as_director %{script_dir}/bacula-password-setup.sh %endif %if 0%{?build_qt_monitor} %post tray-monitor-qt %add_actual_hostname echo "linking %{_sbindir}/bacula-tray-monitor-qt %{_sbindir}/bacula-tray-monitor" ln -sf %{_sbindir}/bacula-tray-monitor-qt %{_sbindir}/bacula-tray-monitor %endif %if 0%{?build_gtk_monitor} %post tray-monitor-gtk %add_actual_hostname echo "linking %{_sbindir}/bacula-tray-monitor-gtk %{_sbindir}/bacula-tray-monitor" ln -sf %{_sbindir}/bacula-tray-monitor-gtk %{_sbindir}/bacula-tray-monitor %endif %post dir %add_actual_hostname %if 0%{?systemd_support} %warn_hot_upgrade %endif %post sd %add_actual_hostname %if 0%{?systemd_support} %warn_hot_upgrade %endif %post fd %add_actual_hostname %if 0%{?systemd_support} %warn_hot_upgrade %endif %if 0%{?build_bat} %post bat %add_actual_hostname %endif # this macro creates the director daemon user and the daemon group. # this is needed in all packages that have files that have user ownership %define add_director_user_and_group \ getent group %{daemon_group} > /dev/null || groupadd -r %{daemon_group}\ getent passwd %{director_daemon_user} > /dev/null || useradd -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{director_daemon_user}\ exit 0\ %pre sql %add_director_user_and_group %pre tools %add_director_user_and_group %pre libs %add_director_user_and_group %pre dir %add_director_user_and_group exit 0 %pre sd #@FIXME sd should also be part of daemon_group to be able to access working_dir getent group %{daemon_group} > /dev/null || groupadd -r %{daemon_group} getent group %{storage_daemon_group} > /dev/null || groupadd -r %{storage_daemon_group} getent passwd %{storage_daemon_user} > /dev/null || useradd -r -c "Bacula" -d %{working_dir} -g %{storage_daemon_group} -G %{storage_daemon_additional_groups} -M -s /sbin/nologin %{storage_daemon_user} # first. set the primary group, then add the additional groups usermod -g %{storage_daemon_group} %{storage_daemon_user} usermod -G %{storage_daemon_additional_groups} %{storage_daemon_user} exit 0 %pre fd getent group %{daemon_group} > /dev/null || groupadd -r %{daemon_group} #@FIXME did we need this if we use root ? #@Answer : yes we can use kernel capabilities, and so need a user getent passwd %{file_daemon_user} > /dev/null || useradd -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{file_daemon_user} exit 0 %pre bconsole # Not perfect but otherwise we are root getent group %{daemon_group} > /dev/null || groupadd -r %{daemon_group} exit 0 %preun dir %stop_on_removal %preun sd %stop_on_removal %preun fd %stop_on_removal %postun dir %insserv_cleanup %postun sd %insserv_cleanup %postun fd %insserv_cleanup # Keep them for ref if we need special actions on those #%%postun catalog-mysql #%%postun catalog-postgresql #%%if 0%%{?build_sqlite3} #%%postun catalog-sqlite3 #%%endif
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor