Index: configure.ac
===================================================================
RCS file: /projects/pgadmin3/configure.ac,v
retrieving revision 1.34
retrieving revision 1.35
diff -Lconfigure.ac -Lconfigure.ac -u -w -r1.34 -r1.35
--- configure.ac
+++ configure.ac
@@ -31,6 +31,7 @@
# Custom checks
ENABLE_APPBUNDLE
+AM_CONDITIONAL([APPBUNDLE], [test x$pg_appbundle = xyes])
CHECK_WX_CONFIG_BINARY
CHECK_PGSQL_INCLUDE
ENABLE_DEBUG
@@ -39,5 +40,7 @@
CHECK_WXWINDOWS
AC_CONFIG_FILES([Makefile
- src/Makefile])
+ src/Makefile
+ pkg/Makefile
+ pkg/mac/Makefile])
AC_OUTPUT
Index: acinclude.m4
===================================================================
RCS file: /projects/pgadmin3/acinclude.m4,v
retrieving revision 1.43
retrieving revision 1.44
diff -Lacinclude.m4 -Lacinclude.m4 -u -w -r1.43 -r1.44
--- acinclude.m4
+++ acinclude.m4
@@ -65,13 +65,17 @@
])
############################
-# Static build of pgAdmin3 #
+# Build an pgAdmin III.app #
############################
AC_DEFUN([ENABLE_APPBUNDLE],
[AC_ARG_ENABLE(appbundle,
-[ --enable-appbundle Build PgAdminIII.app],
+[ --enable-appbundle Build pgAdmin3.app],
[pg_appbundle=yes
prefix=$(pwd)/tmp
+bundledir="$(pwd)/pgAdmin3.app"
+bindir="$bundledir/Contents/MacOS"
+datadir="$bundledir/Contents/SharedSupport"
+AC_SUBST(bundledir)
],
[pg_appbundle=no])
])
Index: Makefile.am
===================================================================
RCS file: /projects/pgadmin3/Makefile.am,v
retrieving revision 1.37
retrieving revision 1.38
diff -LMakefile.am -LMakefile.am -u -w -r1.37 -r1.38
--- Makefile.am
+++ Makefile.am
@@ -3,7 +3,7 @@
# This software is released under the Artistic Licence
#
# Makefile - Makefile for *nix systems
-SUBDIRS = src
+SUBDIRS = src pkg
EXTRA_DIST = \
$(top_srcdir)/README.txt \
$(top_srcdir)/BUGS.txt \
@@ -13,15 +13,12 @@
$(top_srcdir)/pkg/debian/README.Debian \
$(top_srcdir)/pkg/debian/docs \
$(top_srcdir)/pkg/debian/dirs \
- $(top_srcdir)/pkg/debian/copyright
+ $(top_srcdir)/pkg/debian/copyright \
$(top_srcdir)/pkg/debian/control \
- $(top_srcdir)/pkg/debian/changelog
+ $(top_srcdir)/pkg/debian/changelog \
$(top_srcdir)/pkg/debian/make-deb \
$(top_srcdir)/pkg/debian/pgadmin3.menu \
$(top_srcdir)/pkg/fc1/pgadmin3.spec \
- $(top_srcdir)/pkg/mac/Info.plist \
- $(top_srcdir)/pkg/mac/PgAdminIII.icns \
- $(top_srcdir)/pkg/mac/PkgInfo \
$(top_srcdir)/pkg/mandrake/pgadmin3.spec \
$(top_srcdir)/pkg/redhat/pgadmin3.spec \
$(top_srcdir)/pkg/slackware/build-release \
@@ -32,52 +29,15 @@
$(top_srcdir)/pkg/win32/licence.rtf \
$(top_srcdir)/pkg/win32/pgadmin3.wsi
-nobase_dist_pkgdata_DATA = \
+TMP_docs = \
$(top_srcdir)/docs/en_US/pg/*.html \
$(top_srcdir)/docs/en_US/pg/*.css \
$(top_srcdir)/docs/en_US/images/*.png $(top_srcdir)/docs/en_US/*.html \
$(top_srcdir)/docs/en_US/*.css $(top_srcdir)/docs/en_US/pgadmin3.hh* \
$(top_srcdir)/docs/en_US/tips.txt
-PgAdminIII.app:
- @echo "Building Bundle PgAdminIII.app"
- @test -d PgAdminIII.app || $(mkinstalldirs) PgAdminIII.app
- @test -d PgAdminIII.app/Contents/MacOS || $(mkinstalldirs) PgAdminIII.app/Contents/MacOS
- @test -d PgAdminIII.app/Contents/Resources || $(mkinstalldirs) PgAdminIII.app/Contents/Resources
- @test -d PgAdminIII.app/Contents/SharedSupport || $(mkinstalldirs) PgAdminIII.app/Contents/SharedSupport
- @test -d PgAdminIII.app/Contents/Frameworks || $(mkinstalldirs) PgAdminIII.app/Contents/Frameworks
- @cp pkg/mac/PkgInfo PgAdminIII.app
- @cp pkg/mac/Info.plist PgAdminIII.app/Contents
- @cp pkg/mac/PgAdminIII.icns PgAdminIII.app/Contents/Resources
- @$$(@WX_CONFIG@ --rezflags | sed 's/-t[[:space:]]*APPL//') \
- PgAdminIII.app/Contents/Resources/PgAdminIII.rsrc \
- -useDF
- @cp -r $(pkgdatadir)/* PgAdminIII.app/Contents/SharedSupport
- @cp -r $(bindir)/pgadmin3 PgAdminIII.app/Contents/MacOS/PgAdminIII
- @echo "Adding all non-standard shared libraries to PgAdminIII.app" ; \
- cd PgAdminIII.app/Contents ; \
- todo=MacOS/PgAdminIII ; \
- while test "$$todo" != ""; do \
- todo_old=$$todo ; \
- todo="" ; \
- for todo_obj in $$todo_old; do \
- for lib in $$( \
- otool -L $$todo_obj | \
- sed -n 's|^.*[[:space:]]\([^[:space:]]*\.dylib\).*$$|\1|p' | \
- egrep -v '^(/usr/lib)|(/System)' \
- ); do \
- lib_bn="$$(basename "$$lib")" ;\
- if ! test -f "Frameworks/$$lib_bn"; then \
- cp "$$lib" "Frameworks/$$lib_bn" ; \
- install_name_tool \
- -id "@executable_path/../Frameworks/$$lib_bn" \
- "Frameworks/$$lib_bn" ; \
- todo="$$todo Frameworks/$$lib_bn" ; \
- fi ; \
- install_name_tool -change \
- "$$lib" \
- "@executable_path/../Frameworks/$$lib_bn" \
- "$$todo_obj" ; \
- done ; \
- done ; \
- done ;
+if !APPBUNDLE
+nobase_dist_pkgdata_DATA = $(TMP_docs)
+else
+nobase_dist_data_DATA = $(TMP_docs)
+endif
--- /dev/null
+++ pkg/Makefile.am
@@ -0,0 +1,6 @@
+# pgAdmin III - PostgreSQL Tools
+# Copyright (C) 2002 - 2005, The pgAdmin Development Team
+# This software is released under the Artistic Licence
+#
+# Makefile - Makefile for *nix systems
+SUBDIRS = mac
--- /dev/null
+++ pkg/mac/Info-Debug.plist
@@ -0,0 +1,24 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ English
+ CFBundleExecutable
+ pgAdmin3-Debug
+ CFBundleIdentifier
+ org.postgresql.pgadmin3
+ CFBundleInfoDictionaryVersion
+ 1.2
+ CFBundlePackageType
+ APPL
+ CFBundleSignature
+ ????
+ CFBundleVersion
+ 0.1
+ CFBundleIconFile
+ pgAdmin3-Debug.icns
+ CSResourcesFileMapped
+
+
+
--- /dev/null
+++ pkg/mac/debug-bundle.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+bundle_name="pgAdmin3-Debug"
+
+if test -d "$bundle_name.app"; then
+ echo "Bundle: $bundle_name.app already exists" >&2
+ exit 1
+fi
+
+mkdir "$bundle_name.app"
+mkdir -p "$bundle_name.app/Contents/MacOS"
+mkdir -p "$bundle_name.app/Contents/Resources"
+mkdir -p "$bundle_name.app/Contents/SharedSupport"
+
+(cd "$bundle_name.app/"; ln -s ../pkg/mac/PkgInfo PkgInfo) &&
+(cd "$bundle_name.app/Contents" && ln -s ../../pkg/mac/Info-Debug.plist Info.plist) &&
+(cd "$bundle_name.app/Contents/MacOS" && ln -s ../../../src/pgadmin3 "$bundle_name") &&
+(cd "$bundle_name.app/Contents/Resources" && ln -s "../../../pkg/mac/pgAdmin3.icns" "$bundle_name.icns") &&
+(cd "$bundle_name.app/Contents/SharedSupport" && ln -s ../../../src/ui ui) &&
+(cd "$bundle_name.app/Contents/SharedSupport" && ln -s ../../../docs docs)
--- /dev/null
+++ pkg/mac/Makefile.am
@@ -0,0 +1,20 @@
+# pgAdmin III - PostgreSQL Tools
+# Copyright (C) 2002 - 2005, The pgAdmin Development Team
+# This software is released under the Artistic Licence
+#
+# Makefile - Makefile for *nix systems
+
+EXTRA_DIST = \
+ $(top_srcdir)/pkg/mac/Info.plist \
+ "$(top_srcdir)/pkg/mac/pgadmin3.icns" \
+ $(top_srcdir)/pkg/mac/PkgInfo
+
+if APPBUNDLE
+install-exec-hook:
+ $(install_sh_DATA) PkgInfo $(bundledir)/PkgInfo
+ $(install_sh_DATA) Info.plist $(bundledir)/Contents/Info.plist
+ $(install_sh_DATA) "pgadmin3.icns" "$(bundledir)/Contents/Resources/pgAdmin3.icns"
+ $$($(WX_CONFIG) --rezflags | sed 's/-t[[:space:]]*APPL//') \
+ "$(bundledir)/Contents/Resources/pgAdmin3.rsrc" -useDF
+ ./complete-bundle.sh "$(bundledir)"
+endif
Index: Info.plist
===================================================================
RCS file: /projects/pgadmin3/pkg/mac/Info.plist,v
retrieving revision 1.1
retrieving revision 1.2
diff -Lpkg/mac/Info.plist -Lpkg/mac/Info.plist -u -w -r1.1 -r1.2
--- pkg/mac/Info.plist
+++ pkg/mac/Info.plist
@@ -5,7 +5,7 @@
CFBundleDevelopmentRegion
English
CFBundleExecutable
- PgAdminIII
+ pgAdmin3
CFBundleIdentifier
org.postgresql.pgadmin3
CFBundleInfoDictionaryVersion
@@ -17,7 +17,7 @@
CFBundleVersion
0.1
CFBundleIconFile
- PgAdminIII.icns
+ pgAdmin3.icns
CSResourcesFileMapped
--- /dev/null
+++ pkg/mac/complete-bundle.sh
@@ -0,0 +1,51 @@
+#!/bin/sh
+bundle="$1"
+
+if ! test -d "$bundle" ; then
+ echo "$bundle is no bundle!" >&2
+ exit 1
+fi
+
+test -d "$bundle/Contents/Frameworks" || mkdir -p "$bundle/Contents/Frameworks" || exit 1
+
+echo "Completing bundle: $bundle"
+cd "$bundle"
+fw_basepath=$(dirname $(pwd))
+todo=$(find ./ | \
+ xargs file | \
+ sed -n 's/^\([^:][^:]*\):[[:space:]]*Mach-O executable ppc$/\1/p' \
+)
+echo "Found executables: $todo"
+while test "$todo" != ""; do
+ todo_old=$todo ;
+ todo="" ;
+ for todo_obj in $todo_old; do
+ for lib in $(
+ otool -L $todo_obj | \
+ sed -n 's|^.*[[:space:]]\([^[:space:]]*\.dylib\).*$|\1|p' | \
+ egrep -v '^(/usr/lib)|(/System)|@executable_path@' \
+ ); do
+ lib_bn="$(basename "$lib")" ;
+ if ! test -f "Contents/Frameworks/$lib_bn"; then
+ echo "Adding library: $lib_bn (because of: $todo_obj)"
+ case "$lib" in
+ /*)
+ cp "$lib" "Contents/Frameworks/$lib_bn"
+ ;;
+ *)
+ cp "$fw_basepath/$lib" "Contents/Frameworks/$lib_bn"
+ ;;
+ esac
+ install_name_tool \
+ -id "@executable_path/../Frameworks/$lib_bn" \
+ "Contents/Frameworks/$lib_bn" || exit 1
+ todo="$todo Contents/Frameworks/$lib_bn"
+ fi
+ install_name_tool -change \
+ "$lib" \
+ "@executable_path/../Frameworks/$lib_bn" \
+ "$todo_obj" || exit 1
+ done
+ done
+done
+echo "Bundle completed"
Index: Makefile.am
===================================================================
RCS file: /projects/pgadmin3/src/Makefile.am,v
retrieving revision 1.102
retrieving revision 1.103
diff -Lsrc/Makefile.am -Lsrc/Makefile.am -u -w -r1.102 -r1.103
--- src/Makefile.am
+++ src/Makefile.am
@@ -150,7 +150,7 @@
#
##############################################################################
-nobase_dist_pkgdata_DATA = $(srcdir)/ui/common/*.xrc \
+TMP_ui = $(srcdir)/ui/common/*.xrc \
$(srcdir)/ui/wxstd.mo \
$(srcdir)/ui/pgadmin3.lng \
$(srcdir)/ui/pg_settings.csv \
@@ -196,7 +196,20 @@
$(srcdir)/ui/zh_CN/wxstd.mo \
$(srcdir)/ui/zh_TW/wxstd.mo
+if !APPBUNDLE
+
+nobase_dist_pkgdata_DATA = $(TMP_ui)
AM_CXXFLAGS = -DDATA_DIR=\"$(pkgdatadir)/\" -Wall -g -I$(top_srcdir)/src/include -I$(top_srcdir)/src/agent/include -I$(top_srcdir)/src/slony/include
AM_CPPFLAGS = -DDATA_DIR=\"$(pkgdatadir)/\" -Wall -g -I$(top_srcdir)/src/include -I$(top_srcdir)/src/agent/include -I$(top_srcdir)/src/slony/include
AM_CFLAGS = -DDATA_DIR=\"$(pkgdatadir)/\" -Wall -g -I$(top_srcdir)/src/include -I$(top_srcdir)/src/agent/include -I$(top_srcdir)/src/slony/include
+else
+
+nobase_dist_data_DATA = $(TMP_ui)
+AM_CXXFLAGS = -Wall -g -I$(top_srcdir)/src/include -I$(top_srcdir)/src/agent/include -I$(top_srcdir)/src/slony/include
+AM_CPPFLAGS = -Wall -g -I$(top_srcdir)/src/include -I$(top_srcdir)/src/agent/include -I$(top_srcdir)/src/slony/include
+AM_CFLAGS = -Wall -g -I$(top_srcdir)/src/include -I$(top_srcdir)/src/agent/include -I$(top_srcdir)/src/slony/include
+install-exec-hook:
+ (cd $(bindir); mv pgadmin3 "pgAdmin3")
+
+endif