Merge remote-tracking branch 'hack/master'
diff --git a/make-osx-bundle.py b/make-osx-bundle.py
new file mode 100755
index 0000000..536d841
--- /dev/null
+++ b/make-osx-bundle.py
@@ -0,0 +1,394 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+#
+# Loosely based on original bash-version by Sebastian Schlingmann (based, again, on a OSX application bundler
+# by Thomas Keller).
+#
+
+import sys, os, string, re, shutil, plistlib, tempfile, exceptions, datetime, tarfile
+from subprocess import Popen, PIPE
+from optparse import OptionParser
+
+import platform
+
+if platform.system () != 'Darwin':
+  print "This script is indended to be run only on OSX platform"
+  exit (1)
+
+MIN_SUPPORTED_VERSION="10.10"
+
+current_version = tuple(int(i) for i in platform.mac_ver()[0].split('.')[0:2])
+min_supported_version = tuple(int(i) for i in MIN_SUPPORTED_VERSION.split('.')[0:2])
+
+if current_version < min_supported_version:
+  print "This script is indended to be run only on OSX >= %s platform" % MIN_SUPPORTED_VERSION
+  exit (1)
+
+options = None
+
+def gitrev():
+  return os.popen('git describe').read()[:-1]
+
+def codesign(path):
+  '''Call the codesign executable.'''
+
+  if hasattr(path, 'isalpha'):
+    path = (path,)
+
+  for p in path:
+    p = Popen(('codesign', '-vvvv', '--deep', '--force', '--sign', options.codesign, p))
+    retval = p.wait()
+    if retval != 0:
+      return retval
+  return 0
+
+class AppBundle(object):
+
+  def __init__(self, bundle, version, binary):
+    shutil.copytree (src = binary, dst = bundle, symlinks = True)
+
+    self.framework_path = ''
+    self.handled_libs = {}
+    self.bundle = bundle
+    self.version = version
+    self.infopath = os.path.join(os.path.abspath(bundle), 'Contents', 'Info.plist')
+    self.infoplist = plistlib.readPlist(self.infopath)
+    self.binary = os.path.join(os.path.abspath(bundle), 'Contents', 'MacOS', self.infoplist['CFBundleExecutable'])
+    print ' * Preparing AppBundle'
+
+  def is_system_lib(self, lib):
+    '''
+      Is the library a system library, meaning that we should not include it in our bundle?
+    '''
+    if lib.startswith('/System/Library/'):
+      return True
+    if lib.startswith('/usr/lib/'):
+      return True
+
+    return False
+
+  def is_dylib(self, lib):
+    '''
+      Is the library a dylib?
+    '''
+    return lib.endswith('.dylib')
+
+  def get_framework_base(self, fw):
+    '''
+      Extracts the base .framework bundle path from a library in an abitrary place in a framework.
+    '''
+    paths = fw.split('/')
+    for i, str in enumerate(paths):
+      if str.endswith('.framework'):
+        return '/'.join(paths[:i+1])
+    return None
+
+  def is_framework(self, lib):
+    '''
+      Is the library a framework?
+    '''
+    return bool(self.get_framework_base(lib))
+
+  def get_binary_libs(self, path):
+    '''
+      Get a list of libraries that we depend on.
+    '''
+    m = re.compile('^\t(.*)\ \(.*$')
+    libs = Popen(['otool', '-L', path], stdout=PIPE).communicate()[0]
+    libs = string.split(libs, '\n')
+    ret = []
+    bn = os.path.basename(path)
+    for line in libs:
+      g = m.match(line)
+      if g is not None:
+        lib = g.groups()[0]
+        if lib != bn:
+          ret.append(lib)
+    return ret
+
+  def handle_libs(self):
+    '''
+      Copy non-system libraries that we depend on into our bundle, and fix linker
+      paths so they are relative to our bundle.
+    '''
+    print ' * Taking care of libraries'
+
+    # Does our fwpath exist?
+    fwpath = os.path.join(os.path.abspath(self.bundle), 'Contents', 'Frameworks')
+    if not os.path.exists(fwpath):
+      os.mkdir(fwpath)
+
+    self.handle_binary_libs()
+
+  def handle_binary_libs(self, macho=None, loader_path=None):
+    '''
+      Fix up dylib depends for a specific binary.
+    '''
+    # Does our fwpath exist already? If not, create it.
+    if not self.framework_path:
+      self.framework_path = self.bundle + '/Contents/Frameworks'
+      if not os.path.exists(self.framework_path):
+        os.mkdir(self.framework_path)
+      else:
+        shutil.rmtree(self.framework_path)
+        os.mkdir(self.framework_path)
+
+    # If we weren't explicitly told which binary to operate on, pick the
+    # bundle's default executable from its property list.
+    if macho is None:
+      macho = os.path.abspath(self.binary)
+    else:
+      macho = os.path.abspath(macho)
+
+    print "Processing [%s]" % macho
+      
+    libs = self.get_binary_libs(macho)
+
+    for lib in libs:
+
+      # Skip system libraries
+      if self.is_system_lib(lib):
+        continue
+
+      # Frameworks are 'special'.
+      if self.is_framework(lib):
+        fw_path = self.get_framework_base(lib)
+        basename = os.path.basename(fw_path)
+        name = basename.split('.framework')[0]
+        rel = basename + '/' + name
+
+        abs = self.framework_path + '/' + rel
+
+        if not basename in self.handled_libs:
+          dst = self.framework_path + '/' + basename
+          print "COPY ", fw_path, dst
+          shutil.copytree(fw_path, dst, symlinks=True)
+          if name.startswith('Qt'):
+            os.remove(dst + '/' + name + '.prl')
+            os.remove(dst + '/Headers')
+            shutil.rmtree(dst + '/Versions/Current/Headers')
+
+          os.chmod(abs, 0755)
+          os.system('install_name_tool -id "@executable_path/../Frameworks/%s" "%s"' % (rel, abs))
+          self.handled_libs[basename] = True
+          self.handle_binary_libs(abs)
+
+        os.chmod(macho, 0755)
+        # print 'install_name_tool -change "%s" "@executable_path/../Frameworks/%s" "%s"' % (lib, rel, macho)
+        os.system('install_name_tool -change "%s" "@executable_path/../Frameworks/%s" "%s"' % (lib, rel, macho))
+
+      # Regular dylibs
+      else:
+        basename = os.path.basename(lib)
+        rel = basename
+
+        if not basename in self.handled_libs:
+          if lib.startswith('@loader_path'):
+            copypath = lib.replace('@loader_path', loader_path)
+          else:
+            copypath = lib
+
+          print "COPY ", copypath
+          shutil.copy(copypath, self.framework_path  + '/' + basename)
+
+          abs = self.framework_path + '/' + rel
+          os.chmod(abs, 0755)
+          os.system('install_name_tool -id "@executable_path/../Frameworks/%s" "%s"' % (rel, abs))
+          self.handled_libs[basename] = True
+          self.handle_binary_libs(abs, loader_path=os.path.dirname(lib) if loader_path is None else loader_path)
+
+        # print 'install_name_tool -change "%s" "@executable_path/../Frameworks/%s" "%s"' % (lib, rel, macho)
+        os.chmod(macho, 0755)
+        os.system('install_name_tool -change "%s" "@executable_path/../Frameworks/%s" "%s"' % (lib, rel, macho))
+
+  def copy_resources(self, rsrcs):
+    '''
+      Copy needed resources into our bundle.
+    '''
+    print ' * Copying needed resources'
+    rsrcpath = os.path.join(self.bundle, 'Contents', 'Resources')
+    if not os.path.exists(rsrcpath):
+      os.mkdir(rsrcpath)
+
+    # Copy resources already in the bundle
+    for rsrc in rsrcs:
+      b = os.path.basename(rsrc)
+      if os.path.isdir(rsrc):
+        shutil.copytree(rsrc, os.path.join(rsrcpath, b), symlinks=True)
+      elif os.path.isfile(rsrc):
+        shutil.copy(rsrc, os.path.join(rsrcpath, b))
+
+    return
+
+  def copy_qt_plugins(self):
+    '''
+      Copy over any needed Qt plugins.
+    '''
+
+    print ' * Copying Qt and preparing plugins'
+
+    src = os.popen('qmake -query QT_INSTALL_PLUGINS').read().strip()
+    dst = os.path.join(self.bundle, 'Contents', 'QtPlugins')
+    shutil.copytree(src, dst, symlinks=False)
+
+    top = dst
+    files = {}
+
+    def cb(arg, dirname, fnames):
+      if dirname == top:
+        return
+      files[os.path.basename(dirname)] = fnames
+
+    os.path.walk(top, cb, None)
+
+    exclude = ( 'phonon_backend', 'designer', 'script' )
+
+    for dir, files in files.items():
+      absdir = dst + '/' + dir
+      if dir in exclude:
+        shutil.rmtree(absdir)
+        continue
+      for file in files:
+        abs = absdir + '/' + file
+        if file.endswith('_debug.dylib'):
+          os.remove(abs)
+        else:
+          os.system('install_name_tool -id "%s" "%s"' % (file, abs))
+          self.handle_binary_libs(abs)
+
+  def set_min_macosx_version(self, version):
+    '''
+      Set the minimum version of Mac OS X version that this App will run on.
+    '''
+    print ' * Setting minimum Mac OS X version to: %s' % (version)
+    self.infoplist['LSMinimumSystemVersion'] = version
+
+  def done(self):
+    plistlib.writePlist(self.infoplist, self.infopath)
+    print ' * Done!'
+    print ''
+
+class FolderObject(object):
+  class Exception(exceptions.Exception):
+    pass
+
+  def __init__(self):
+    self.tmp = tempfile.mkdtemp()
+
+  def copy(self, src, dst='/'):
+    '''
+      Copy a file or directory into foler
+    '''
+    asrc = os.path.abspath(src)
+
+    if dst[0] != '/':
+      raise self.Exception
+
+    # Determine destination
+    if dst[-1] == '/':
+      adst = os.path.abspath(self.tmp + '/' + dst + os.path.basename(src))
+    else:
+      adst = os.path.abspath(self.tmp + '/' + dst)
+
+    if os.path.isdir(asrc):
+      print ' * Copying directory: %s' % os.path.basename(asrc)
+      shutil.copytree(asrc, adst, symlinks=True)
+    elif os.path.isfile(asrc):
+      print ' * Copying file: %s' % os.path.basename(asrc)
+      shutil.copy(asrc, adst)
+
+  def symlink(self, src, dst):
+    '''
+      Create a symlink inside the folder
+    '''
+    asrc = os.path.abspath(src)
+    adst = self.tmp + '/' + dst
+    print " * Creating symlink %s" % os.path.basename(asrc)
+    os.symlink(asrc, adst)
+
+  def mkdir(self, name):
+    '''
+      Create a directory inside the folder.
+    '''
+    print ' * Creating directory %s' % os.path.basename(name)
+    adst = self.tmp + '/' + name
+    os.makedirs(adst)
+
+class DiskImage(FolderObject):
+
+  def __init__(self, filename, volname):
+    FolderObject.__init__(self)
+    print ' * Preparing to create diskimage'
+    self.filename = filename
+    self.volname = volname
+
+  def create(self):
+    '''
+      Create the disk image
+    '''
+    print ' * Creating disk image. Please wait...'
+    if os.path.exists(self.filename):
+      os.remove(self.filename)
+      shutil.rmtree(self.filename, ignore_errors=True)
+    p = Popen(['hdiutil', 'create',
+              '-srcfolder', self.tmp,
+              '-format', 'UDBZ',
+              '-volname', self.volname,
+              self.filename])
+
+    retval = p.wait()
+    print ' * Removing temporary directory.'
+    shutil.rmtree(self.tmp)
+    print ' * Done!'
+
+
+if __name__ == '__main__':
+  parser = OptionParser()
+  parser.add_option('-r', '--release', dest='release', help='Build a release. This determines the version number of the release.')
+  parser.add_option('-s', '--snapshot', dest='snapshot', help='Build a snapshot release. This determines the \'snapshot version\'.')
+  parser.add_option('-g', '--git', dest='git', help='Build a snapshot release. Use the git revision number as the \'snapshot version\'.', action='store_true', default=False)
+  parser.add_option('--codesign', dest='codesign', help='Identity to use for code signing. (If not set, no code signing will occur)')
+
+  options, args = parser.parse_args()
+
+  # Release
+  if options.release:
+    ver = options.release
+  # Snapshot
+  elif options.snapshot or options.git:
+    if not options.git:
+      ver = options.snapshot
+    else:
+      ver = gitrev()
+  else:
+    print 'ERROR: Neither snapshot or release selected. Bailing.'
+    parser.print_help ()
+    sys.exit(1)
+
+  # Do the finishing touches to our Application bundle before release
+  shutil.rmtree('build/%s/NDN.app' % (MIN_SUPPORTED_VERSION), ignore_errors=True)
+  a = AppBundle('build/%s/NDN.app' % (MIN_SUPPORTED_VERSION), ver, 'build/NFD Control Center.app')
+  a.copy_qt_plugins()
+  a.handle_libs()
+  a.copy_resources(['qt.conf'])
+  a.set_min_macosx_version('%s.0' % MIN_SUPPORTED_VERSION)
+  a.done()
+
+  # Sign our binaries, etc.
+  if options.codesign:
+    print ' * Signing binaries with identity `%s\'' % options.codesign
+    binaries = (
+      'build/%s/ChronoChat.app' % (MIN_SUPPORTED_VERSION),
+    )
+
+    codesign(binaries)
+    print ''
+
+  # Create diskimage
+  title = "NDN-%s-%s" % (ver, MIN_SUPPORTED_VERSION)
+  fn = "build/%s.dmg" % title
+  d = DiskImage(fn, title)
+  d.symlink('/Applications', '/Applications')
+  d.copy('build/%s/NDN.app' % MIN_SUPPORTED_VERSION, '/NDN.app')
+  d.create()
diff --git a/src/nfd-control-center.desktop.in b/nfd-control-center.desktop.in
similarity index 64%
rename from src/nfd-control-center.desktop.in
rename to nfd-control-center.desktop.in
index 742ae47..ddf2f64 100644
--- a/src/nfd-control-center.desktop.in
+++ b/nfd-control-center.desktop.in
@@ -1,12 +1,12 @@
 [Desktop Entry]
 Version=1.0
-Name=NDNx Control Center
-Keywords=Internet;NDN;NDNx
+Name=NFD Control Center
+Keywords=Internet;NDN
 Exec=@BINDIR@/@BINARY@
 Terminal=false
 X-MultipleArgs=false
 Type=Application
-Icon=@DATAROOTDIR@/ndnx-control-center/ndnx-main.png
+Icon=@DATAROOTDIR@/nfd-control-center/ndn_app.png
 Categories=GNOME;GTK;Network;
 StartupNotify=true
 Actions=NewWindow;NewPrivateWindow;
diff --git a/osx/Resources/IconDisconnected.png b/osx/Resources/IconDisconnected.png
new file mode 100644
index 0000000..eb96e9c
--- /dev/null
+++ b/osx/Resources/IconDisconnected.png
Binary files differ
diff --git a/src/app.icns b/osx/Resources/nfd-main.icns
similarity index 100%
rename from src/app.icns
rename to osx/Resources/nfd-main.icns
Binary files differ
diff --git a/osx/Resources/nfd-tray.icns b/osx/Resources/nfd-tray.icns
new file mode 100644
index 0000000..f347dd7
--- /dev/null
+++ b/osx/Resources/nfd-tray.icns
Binary files differ
diff --git a/osx/Resources/status-to-fib.xslt b/osx/Resources/status-to-fib.xslt
new file mode 100644
index 0000000..58f2fc7
--- /dev/null
+++ b/osx/Resources/status-to-fib.xslt
@@ -0,0 +1,29 @@
+<xsl:stylesheet version = '1.0'
+                xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
+
+<xsl:template match="/ndnd">
+<fibs>
+<xsl:apply-templates select="forwarding/fentry/dest" />
+</fibs>
+</xsl:template>
+
+<xsl:template match="dest">
+<fib>
+<xsl:apply-templates select="faceid" />
+<prefix><xsl:value-of select="../prefix"/></prefix>
+</fib>
+</xsl:template>
+
+<xsl:template match="faceid">
+<xsl:variable name="id"><xsl:value-of select="." /></xsl:variable>
+<faceID><xsl:copy-of select="$id" /></faceID>
+<ip>
+<xsl:choose>
+  <xsl:when test="count(//face/ip[../faceid=$id]) &gt; 0"><xsl:value-of select="//face/ip[../faceid=$id]" />
+  </xsl:when>
+  <xsl:otherwise>app</xsl:otherwise>
+</xsl:choose>
+</ip>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/osx/Resources/status.xslt b/osx/Resources/status.xslt
new file mode 100644
index 0000000..d64ea59
--- /dev/null
+++ b/osx/Resources/status.xslt
@@ -0,0 +1,20 @@
+<xsl:stylesheet version = '1.0'
+                xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
+
+<xsl:template match="/">
+<stats>
+  <data>
+    <in><xsl:value-of select="sum(/ndnd/faces/face/meters/datain/total)" /></in>
+    <out><xsl:value-of select="sum(/ndnd/faces/face/meters/dataout/total)" /></out>
+    <!-- <in><xsl:value-of select="sum(/ndnd/faces/face/meters/datain/persec)" /></in> -->
+    <!-- <out><xsl:value-of select="sum(/ndnd/faces/face/meters/dataout/persec)" /></out> -->
+  </data>
+  <interests>
+    <in><xsl:value-of select="sum(/ndnd/faces/face/meters/intrin/total)" /></in>
+    <out><xsl:value-of select="sum(/ndnd/faces/face/meters/introut/total)" /></out>
+    <!-- <in><xsl:value-of select="sum(/ndnd/faces/face/meters/intrin/persec)" /></in> -->
+    <!-- <out><xsl:value-of select="sum(/ndnd/faces/face/meters/introut/persec)" /></out> -->
+  </interests>
+</stats>
+</xsl:template>
+</xsl:stylesheet>
diff --git a/qt.conf b/qt.conf
new file mode 100644
index 0000000..2438eff
--- /dev/null
+++ b/qt.conf
@@ -0,0 +1,2 @@
+[Paths]
+Plugins = QtPlugins
diff --git a/src/resources/GenericNetworkIcon_22_128x128x32.png b/res/GenericNetworkIcon_22_128x128x32.png
similarity index 100%
rename from src/resources/GenericNetworkIcon_22_128x128x32.png
rename to res/GenericNetworkIcon_22_128x128x32.png
Binary files differ
diff --git a/src/resources/Keychain_22_128x128x32.png b/res/Keychain_22_128x128x32.png
similarity index 100%
rename from src/resources/Keychain_22_128x128x32.png
rename to res/Keychain_22_128x128x32.png
Binary files differ
diff --git a/src/resources/System Preferences_22_128x128x32.png b/res/System Preferences_22_128x128x32.png
similarity index 100%
rename from src/resources/System Preferences_22_128x128x32.png
rename to res/System Preferences_22_128x128x32.png
Binary files differ
diff --git a/src/resources/ToolbarAdvanced_22_128x128x32.png b/res/ToolbarAdvanced_22_128x128x32.png
similarity index 100%
rename from src/resources/ToolbarAdvanced_22_128x128x32.png
rename to res/ToolbarAdvanced_22_128x128x32.png
Binary files differ
diff --git a/src/resources/icon-connected-black.png b/res/icon-connected-black.png
similarity index 100%
rename from src/resources/icon-connected-black.png
rename to res/icon-connected-black.png
Binary files differ
diff --git a/src/resources/icon-connected-white.png b/res/icon-connected-white.png
similarity index 100%
rename from src/resources/icon-connected-white.png
rename to res/icon-connected-white.png
Binary files differ
diff --git a/src/resources/icon-disconnected-black.png b/res/icon-disconnected-black.png
similarity index 100%
rename from src/resources/icon-disconnected-black.png
rename to res/icon-disconnected-black.png
Binary files differ
diff --git a/src/resources/icon-disconnected-white.png b/res/icon-disconnected-white.png
similarity index 100%
rename from src/resources/icon-disconnected-white.png
rename to res/icon-disconnected-white.png
Binary files differ
diff --git a/res/ndn_app.ai b/res/ndn_app.ai
new file mode 100644
index 0000000..e205d94
--- /dev/null
+++ b/res/ndn_app.ai
Binary files differ
diff --git a/res/ndn_app.icns b/res/ndn_app.icns
new file mode 100644
index 0000000..95affee
--- /dev/null
+++ b/res/ndn_app.icns
Binary files differ
diff --git a/res/ndn_app.png b/res/ndn_app.png
new file mode 100644
index 0000000..a6a2db7
--- /dev/null
+++ b/res/ndn_app.png
Binary files differ
diff --git a/src/Info.plist b/src/Info.plist
index b101b6a..472780d 100644
--- a/src/Info.plist
+++ b/src/Info.plist
@@ -7,7 +7,7 @@
     <key>CFBundleExecutable</key>
     <string>NFD Control Center</string>
     <key>CFBundleIconFile</key>
-    <string>nfd-main.icns</string>
+    <string>ndn_app.icns</string>
     <key>CFBundleIdentifier</key>
     <string>net.named-data.control-center</string>
     <key>CFBundleInfoDictionaryVersion</key>
diff --git a/src/qml.qrc b/src/qml.qrc
index 19a180f..d3586da 100644
--- a/src/qml.qrc
+++ b/src/qml.qrc
@@ -1,13 +1,13 @@
 <RCC>
     <qresource prefix="/">
         <file>main.qml</file>
-        <file>resources/icon-connected-white.png</file>
-        <file>resources/icon-disconnected-white.png</file>
-        <file>resources/GenericNetworkIcon_22_128x128x32.png</file>
-        <file>resources/Keychain_22_128x128x32.png</file>
-        <file>resources/System Preferences_22_128x128x32.png</file>
-        <file>resources/ToolbarAdvanced_22_128x128x32.png</file>
-        <file>resources/icon-connected-black.png</file>
-        <file>resources/icon-disconnected-black.png</file>
+        <file>../res/icon-connected-white.png</file>
+        <file>../res/icon-disconnected-white.png</file>
+        <file>../res/GenericNetworkIcon_22_128x128x32.png</file>
+        <file>../res/Keychain_22_128x128x32.png</file>
+        <file>../res/System Preferences_22_128x128x32.png</file>
+        <file>../res/ToolbarAdvanced_22_128x128x32.png</file>
+        <file>../res/icon-connected-black.png</file>
+        <file>../res/icon-disconnected-black.png</file>
     </qresource>
 </RCC>
diff --git a/src/tray-menu.cpp b/src/tray-menu.cpp
index 1d47216..54fca2c 100644
--- a/src/tray-menu.cpp
+++ b/src/tray-menu.cpp
@@ -25,11 +25,11 @@
 
 
 #ifdef OSX_BUILD
-#define CONNECT_ICON ":/resources/icon-connected-black.png"
-#define DISCONNECT_ICON ":/resources/icon-disconnected-black.png"
+#define CONNECT_ICON ":/res/icon-connected-black.png"
+#define DISCONNECT_ICON ":/res/icon-disconnected-black.png"
 #else
-#define CONNECT_ICON ":/resources/icon-connected-white.png"
-#define DISCONNECT_ICON ":/resources/icon-disconnected-white.png"
+#define CONNECT_ICON ":/res/icon-connected-white.png"
+#define DISCONNECT_ICON ":/res/icon-disconnected-white.png"
 #endif
 
 #ifdef WAF
diff --git a/wscript b/wscript
index 459d7b4..4c3a543 100644
--- a/wscript
+++ b/wscript
@@ -18,7 +18,7 @@
 
     conf.check_boost(lib="system thread")
 
-    # conf.define('RESOURCES_DIR', Utils.subst_vars("${DATAROOTDIR}/nfd-control-center", conf.env))
+    conf.define('RESOURCES_DIR', Utils.subst_vars("${DATAROOTDIR}/nfd-control-center", conf.env))
 
     if Utils.unversioned_sys_platform() == "darwin":
         conf.define('OSX_BUILD', 1)
@@ -40,17 +40,16 @@
         app.target = "nfd-control-center"
 
         bld(features = "subst",
-             source = 'src/nfd-control-center.desktop.in',
-             target = 'src/nfd-control-center.desktop',
+             source = 'nfd-control-center.desktop.in',
+             target = 'nfd-control-center.desktop',
              BINARY = "nfd-control-center",
              install_path = "${DATAROOTDIR}/nfd-control-center"
             )
 
         bld.install_files("${DATAROOTDIR}/nfd-control-center",
-                      bld.path.ant_glob(['Resources/*']))
+                          bld.path.ant_glob(['res/*']))
     else:
         app.target = "NFD Control Center"
         app.mac_app = True
         app.mac_plist = 'src/Info.plist'
-        # app.mac_resources = [i.path_from(bld.path)
-        #                      for i in bld.path.parent.ant_glob('src/Resources/*')]
+        app.mac_resources = [i.path_from(bld.path) for i in bld.path.ant_glob('res/**/*', excl='**/*.ai')]