29 |
import copy |
import copy |
30 |
|
|
31 |
from distutils.core import setup |
from distutils.core import setup |
32 |
from distutils.command.build_scripts import build_scripts |
from distutils.command.build import build |
33 |
from distutils.command.install import install |
from distutils.command.install import install |
34 |
|
|
35 |
from src import PACKAGE, VERSION |
from src import PACKAGE, VERSION |
62 |
pass |
pass |
63 |
|
|
64 |
# ----------------------------------------------------------------------------- |
# ----------------------------------------------------------------------------- |
65 |
# sdist (Source distribution): build documentation, SQL scripts and manpage |
# Build files to be distributed and installed |
66 |
# ----------------------------------------------------------------------------- |
# ----------------------------------------------------------------------------- |
67 |
|
|
68 |
if "sdist" in sys.argv: |
def build_files (): |
69 |
|
|
70 |
# First check if we have everything installed we need to build the |
# First check if we have everything installed we need to build the |
71 |
# distribution |
# distribution |
72 |
|
|
128 |
sys.exit (1) |
sys.exit (1) |
129 |
|
|
130 |
# ----------------------------------------------------------------------------- |
# ----------------------------------------------------------------------------- |
131 |
|
# Source distribution: Build files to be distributed |
132 |
|
# ----------------------------------------------------------------------------- |
133 |
|
|
134 |
|
if "sdist" in sys.argv: |
135 |
|
build_files () |
136 |
|
|
137 |
|
# ----------------------------------------------------------------------------- |
138 |
# User can supply a path to the config file |
# User can supply a path to the config file |
139 |
# ----------------------------------------------------------------------------- |
# ----------------------------------------------------------------------------- |
140 |
|
|
148 |
config_line = "" |
config_line = "" |
149 |
|
|
150 |
# ============================================================================= |
# ============================================================================= |
151 |
|
# Before build: if done from CVS, build files to be installed |
152 |
|
# ============================================================================= |
153 |
|
|
154 |
|
class gnue_build (build): |
155 |
|
|
156 |
|
def finalize_options (self): |
157 |
|
build.finalize_options (self) |
158 |
|
if self.finalized: |
159 |
|
return |
160 |
|
|
161 |
|
if not os.path.isfile ("PKG-INFO"): # downloaded from CVS? |
162 |
|
build_files () |
163 |
|
|
164 |
|
# ============================================================================= |
165 |
# Before installation: check dependencies and create real scripts |
# Before installation: check dependencies and create real scripts |
166 |
# ============================================================================= |
# ============================================================================= |
167 |
|
|
168 |
class my_install (install): |
class gnue_install (install): |
169 |
|
|
170 |
# --------------------------------------------------------------------------- |
# --------------------------------------------------------------------------- |
171 |
# Check dependencies |
# Check dependencies |
346 |
# Call the actual setup routine |
# Call the actual setup routine |
347 |
# ----------------------------------------------------------------------------- |
# ----------------------------------------------------------------------------- |
348 |
|
|
349 |
|
datafiles = ["src/classrep/repository.ini"] |
350 |
|
|
351 |
|
grpcfiles = ["grpc/appserver.grpc"] |
352 |
|
|
353 |
manfiles = [] |
manfiles = [] |
354 |
for file in ("man/gnue-appserver.1",): |
for file in ("man/gnue-appserver.1",): |
355 |
if os.path.isfile(file): |
if os.path.isfile(file): |
376 |
else: |
else: |
377 |
print "WARNING: File %s does not exist... not installing!" % file |
print "WARNING: File %s does not exist... not installing!" % file |
378 |
|
|
|
grpcfiles = ["grpc/appserver.grpc"] |
|
|
|
|
|
datafiles = ["src/classrep/repository.ini"] |
|
|
|
|
379 |
setup (name = "GNUe-AppServer", |
setup (name = "GNUe-AppServer", |
380 |
version = VERSION + suffix, |
version = VERSION + suffix, |
381 |
description = "GNU Enterprise Application Server", |
description = "GNU Enterprise Application Server", |
386 |
license = "GPL", |
license = "GPL", |
387 |
|
|
388 |
# Override certain command classes with our own ones |
# Override certain command classes with our own ones |
389 |
cmdclass = {"install": my_install}, |
cmdclass = {"build": gnue_build, |
390 |
|
"install": gnue_install}, |
391 |
|
|
392 |
data_files = [ ("share/man/man1", manfiles), |
data_files = [("share/gnue-appserver", datafiles), |
393 |
("share/doc/gnue-appserver", docfiles), |
("shared/grpc", grpcfiles), |
394 |
("share/doc/gnue-appserver/samples", samplefiles), |
("share/man/man1", manfiles), |
395 |
("shared/grpc", grpcfiles), |
("share/doc/gnue-appserver", docfiles), |
396 |
("share/gnue-appserver", datafiles) |
("share/doc/gnue-appserver/samples", samplefiles)], |
|
], |
|
397 |
|
|
398 |
packages = ["gnue.appserver", |
packages = ["gnue.appserver", |
399 |
"gnue.appserver.classrep", |
"gnue.appserver.classrep", |