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
import py2exe
import distutils.sysconfig
import glob
setup(
name="pycam",
description="Python CAM",
version="0.1",
windows=[
{
'script' : 'pycam.py',
}
],
options = {
'py2exe': {
"packages": 'ctypes, logging, weakref, pycam',
"includes": 'distutils.util',
"excludes": 'OpenGL',
}
},
data_files= [
'README.TXT',
distutils.sysconfig.get_python_lib()+"/PyOpenGL-3.0.0b5-py2.5.egg",
distutils.sysconfig.get_python_lib()+"/setuptools-0.6c8-py2.5.egg",
('Samples', glob.glob('Samples/stl/*.stl')),
],
)
#!/usr/bin/env python
from distutils.core import setup
import distutils.sysconfig
import glob
import os.path
setup(
name="pycam",
version="0.2.1",
license="GPL v3",
description="Open Source CAM - Toolpath Generation for 3-Axis CNC machining",
author="Lode Leroy",
#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",
keywords=["3-axis", "cnc", "cam", "toolpath", "machining", "g-code"],
# full list of classifiers at:
# http://pypi.python.org/pypi?:action=list_classifiers
classifiers=[
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: GNU General Public License (GPL)",
"Topic :: Scientific/Engineering",
"Environment :: Win32 (MS Windows)",
"Environment :: X11 Applications",
"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