Commit 89b697d2 authored by sumpfralle's avatar sumpfralle

added a first draft of the distutils-setup script (thanks to Arthur Magill for this contribution!)


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@235 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 92f6da92
include LICENSE.TXT
include HOWTO.TXT
include COPYING.TXT
include README.TXT
include Changelog
include release_info.txt
include pycam_start.py
recursive-include pycam *
recursive-include Samples *
recursive-include Tests *
import distutils.sysconfig
import os
import sys
try:
logfile = os.path.join(distutils.sysconfig.PREFIX, "pycam-wininst-postinstall.log", "a")
except OSError:
logfile = None
if logfile:
sys.stdout = logfile
sys.stderr = logfile
LINK_EXTENSION = ".lnk"
try:
START_MENU_BASEDIR = get_special_folder_path("CSIDL_COMMON_PROGRAMS")
except OSError:
START_MENU_BASEDIR = get_special_folder_path("CSIDL_PROGRAMS")
except NameError:
START_MENU_BASEDIR = "HELO"
START_MENU_SUBDIR = os.path.join(START_MENU_BASEDIR, "PyCAM")
# create a start menu item for pycam
PYTHON_EXE = os.path.join(distutils.sysconfig.EXEC_PREFIX, "python.exe")
START_SCRIPT = os.path.join(distutils.sysconfig.EXEC_PREFIX, "Scripts", "pycam_start.py")
RUN_TARGET = '%s "%s"' % (PYTHON_EXE, START_SCRIPT)
PYTHON_DATA_DIR = os.path.join(distutils.sysconfig.PREFIX, "share", "python-pycam")
# add some more doc files
DOC_FILES = [
("HOWTO.TXT", "Introduction"),
("LICENSE.TXT", "License"),
("README.TXT", "Readme")]
WEB_LINKS = [
(r"http://sourceforge.net/projects/pycam/", "Project's Website"),
(r"http://sourceforge.net/tracker/?group_id=237831&atid=1104176", "Report a Bug"),
(r"http://sourceforge.net/projects/pycam/forums", "Forum Discussions"),
(r"http://sourceforge.net/apps/mediawiki/pycam/", "Wiki")]
MENU_ITEMS = map(lambda v: (os.path.join(PYTHON_DATA_DIR, v[0]), v[1]), DOC_FILES)
MENU_ITEMS.extend(WEB_LINKS)
action = sys.argv[1]
if action == "-install":
if not os.path.exists(START_MENU_SUBDIR):
os.mkdir(START_MENU_SUBDIR)
directory_created(START_MENU_SUBDIR)
for menu_item in MENU_ITEMS:
target, description = menu_item
filename = os.path.join(START_MENU_SUBDIR, description) + LINK_EXTENSION
create_shortcut(target, description, filename)
file_created(filename)
filename = os.path.join(START_MENU_SUBDIR, "Run PyCAM") + LINK_EXTENSION
create_shortcut(PYTHON_EXE, "Run PyCAM", filename, START_SCRIPT)
file_created(filename)
elif action == "-remove":
pass
else:
pass
[bdist_wininst]
install_script=pycam_win32_postinstall.py
[bdist_rpm]
packager = Lars Kruse <devel@sumpfralle.de>
doc_files = Changelog
README.TXT
INSTALL.TXT
HOWTO.TXT
LICENSE.TXT
COPYING.TXT
doc/
examples/
from distutils.core import setup #!/usr/bin/env python
import py2exe
from distutils.core import setup
import distutils.sysconfig import distutils.sysconfig
import glob
import glob import os.path
setup( setup(
name="pycam", name="pycam",
description="Python CAM", version="0.2.1",
version="0.1", license="GPL v3",
windows=[ description="Open Source CAM - Toolpath Generation for 3-Axis CNC machining",
{ author="Lode Leroy",
'script' : 'pycam.py', #author_email="",
} url="http://sourceforge.net/projects/pycam",
], download_url="http://sourceforge.net/projects/pycam/files/pycam/0.2.1/pycam-0.2.1.tgz/download",
options = { keywords=["3-axis", "cnc", "cam", "toolpath", "machining", "g-code"],
'py2exe': { # full list of classifiers at:
"packages": 'ctypes, logging, weakref, pycam', # http://pypi.python.org/pypi?:action=list_classifiers
"includes": 'distutils.util', classifiers=[
"excludes": 'OpenGL', "Programming Language :: Python",
} "Programming Language :: Python :: 2",
}, "Development Status :: 3 - Alpha",
data_files= [ "License :: OSI Approved :: GNU General Public License (GPL)",
'README.TXT', "Topic :: Scientific/Engineering",
distutils.sysconfig.get_python_lib()+"/PyOpenGL-3.0.0b5-py2.5.egg", "Environment :: Win32 (MS Windows)",
distutils.sysconfig.get_python_lib()+"/setuptools-0.6c8-py2.5.egg", "Environment :: X11 Applications",
('Samples', glob.glob('Samples/stl/*.stl')), "Intended Audience :: Manufacturing",
], "Operating System :: Microsoft :: Windows",
) "Operating System :: POSIX",
],
packages=[
"pycam",
"pycam.Cutters",
"pycam.Geometry",
"pycam.Importers",
"pycam.PathProcessors",
"pycam.Utils",
"pycam.Exporters",
"pycam.Gui",
"pycam.PathGenerators",
"pycam.Simulation"
],
scripts = ['pycam_start.py', 'pycam_win32_postinstall.py'],
data_files=[("share/python-pycam",[
"COPYING.TXT",
"HOWTO.TXT",
"INSTALL.TXT",
"LICENSE.TXT",
"README.TXT",
"Changelog",
"release_info.txt"]),
("share/python-pycam/ui", [
os.path.join("pycam", "Gui", "gtk-interface", "pycam-project.ui"),
os.path.join("pycam", "Gui", "gtk-interface", "menubar.xml"),
]),
("share/python-pycam/samples",
glob.glob(os.path.join("Samples","STL","*.stl"))),
],
)
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment