forked from ssato/python-anyconfig
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.spec.in
More file actions
242 lines (206 loc) · 9.39 KB
/
Copy pathpackage.spec.in
File metadata and controls
242 lines (206 loc) · 9.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
%if 0%{?rhel} && 0%{?rhel} < 5
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%{!?python_version: %global python_version %(%{__python} -c "import sys ; print sys.version[:3]")}
%endif
%{!?python3_version: %global python3_version %(%{__python3} -c "import sys; sys.stdout.write(sys.version[:3])")}
%if 0%{?fedora}
%global with_python3 1
%endif
# disable debuginfo
%define debug_package %{nil}
%define pkgname anyconfig
Name: python-%{pkgname}
Version: @VERSION@
Release: 1%{?dist}
Summary: Generic access to configuration files in some formats
Group: Development/Libraries
License: MIT
URL: https://github.com/ssato/%{name}
#Source0: https://github.com/ssato/%{name}/tarball/master/%{name}-%{version}.tar.gz
Source0: %{pkgname}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: python-devel
BuildRequires: python-setuptools
Requires: PyYAML
# FIXME: How to add weak dependency ?
#Requires: python-jinja2
Requires: python-setuptools
%if %{?rhel}%{!?rhel:0} == 5
Requires: python-simplejson
%endif
%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
%endif
%description
Python library to provide generic access to configuration files in some
formats such like INI, JSON and YAML.
%if 0%{?with_python3}
%package -n python3-%{pkgname}
Summary: Generic access to configuration files in some formats
Group: Development/Libraries
Requires: python3-PyYAML
# FIXME: Likewise
#Requires: python3-jinja2
Requires: python3-setuptools
%description -n python3-%{pkgname}
Python library to provide generic access to configuration files in some
formats such like INI, JSON and YAML.
%endif
%prep
%setup -q -n %{pkgname}-%{version}
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif
%build
%{__python} setup.py build
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif
%install
rm -rf $RPM_BUILD_ROOT
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
mv $RPM_BUILD_ROOT%{_bindir}/anyconfig_cli $RPM_BUILD_ROOT%{_bindir}/py3anyconfig_cli
# TODO: It does not look working well:
#chmod +x $RPM_BUILD_ROOT%{_bindir}/py3anyconfig_cli
popd
%endif
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc README.rst
%{python_sitelib}/*
%{_bindir}/anyconfig_cli
%{_mandir}/*/*
%if 0%{?with_python3}
%files -n python3-%{pkgname}
%defattr(644,root,root,755)
%doc README.rst
%{python3_sitelib}/*
%attr(755,root,root) %{_bindir}/py3anyconfig_cli
%endif
%changelog
* Thu Apr 23 2015 Satoru SATOH <ssato@redhat.com> - 0.0.7-1
- module level logging fixes and improvements, may close issue#13 and issue#14
- export anyconfig.api.set_ to public which was not exported
- rename a few function parameters template and context passed to *load* to
avoid conflicts with parameters intended to pass to backends
- reorder some arguments passed to anyconfig.api.*load to keep consistency in
the order of arguments among them
- add --env option to the CLI frontend to pass configuration default values
from envrionment variables
- some more minor bug fixes and enhancements
* Fri Mar 13 2015 Satoru SATOH <ssato@redhat.com> - 0.0.6-1
- show ini file structure erros by Kamil Chmielewski, closes PR#8
- beautify README.rst by Florian Ludwig, closes PR#10
- add support to load template config files
- removes all custom logging magic and changes the behaviour to the standard
way of logging for Python libraries by Wouter Bolsterlee, closed PR#11
- re-enable Travis-CI tests for python 2.6
- some more minor bug fixes and enhancements
* Sun Oct 26 2014 Satoru SATOH <ssato@redhat.com> - 0.0.5-1
- start to monitor code coverage w/ using coveralls.io
- start to do extra health check by landscape.io
- introduce 'ignore_missing' optional parameter to ignore missing config
file[s] in anyconfig.apy.*load() originally suggested by chmac in issue#4
- add -x/--ignore-missing option to allow ignoring missing files in anyconfig_cli
- make xml backend loader worked although it nees a lot more work
- fix a typo in README.rst by Jonathan Eunice, closes PR#1
- some more minor bug fixes and enhancements
* Tue Aug 19 2014 Satoru SATOH <ssato@redhat.com> - 0.0.4-1
- Change the versioning scheme and bump up the version to fix the issue #3
* Fri Aug 1 2014 Satoru SATOH <ssato@redhat.com> - 0.0.3.13-1
- Enable flake8 (pyFlake + pep8) testing
- Fix some minor errors like F401 (import-but-not-used eror) found by flake8
- Introduce an environment variable ANYCONFIG_DEBUG to control module's log
level from outside world
- Add anyconfig.getset module and --get option to anyconfig cli frontend to get
(extract) partial configuration[s] from loaded config files
- Add python 3.4 support and also make it tested in CI process
* Sat May 3 2014 Satoru SATOH <ssato@redhat.com> - 0.0.3.12-1
- Support safe_{load,dump} in YAML backend by safe=True argument
- Add some more keyword arguments support in JSON backend
- Add man page of anyconfig_cli
- Misc fixes and enhancements in anyconfig_cli
- Some PEP8 and pylint errors and warnings
- Fix some rpmlint errors
* Fri Jan 10 2014 Satoru SATOH <ssato@redhat.com> - 0.0.3.11-1
- Just a maintenance update release
- Add pylint checks and refactor test driver script
- Fix some PEP8 and pylint errors and warnings
* Thu May 2 2013 Satoru SATOH <ssato@redhat.com> - 0.0.3.10-1
- [anyconfig_cli] Fix a typo in its filename; s/anyconfg/anyconfig/g,
it's alsot pointed by jonathaneunice-san. Thanks a lot!
- Swtich to use setuptools instead of standard distutils to allow writing
various pluggable backends
- Implement pluggable backend system w/ using setuptools
- Fix some build and runtime dependencies to PyYAML and setuptools
- Spin off java properties file backend into a separate project:
https://github.com/ssato/python-anyconfig-pyjavaproperties-backend
- Fix some type mismatches in methods of backend modules
- Make cli frontend generated w/ setuptools' help and remove tools/*
* Sun Mar 31 2013 Satoru SATOH <ssato@redhat.com> - 0.0.3.9-1
- Some fixes and enhancements around logging code
- [anyconfig_cli] add -s/--silent and -v/--verbose option to control log level
and removed -d/--debug option
- Allow swtich from/to build time snapshot-versioning-mode dynamically
- Build also RPMs for python-3.x
- Allow backend specific options passed to load*/dump* methods of some backends
- Ensure dir to dump output created if that dir not exist
* Wed Mar 13 2013 Satoru SATOH <ssato@redhat.com> - 0.0.3.8-1
- Do not expose internal repr. of loaded data when dump them
- Fix for ini (configparser) backend
* Tue Mar 12 2013 Satoru SATOH <ssato@redhat.com> - 0.0.3.7-1
- change API from anyconfig.find_parser to anyconfig.find_loader
- [anyconfig_cli] rename cli frontend from anyconfig_cui to anyconfig_cli
- [anyconfig_cli] add new option '-M/--merge' to select strategy to merge
multiple configs
- add 'noreplace' merging strategy
- fix the bug that 'replace' merge strategy (value: 0) was evaluated as False
and cause an 'invalid strategy' error, and change default merging strategy
- other misc fixes for PEP8 errors and warns, etc.
* Fri Feb 1 2013 Satoru SATOH <ssato@redhat.com> - 0.0.3.6-1
- Added -A and --atype option to anyconfig_cui to override configs w/ -A option
- Fixed an error in anyconfig.api.loads when config type is None
- Updated usage example of anyconfig_cui in README
* Fri Jan 18 2013 Satoru SATOH <ssato@redhat.com> - 0.0.3.5-1
- Changed the default merge strategy of anyconfig.mergeabledict.MergeableDict
from merge_dicts_and_lists to merge_dicts
- Updated README and added some usage examples
* Thu Jan 17 2013 Satoru SATOH <ssato@redhat.com> - 0.0.3.4-1
- Fine tunes in some APIs to load multi config files
- Updated and enhanced CUI frontend, anyconfig_cui
- Fixed a bug in anyconfig.Bunch.update_w_merge that cause error when merging
lists with passing merge_lists=True argument
- Updated module's doctext and added some usage examples
- Removed strong dependency to anyconfig.Bunch.Bunch, and switched to
anyconfig.mergeabledict.MergeableDict which is stripped-down version of
anyconfig.Bunch.Bunch object
* Fri Jan 4 2013 Satoru SATOH <ssato@redhat.com> - 0.0.3.3-1
- Changed APIs (new: load, {single,mulit}_load) and some cleanups
- Complemented some meta package info to register this module to PyPI
- Changed the name of python module; stripped 'python-' from its name
* Fri Jan 4 2013 Satoru SATOH <ssato@redhat.com> - 0.0.3.2-1
- Fixed a few that yaml.* and etree.* not defined when yaml and etree module is
not found, causing build time error
* Fri Jan 4 2013 Satoru SATOH <ssato@redhat.com> - 0.0.3.1-1
- Added metaconfig module to control config-loading behavior
- Added some new APIs including anyconfig.{mload,loads}, etc.
- Started CI tests w/ Travis
* Sat Aug 4 2012 Satoru SATOH <ssato@redhat.com> - 0.0.3-1
- Fixed a grave syntax error in anyconfig.backend.properties_
- Some docstring cleanups
- Some refactoring
- Implemented dicts merge/replacements came from config files
* Mon Jul 2 2012 Satoru SATOH <ssato@redhat.com> - 0.0.2-1
- Fixed packaging bug that some modules were missing from the list
* Fri Jun 29 2012 Satoru SATOH <ssato@redhat.com> - 0.0.1-1
- Initial packaging