/rescue/solaris/1
/rescue/solaris/bacula-fd
/rescue/solaris/bacula-fd.conf
+platforms/osx/build
+platforms/osx/dl
+platforms/osx/products
+platforms/osx/tools
BACULA_SOURCE:=${WORKING_DIR}/bacula-${BACULA_VERSION}
BACULA_DESTDIR:=${WORKING_DIR}/destdir
BACULA_PREFIX:=/usr/local/bacula-${BACULA_VERSION}
+BACULA_FD_CONF:=/Library/Preferences/bacula/bacula-fd.conf
# Detect whether we sit inside the bacula source tree. In this case we won't
# download the tar from sourceforge but instead work with what its there
PACKAGE_DIR:=${PRODUCTS_DIR}/${PACKAGE_TITLE}
PACKAGE_BUNDLE:=${PACKAGE_DIR}/${PACKAGE_TITLE}.pkg
PACKAGE_DMG:=${PRODUCTS_DIR}/${PACKAGE_TITLE}.dmg
-PACKAGE_RESOURCES:=Description.plist Info.plist ReadMe.html postflight preupgrade
+PACKAGE_RESOURCES:=Description.plist ReadMe.html postflight preupgrade
PACKAGE_XRESOURCES:=postflight preupgrade
FAKEROOT_TAR:=${DL_DIR}/fakeroot-${FAKEROOT_VERSION}.tar.gz
CXXFLAGS:=${CFLAGS}
LDFLAGS:=${MACOSX_VERSION_FLAGS} ${ARCHFLAGS}
+# Placeholders for *.in files
+INFILE_SUBST=\
+ -e "s,@PREFIX@,${BACULA_PREFIX},g" \
+ -e "s,@BACULA_VERSION@,${BACULA_VERSION},g" \
+ -e "s,@FD_CONF@,${BACULA_FD_CONF},g"
+
dmg: pkg
hdiutil create -srcfolder "${PACKAGE_DIR}" "${PACKAGE_DMG}"
pkg: ${BACULA_DESTDIR} ${WORKING_DIR}/resources ${FAKEROOT_DESTDIR}
mkdir -p "${PACKAGE_DIR}"
+ sed ${INFILE_SUBST} \
+ files/Info.plist.in > "${WORKING_DIR}/Info.plist";
+
${FAKEROOT} ${PM} -build -ds -v -f "\"${BACULA_DESTDIR}\"" -p "\"${PACKAGE_BUNDLE}\"" \
- -r "\"${WORKING_DIR}/resources\"" -i "\"${WORKING_DIR}/resources/Info.plist\""
+ -r "\"${WORKING_DIR}/resources\"" -i "\"${WORKING_DIR}/Info.plist\""
cp ${WORKING_DIR}/resources/ReadMe.html "${PACKAGE_DIR}/ReadMe.html"
- sed -e "s,@PREFIX@,${BACULA_PREFIX},g" -e "s,@BACULA_VERSION@,${BACULA_VERSION},g" \
+ sed ${INFILE_SUBST} \
files/uninstall.command.in > "${PACKAGE_DIR}/uninstall.command";
chmod 0775 "${PACKAGE_DIR}/uninstall.command"
mkdir -p "${WORKING_DIR}/resources"
for res in ${PACKAGE_RESOURCES}; do \
- sed -e "s,@PREFIX@,${BACULA_PREFIX},g" -e "s,@BACULA_VERSION@,${BACULA_VERSION},g" \
+ sed ${INFILE_SUBST} \
resources/$$res.in > "${WORKING_DIR}/resources/$$res"; \
done
done
mkdir -p "${BACULA_DESTDIR}${BACULA_PREFIX}/Library/LaunchDaemons"
- sed "s,@PREFIX@,${BACULA_PREFIX},g" files/org.bacula.bacula-fd.plist.in \
+ sed ${INFILE_SUBST} files/org.bacula.bacula-fd.plist.in \
> "${BACULA_DESTDIR}${BACULA_PREFIX}/Library/LaunchDaemons/org.bacula.bacula-fd.plist"
${BACULA_SOURCE}: ${BACULA_TAR}
--- /dev/null
+Bacula file daemon package builder for Mac OS X
+===============================================
+
+This package build script lets you download, compile and package the bacula
+file daemon easily with a single command line. Beside the bacula file daemon
+the resulting installer package contains a short ReadMe file with instructions
+on how to install and use the software. Also a basic launchd property list is
+included along with preugrade and postflight installer scripts to stop and
+restart the daemon while upgrading. To ensure the security of the users the
+passwords in the configuration files are generated during a first time
+installation and file permissions are checked and corrected on upgrades.
+
+Requirements:
+* Mac OS X 10.4 or later
+* Mac OS X developer tools installed
+
+Example (compile and create package from within bacula source tree):
+$ ./configure --enable-client-only
+$ make -C platforms/osx
+
+By moving the contents of platforms/osx to some other directory (e.g.
+~/bacula-standalone-bulder), it is possible to create installer packages from
+older bacula versions and for specific platforms.
+
+Examples (standalone mode):
+ 1. Create an installer package from the newest supported bacula source
+ containing the bacula file daemon as a PPC/Intel universal binary.
+ $ make dmg
+
+ 2. Create an installer package from a specified version of the bacula source
+ containing the bacula file daemon as a PPC/Intel universal binary.
+ $ make dmg BACULA_VERSION=3.0.0
+
+ 3. Create an installer package from the newest supported bacula source
+ containing the bacula file daemon for PPC architecture only.
+ $ make dmg ARCHFLAGS="-arch ppc" PACKAGE_TITLE="Bacula File Daemon PPC x.y.z"
+
+ 4. Create an installer package from a specified version of the bacula source
+ containing the bacula file daemon for the current architecture.
+ $ make dmg BACULA_VERSION=2.4.4 ARCHFLAGS=""
+
+You find the built disk images in the products folder.
+
+Misc commands:
+ 1. Cleanup the build directory
+ $ make clean
+ 2. Additionally remove the downloads and products:
+ $ make distclean
+
+Additional notes on the build-script:
+ * The following *FLAGS are used tu build universal binary with 10.4 SDK:
+ CPPFLAGS=-isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4
+ CFLAGS=-O -g -arch i386 -arch ppc
+ CXXFLAGS=${CFLAGS}
+ LDFLAGS=-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch i386 -arch ppc
+
+ Because the configure-scripts fails on 10.4 when -syslibroot is specified,
+ this option is supplied to make only.
+
+ * In order to build Mac OS X installer packages in a repeatable manner with
+ the correct owner/group and permissions, PackageMakers's cheap and broken
+ mechanism of applying recommended permissions is not used. Instead
+ Debian's fakeroot tool gets built and used during the packaging process to
+ ensure that the ownership of the files in the installer's Archive.pax.gz
+ is set to root and that permissions are kept exactly like "make install"
+ set them before.
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleIdentifier</key>
+ <string>org.bacula.bacula-fd</string>
+ <key>CFBundleShortVersionString</key>
+ <string>@VERSION@</string>
+ <key>IFPkgFlagAllowBackRev</key>
+ <false/>
+ <key>IFPkgFlagAuthorizationAction</key>
+ <string>RootAuthorization</string>
+ <key>IFPkgFlagDefaultLocation</key>
+ <string>/</string>
+ <key>IFPkgFlagFollowLinks</key>
+ <true/>
+ <key>IFPkgFlagInstallFat</key>
+ <false/>
+ <key>IFPkgFlagIsRequired</key>
+ <false/>
+ <key>IFPkgFlagOverwritePermissions</key>
+ <false/>
+ <key>IFPkgFlagRelocatable</key>
+ <false/>
+ <key>IFPkgFlagRestartAction</key>
+ <string>None</string>
+ <key>IFPkgFlagRootVolumeOnly</key>
+ <false/>
+ <key>IFPkgFlagUpdateInstalledLanguages</key>
+ <false/>
+</dict>
+</plist>
<string>@PREFIX@/sbin/bacula-fd</string>
<string>-f</string>
<string>-c</string>
- <string>@PREFIX@/etc/bacula-fd.conf</string>
+ <string>@FD_CONF@</string>
</array>
<key>Sockets</key>
<dict>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleIdentifier</key>
- <string>org.bacula.bacula-fd</string>
- <key>CFBundleShortVersionString</key>
- <string>@BACULA_VERSION@</string>
-</dict>
-</plist>
</p>
<h2>Installation</h2>
<p>
- Open the Bacula File Daemon @BACULA_VERSION@ installer package and follow the
- directions given to you.
+ Open the Bacula File Daemon @BACULA_VERSION@ installer package and follow
+ the directions given to you.
</p>
<h2>Configuration</h2>
<p>
After the installation is complete you have to adapt the configuration
- file to your needs. Use your favorite command line editor and don't forget
- to become root before you try to open the file. E.g:
- <pre>sudo vim /usr/local/bacula-@BACULA_VERSION@/etc/bacula-fd.conf</pre>
+ file to your needs. The file is located in system-wide Preferences folder:
+ <pre>/Library/Preferences/bacula/bacula-fd.conf</pre>
+ </p>
+ <p>
+ <strong>Note:</strong> The configuration file contains passwords and
+ therefore must not be accessible for any users except root. Use the
+ following command line to edit the file as root-user:
+ <pre>sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit /Library/Preferences/bacula/bacula-fd.conf</pre>
</p>
<h2>Operating the File Daemon</h2>
<p>
}
# copy example config files and fix permissions
-if [ ! -f $3@PREFIX@/etc/bacula-fd.conf ]; then
+if [ ! -f $3@FD_CONF@ ]; then
DIR_PW=$(genpw)
FD_PW=$(genpw)
SD_PW=$(genpw)
MON_FD_PW=$(genpw)
MON_SD_PW=$(genpw)
HOSTNAME=$(hostname -s)
+ mkdir -p "$(dirname $3@FD_CONF@)"
sed \
-e "s,@DIR_PW@,$DIR_PW,g" \
-e "s,@FD_PW@,$FD_PW,g" \
-e "s,@MON_SD_PW@,$MON_SD_PW,g" \
-e "s,@BASENAME@,$HOSTNAME,g" \
-e "s,@HOSTNAME@,$HOSTNAME,g" \
- "$3@PREFIX@/etc/bacula-fd.conf.example" > "$3@PREFIX@/etc/bacula-fd.conf"
+ "$3@PREFIX@/etc/bacula-fd.conf.example" > "$3@FD_CONF@"
fi
-chmod 0640 "$3@PREFIX@/etc/bacula-fd.conf"
+chmod 0600 "$3@FD_CONF@"
# install startup item
mkdir -p -m 0755 "$3/Library/LaunchDaemons"