Gentoo Archives: gentoo-commits

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