Permalink
Browse files

Add util lib as dependency to link against for linux. Moved package_f…

…or_release.py script to create_dsit.py and made updates for build automation.
  • Loading branch information...
1 parent 2fcc6af commit dad48c9d395c5fd04ba5842e29dcd93952eb1dd1 @rapiscan rapiscan committed with Jun 27, 2010
Showing with 236 additions and 207 deletions.
  1. +1 −0 CMakeLists.txt
  2. +1 −0 src/client/CMakeLists.txt
  3. +1 −0 src/server/CMakeLists.txt
  4. +233 −0 tools/create_dist.py
  5. +0 −207 tools/package_for_release.py
View
@@ -14,6 +14,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "BSD")
message(STATUS "...Linux...")
add_definitions (-DLINUX)
set(CMAKE_CXX_FLAGS "-g -O1 -Wall")# -Werror") # Due to warnings in BSD
+ set(UTIL util)
else(${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "BSD")
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
@@ -100,6 +100,7 @@ set(CLIENT_LIBRARIES
${OPENGL_LIBRARIES}
${ZLIB_LIBRARIES}
${BULLET_LIBRARIES}
+ ${UTIL}
)
if(${WIN32})
@@ -71,6 +71,7 @@ target_link_libraries(Intensity_CServer
${SDLSOUND_LIBRARY}
${ZLIB_LIBRARIES}
${BULLET_LIBRARIES}
+ ${UTIL}
)
if(${WIN32})
View
@@ -0,0 +1,233 @@
+
+#=============================================================================
+# Copyright (C) 2008 Alon Zakai ('Kripken') kripkensteiner@gmail.com
+#
+# This file is part of the Intensity Engine project,
+# http://www.intensityengine.com
+#
+# The Intensity Engine is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, version 3.
+#
+# The Intensity Engine is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with the Intensity Engine. If not, see
+# http://www.gnu.org/licenses/
+# http://www.gnu.org/licenses/agpl-3.0.html
+#=============================================================================
+
+
+import os, sys
+import glob, shutil, stat
+from optparse import OptionParser
+
+EXEC = '<exec>'
+RECURSE = '<recurse>'
+
+needed_globs = [
+ 'intensity*.py',
+ 'README.markdown', 'TROUBLESHOOTING.txt', 'mybrushes.cfg', 'README-standalone.txt', 'README-server.txt', 'COMPILE.txt',
+ 'data/*',
+ 'CMakeLists.txt',
+ 'src/CMakeLists.txt',
+ 'src/enet/CMakeLists.txt',
+ 'src/client/CMakeLists.txt',
+ 'src/server/CMakeLists.txt',
+ 'local/client/settings.cfg',
+ 'local/server/settings.cfg',
+ 'local/master_server/settings.cfg',
+ 'local/master_server/templates/*.html',
+ 'master_django/*.py',
+ 'master_django/intensity/*.py',
+ 'master_django/intensity/register/*.py',
+ 'master_django/intensity/components/*.py',
+ 'master_django/intensity/components/templates/*.html',
+ 'master_django/intensity/middleware/*.py',
+ 'master_django/intensity/static/*',
+ 'master_django/intensity/templates/*.html',
+ 'master_django/intensity/templates/registration/*.html',
+ 'master_django/intensity/templatetags/*.py',
+ 'master_django/intensity/tracker/*.py',
+ 'master_django/intensity/tracker/fixtures/*.py',
+ 'master_django/intensity/tracker/fixtures/*.json',
+ 'master_django/intensity/tracker/fixtures/*.tar.gz',
+ 'master_django/intensity/tracker/templates/tracker/*.html',
+ 'packages/*',
+ 'packages/brushes/*',
+ 'packages/caustics/*',
+ 'packages/cloward/*',
+ 'packages/freeseamless/*',
+ 'packages/golgotha/*',
+ 'packages/gor/*',
+ 'packages/hud/*',
+ 'packages/icons/*',
+ 'packages/library/*',
+ 'packages/library/modes/*',
+ 'packages/library/guns/*',
+ 'packages/materials/*',
+ 'packages/models/areatrigger/*',
+ 'packages/models/cannon/*',
+ 'packages/models/cannon/barrel/*',
+ 'packages/models/cannon/base/*',
+ 'packages/models/debris/*',
+ RECURSE + 'packages/models/flag/*',
+ 'packages/models/frankie/*',
+ 'packages/models/frankie/alt/*',
+ 'packages/models/gibc/*',
+ 'packages/models/gibh/*',
+ 'packages/models/invisiblegeneric/*',
+ 'packages/models/invisiblegeneric/ellipse/*',
+ 'packages/models/nut/*',
+ 'packages/models/platform/*',
+ RECURSE + 'packages/models/stromar/*',
+ 'packages/models/tree/*',
+ 'packages/music/*',
+ 'packages/particles/*',
+ 'packages/skyboxes/mayhem/*',
+ 'packages/skyboxes/philo/*',
+ 'packages/sounds/0ad/*',
+ 'packages/sounds/gk/*',
+ 'packages/sounds/olpc/*',
+ 'packages/sounds/olpc/AdamKeshen/*',
+ 'packages/sounds/olpc/Berklee44BoulangerFX/*',
+ 'packages/sounds/olpc/FlavioGaete/*',
+ 'packages/sounds/olpc/MichaelBierylo/*',
+ 'packages/sounds/olpc/NilsVanOttorloo/*',
+ 'packages/sounds/yo_frankie/*',
+ 'packages/tomek/*',
+ 'packages/yo_frankie/*',
+ 'src/*',
+ 'src/enet/*',
+ 'src/enet/include/*',
+ 'src/enet/include/enet/*',
+ 'src/engine/*',
+ 'src/fpsgame/*',
+ 'src/intensity/*',
+ 'src/javascript/*',
+ 'src/javascript/intensity/*',
+ 'src/python/_dispatch/*',
+ 'src/python/intensity/*',
+ 'src/python/intensity/client/*',
+ 'src/python/intensity/server/*',
+ RECURSE + 'src/python/intensity/components/*',
+ 'src/shared/*',
+ 'src/thirdparty/v8/LICENSE',
+ 'src/thirdparty/SDL.txt',
+ 'syntensity/client/settings.cfg',
+ 'syntensity/server/settings.cfg',
+]
+
+def create_dist(tarball, package):
+
+ global EXEC, RECURSE, needed_globs
+
+ if package:
+ needed_globs += [
+ RECURSE + os.path.join(package, '*')
+ ]
+
+
+ if 'linux' in sys.platform:
+ print "Creating linux distribution."
+ LINUX = True
+ WINDOWS = False
+ elif 'win' in sys.platform:
+ print "Create Windows distribution."
+ WINDOWS = True
+ LINUX = False
+ else:
+ print "Error: Unknown platform %s" % sys.platform
+ sys.exit(2)
+
+ if not tarball:
+ if LINUX:
+ needed_globs += [
+ EXEC + 'cbuild/src/client/Intensity*',
+ EXEC + 'cbuild/src/server/Intensity*',
+ ]
+ else:
+ needed_globs += [
+ EXEC + 'cbuild/src/client/Release/Intensity*',
+ EXEC + 'cbuild/src/server/Release/Intensity*',
+ ]
+
+ if LINUX:
+ needed_globs += [
+ EXEC + 'intensity*.sh',
+ ]
+
+ if not tarball:
+ needed_globs += [
+ # EXEC + 'build/openjpeg/*.so',
+ ]
+ elif WINDOWS:
+ needed_globs += [
+ EXEC + 'intensity*.bat',
+ # EXEC + 'build/openjpeg/*.dll',
+ # EXEC + 'build/openjpeg/*.manifest',
+ EXEC + 'windows/dll/*',
+ # RECURSE + 'Python25/*',
+ ]
+
+
+ while len(needed_globs) > 0:
+ temp_needed_globs = needed_globs
+ needed_globs = []
+ for needed_glob in temp_needed_globs:
+ needed_glob = needed_glob.replace('/', os.path.sep)
+ print ' + ' + needed_glob
+
+ if needed_glob[:len(EXEC):] == EXEC:
+ needed_glob = needed_glob.replace(EXEC, '')
+ make_exec = True
+ else:
+ make_exec = False
+
+ if needed_glob[:len(RECURSE):] == RECURSE:
+ print ' (recursing)'
+ needed_glob = needed_glob.replace(RECURSE, '')
+ recurse = True
+ else:
+ recurse = False
+
+ files = glob.glob(needed_glob)
+ assert(len(files) > 0) # No missing globs, which might be a typo here or missing file on filesystem
+ actual_files = 0
+ for filename in files:
+ if os.path.isdir(filename):
+ if recurse:
+ needed_globs += [RECURSE + filename + '/*']
+ actual_files += 1
+ continue
+
+ actual_files += 1
+ if filename[-1] == '~' or filename[-4:] == '.BAK': continue
+ print ' |-- ' + filename
+ dirname = os.path.join(dest_dir, os.path.dirname(filename))
+ if not os.path.exists(dirname):
+ os.makedirs(os.path.join(dest_dir, os.path.dirname(filename)))
+ full_filename = os.path.join(dest_dir, filename)
+ shutil.copyfile(filename, full_filename)
+ if make_exec:
+ os.chmod(full_filename, os.stat(full_filename).st_mode | stat.S_IXUSR)
+ assert(actual_files > 0)
+
+if __name__ == "__main__":
+ usage = "usage: %prog [options] SOURCE_DIR DEST_DIR"
+ parser = OptionParser(usage=usage)
+ parser.add_option("-t", "--tarball", action='store_true',
+ help="Create a tarball distribution.")
+ parser.add_option("-p", "--package", metavar='DIR',
+ help="Include an initial package in the distribution.")
+ (opts, args) = parser.parse_args()
+ if len(args) != 2:
+ parser.error("Incorrect number of arguments.")
+
+ os.chdir(args[0])
+ dest_dir = args[1]
+
+ create_dist(opts.tarball, opts.package)
Oops, something went wrong.

0 comments on commit dad48c9

Please sign in to comment.