|
| 1 | +#!/usr/bin/env python |
| 2 | + |
| 3 | +''' |
| 4 | + This program is free software; you can redistribute it and/or modify |
| 5 | + it under the terms of the Revised BSD License. |
| 6 | +
|
| 7 | + This program is distributed in the hope that it will be useful, |
| 8 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | + Revised BSD License for more details. |
| 11 | +
|
| 12 | + Copyright 2016 Cool Dude 2k - http://idb.berlios.de/ |
| 13 | + Copyright 2016 Game Maker 2k - http://intdb.sourceforge.net/ |
| 14 | + Copyright 2016 Kazuki Przyborowski - https://github.com/KazukiPrzyborowski |
| 15 | +
|
| 16 | + $FileInfo: setup.py - Last Update: 1/9/2018 Ver. 4.10.0 RC 1 - Author: cooldude2k $ |
| 17 | +''' |
| 18 | + |
| 19 | +import re, os, sys, time, datetime, platform, pkg_resources; |
| 20 | +from setuptools import setup, find_packages; |
| 21 | + |
| 22 | +verinfofilename = os.path.realpath("."+os.path.sep+os.path.sep+"pycatfile.py"); |
| 23 | +verinfofile = open(verinfofilename, "r"); |
| 24 | +verinfodata = verinfofile.read(); |
| 25 | +verinfofile.close(); |
| 26 | +setuppy_verinfo_esc = re.escape("__version_info__ = (")+"(.*)"+re.escape(");"); |
| 27 | +setuppy_verinfo = re.findall(setuppy_verinfo_esc, verinfodata)[0]; |
| 28 | +setuppy_verinfo_exp = [vergetspt.strip().replace("\"", "") for vergetspt in setuppy_verinfo.split(',')]; |
| 29 | +setuppy_dateinfo_esc = re.escape("__version_date_info__ = (")+"(.*)"+re.escape(");"); |
| 30 | +setuppy_dateinfo = re.findall(setuppy_dateinfo_esc, verinfodata)[0]; |
| 31 | +setuppy_dateinfo_exp = [vergetspt.strip().replace("\"", "") for vergetspt in setuppy_dateinfo.split(',')]; |
| 32 | +pymodule = {}; |
| 33 | +pymodule['version'] = str(setuppy_verinfo_exp[0])+"."+str(setuppy_verinfo_exp[1])+"."+str(setuppy_verinfo_exp[2]); |
| 34 | +pymodule['versionrc'] = int(setuppy_verinfo_exp[4]); |
| 35 | +pymodule['versionlist'] = (int(setuppy_verinfo_exp[0]), int(setuppy_verinfo_exp[1]), int(setuppy_verinfo_exp[2]), str(setuppy_verinfo_exp[3]), int(setuppy_verinfo_exp[4])); |
| 36 | +pymodule['verdate'] = str(setuppy_dateinfo_exp[0])+"."+str(setuppy_dateinfo_exp[1])+"."+str(setuppy_dateinfo_exp[2]); |
| 37 | +pymodule['verdaterc'] = int(setuppy_dateinfo_exp[4]); |
| 38 | +pymodule['verdatelist'] = (int(setuppy_dateinfo_exp[0]), int(setuppy_dateinfo_exp[1]), int(setuppy_dateinfo_exp[2]), str(setuppy_dateinfo_exp[3]), int(setuppy_dateinfo_exp[4])); |
| 39 | +pymodule['name'] = 'PyCatFile'; |
| 40 | +pymodule['author'] = 'Kazuki Przyborowski'; |
| 41 | +pymodule['authoremail'] = 'kazuki.przyborowski@gmail.com'; |
| 42 | +pymodule['maintainer'] = 'Kazuki Przyborowski'; |
| 43 | +pymodule['maintaineremail'] = 'kazuki.przyborowski@gmail.com'; |
| 44 | +pymodule['description'] = 'A tar like file format name catfile after unix cat command (concatenate files) .'; |
| 45 | +pymodule['license'] = 'Revised BSD License'; |
| 46 | +pymodule['keywords'] = 'catfile pycatfile python python-catfile'; |
| 47 | +pymodule['url'] = 'https://github.com/GameMaker2k/PyCatFile'; |
| 48 | +pymodule['downloadurl'] = 'https://github.com/GameMaker2k/PyCatFile/archive/master.tar.gz'; |
| 49 | +pymodule['longdescription'] = 'A tar like file format name catfile after unix cat command (concatenate files) .'; |
| 50 | +pymodule['platforms'] = 'OS Independent'; |
| 51 | +pymodule['zipsafe'] = True; |
| 52 | +pymodule['pymodules'] = ['pycatfile']; |
| 53 | +pymodule['classifiers'] = [ |
| 54 | + 'Development Status :: 5 - Production/Stable', |
| 55 | + 'Intended Audience :: Developers', |
| 56 | + 'Intended Audience :: Other Audience', |
| 57 | + 'License :: OSI Approved', |
| 58 | + 'License :: OSI Approved :: BSD License', |
| 59 | + 'Natural Language :: English', |
| 60 | + 'Operating System :: MacOS', |
| 61 | + 'Operating System :: MacOS :: MacOS X', |
| 62 | + 'Operating System :: Microsoft', |
| 63 | + 'Operating System :: Microsoft :: Windows', |
| 64 | + 'Operating System :: OS/2', |
| 65 | + 'Operating System :: OS Independent', |
| 66 | + 'Operating System :: POSIX', |
| 67 | + 'Operating System :: Unix', |
| 68 | + 'Programming Language :: Python', |
| 69 | + 'Topic :: Utilities', |
| 70 | + 'Topic :: Software Development', |
| 71 | + 'Topic :: Software Development :: Libraries', |
| 72 | + 'Topic :: Software Development :: Libraries :: Python Modules' |
| 73 | +]; |
| 74 | +if(len(sys.argv)>1 and (sys.argv[1]=="versioninfo" or sys.argv[1]=="getversioninfo")): |
| 75 | + import json; |
| 76 | + pymodule_data = json.dumps(pymodule); |
| 77 | + print(pymodule_data); |
| 78 | + sys.exit(); |
| 79 | +if(len(sys.argv)>1 and (sys.argv[1]=="sourceinfo" or sys.argv[1]=="getsourceinfo")): |
| 80 | + srcinfofilename = os.path.realpath("."+os.path.sep+pkg_resources.to_filename(pymodule['name'])+".egg-info"+os.path.sep+"SOURCES.txt"); |
| 81 | + srcinfofile = open(srcinfofilename, "r"); |
| 82 | + srcinfodata = srcinfofile.read(); |
| 83 | + srcinfofile.close(); |
| 84 | + srcinfolist = srcinfodata.split('\n'); |
| 85 | + srcfilelist = ""; |
| 86 | + srcpdir = os.path.basename(os.path.dirname(os.path.realpath(__file__))); |
| 87 | + for ifile in srcinfolist: |
| 88 | + srcfilelist = "."+os.path.sep+srcpdir+os.path.sep+ifile+" "+srcfilelist; |
| 89 | + print(srcfilelist); |
| 90 | + sys.exit(); |
| 91 | +if(len(sys.argv)>1 and sys.argv[1]=="cleansourceinfo"): |
| 92 | + os.system("rm -rfv \""+os.path.realpath("."+os.path.sep+"dist\"")); |
| 93 | + os.system("rm -rfv \""+os.path.realpath("."+os.path.sep+pkg_resources.to_filename(pymodule['name'])+".egg-info\"")); |
| 94 | + sys.exit(); |
| 95 | + |
| 96 | +setup( |
| 97 | + name = pymodule['name'], |
| 98 | + version = pymodule['version'], |
| 99 | + author = pymodule['author'], |
| 100 | + author_email = pymodule['authoremail'], |
| 101 | + maintainer = pymodule['maintainer'], |
| 102 | + maintainer_email = pymodule['maintaineremail'], |
| 103 | + description = pymodule['description'], |
| 104 | + license = pymodule['license'], |
| 105 | + keywords = pymodule['keywords'], |
| 106 | + url = pymodule['url'], |
| 107 | + download_url = pymodule['downloadurl'], |
| 108 | + long_description = pymodule['longdescription'], |
| 109 | + platforms = pymodule['platforms'], |
| 110 | + zip_safe = pymodule['zipsafe'], |
| 111 | + py_modules = pymodule['pymodules'], |
| 112 | + classifiers = pymodule['classifiers'] |
| 113 | +) |
0 commit comments