]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Rework MacOS package
authorEric Bollengier <eric@baculasystems.com>
Tue, 21 Jun 2022 13:06:32 +0000 (15:06 +0200)
committerEric Bollengier <eric@baculasystems.com>
Tue, 5 Jul 2022 09:10:32 +0000 (11:10 +0200)
bacula/autoconf/configure.in
bacula/platforms/osx/Makefile [new file with mode: 0644]
bacula/platforms/osx/Makefile.in [deleted file]
bacula/platforms/osx/files/bacula-fd.plist.in [new file with mode: 0644]
bacula/platforms/osx/installer-gencontents.py
bacula/platforms/osx/resources/ReadMe.html.in
bacula/platforms/osx/update-libs [new file with mode: 0755]
bacula/platforms/osx/wait-notarize [new file with mode: 0755]
bacula/scripts/getver [new file with mode: 0755]

index dd51e0e8dd17ef80662f98eec344c8ab606ec804..0df382866cd234aa340d24e3075a3052b2982849 100644 (file)
@@ -3604,8 +3604,6 @@ osx)
    TAPEDRIVE="/dev/nst0"
    PSCMD="ps -e -o pid,command"
    MACOSX=macosx
-   PFILES="${PFILES} \
-      platforms/osx/Makefile"
   ;;
 debian)
    if `test -f /etc/apt/sources.list && grep -q ubuntu /etc/apt/sources.list`; then
diff --git a/bacula/platforms/osx/Makefile b/bacula/platforms/osx/Makefile
new file mode 100644 (file)
index 0000000..3fc1bf2
--- /dev/null
@@ -0,0 +1,267 @@
+#
+# Copyright (C) 2000-2022 Kern Sibbald
+# License: BSD 2-Clause; see file LICENSE-FOSS
+#
+# This is the makefile template for the platform directory
+# which contains general platform installation.
+#
+#  17 August 2009 -- Lorenz Schori
+#  29 Jun    2022 -- Eric Bollengier
+# 
+#   for Bacula 
+#
+
+
+# bacula version and download site
+BACULA_VERSION ?= $(shell ../../scripts/getver ../../src/version.h)
+
+SWIFT_APP_GIT ?= git@bsweb:macosx
+SWIFT_APP_BRANCH ?= master
+
+OPENSSL_VERSION_BASE ?= 1.1.1
+OPENSSL_VERSION=$(shell curl https://www.openssl.org/source/ 2>/dev/null| perl -ne '/openssl-(${OPENSSL_VERSION_BASE}[a-z]+).tar.gz/ && print $$1')
+OPENSSL_DL_URL:=https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz
+
+LZO_VERSION=2.10
+LZO_DL_URL=https://www.oberhumer.com/opensource/lzo/download/lzo-${LZO_VERSION}.tar.gz
+
+# Build universal binary. Comment out when building versions of bacula < 3.0.0
+ARCHFLAGS:=
+MACOSX_SDK_SYSROOT:=
+MACOSX_VERSION_FLAGS:=
+
+# Tools
+PB:=/usr/bin/pkgbuild
+MAKE:=/usr/bin/make
+CURL:=/usr/bin/curl
+TAR:=/usr/bin/tar
+
+########### you should not have to edit anything beyond this line ###########
+
+# Build paths
+DL_DIR:=dl
+BUILD_DIR:=build
+PRODUCTS_DIR:=products
+
+# Can source ~/config to have all it set
+# To unlock the security, use security unlock
+
+# "Developer ID Application: Bacula YYYY (XXX)"
+BIN_KEY ?= "Must specify BIN_KEY='Developer ID Application: Bacula YYYY (XXX)'"
+
+# "Developer ID Installer: Bacula YYYY (XXXX)"
+PRODUCT_KEY ?= "Must specify PRODUCT_KEY='Developer ID Installer: Bacula YYYY (XXXX)'"
+
+APPLEID_USER ?= "Must specify APPLEID_USER='test@bacula.org'"
+APPLEID_APP_PASS ?= "Must specify APPLEID_APP_PASS='xxx'"
+
+WORKING_DIR:=${BUILD_DIR}
+BACULA_TAR:=${DL_DIR}/bacula-${BACULA_VERSION}.tar.gz
+BACULA_SOURCE:=${WORKING_DIR}/bacula-${BACULA_VERSION}
+BACULA_DESTDIR:=${WORKING_DIR}/destdir
+BACULA_PREFIX:=/Applications/Bacula.app/Contents/Resources/BaculaBin
+BACULA_FD_CONF:=/Library/Preferences/bacula/bacula-fd.conf
+BACULA_WORKING_DIR:=/private/var/bacula/working
+BACULA_PMDOC:=${WORKING_DIR}/installer.pmdoc
+
+# 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 is there
+# already
+CURSUB:=$(CURDIR:%/platforms/osx=%)
+ifneq ($(CURDIR),$(CURSUB))
+       BACULA_TAR:=
+       BACULA_SOURCE:=../../
+endif
+
+NOW=$(shell date +%d%h%y-%H%M)
+
+PACKAGE_TITLE:=bacula-client-${BACULA_VERSION}-${NOW}
+PACKAGE_BASE:=org.bacula
+PACKAGE_ID:=${PACKAGE_BASE}.bacula-fd.pkg
+PACKAGE_DIR:=${PRODUCTS_DIR}/${PACKAGE_TITLE}
+PACKAGE_BUNDLE:=${PACKAGE_DIR}/${PACKAGE_TITLE}.pkg
+PACKAGE_DMG:=${PRODUCTS_DIR}/${PACKAGE_TITLE}.dmg
+PACKAGE_RESOURCES:=ReadMe.html postflight preupgrade
+PACKAGE_XRESOURCES:=postflight preupgrade
+
+# Flags for the toolchain
+CONFIGFLAGS:= \
+  --enable-client-only \
+  --prefix=${BACULA_PREFIX} \
+  --with-dir-password=@DIR_PW@ \
+  --with-fd-password=@FD_PW@ \
+  --with-sd-password=@SD_PW@ \
+  --with-mon-dir-password=@MON_DIR_PW@ \
+  --with-mon-fd-password=@MON_FD_PW@ \
+  --with-mon-sd-password=@MON_SD_PW@ \
+  --with-basename=@BASENAME@ \
+  --with-hostname=@HOSTNAME@ \
+  --with-working-dir=@CONTAINER_PATH@ \
+  --with-pid-dir=@CONTAINER_PATH@ \
+  --with-openssl=${PWD}/openssl \
+  --with-lzo=${PWD}/lzo
+CPPFLAGS:=
+CFLAGS:=-O -g
+CXXFLAGS:=${CFLAGS}
+LDFLAGS:=-framework CoreFoundation
+
+# required on snow leopard: compiling for 10.4 requires usage of gcc 4.0
+# system defaults to version 4.2
+CC:=gcc
+CPP:=cpp
+CXX:=g++
+CXXPP:=cpp
+
+# Placeholders for *.in files
+INFILE_SUBST=\
+  -e "s,@PACKAGE_BASE@,${PACKAGE_BASE},g" \
+  -e "s,@PREFIX@,${BACULA_PREFIX},g" \
+  -e "s,@BACULA_VERSION@,${BACULA_VERSION},g" \
+  -e "s,@FD_CONF@,${BACULA_FD_CONF},g" \
+  -e "s,@BACULA_DESTDIR@,${BACULA_DESTDIR},g" \
+  -e "s,@PACKAGE_ID@,${PACKAGE_ID},g"
+
+all: sign-fd ${PACKAGE_TITLE}.pkg notarize-pkg
+
+clean-fd:
+       rm -rf ${CURDIR}/${BACULA_DESTDIR}
+
+install-fd: clean-fd build-fd
+       ${MAKE} -C ${BACULA_SOURCE} install DESTDIR="${CURDIR}/${BACULA_DESTDIR}"
+       ${MAKE} -C ${BACULA_SOURCE}/src/tools install-bsnapshot DESTDIR="${CURDIR}/${BACULA_DESTDIR}"
+       cp lzo/lib/*.dylib ${CURDIR}/${BACULA_DESTDIR}/${BACULA_PREFIX}/lib
+       cp lzo/share/doc/lzo/COPYING ${CURDIR}/${BACULA_DESTDIR}/${BACULA_PREFIX}/share/doc/COPYING.lzo
+       cp openssl/lib/*.dylib ${CURDIR}/${BACULA_DESTDIR}/${BACULA_PREFIX}/lib
+       cp -r openssl/lib/engines* ${CURDIR}/${BACULA_DESTDIR}/${BACULA_PREFIX}/lib
+       cp -r openssl/ssl ${CURDIR}/${BACULA_DESTDIR}/${BACULA_PREFIX}/
+       cp -r openssl/bin/* ${CURDIR}/${BACULA_DESTDIR}/${BACULA_PREFIX}/sbin/
+       cp -r openssl/bin/* ${CURDIR}/${BACULA_DESTDIR}/${BACULA_PREFIX}/sbin/
+       chmod 755 ${CURDIR}/${BACULA_DESTDIR}/${BACULA_PREFIX}/sbin/*
+       chmod 644 ${CURDIR}/${BACULA_DESTDIR}/${BACULA_PREFIX}/lib/*.dylib
+       chmod 755 ${CURDIR}/${BACULA_DESTDIR}/${BACULA_PREFIX}/etc
+       rm -rf "${BACULA_DESTDIR}/tmp"
+       rm -rf "${BACULA_DESTDIR}/opt"
+       rm -rf "${BACULA_DESTDIR}/private"
+       rm -rf "${BACULA_DESTDIR}/usr"
+
+       for conffile in ${BACULA_DESTDIR}${BACULA_PREFIX}/etc/*.conf; do \
+               mv $$conffile $$conffile.example; \
+       done
+
+       chmod 644 ${CURDIR}/${BACULA_DESTDIR}/${BACULA_PREFIX}/etc/*.example
+
+       mkdir -p "${BACULA_DESTDIR}${BACULA_PREFIX}/Library/LaunchDaemons"
+       sed ${INFILE_SUBST} files/bacula-fd.plist.in \
+               > "${BACULA_DESTDIR}${BACULA_PREFIX}/Library/LaunchDaemons/${PACKAGE_BASE}.bacula-fd.plist"
+
+       mkdir -p "${BACULA_PMDOC}"
+       for f in index.xml 01destdir.xml; do \
+               sed ${INFILE_SUBST} \
+                       files/installer.pmdoc.in/$$f > "${BACULA_PMDOC}/$$f"; \
+       done
+
+       mkdir -p "${WORKING_DIR}/resources"
+
+       for res in ${PACKAGE_RESOURCES}; do \
+               sed ${INFILE_SUBST} \
+                       resources/$$res.in > "${WORKING_DIR}/resources/$$res"; \
+       done
+
+       for xres in ${PACKAGE_XRESOURCES}; do \
+               chmod +x "${WORKING_DIR}/resources/$$xres"; \
+       done
+
+       cp "${BACULA_SOURCE}/LICENSE" "${WORKING_DIR}/resources/License.txt"
+
+
+dmg: pkg
+       rm -rf "${PACKAGE_DIR}"
+       mkdir -p "${PACKAGE_DIR}"
+       cp ${PACKAGE_TITLE}.pkg "${PACKAGE_DIR}"
+       cp ${WORKING_DIR}/resources/ReadMe.html "${PACKAGE_DIR}/ReadMe.html"
+
+       sed ${INFILE_SUBST} \
+               files/uninstall.command.in > "${PACKAGE_DIR}/uninstall.command";
+       chmod 0775 "${PACKAGE_DIR}/uninstall.command"
+
+       hdiutil create -srcfolder "${PACKAGE_DIR}" "${PACKAGE_DMG}"
+
+pkg: setup-pkg sign-pkg notarize-pkg
+
+notarize-pkg: ${PACKAGE_TITLE}.pkg
+       @echo "Sending the notarize request to Apple"
+       xcrun altool --notarize-app --file $< --username $(APPLEID_USER) --password $(APPLEID_APP_PASS) --primary-bundle-id "${PACKAGE_BASE}.pkg" > 1
+       @cat 1
+       ./wait-notarize 1
+
+${PACKAGE_TITLE}.unsigned.pkg:
+       ${PB} --identifier "${PACKAGE_ID}" --version ${BACULA_VERSION} --install-location /Applications --root "${BACULA_DESTDIR}/Applications" ${PACKAGE_TITLE}.unsigned.pkg
+
+sign-pkg: ${PACKAGE_TITLE}.pkg
+
+${PACKAGE_TITLE}.pkg: ${PACKAGE_TITLE}.unsigned.pkg
+       productsign --sign  "$(PRODUCT_KEY)" ${PACKAGE_TITLE}.unsigned.pkg ${PACKAGE_TITLE}.pkg
+       rm ${PACKAGE_TITLE}.unsigned.pkg
+       echo ${PACKAGE_TITLE}.pkg
+
+sign-fd:  install-fd
+       for binfile in ${BACULA_DESTDIR}${BACULA_PREFIX}/sbin/* ${BACULA_DESTDIR}${BACULA_PREFIX}/lib/*dylib ${BACULA_DESTDIR}${BACULA_PREFIX}/lib/*/*dylib ${BACULA_DESTDIR}${BACULA_PREFIX}/lib/*.so ; do \
+               ./update-libs ${BACULA_PREFIX} $$binfile ;\
+               codesign  -v --force --timestamp --options=runtime --sign "$(BIN_KEY)" $$binfile; \
+       done
+
+build-fd: configure-fd
+       make -C ${BACULA_SOURCE}
+
+configure-fd: openssl lzo ${BACULA_SOURCE}/configure
+       (cd ${BACULA_SOURCE} && ./configure ${CONFIGFLAGS} CPPFLAGS="${CPPFLAGS}" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" LDFLAGS="${LDFLAGS}" CC="${CC}" CPP="${CPP}" CXX="${CXX}" CXXPP="${CXXPP}")
+       grep " TLS support:" ${BACULA_SOURCE}/config.out | grep yes
+       grep "Encryption support:" ${BACULA_SOURCE}/config.out | grep yes
+       touch $@
+
+lzo-${LZO_VERSION}.tar.gz:
+       @echo "Download LZO ${LZO_VERSION}"
+       ${CURL} --output $@ ${LZO_DL_URL}
+
+lzo-${LZO_VERSION}: lzo-${LZO_VERSION}.tar.gz
+       tar xfz $< 
+
+lzo: lzo-${LZO_VERSION} lzo-${LZO_VERSION}/Makefile
+       rm -rf lzo
+       make -j3 -C lzo-${LZO_VERSION}
+       make -j3 -C lzo-${LZO_VERSION} install
+
+lzo-${LZO_VERSION}/Makefile:
+       (cd lzo-${LZO_VERSION} && ./configure --prefix=${PWD}/lzo --enable-shared)
+
+openssl-${OPENSSL_VERSION}.tar.gz:
+       @echo "Download ${OPENSSL_VERSION}"
+       ${CURL} --output $@ ${OPENSSL_DL_URL}
+
+openssl-${OPENSSL_VERSION}: openssl-${OPENSSL_VERSION}.tar.gz
+       tar xfz $< 
+
+openssl: openssl-${OPENSSL_VERSION} openssl-${OPENSSL_VERSION}/Makefile
+       rm -rf openssl
+       make -j4 -C openssl-${OPENSSL_VERSION}
+       make -j4 -C openssl-${OPENSSL_VERSION} install
+
+openssl-${OPENSSL_VERSION}/Makefile:
+       (cd openssl-${OPENSSL_VERSION} && ./config --prefix=${PWD}/openssl)
+
+################################################################
+
+unlock:
+       security unlock
+
+.PHONY: distclean
+distclean: clean
+       rm -rf build
+       make -C ../../ distclean
+
+.PHONY: clean cleanup
+clean:
+       rm -rf *.pkg *.dmg 1 products sign-pkg pkg check-pkg setup-swift-app configure-fd pkg Applications
+
+cleanup:
+       make -C ../../ clean
diff --git a/bacula/platforms/osx/Makefile.in b/bacula/platforms/osx/Makefile.in
deleted file mode 100644 (file)
index 3cfaf24..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-#
-# Copyright (C) 2000-2022 Kern Sibbald
-# License: BSD 2-Clause; see file LICENSE-FOSS
-#
-# This is the makefile template for the platform directory
-# which contains general platform installation.
-#
-#  17 August 2009 -- Lorenz Schori
-# 
-#   for Bacula release @VERSION@ (@DATE@) -- @DISTNAME@
-#
-
-
-# bacula version and download site
-BACULA_VERSION:=@VERSION@
-BACULA_DL_URL:=http://downloads.sourceforge.net/project/bacula/bacula/${BACULA_VERSION}/bacula-${BACULA_VERSION}.tar.gz
-
-# Build universal binary. Comment out when building versions of bacula < 3.0.0
-ARCHFLAGS:=
-MACOSX_SDK_SYSROOT:=
-MACOSX_VERSION_FLAGS:=
-
-# Tools
-PB:=/usr/bin/pkgbuild
-MAKE:=/usr/bin/make
-CURL:=/usr/bin/curl
-TAR:=/usr/bin/tar
-
-########### you should not have to edit anything beyond this line ###########
-
-# Build paths
-DL_DIR:=dl
-BUILD_DIR:=build
-PRODUCTS_DIR:=products
-
-WORKING_DIR:=${BUILD_DIR}/${BACULA_VERSION}
-BACULA_TAR:=${DL_DIR}/bacula-${BACULA_VERSION}.tar.gz
-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
-BACULA_WORKING_DIR:=/private/var/bacula/working
-BACULA_PMDOC:=${WORKING_DIR}/installer.pmdoc
-
-# 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 is there
-# already
-CURSUB:=$(CURDIR:%/platforms/osx=%)
-ifneq ($(CURDIR),$(CURSUB))
-       BACULA_TAR:=
-       BACULA_SOURCE:=../../
-#      BACULA_VERSION:=$(shell sed -n 's,^VERSION=,,p' $(CURSUB)/autoconf/Make.common)
-endif
-
-PACKAGE_TITLE:=Bacula File Daemon ${BACULA_VERSION}
-PACKAGE_ID:=org.bacula.bacula-fd.pkg
-PACKAGE_DIR:=${PRODUCTS_DIR}/${PACKAGE_TITLE}
-PACKAGE_BUNDLE:=${PACKAGE_DIR}/${PACKAGE_TITLE}.pkg
-PACKAGE_DMG:=${PRODUCTS_DIR}/${PACKAGE_TITLE}.dmg
-PACKAGE_RESOURCES:=ReadMe.html postflight preupgrade
-PACKAGE_XRESOURCES:=postflight preupgrade
-
-# Flags for the toolchain
-CONFIGFLAGS:= \
-  --enable-client-only \
-  --prefix=${BACULA_PREFIX} \
-  --with-dir-password=@DIR_PW@ \
-  --with-fd-password=@FD_PW@ \
-  --with-sd-password=@SD_PW@ \
-  --with-mon-dir-password=@MON_DIR_PW@ \
-  --with-mon-fd-password=@MON_FD_PW@ \
-  --with-mon-sd-password=@MON_SD_PW@ \
-  --with-basename=@BASENAME@ \
-  --with-hostname=@HOSTNAME@ \
-  --with-working-dir=${BACULA_WORKING_DIR}
-CPPFLAGS:=
-CFLAGS:=-O -g
-CXXFLAGS:=${CFLAGS}
-LDFLAGS:=-framework CoreFoundation
-
-# required on snow leopard: compiling for 10.4 requires usage of gcc 4.0
-# system defaults to version 4.2
-CC:=gcc
-CPP:=cpp
-CXX:=g++
-CXXPP:=cpp
-
-# 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" \
-  -e "s,@BACULA_DESTDIR@,${BACULA_DESTDIR},g" \
-  -e "s,@PACKAGE_ID@,${PACKAGE_ID},g"
-
-dmg: pkg
-       hdiutil create -srcfolder "${PACKAGE_DIR}" "${PACKAGE_DMG}"
-
-pkg: ${BACULA_DESTDIR} ${BACULA_PMDOC} ${WORKING_DIR}/resources
-       mkdir -p "${PACKAGE_DIR}"
-
-       mkdir -p "${CURDIR}/${BACULA_DESTDIR}${WORKING_DIR}"
-
-       ${PB} --identifier "${PACKAGE_ID}" --root "${CURDIR}/${BACULA_DESTDIR}" "${PACKAGE_TITLE}.pkg"
-
-       cp "${PACKAGE_TITLE}.pkg" "${PACKAGE_DIR}"
-       cp ${WORKING_DIR}/resources/ReadMe.html "${PACKAGE_DIR}/ReadMe.html"
-
-       sed ${INFILE_SUBST} \
-               files/uninstall.command.in > "${PACKAGE_DIR}/uninstall.command";
-       chmod 0775 "${PACKAGE_DIR}/uninstall.command"
-
-${BACULA_PMDOC}: ${BACULA_DESTDIR} ${WORKING_DIR}/resources
-       mkdir -p "${BACULA_PMDOC}"
-
-       for f in index.xml 01destdir.xml; do \
-               sed ${INFILE_SUBST} \
-                       files/installer.pmdoc.in/$$f > "${BACULA_PMDOC}/$$f"; \
-       done
-
-       python installer-gencontents.py ${BACULA_DESTDIR} > ${BACULA_PMDOC}/01destdir-contents.xml
-
-${WORKING_DIR}/resources: ${BACULA_DESTDIR}
-       mkdir -p "${WORKING_DIR}/resources"
-
-       for res in ${PACKAGE_RESOURCES}; do \
-               sed ${INFILE_SUBST} \
-                       resources/$$res.in > "${WORKING_DIR}/resources/$$res"; \
-       done
-
-       for xres in ${PACKAGE_XRESOURCES}; do \
-               chmod +x "${WORKING_DIR}/resources/$$xres"; \
-       done
-
-       cp "${BACULA_SOURCE}/LICENSE" "${WORKING_DIR}/resources/License.txt"
-
-${BACULA_DESTDIR}: ${BACULA_SOURCE}
-       (cd ${BACULA_SOURCE} && ./configure ${CONFIGFLAGS} CPPFLAGS="${CPPFLAGS}" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" LDFLAGS="${LDFLAGS}" CC="${CC}" CPP="${CPP}" CXX="${CXX}" CXXPP="${CXXPP}")
-       ${MAKE} -C ${BACULA_SOURCE}
-       ${MAKE} -C ${BACULA_SOURCE} install DESTDIR="${CURDIR}/${BACULA_DESTDIR}"
-       ${MAKE} -C ${BACULA_SOURCE}/src/tools bsnapshot
-       ${MAKE} -C ${BACULA_SOURCE}/src/tools install-bsnapshot DESTDIR="${CURDIR}/${BACULA_DESTDIR}"
-
-       rm -rf "${BACULA_DESTDIR}/tmp"
-
-       for conffile in ${BACULA_DESTDIR}${BACULA_PREFIX}/etc/*.conf; do \
-               mv $$conffile $$conffile.example; \
-       done
-
-       mkdir -p "${BACULA_DESTDIR}${BACULA_PREFIX}/Library/LaunchDaemons"
-       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}
-       mkdir -p "${WORKING_DIR}"
-       ${TAR} -xzf "${BACULA_TAR}" -C "${WORKING_DIR}"
-
-${BACULA_TAR}:
-       mkdir -p "${DL_DIR}"
-       ${CURL} -L -o "${BACULA_TAR}" "${BACULA_DL_URL}"
-
-.PHONY: distclean
-distclean: clean
-       rm -rf "${DL_DIR}" "${PRODUCTS_DIR}"
-
-.PHONY: clean
-clean:
-       rm -rf "${BUILD_DIR}" "${PACKAGE_DIR}" "${PACKAGE_DMG}"
diff --git a/bacula/platforms/osx/files/bacula-fd.plist.in b/bacula/platforms/osx/files/bacula-fd.plist.in
new file mode 100644 (file)
index 0000000..d2eecc7
--- /dev/null
@@ -0,0 +1,17 @@
+<?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>Label</key>
+        <string>@PACKAGE_BASE@.bacula-fd</string>
+        <key>ProgramArguments</key>
+        <array>
+                <string>@PREFIX@/sbin/bacula-fd</string>
+                <string>-f</string>
+                <string>-c</string>
+                <string>@FD_CONF@</string>
+        </array>
+        <key>RunAtLoad</key>
+        <true/>
+</dict>
+</plist>
index a061946cb718d10c8a9d5c900af810eb2ece0cc9..816c0a888ff40cea9d141b14f4fc60478c9c53be 100644 (file)
@@ -53,4 +53,4 @@ def generateContentsDocument(path):
 if __name__ == "__main__":
     # construct document
     doc = generateContentsDocument(sys.argv[1])
-    print doc.toprettyxml(indent="  "),
+    print (doc.toprettyxml(indent="  "),)
index 41b396fe93d42345683080f3347c3baf7ab4df7e..652c35ee19c9fc76306e697270f69e9a72c023d9 100644 (file)
@@ -14,9 +14,9 @@
 <body>
   <h1>Bacula File Daemon @BACULA_VERSION@</h1>
   <p>
-    Bacula is on Open Source, enterprise ready, network based backup program.
-    This installer package contains the bacula file daemon for Mac OS X 10.4
-    or later built as an universal binary for PPC and Intel processors.
+    Bacula is an Open Source, enterprise ready, network based backup program.
+    This installer package contains the Bacula Enterprise File daemon for Mac OS X 12
+    or later built as an universal binary for M1 and Intel processors.
   </p>
   <h2>Requirements</h2>
   <p>
     director and storage daemon, typically installed on a server machine in
     the local network.
   </p>
+  <h3>OpenSSL support</h3>
+  <p>
+    Please note that this package have been built with OpenSSL support enabled.
+  </p>
+
   <h2>Installation</h2>
   <p>
     Open the Bacula File Daemon @BACULA_VERSION@ installer package and follow
-    the directions given to you.
+    the directions given to you. The application can be installed only in /Applications.
+    At the first startup, the Bacula.app will configure the system to start the application
+    automatically at login by creating a file on ~/Library/LaunchAgents/bacula-fd.plist    
   </p>
   <h2>Configuration</h2>
   <p>
diff --git a/bacula/platforms/osx/update-libs b/bacula/platforms/osx/update-libs
new file mode 100755 (executable)
index 0000000..eba20ca
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+# Update path to libraries, probably done by libtool but not working here
+
+dest=$1
+file=$2
+otool -L $file | awk '/Users/ { print $1 }' | while read fname
+do
+    f=`basename $fname`
+    install_name_tool -change $fname $dest/lib/$f $file
+done
diff --git a/bacula/platforms/osx/wait-notarize b/bacula/platforms/osx/wait-notarize
new file mode 100755 (executable)
index 0000000..94c1842
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+output=$1
+uuid=`awk -F= '/RequestUUID/ { print $2 }' $output`
+
+while xcrun altool --notarization-info $uuid --username $APPLEID_USER --password $APPLEID_APP_PASS | grep "in progress"
+do
+    sleep 15
+done
+
+xcrun altool --notarization-info $uuid --username $APPLEID_USER --password $APPLEID_APP_PASS | tee wait-notarize.out
+grep "Package Approved" wait-notarize.out
+ret=$?
+
+rm -f wait-notarize.out
+exit $ret
diff --git a/bacula/scripts/getver b/bacula/scripts/getver
new file mode 100755 (executable)
index 0000000..72807fe
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+versionh=$1
+if [ ! -f "$1" ]; then
+    echo "Usage: $0 version.h" >&2
+    exit 1
+fi
+
+sed -n -e 's/^#define VERSION.*"\(.*\)"$/\1/p' $versionh