MAKE:=/usr/bin/make
CURL:=/usr/bin/curl
TAR:=/usr/bin/tar
-FAKEROOT:=/usr/local/bin/fakeroot
########### you should not have to edit anything beyond this line ###########
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 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 ReadMe.html postflight preupgrade
+PACKAGE_RESOURCES:=ReadMe.html postflight preupgrade
PACKAGE_XRESOURCES:=postflight preupgrade
# Flags for the toolchain
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,@FD_CONF@,${BACULA_FD_CONF},g" \
+ -e "s,@BACULA_DESTDIR@,${BACULA_DESTDIR},g"
dmg: pkg
hdiutil create -srcfolder "${PACKAGE_DIR}" "${PACKAGE_DMG}"
-pkg: ${BACULA_DESTDIR} ${WORKING_DIR}/resources
+pkg: ${BACULA_DESTDIR} ${BACULA_PMDOC} ${WORKING_DIR}/resources
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}/Info.plist\""
+ ${PM} --doc "${BACULA_PMDOC}" --out "${PACKAGE_BUNDLE}"
cp ${WORKING_DIR}/resources/ReadMe.html "${PACKAGE_DIR}/ReadMe.html"
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 destdir > ${BACULA_PMDOC}/01destdir-contents.xml
+
${WORKING_DIR}/resources: ${BACULA_DESTDIR}
mkdir -p "${WORKING_DIR}/resources"
Requirements:
* Mac OS X 10.4 or later
* Mac OS X developer tools installed
-* fakeroot >= 1.13 (http://ftp.debian.org/debian/pool/main/f/fakeroot/)
- The makefile expects the compiled binary at /usr/local/bin/fakeroot.
Example (compile and create package from within bacula source tree):
$ ./configure --enable-client-only
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 is used during package building phase 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>@BACULA_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>
--- /dev/null
+<?xml version="1.0"?>
+<pkgref spec="1.12" uuid="E3A20DCD-888A-4211-8318-BF9CAA10B769">
+ <config>
+ <identifier>org.bacula.bacula-fd.pkg</identifier>
+ <version>@BACULA_VERSION@</version>
+ <description/>
+ <post-install type="none"/>
+ <requireAuthorization/>
+ <installFrom>destdir</installFrom>
+ <installTo>/</installTo>
+ <flags>
+ <followSymbolicLinks/>
+ </flags>
+ <packageStore type="internal"/>
+ <mod>version</mod>
+ <mod>identifier</mod>
+ <mod>parent</mod>
+ </config>
+ <scripts>
+ <postflight relative="true" mod="true">resources/postflight</postflight>
+ <preupgrade relative="true" mod="true">resources/preupgrade</preupgrade>
+ </scripts>
+ <contents>
+ <file-list>01destdir-contents.xml</file-list>
+ <filter>/\.DS_Store$</filter>
+ </contents>
+</pkgref>
--- /dev/null
+<?xml version="1.0"?>
+<pkmkdoc spec="1.12">
+ <properties>
+ <title>Bacula File Daemon @BACULA_VERSION@</title>
+ <organization>org.bacula</organization>
+ <userSees ui="easy"/>
+ <min-target os="2"/>
+ <domain system="true"/>
+ </properties>
+ <distribution>
+ <versions min-spec="1.000000"/>
+ <scripts/>
+ </distribution>
+ <contents>
+ <choice title="destdir" id="choice0" starts_selected="true" starts_enabled="true" starts_hidden="false">
+ <pkgref id="org.bacula.bacula-fd.pkg"/>
+ </choice>
+ </contents>
+ <resources bg-scale="none" bg-align="topleft">
+ <locale lang="en">
+ <resource mod="true" type="license">resources/License.txt</resource>
+ <resource mod="true" type="readme">resources/ReadMe.html</resource>
+ </locale>
+ </resources>
+ <flags/>
+ <item type="file">01destdir.xml</item>
+ <mod>properties.title</mod>
+ <mod>properties.anywhereDomain</mod>
+ <mod>properties.systemDomain</mod>
+</pkmkdoc>
--- /dev/null
+import os
+import stat
+import sys
+from xml.dom.minidom import Document
+
+def createFtags(doc, path, isrootpath=True):
+ """
+ create f-tags for packagemaker's contents.xml files recursively replacing
+ owner with "root" and group with "wheel" in each entry
+ """
+
+ statinfo = os.lstat(path)
+ isdir = stat.S_ISDIR(statinfo[0])
+
+ ftag = doc.createElement("f")
+ ftag.setAttribute("n",os.path.split(path)[1])
+ ftag.setAttribute("p","%d" % statinfo[0])
+ ftag.setAttribute("o","root")
+ ftag.setAttribute("g","wheel")
+
+ # we additionally have to create <mod>owner</mod> and <mod>group</mod>
+ # within each f-tag
+ ftag.appendChild(doc.createElement("mod").appendChild(doc.createTextNode("owner")))
+ ftag.appendChild(doc.createElement("mod").appendChild(doc.createTextNode("group")))
+
+ if isrootpath:
+ # needs to be the full path
+ ftag.setAttribute("pt",os.path.abspath(path))
+ # no idea what those attributes mean:
+ ftag.setAttribute("m","false")
+ ftag.setAttribute("t","file")
+
+ if isdir:
+ for item in os.listdir(path):
+ ftag.appendChild(createFtags(doc, os.path.join(path,item), False))
+
+ return ftag
+
+def generateContentsDocument(path):
+ """
+ create new minidom document and generate contents by recursively traver-
+ sing the given path.
+ """
+
+ doc = Document()
+ root = doc.createElement("pkg-contents")
+ root.setAttribute("spec","1.12")
+ root.appendChild(createFtags(doc, path))
+ doc.appendChild(root)
+
+ return doc
+
+if __name__ == "__main__":
+ # construct document
+ doc = generateContentsDocument(sys.argv[1])
+ print doc.toprettyxml(indent=" "),
+++ /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>IFPkgDescriptionDescription</key>
- <string></string>
- <key>IFPkgDescriptionTitle</key>
- <string>Bacula File Daemon @BACULA_VERSION@</string>
-</dict>
-</plist>