Permalink
Browse files

new useful tools for mac os package.

  • Loading branch information...
fcecconi committed Jan 30, 2013
1 parent e78d77d commit 68dae3aa26ea03817ff369f755fbd3c9be95c04b
Showing with 54 additions and 0 deletions.
  1. +19 −0 script/mac/make_dmg.rb
  2. +35 −0 script/mac/rename_dep.sh
View
@@ -0,0 +1,19 @@
#!/usr/bin/env ruby
# Create a dmg image for nmapsi4.app
if ARGV.length < 1 or ARGV.length > 2 then
$stderr.puts( "Usage: #{File.basename( $0 )} directory [cd name]" )
exit( 1 )
end
# get variables
dir = ARGV.shift.sub( /\/$/, "" )
volname = if ARGV.length == 0 then
File.basename( File.expand_path( dir ) )
else
ARGV.shift
end
output = "#{dir}.dmg"
# dmg the folder
`hdiutil create -fs HFS+ -srcfolder "#{dir}" -volname "#{volname}" "#{output}"`
View
@@ -0,0 +1,35 @@
#!/bin/bash
# Francesco Cecconi <francesco.cecconi@gmail.com>
# copy required Qt4 into Mac OS bundle package
BUNDLE="nmapsi4.app/Contents/";
LIB_DEFAULT="/Library/Frameworks/";
VERSION_STRING="/Versions/4/";
DEP[1]="QtWebKit.framework";
DEP[2]="QtGui.framework";
DEP[3]="QtXmlPatterns.framework";
DEP[4]="QtNetwork.framework";
DEP[5]="QtCore.framework";
#DEP[6]="QtDeclarative.framework";
#DEP[7]="QtScript.framework";
#DEP[8]="QtSvg.framework";
#DEP[9]="QtXml.framework";
#DEP[10]="QtSql.framework";
echo -e "\033[00;31mSTATUS:: copy dependencies\033[00m"
mkdir -p $BUNDLE"/Frameworks/"
for i in "${DEP[@]}"; do
SOURCE="$LIB_DEFAULT$i/";
DEST=$BUNDLE"Frameworks/"$i;
cp -R $SOURCE $DEST;
done
echo -e "\033[00;31mSTATUS:: change dependencies path\033[00m"
BINARY_NAME=$BUNDLE"MacOS/nmapsi4";
for i in "${DEP[@]}"; do
SOURCE=$i$VERSION_STRING${i%.*};
DEST="@executable_path/../"$i$VERSION_STRING${i%.*};
install_name_tool -change $SOURCE $DEST $BINARY_NAME
done

0 comments on commit 68dae3a

Please sign in to comment.