1 |
#!/usr/bin/env python |
#!/usr/bin/env python |
2 |
# |
# |
3 |
|
# GNU Enterprise Application Server - Installation Procedure |
4 |
|
# |
5 |
# Copyright 2001-2003 Free Software Foundation |
# Copyright 2001-2003 Free Software Foundation |
6 |
# |
# |
7 |
# This file is part of GNU Enterprise. |
# This file is part of GNU Enterprise. |
21 |
# write to the Free Software Foundation, Inc., 59 Temple Place |
# write to the Free Software Foundation, Inc., 59 Temple Place |
22 |
# - Suite 330, Boston, MA 02111-1307, USA. |
# - Suite 330, Boston, MA 02111-1307, USA. |
23 |
# |
# |
24 |
|
# $Id$ |
25 |
|
|
26 |
import sys |
import sys |
27 |
import string |
import string |
29 |
import os.path |
import os.path |
30 |
import copy |
import copy |
31 |
|
|
32 |
from src import VERSION |
from src import PACKAGE, VERSION |
33 |
|
|
34 |
|
# ----------------------------------------------------------------------------- |
35 |
|
# Check Python version |
36 |
|
# ----------------------------------------------------------------------------- |
37 |
|
|
38 |
# |
if sys.hexversion < 0x02010000: |
39 |
# hack to deal w/ fact distutils won't |
print "%s needs at least Python version 2.1" % PACKAGE |
40 |
# allow us to set absolute path prefix |
sys.exit() |
41 |
# on windows |
|
42 |
# |
# ----------------------------------------------------------------------------- |
43 |
|
# distutils won't allow us to set absolute path prefix on windows |
44 |
|
# ----------------------------------------------------------------------------- |
45 |
|
|
46 |
if not 'sdist' in sys.argv: |
if not 'sdist' in sys.argv: |
47 |
if sys.platform != 'win32': |
if sys.platform != 'win32': |
52 |
except: |
except: |
53 |
pass |
pass |
54 |
|
|
55 |
try: |
# ----------------------------------------------------------------------------- |
56 |
from distutils.core import setup |
# Initalize stuff |
57 |
from distutils.command.build_scripts import build_scripts |
# ----------------------------------------------------------------------------- |
58 |
# from setupext import Data_Files, install_Data_Files |
|
59 |
except ImportError: |
from distutils.core import setup |
60 |
print """ |
from distutils.command.build_scripts import build_scripts |
61 |
Setup requires that python's distutils be |
|
62 |
installed. You can get a copy of it from |
docfiles = None |
63 |
http://www.python.org/sigs/distutils-sig/ |
manfiles = None |
64 |
""" |
|
65 |
sys.exit() |
# ----------------------------------------------------------------------------- |
66 |
|
# sdist (Source distribution): build docs |
67 |
|
# ----------------------------------------------------------------------------- |
68 |
|
|
69 |
if 'sdist' in sys.argv: |
if 'sdist' in sys.argv: |
70 |
print """ |
print """ |
93 |
../scripts/gacvs --generate-man-page |
../scripts/gacvs --generate-man-page |
94 |
""") |
""") |
95 |
|
|
96 |
|
# ----------------------------------------------------------------------------- |
97 |
|
# build and install: Check dependencies |
98 |
|
# ----------------------------------------------------------------------------- |
99 |
|
|
100 |
if ('build' in sys.argv) or ('install' in sys.argv): |
if ('build' in sys.argv) or ('install' in sys.argv): |
101 |
|
|
186 |
""" |
""" |
187 |
sys.exit() |
sys.exit() |
188 |
|
|
189 |
|
# List non-program files to be installed |
190 |
|
|
191 |
|
docfiles = ['README', 'INSTALL', 'AUTHORS', 'COPYING', 'NEWS', 'THANKS'] |
192 |
|
for file in ('doc/api/api.html', |
193 |
|
'doc/api/api.txt', |
194 |
|
'doc/api/api.pdf', |
195 |
|
'doc/whitepaper/whitepaper.html', |
196 |
|
'doc/whitepaper/whitepaper.txt', |
197 |
|
'doc/whitepaper/whitepaper.pdf'): |
198 |
|
if os.path.isfile(file): |
199 |
|
docfiles.append(file) |
200 |
|
else: |
201 |
|
print "WARNING: File %s does not exist... not installing!" % file |
202 |
|
|
203 |
|
manfiles = [] |
204 |
|
for file in ('man/gnue-appserver.1'): |
205 |
|
if os.path.isfile(file): |
206 |
|
manfiles.append(file) |
207 |
|
else: |
208 |
|
print "WARNING: File %s does not exist... not installing!" % file |
209 |
|
|
210 |
|
# ----------------------------------------------------------------------------- |
211 |
# Site config stuff |
# Site config stuff |
212 |
|
# ----------------------------------------------------------------------------- |
213 |
|
|
214 |
try: |
try: |
215 |
index = sys.argv.index('--cfg-file') |
index = sys.argv.index('--cfg-file') |
216 |
site_config = os.path.join(os.path.abspath(sys.argv[index+1])) |
site_config = os.path.join(os.path.abspath(sys.argv[index+1])) |
217 |
sys.argv.pop(index) |
sys.argv.pop(index) |
218 |
sys.argv.pop(index) |
sys.argv.pop(index) |
219 |
config_line = "os.environ['GNUE_INSTALLED_SITE_CFG']='%s'\n" % site_config |
config_line = "os.environ['GNUE_INSTALLED_SITE_CFG']='%s'\n" % site_config |
|
|
|
220 |
except ValueError: |
except ValueError: |
221 |
config_line = "" |
config_line = "" |
222 |
|
|
|
|
|
|
|
|
223 |
class my_build_scripts(build_scripts): |
class my_build_scripts(build_scripts): |
224 |
def finalize_options(self): |
def finalize_options(self): |
225 |
|
|
286 |
fout.close() |
fout.close() |
287 |
print "OK" |
print "OK" |
288 |
|
|
289 |
docfiles = ['README', 'INSTALL', 'AUTHORS', 'COPYING', 'NEWS', 'THANKS'] |
# ----------------------------------------------------------------------------- |
290 |
for file in ('doc/api/api.html', |
# GNUE_VERSION_SUFFIX handling |
291 |
'doc/api/api.txt', |
# ----------------------------------------------------------------------------- |
|
'doc/api/api.pdf', |
|
|
'doc/whitepaper/whitepaper.html', |
|
|
'doc/whitepaper/whitepaper.txt', |
|
|
'doc/whitepaper/whitepaper.pdf'): |
|
|
if os.path.isfile(file): |
|
|
docfiles.append(file) |
|
|
else: |
|
|
print "WARNING: File %s does not exist... not installing!" % file |
|
|
|
|
|
manfiles = [] |
|
|
for file in ('man/gnue-appserver.1', |
|
|
'man/gnue-appserver.1'): |
|
|
if os.path.isfile(file): |
|
|
manfiles.append(file) |
|
|
else: |
|
|
print "WARNING: File %s does not exist... not installing!" % file |
|
|
|
|
|
|
|
292 |
|
|
|
# |
|
293 |
# You can run: |
# You can run: |
294 |
# $ GNUE_VERSION_SUFFIX=-pre1 ./setup.py sdist |
# $ GNUE_VERSION_SUFFIX=-pre1 ./setup.py sdist |
295 |
# and the packages will be created as GNUe-App-0.x.x-pre1.tar.gz |
# and the packages will be created as GNUe-App-0.x.x-pre1.tar.gz |
296 |
# |
|
297 |
try: |
try: |
298 |
suffix = os.environ['GNUE_VERSION_SUFFIX'] |
suffix = os.environ['GNUE_VERSION_SUFFIX'] |
299 |
except KeyError: |
except KeyError: |
300 |
suffix = "" |
suffix = "" |
301 |
|
|
302 |
|
# ----------------------------------------------------------------------------- |
303 |
|
# Call the actual setup routine |
304 |
|
# ----------------------------------------------------------------------------- |
305 |
|
|
306 |
setup (name = "GNUe-AppServer", |
setup (name = "GNUe-AppServer", |
307 |
version = VERSION + suffix, |
version = VERSION + suffix, |
308 |
description = "GNU Enterprise Application Server", |
description = "GNU Enterprise Application Server", |
326 |
packages = ["gnue.appserver", |
packages = ["gnue.appserver", |
327 |
"gnue.appserver.classrep", |
"gnue.appserver.classrep", |
328 |
"gnue.appserver.language",], |
"gnue.appserver.language",], |
329 |
|
|
330 |
package_dir = {"gnue.appserver" : "src"}, |
package_dir = {"gnue.appserver" : "src"}, |
331 |
|
|
332 |
scripts = ["scripts/gnue-appserver"] |
scripts = ["scripts/gnue-appserver"] |
333 |
) |
) |
334 |
|
|
341 |
A sample is provided in that directory that you can typically just copy over. |
A sample is provided in that directory that you can typically just copy over. |
342 |
""" |
""" |
343 |
|
|
344 |
|
# ----------------------------------------------------------------------------- |
345 |
|
# Clean up |
346 |
|
# ----------------------------------------------------------------------------- |
347 |
|
|
348 |
if not 'sdist' in sys.argv: |
if not 'sdist' in sys.argv: |
349 |
if sys.platform != 'win32': |
if sys.platform != 'win32': |
350 |
os.system (""" /bin/rm -rf setup.cfg""") |
os.system (""" /bin/rm -rf setup.cfg""") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|