python-pytz/python-pytz.spec

Tue, 29 Mar 2011 20:04:34 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 29 Mar 2011 20:04:34 +0200
changeset 334
4a34d7a82eab
child 387
33ae2d61c751
permissions
-rw-r--r--

Rework package yet again, correcting and introducing new buildconf logic:
Conditionally disable bootstrap stage comparison correctly, correct
english grammar, better find system as(1) and ld(1), indotruce detailed
optimization option messages, more completely guess cpu types, allow
profiled bootstrapping without a preinstalled GCC because many other
compilers have long since implemented 64-bit arithmetic, instruct make
to build sequentially (not in sparallel) when building a profiled
bootstrap as GCC online documents recommend, and generally improve
comment blocks.

The single most important correction in this changeset relates to the
GCC changed optimization policy since at least GCC 4.5, in which -march
is always passed and not always correctly guessed. In the case of this
package, allowing GCC to guess the architecture leads to wild build
errors at various subcomponents (zlib, libgcc, libiberty...) and
bootstrap stages. It seems quite platform specific, and the safest
approach to correcting this seems to be explicitly always specifying the
-march argument when bootstrapping GCC. Because the best choice 'native'
is not available when bootstrapping using a foreign (non GCC) compiler,
a guess is made according to rpmmacros l_platform in that case.

It is questionable as to whether these recent optimization changes
on the part of GCC or this package are compatible with each other,
or if either are complete or correct at all. At least applying these
corrections allows this package to build again in most cases test.

michael@317 1 ##
michael@317 2 ## python-pytz.spec -- OpenPKG RPM Package Specification
michael@317 3 ## Copyright (c) 2011 Michael Schloh von Bennewitz <michael@schloh.com>
michael@317 4 ##
michael@317 5 ## Permission to use, copy, modify, and distribute this software for
michael@317 6 ## any purpose with or without fee is hereby granted, provided that
michael@317 7 ## the above copyright notice and this permission notice appear in all
michael@317 8 ## copies.
michael@317 9 ##
michael@317 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@317 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@317 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@317 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@317 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@317 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@317 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@317 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@317 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@317 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@317 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@317 21 ## SUCH DAMAGE.
michael@317 22 ##
michael@317 23
michael@317 24 # package version
michael@317 25 %define V_python 2.3
michael@317 26 %define V_pytz 2011d
michael@317 27
michael@317 28 # package information
michael@317 29 Name: python-pytz
michael@317 30 Summary: Python World Timezone Definitions
michael@317 31 URL: http://pytz.sourceforge.net/
michael@317 32 Vendor: Stuart Bishop
michael@317 33 Packager: Michael Schloh von Bennewitz
michael@317 34 Distribution: Michael Schloh von Bennewitz
michael@317 35 Class: EVAL
michael@317 36 Group: Language
michael@317 37 License: MIT
michael@317 38 Version: %{V_pytz}
michael@317 39 Release: 20110300
michael@317 40
michael@317 41 # list of sources
michael@317 42 Source0: http://pypi.python.org/packages/source/p/pytz/pytz-%{version}.tar.bz2
michael@317 43
michael@317 44 # build information
michael@317 45 Prefix: %{l_prefix}
michael@317 46 BuildRoot: %{l_buildroot}
michael@317 47 BuildPreReq: OpenPKG, openpkg >= 20060823, python >= %{V_python}
michael@317 48 PreReq: OpenPKG, openpkg >= 20060823, python >= %{V_python}
michael@317 49 AutoReq: no
michael@317 50 AutoReqProv: no
michael@317 51
michael@317 52 %description
michael@317 53 Pytz brings the Olson tz database into Python. This library allows
michael@317 54 accurate and cross platform timezone calculations using Python 2.3
michael@317 55 or higher. It also solves the issue of ambiguous times at the end
michael@317 56 of daylight savings, as specified in the Python Library Reference
michael@317 57 section datetime.tzinfo.
michael@317 58
michael@317 59 %track
michael@317 60 prog python-pytz = {
michael@317 61 version = %{version}
michael@317 62 url = http://pypi.python.org/packages/source/p/pytz
michael@317 63 regex = /pytz-(__VER__)\.tar\.bz2
michael@317 64 }
michael@317 65
michael@317 66 %prep
michael@317 67 %setup -q -n pytz-%{version}
michael@317 68
michael@317 69 %build
michael@317 70 %{l_prefix}/bin/python setup.py build
michael@317 71
michael@317 72 %install
michael@317 73 rm -rf $RPM_BUILD_ROOT
michael@317 74 %{l_prefix}/bin/python setup.py install \
michael@317 75 --skip-build \
michael@317 76 --root=$RPM_BUILD_ROOT \
michael@317 77 --prefix=%{l_prefix}
michael@317 78 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
michael@317 79
michael@317 80 %files -f files
michael@317 81
michael@317 82 %clean
michael@317 83 rm -rf $RPM_BUILD_ROOT
michael@317 84

mercurial