diff --git a/MANIFEST.in b/MANIFEST.in index e4945b07..d5a43774 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,4 @@ -include README.md RELEASENOTES.md +include README.md RELEASENOTES.md COPYING recursive-include docs *.md recursive-include samples *.py recursive-include tests *.py diff --git a/README.rpm-generation b/README.rpm-generation new file mode 100644 index 00000000..b159b39f --- /dev/null +++ b/README.rpm-generation @@ -0,0 +1,43 @@ +* Notes related to RPM generation + +You can generate an RPM from the upstream pyrax source tree by running: + +$ make rpms + +This will generate a distribution tarball by running: + +$ python setup.py sdist + +Code within setup.py creates a SPEC file with the version and release +replaced from the SPEC template "python-pyrax.spec.in" + +Details of how the release string is generated can be found in setup.py. + +Generally speaking, during development the release string should be "0". +This allows frequent rebuilds of the RPMs and will generate a timestamp +based release that is always "newer" for more recent rebuilds. + +When doing a formal upstream release the "release" string can be set +to any non-zero value. This will turn off the generation of additional +time and git-based release string content. + +* Snapshot Packages + +If you need to generate an RPM that is not based on an entirely unmodified +upstream source release, you should set "snapshot_release" to True. +This will generate a release suffix based on the date and git hash that +meets the Fedora package guidelines presented here: + +http://fedoraproject.org/wiki/Packaging:NamingGuidelines#Snapshot_packages + +(Note from imcleod@redhat.com - Monday, July 28, 2014 + +We are working to get pyrax into the Fedora package set. Our submission +is in bugzilla here: + +https://bugzilla.redhat.com/show_bug.cgi?id=1123044 + +Until we can coordinate releases regularly with upstream, I will be doing +snapshot package generation as described above. I will fork upstream at +the point of release and then set the RPM version and release details as +needed to generate a package.) diff --git a/pyrax.spec.in b/pyrax.spec.in deleted file mode 100644 index 9ee13598..00000000 --- a/pyrax.spec.in +++ /dev/null @@ -1,56 +0,0 @@ -%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} - -Name: pyrax -Version: @VERSION@ -Release: @RELEASE@%{?dist} -Summary: Python language bindings for OpenStack Clouds - -License: ASLv2 -URL: https://github.com/rackerlabs/pyrax -Source0: %{name}-%{version}.tar.gz - -BuildArch: noarch -BuildRequires: python-setuptools -BuildRequires: python-mock -Requires: python-novaclient >= 2.13.0 -Requires: python-swiftclient >= 1.5.0 -Requires: python-httplib2 -Requires: python-keyring - - -%description -A library for working with most OpenStack-based cloud deployments, though it -originally targeted the Rackspace public cloud. For example, the code for -cloudfiles contains the ability to publish your content on Rackspace's CDN -network, even though CDN support is not part of OpenStack Swift. But if you -don't use any of the CDN-related code, your app will work fine on any -standard Swift deployment. - - -%package rackspace -Summary: Bring in the bits that work with Rackspace's Cloud -Requires: pyrax -Requires: rackspace-novaclient - -%description rackspace -The Rackspace Cloud has additional libraries that are required to access -all the things. This package just makes sure they are available for pyrax. - -%prep -%setup -q - - -%build - - -%install -rm -rf $RPM_BUILD_ROOT -%{__python} setup.py install --root $RPM_BUILD_ROOT - -%files -%{python_sitelib}/* -#%{_bindir}/ - -%changelog -* Fri Sep 6 2013 Greg Swift - 1.5.0-1 -- Initial spec diff --git a/pyrax/__init__.py b/pyrax/__init__.py index b63526e5..0f6a385e 100755 --- a/pyrax/__init__.py +++ b/pyrax/__init__.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c)2012 Rackspace US, Inc. diff --git a/pyrax/autoscale.py b/pyrax/autoscale.py index 91fab8e3..e510057e 100644 --- a/pyrax/autoscale.py +++ b/pyrax/autoscale.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c)2013 Rackspace US, Inc. diff --git a/pyrax/base_identity.py b/pyrax/base_identity.py index 580decbc..6c717e9d 100644 --- a/pyrax/base_identity.py +++ b/pyrax/base_identity.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- diff --git a/pyrax/client.py b/pyrax/client.py index 0b8ab0a3..9b6472bd 100644 --- a/pyrax/client.py +++ b/pyrax/client.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2010 Jacob Kaplan-Moss diff --git a/pyrax/cloudblockstorage.py b/pyrax/cloudblockstorage.py index 9d13678a..86dd18dd 100644 --- a/pyrax/cloudblockstorage.py +++ b/pyrax/cloudblockstorage.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c)2012 Rackspace US, Inc. diff --git a/pyrax/clouddatabases.py b/pyrax/clouddatabases.py index 0350c54a..dcb61907 100644 --- a/pyrax/clouddatabases.py +++ b/pyrax/clouddatabases.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c)2012 Rackspace US, Inc. diff --git a/pyrax/clouddns.py b/pyrax/clouddns.py index f2160595..5e0cd120 100644 --- a/pyrax/clouddns.py +++ b/pyrax/clouddns.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c)2012 Rackspace US, Inc. diff --git a/pyrax/cloudloadbalancers.py b/pyrax/cloudloadbalancers.py index 1af39642..f61b1313 100644 --- a/pyrax/cloudloadbalancers.py +++ b/pyrax/cloudloadbalancers.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c)2012 Rackspace US, Inc. diff --git a/pyrax/cloudmonitoring.py b/pyrax/cloudmonitoring.py index b1b5489a..07e02c40 100644 --- a/pyrax/cloudmonitoring.py +++ b/pyrax/cloudmonitoring.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c)2013 Rackspace US, Inc. diff --git a/pyrax/cloudnetworks.py b/pyrax/cloudnetworks.py index 43713d62..1484a75c 100644 --- a/pyrax/cloudnetworks.py +++ b/pyrax/cloudnetworks.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c)2013 Rackspace US, Inc. diff --git a/pyrax/exceptions.py b/pyrax/exceptions.py index c73af611..8846e2ad 100644 --- a/pyrax/exceptions.py +++ b/pyrax/exceptions.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c)2012 Rackspace US, Inc. diff --git a/pyrax/fakes.py b/pyrax/fakes.py index 45909007..d36fbf05 100644 --- a/pyrax/fakes.py +++ b/pyrax/fakes.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- import json import os diff --git a/pyrax/identity/__init__.py b/pyrax/identity/__init__.py index f5ae2162..e53c0d93 100644 --- a/pyrax/identity/__init__.py +++ b/pyrax/identity/__init__.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- import glob diff --git a/pyrax/identity/keystone_identity.py b/pyrax/identity/keystone_identity.py index 323dcc40..fe9893f6 100644 --- a/pyrax/identity/keystone_identity.py +++ b/pyrax/identity/keystone_identity.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import diff --git a/pyrax/identity/rax_identity.py b/pyrax/identity/rax_identity.py index 741bca38..648197d9 100644 --- a/pyrax/identity/rax_identity.py +++ b/pyrax/identity/rax_identity.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import diff --git a/pyrax/image.py b/pyrax/image.py index c5c61bb7..3f1fca68 100644 --- a/pyrax/image.py +++ b/pyrax/image.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c)2014 Rackspace US, Inc. diff --git a/pyrax/object_storage.py b/pyrax/object_storage.py index 5e47d9bf..815da17c 100644 --- a/pyrax/object_storage.py +++ b/pyrax/object_storage.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2014 Rackspace diff --git a/pyrax/queueing.py b/pyrax/queueing.py index bd913595..3199b172 100644 --- a/pyrax/queueing.py +++ b/pyrax/queueing.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c)2012 Rackspace US, Inc. diff --git a/pyrax/utils.py b/pyrax/utils.py index 88e19c7b..f71ae09f 100644 --- a/pyrax/utils.py +++ b/pyrax/utils.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function @@ -712,7 +711,37 @@ def import_class(import_str): __import__(mod_str) return getattr(sys.modules[mod_str], class_str) - +# Code below is originally from django +# Django is 3-clause BSD, which we'll duplicate here to be safe +# +# Copyright (c) Django Software Foundation and individual contributors. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# 3. Neither the name of Django nor the names of its contributors may be used +# to endorse or promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# # http://code.activestate.com/recipes/ # 577257-slugify-make-a-string-usable-in-a-url-or-filename/ def slugify(value): diff --git a/pyrax/version.py b/pyrax/version.py index ab7d7141..0e6eb431 100644 --- a/pyrax/version.py +++ b/pyrax/version.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- -version = "1.9.0" +version = "1.9.1" diff --git a/python-pyrax.spec.in b/python-pyrax.spec.in new file mode 100644 index 00000000..589629c6 --- /dev/null +++ b/python-pyrax.spec.in @@ -0,0 +1,64 @@ +# The python2 defines are missing in RHEL6 +%if 0%{?rhel} == 6 +%define __python2 %{__python} +%define python2_sitelib %{python_sitelib} +%endif + +Name: python-pyrax +Version: @VERSION@ +Release: @RELEASE@%{?dist} +Summary: Python language bindings for OpenStack Clouds + + +License: ASL 2.0 +Source0: http://imcleod.fedorapeople.org/src/pyrax/pyrax-%{version}.tar.gz +URL: https://github.com/rackspace/pyrax + +# Earlier upstream RPMs had the name pyrax - provide this for compatibility +Provides: pyrax = %{version} +BuildArch: noarch +BuildRequires: python-setuptools +BuildRequires: python-mock +BuildRequires: python2-devel +Requires: python-novaclient >= 2.13.0 +Requires: python-keyring + + +%description +A library for working with most OpenStack-based cloud deployments, though it +originally targeted the Rackspace public cloud. For example, the code for +cloudfiles contains the ability to publish your content on Rackspace's CDN +network, even though CDN support is not part of OpenStack Swift. But if you +don't use any of the CDN-related code, your app will work fine on any +standard Swift deployment. + +%prep +%setup -q -n pyrax-%{version} + + +%build + + +%install +rm -rf $RPM_BUILD_ROOT +%{__python2} setup.py install --root $RPM_BUILD_ROOT + +%files +%doc README COPYING samples docs +%{python2_sitelib}/* + +%changelog +* Tue Jul 29 2014 Ian McLeod - 1.9.0-3 +- SPEC change to add missing macros for EPEL 6 builds + +* Mon Jul 28 2014 Ian McLeod - 1.9.0-2 +- Remove obsolete httplib requirement from SPEC file +- Remove #! execution headers for non-executable components [BZ1123044] +- add inline license for slugify() function to satisfy 3-clause BSD requirements from django [BZ1123044] +- misc additional SPEC change to comply with Fedora package guidelines [BZ1123044] + +* Thu Jul 24 2014 Ian McLeod - 1.9.0-1 +- Pull in upstream 1.9.0 release + +* Fri Sep 6 2013 Greg Swift - 1.5.0-1 +- Initial spec diff --git a/setup.py b/setup.py index 941c891e..afde88ce 100755 --- a/setup.py +++ b/setup.py @@ -23,6 +23,10 @@ # Set to another value when cutting official release RPMS, then change back to # zero for the next development cycle release = '0' +# At the moment we are doing this in a fork so every release is strictly speaking +# a snapshot. Set this to false _and_ set above release to a non-zero value to +# get short "normal" release strings +snapshot_release = False class sdist(_sdist): """ custom sdist command, to prep pyrax.spec file """ @@ -37,10 +41,12 @@ def run(self): stdout=subprocess.PIPE).communicate()[0].strip() date = time.strftime("%Y%m%d%H%M%S", time.gmtime()) git_release = "%sgit%s" % (date, git_head) + shortdate = time.strftime("%Y%m%d", time.gmtime()) + snapshot_git_release = "%sgit%s" % (shortdate, git_head) # Expand macros in pyrax.spec.in - spec_in = open('pyrax.spec.in', 'r') - spec = open('pyrax.spec', 'w') + spec_in = open('python-pyrax.spec.in', 'r') + spec = open('python-pyrax.spec', 'w') for line in spec_in.xreadlines(): if "@VERSION@" in line: line = line.replace("@VERSION@", version) @@ -48,6 +54,8 @@ def run(self): # If development release, include date+githash in %{release} if release.startswith('0'): release += '.' + git_release + elif snapshot_release: + release += '.' + snapshot_git_release line = line.replace("@RELEASE@", release) spec.write(line) spec_in.close()