1 |
commit: 34be7b0c24c49868cfad5791b5c08f86d7ac19bf |
2 |
Author: W. Trevor King <wking <AT> tremily <DOT> us> |
3 |
AuthorDate: Wed Jun 5 17:13:43 2013 +0000 |
4 |
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com> |
5 |
CommitDate: Fri Nov 22 06:02:35 2013 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=34be7b0c |
7 |
|
8 |
setup.py: Add disutils-based packaging |
9 |
|
10 |
Package catalyst in the usual manner for Python projects. Now it is |
11 |
ready for PyPI :). |
12 |
|
13 |
I also expose the version string in catalyst.__version__, since that's |
14 |
a more traditional location than catalyst.version.__version__. |
15 |
|
16 |
--- |
17 |
.gitignore | 7 ++++- |
18 |
MANIFEST.in | 6 ++++ |
19 |
catalyst/__init__.py | 3 ++ |
20 |
setup.py | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++ |
21 |
4 files changed, 104 insertions(+), 1 deletion(-) |
22 |
|
23 |
diff --git a/.gitignore b/.gitignore |
24 |
index 711f9e8..0cf4f26 100644 |
25 |
--- a/.gitignore |
26 |
+++ b/.gitignore |
27 |
@@ -1,5 +1,10 @@ |
28 |
*.py[co] |
29 |
+ |
30 |
+build |
31 |
+dist |
32 |
+files |
33 |
+MANIFEST |
34 |
+ |
35 |
test.* |
36 |
*.geany |
37 |
Scratch |
38 |
- |
39 |
|
40 |
diff --git a/MANIFEST.in b/MANIFEST.in |
41 |
new file mode 100644 |
42 |
index 0000000..4274094 |
43 |
--- /dev/null |
44 |
+++ b/MANIFEST.in |
45 |
@@ -0,0 +1,6 @@ |
46 |
+include AUTHORS |
47 |
+include ChangeLog |
48 |
+include COPYING |
49 |
+include Makefile |
50 |
+recursive-include doc *.conf *.py HOWTO.txt catalyst*.txt |
51 |
+recursive-include examples README *.example *.spec |
52 |
|
53 |
diff --git a/catalyst/__init__.py b/catalyst/__init__.py |
54 |
index e69de29..c2538aa 100644 |
55 |
--- a/catalyst/__init__.py |
56 |
+++ b/catalyst/__init__.py |
57 |
@@ -0,0 +1,3 @@ |
58 |
+"Catalyst is a release building tool used by Gentoo Linux" |
59 |
+ |
60 |
+from .version import __version__ |
61 |
|
62 |
diff --git a/setup.py b/setup.py |
63 |
new file mode 100644 |
64 |
index 0000000..34eae53 |
65 |
--- /dev/null |
66 |
+++ b/setup.py |
67 |
@@ -0,0 +1,89 @@ |
68 |
+# Copyright (C) 2013 W. Trevor King <wking@×××××××.us> |
69 |
+# |
70 |
+# This program is free software: you can redistribute it and/or modify |
71 |
+# it under the terms of the GNU General Public License as published by |
72 |
+# the Free Software Foundation, either version 2 of the License, or |
73 |
+# (at your option) any later version. |
74 |
+# |
75 |
+# This program is distributed in the hope that it will be useful, |
76 |
+# but WITHOUT ANY WARRANTY; without even the implied warranty of |
77 |
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
78 |
+# GNU General Public License for more details. |
79 |
+# |
80 |
+# You should have received a copy of the GNU General Public License |
81 |
+# along with this program. If not, see <http://www.gnu.org/licenses/>. |
82 |
+ |
83 |
+"Catalyst is a release building tool used by Gentoo Linux" |
84 |
+ |
85 |
+import codecs as _codecs |
86 |
+from distutils.core import setup as _setup |
87 |
+import itertools as _itertools |
88 |
+import os as _os |
89 |
+ |
90 |
+from catalyst import __version__ |
91 |
+ |
92 |
+ |
93 |
+_this_dir = _os.path.dirname(__file__) |
94 |
+package_name = 'catalyst' |
95 |
+tag = '{0}-{1}'.format(package_name, __version__) |
96 |
+ |
97 |
+ |
98 |
+def files(root): |
99 |
+ """Iterate through all the file paths under `root` |
100 |
+ |
101 |
+ Distutils wants all paths to be written in the Unix convention |
102 |
+ (i.e. slash-separated) [1], so that's what we'll do here. |
103 |
+ |
104 |
+ [1]: http://docs.python.org/2/distutils/setupscript.html#writing-the-setup-script |
105 |
+ """ |
106 |
+ for dirpath, dirnames, filenames in _os.walk(root): |
107 |
+ for filename in filenames: |
108 |
+ path = _os.path.join(dirpath, filename) |
109 |
+ if _os.path.sep != '/': |
110 |
+ path = path.replace(_os.path.sep, '/') |
111 |
+ yield path |
112 |
+ |
113 |
+ |
114 |
+_setup( |
115 |
+ name=package_name, |
116 |
+ version=__version__, |
117 |
+ maintainer='Gentoo Release Engineering', |
118 |
+ maintainer_email='releng@g.o', |
119 |
+ url='http://www.gentoo.org/proj/en/releng/{0}/'.format(package_name), |
120 |
+ download_url='http://git.overlays.gentoo.org/gitweb/?p=proj/{0}.git;a=snapshot;h={1};sf=tgz'.format(package_name, tag), |
121 |
+ license='GNU General Public License (GPL)', |
122 |
+ platforms=['all'], |
123 |
+ description=__doc__, |
124 |
+ long_description=_codecs.open( |
125 |
+ _os.path.join(_this_dir, 'README'), 'r', 'utf-8').read(), |
126 |
+ classifiers=[ |
127 |
+ 'Development Status :: 5 - Production/Stable', |
128 |
+ 'License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)', |
129 |
+ 'Intended Audience :: System Administrators', |
130 |
+ 'Operating System :: POSIX', |
131 |
+ 'Topic :: System :: Archiving :: Packaging', |
132 |
+ 'Topic :: System :: Installation/Setup', |
133 |
+ 'Topic :: System :: Software Distribution', |
134 |
+ 'Programming Language :: Python :: 2', |
135 |
+ 'Programming Language :: Python :: 2.6', |
136 |
+ 'Programming Language :: Python :: 2.7', |
137 |
+ ], |
138 |
+ scripts=['bin/{0}'.format(package_name)], |
139 |
+ packages=[ |
140 |
+ package_name, |
141 |
+ '{0}.arch'.format(package_name), |
142 |
+ '{0}.base'.format(package_name), |
143 |
+ '{0}.targets'.format(package_name), |
144 |
+ ], |
145 |
+ data_files=[ |
146 |
+ ('/etc/catalyst', [ |
147 |
+ 'etc/catalyst.conf', |
148 |
+ 'etc/catalystrc', |
149 |
+ ]), |
150 |
+ ('lib/catalyst/', list(_itertools.chain( |
151 |
+ files('livecd'), |
152 |
+ files('targets'), |
153 |
+ ))), |
154 |
+ ], |
155 |
+ provides=[package_name], |
156 |
+ ) |