More OS X adjustments

This commit is contained in:
Timothy Warren 2012-11-28 17:59:31 -05:00
parent f443476435
commit fcdcc070db
5 changed files with 61 additions and 53 deletions

BIN
OpenSQLManager.app.zip Executable file

Binary file not shown.

View File

@ -1,9 +1,12 @@
<?php <?php
define('VERSION', '0.1.0'); // Compile the binary
define('MAJOR_VERSION', '0'); `make clean`;
define('MINOR_VERSION', '1'); `make all`;
define('VERSION', '0.2.0');
define('APP_PATH', __DIR__.'/OpenSQLManager.app'); define('APP_PATH', __DIR__.'/OpenSQLManager.app');
define('CONTENTS', APP_PATH . '/Contents'); define('CONTENTS', APP_PATH . '/Contents');
define('FRAMEWORKS', CONTENTS . '/Frameworks');
define('MAC_OS', CONTENTS . '/MacOS'); define('MAC_OS', CONTENTS . '/MacOS');
define('RESOURCES', CONTENTS . '/Resources'); define('RESOURCES', CONTENTS . '/Resources');
define('SRC_DIR', __DIR__.'/src'); define('SRC_DIR', __DIR__.'/src');
@ -33,13 +36,13 @@ if ( ! function_exists('glob_recursive'))
*/ */
function create_dirs() function create_dirs()
{ {
if ( ! is_dir(APP_PATH)) if ( ! is_dir(APP_PATH)) mkdir(APP_PATH);
{
mkdir(APP_PATH);
if ( ! is_dir(CONTENTS)) if ( ! is_dir(CONTENTS))
{ {
mkdir(CONTENTS); mkdir(CONTENTS);
//mkdir(CONTENTS.'/Frameworks');
}
if ( ! is_dir(RESOURCES)) if ( ! is_dir(RESOURCES))
{ {
@ -63,11 +66,6 @@ function create_dirs()
mkdir(MAC_OS.'/sys/db/drivers/odbc'); mkdir(MAC_OS.'/sys/db/drivers/odbc');
mkdir(MAC_OS.'/sys/db/drivers/firebird'); mkdir(MAC_OS.'/sys/db/drivers/firebird');
} }
}
}
} }
/** /**
@ -108,6 +106,9 @@ function copy_src()
copy($file, $new_file); copy($file, $new_file);
} }
// Copy license file
copy(SRC_RESOURCES.'/LICENSE', RESOURCES.'/LICENSE');
// Copy resources // Copy resources
$rs = glob_recursive(SRC_RESOURCES.'/*.*'); $rs = glob_recursive(SRC_RESOURCES.'/*.*');
foreach ($rs as $resource) foreach ($rs as $resource)
@ -118,6 +119,13 @@ function copy_src()
// Copy the files // Copy the files
copy($resource, $new_rs); copy($resource, $new_rs);
} }
// Copy frameworks
/*if (is_dir('/Library/Frameworks/Firebird.Framework'))
{
$new_path = FRAMEWORKS;
`cp -R /Library/Frameworks/Firebird.framework/ {$new_path}/Firebird.framework`;
}*/
} }
/** /**
@ -126,8 +134,6 @@ function copy_src()
function create_plist() function create_plist()
{ {
$version = VERSION; $version = VERSION;
$minor = MINOR_VERSION;
$major = MAJOR_VERSION;
$plist = <<<XML $plist = <<<XML
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
@ -143,17 +149,15 @@ function create_plist()
<key>CFBundleName</key> <key>CFBundleName</key>
<string>OpenSQLManager</string> <string>OpenSQLManager</string>
<key>CFBundleIconFile</key> <key>CFBundleIconFile</key>
<string>OSM.icns</string> <string>OpenSQLManager.icns</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>{$version}</string> <string>{$version}</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>IFMajorVersion</key> <key>LSMinimumSystemVersion</key>
<integer>{$major}</integer> <string>10.6.0</string>
<key>IFMinorVersion</key>
<integer>{$minor}</integer>
</dict> </dict>
</plist> </plist>
XML; XML;

View File

@ -7,5 +7,8 @@ all: OpenSQLManager.c
${CC} -O0 -o OpenSQLManager OpenSQLManager.o ${LDFLAGS} ${CC} -O0 -o OpenSQLManager OpenSQLManager.o ${LDFLAGS}
release: OpenSQLManager.c release: OpenSQLManager.c
${CC} -O2 -o OpenSQLManager.o OpenSQLManager.c ${CFLAGS} ${CC} -Os -o OpenSQLManager.o OpenSQLManager.c ${CFLAGS}
${CC} -O2 -o OpenSQLManager OpenSQLManager.o ${LDFLAGS} ${CC} -Os -o OpenSQLManager OpenSQLManager.o ${LDFLAGS}
clean:
rm -f OpenSQLManager.o

View File

@ -32,10 +32,11 @@ ini_set('memory_limit', -1);
// Set the current directory as the base for included files // Set the current directory as the base for included files
define('OSM_BASE_DIR', __DIR__.'/sys'); define('OSM_BASE_DIR', __DIR__.'/sys');
define('OSM_RESOURCE_DIR', __DIR__.'/../Resources'); define('OSM_RESOURCE_DIR', realpath(__DIR__.'/../Resources'));
define('OSM_SETTINGS_DIR', __DIR__); define('OSM_SETTINGS_DIR', __DIR__);
define('OSM_PROGRAM_NAME', 'OpenSQLManager'); define('OSM_PROGRAM_NAME', 'OpenSQLManager');
define('OSM_VERSION', '0.2.0pre'); define('OSM_VERSION', '0.2.0pre');
echo OSM_RESOURCE_DIR . "\n";
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------