From 2e3999586445ebd9bc8fea2571f7159d41034ff5 Mon Sep 17 00:00:00 2001 From: Bulat Gaifullin Date: Thu, 26 Nov 2015 19:34:32 +0300 Subject: [PATCH] Added packaging for fuel-mirror Change-Id: I296a5f356ca805deda28ea984df15c0b63b43a80 Closes-Bug: #1487077 Closes-Bug: #1489506 Implements: blueprint refactor-local-mirror-scripts --- contrib/fuel_mirror/data/centos.yaml | 3 - .../fuel_mirror/common/accessors.py | 8 +- contrib/fuel_mirror/requirements.txt | 4 +- contrib/fuel_mirror/setup.cfg | 8 +- contrib/fuel_mirror/setup_hooks.py | 21 ++++ debian/changelog | 60 +--------- debian/compat | 2 +- debian/conffiles | 6 - debian/control | 62 ++++++++-- debian/copyright | 44 ++++++- debian/fuel-mirror.install | 2 + debian/postinst | 3 - debian/postrm | 10 -- debian/rules | 83 +++++-------- debian/source/format | 1 + requirements.txt | 6 +- setup.cfg | 8 +- setup_hooks.py | 21 ++++ specs/fuel-createmirror.spec | 112 ------------------ specs/fuel-mirror.spec | 96 +++++++++++++++ test-requirements.txt | 2 - 21 files changed, 297 insertions(+), 265 deletions(-) create mode 100644 contrib/fuel_mirror/setup_hooks.py delete mode 100644 debian/conffiles create mode 100644 debian/fuel-mirror.install delete mode 100644 debian/postinst delete mode 100644 debian/postrm create mode 100644 debian/source/format create mode 100644 setup_hooks.py delete mode 100644 specs/fuel-createmirror.spec create mode 100644 specs/fuel-mirror.spec diff --git a/contrib/fuel_mirror/data/centos.yaml b/contrib/fuel_mirror/data/centos.yaml index 6b9b993..18e447d 100644 --- a/contrib/fuel_mirror/data/centos.yaml +++ b/contrib/fuel_mirror/data/centos.yaml @@ -1,6 +1,3 @@ -centos_baseurl: ¢os_baseurl -mos_baseurl: &mos_baseurl - fuel_release_match: version: $openstack_version operating_system: CentOS diff --git a/contrib/fuel_mirror/fuel_mirror/common/accessors.py b/contrib/fuel_mirror/fuel_mirror/common/accessors.py index e2cbc0a..af09c8d 100644 --- a/contrib/fuel_mirror/fuel_mirror/common/accessors.py +++ b/contrib/fuel_mirror/fuel_mirror/common/accessors.py @@ -50,5 +50,11 @@ def get_fuel_api_accessor(address=None, user=None, password=None): # import fuelclient.ClientAPI after configuring # environment variables - from fuelclient import objects + try: + from fuelclient import objects + except ImportError: + raise RuntimeError( + "fuelclient module seems not installed. " + "This action requires it to be available." + ) return objects diff --git a/contrib/fuel_mirror/requirements.txt b/contrib/fuel_mirror/requirements.txt index d07d40a..39bbf46 100644 --- a/contrib/fuel_mirror/requirements.txt +++ b/contrib/fuel_mirror/requirements.txt @@ -6,4 +6,6 @@ pbr>=0.8 Babel>=1.3 cliff>=1.7.0 six>=1.5.2 -packetary +PyYAML>=3.10 +packetary>=0.1.0 +python-fuelclient>=7.0.0 diff --git a/contrib/fuel_mirror/setup.cfg b/contrib/fuel_mirror/setup.cfg index 0a27b38..8f16b8f 100644 --- a/contrib/fuel_mirror/setup.cfg +++ b/contrib/fuel_mirror/setup.cfg @@ -1,5 +1,6 @@ [metadata] name = fuel_mirror +version = 8.0.0 summary = The Utility to create local repositories with packages is required for openstack deployment. description-file = @@ -13,7 +14,7 @@ classifier = Environment :: OpenStack Intended Audience :: Information Technology Intended Audience :: System Administrators - License :: OSI Approved :: Apache Software License + License :: OSI Approved :: GNU General Public License v2 (GPLv2) Operating System :: POSIX :: Linux Programming Language :: Python Programming Language :: Python :: 2 @@ -59,3 +60,8 @@ input_file = locale/fuel_mirror.pot keywords = _ gettext ngettext l_ lazy_gettext mapping_file = babel.cfg output_file = locale/fuel_mirror.pot + +[global] +setup-hooks = + pbr.hooks.setup_hook + setup_hooks.setup_hook diff --git a/contrib/fuel_mirror/setup_hooks.py b/contrib/fuel_mirror/setup_hooks.py new file mode 100644 index 0000000..5b16a78 --- /dev/null +++ b/contrib/fuel_mirror/setup_hooks.py @@ -0,0 +1,21 @@ +# Copyright 2015 Mirantis, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + + +def setup_hook(config): + import pbr + import pbr.packaging + + # this monkey patch is to avoid appending git version to version + pbr.packaging._get_version_from_git = lambda pre_version: pre_version diff --git a/debian/changelog b/debian/changelog index 2929b6a..7d45c0f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,59 +1,5 @@ -fuel-createmirror (8.0-1) experimental; urgency=low +fuel-mirror (8.0.0-1) experimental; urgency=low - * Thu Sep 03 2015 skulanov + * Initial release. - - Bump to version 8.0 - - -- skulanov Thu, 03 Sep 2015 12:35:26 +0300 - -fuel-createmirror (7.0-2) experimental; urgency=low - - * Thu Aug 13 2015 vparakhin - - - Switch MOS DEB repos to new format, update configs from fuel-main - - -- vparakhin Thu, 13 Aug 2015 14:58:48 +0300 - -fuel-createmirror (7.0-1) experimental; urgency=low - - * Fri Aug 07 2015 skulanov - - - Bump version to 7.0. Update code from upstream - - -- skulanov Fri, 07 Aug 2015 17:25:49 +0300 - -fuel-createmirror (6.1-14) experimental; urgency=low - - * Fri Jul 24 2015 aschultz - - - Fixing permisions after rsync of pool data - - -- aschultz Fri, 24 Jul 2015 13:45:00 -0600 - -fuel-createmirror (6.1-13) experimental; urgency=low - - * Thu Jun 11 2015 vparakhin - - - Add sysfsutils package to requirements-deb.txt - - * Fri Jun 5 2015 vparakhin - - - Fix release ID hardcoded in fuel-createmirror - - * Thu Jun 4 2015 vparakhin - - - Change netboot installer path for partial mirror - - * Tue Jun 2 2015 vparakhin - - - Bypass http proxy while accessing Fuel Master node - - * Tue Jun 2 2015 mmosesohn - - - Added proxy info to help - - * Converted from .rpm format to .deb - - - Added fuel-package-updates integration - - -- vparakhin Fri, 22 May 2015 14:58:48 +0300 + -- bgaifullin Fri, 27 Nov 2015 00:28:26 +0300 diff --git a/debian/compat b/debian/compat index 7f8f011..ec63514 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -7 +9 diff --git a/debian/conffiles b/debian/conffiles deleted file mode 100644 index 8fc0140..0000000 --- a/debian/conffiles +++ /dev/null @@ -1,6 +0,0 @@ -/opt/fuel-createmirror-8.0/config/common.cfg -/opt/fuel-createmirror-8.0/config/fuel.cfg -/opt/fuel-createmirror-8.0/config/mos-ubuntu-updatesonly.cfg -/opt/fuel-createmirror-8.0/config/mos-ubuntu.cfg -/opt/fuel-createmirror-8.0/config/requirements-deb.txt -/opt/fuel-createmirror-8.0/config/ubuntu.cfg diff --git a/debian/control b/debian/control index f094c4c..4598767 100644 --- a/debian/control +++ b/debian/control @@ -1,14 +1,54 @@ -Source: fuel-createmirror -Section: admin -Priority: optional +Source: fuel-mirror +Section: Utilities +Priority: extra Maintainer: Mirantis Product -Build-Depends: debhelper (>= 7) -Standards-Version: 3.9.2 +Build-Depends: debhelper (>= 9), + dh-python, + openstack-pkg-tools (>= 23~), + python-all, + python-pbr (>= 0.8), + python-setuptools +Standards-Version: 3.9.6 +Homepage: mirantis.com -Package: fuel-createmirror +Package: fuel-mirror Architecture: all -Depends: ${shlibs:Depends},python,dpkg-dev,openssl,rsync -Description: CLI script for MOS/upstream mirroring - **fuel-createmirror -- utility for creating local mirrors of MOS and - upstream OS repositories - . +Section: python +Depends: python-babel, + python-cliff (>= 1.7.0), + python-packetary (= ${binary:Version}), + python-pbr (>= 0.8), + python-six, + python-yaml, + python-tz, + ${python:Depends} +Recommends: python-fuelclient (>= 7.0.0) +Description: Utility to create RPM and DEB mirror + Provides two commands fuel-mirror and fuel-createmirror. + Second one is for backward compatibility with the previous + generation of the utility. These commands could be used + to create local copies of MOS and upstream deb and rpm + repositories. + +Package: python-packetary +Architecture: all +Depends: createrepo, + python-babel, + python-bintrees (>= 2.0.2), + python-chardet, + python-cliff (>= 1.7.0), + python-debian (>= 0.1.21), + python-eventlet (>= 0.15), + python-lxml, + python-pbr (>= 0.8), + python-six, + python-stevedore (>= 1.1.0), + python-tz, + ${python:Depends} +Description: Library allows to build and clone deb and rpm repos + Provides object model and API for dealing with deb + and rpm repositories. One can use this framework to + implement operations like building repository + from a set of packages, clone repository, find package + dependencies, mix repositories, pull out a subset of + packages into a separate repository, etc. diff --git a/debian/copyright b/debian/copyright index 7d1a3a4..2fa4ac7 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1 +1,43 @@ -Copyright: GPLv2 +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: fuel-mirror +Source: git://github.com/openstack/fuel-mirror.git + +Files: debian/* +Copyright: (c) 2014, Mirantis +License: GPL-2 + +Files: * +Copyright: (c) 2014, Mirantis +License: Apache-2 + +License: Apache-2 + Licensed under the Apache License, Version 2.0 (the "License"); you may not + use this file except in compliance with the License. You may obtain a copy of + the License at: + . + http://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + License for the specific language governing permissions and limitations under + the License. + . + On Debian-based systems the full text of the Apache version 2.0 license can be + found in /usr/share/common-licenses/Apache-2.0. + +License: GPL-2 + Licensed under the GPL License, Version 2.0 (the "License"); you may not + use this file except in compliance with the License. You may obtain a copy of + the License at: + . + http://www.opensource.org/licenses/GPL-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + License for the specific language governing permissions and limitations under + the License. + . + On Debian-based systems the full text of the GPL version 2.0 license can be + found in /usr/share/common-licenses/GPL-2. diff --git a/debian/fuel-mirror.install b/debian/fuel-mirror.install new file mode 100644 index 0000000..e8eabae --- /dev/null +++ b/debian/fuel-mirror.install @@ -0,0 +1,2 @@ +contrib/fuel_mirror/etc/config.yaml /etc/fuel-mirror +contrib/fuel_mirror/scripts/fuel-createmirror /usr/bin/ diff --git a/debian/postinst b/debian/postinst deleted file mode 100644 index 4848a06..0000000 --- a/debian/postinst +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -ln -sf /opt/fuel-createmirror-8.0/fuel-createmirror /usr/bin/ -ln -sf /opt/fuel-createmirror-8.0/config /etc/fuel-createmirror diff --git a/debian/postrm b/debian/postrm deleted file mode 100644 index fcb46e0..0000000 --- a/debian/postrm +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -if [ "$1" = "1" ]; then - rm -f /usr/bin/fuel-createmirror - rm -f /etc/fuel-createmirror - ln -sf /opt/fuel-createmirror-8.0/fuel-createmirror /usr/bin/ - ln -sf /opt/fuel-createmirror-8.0/config /etc/fuel-createmirror -else - rm -f /usr/bin/fuel-createmirror - rm -f /etc/fuel-createmirror -fi diff --git a/debian/rules b/debian/rules index 7ef2c46..21c7f69 100755 --- a/debian/rules +++ b/debian/rules @@ -1,60 +1,39 @@ #!/usr/bin/make -f -# FIXME (skulanov) -# Since we are still building packages with ISO -# we have to define DEB_VERSION_EPOCH_UPSTREAM explicitly -DEB_VERSION_EPOCH_UPSTREAM=8.0 -# otherwise this variable correctly defined below -# include /usr/share/dpkg/pkg-info.mk +PYTHONS:=$(shell pyversions -vr) -export DH_ALWAYS_EXCLUDE=CVS:.git:specs +include /usr/share/openstack-pkg-tools/pkgos.make +export OSLO_PACKAGE_VERSION=$(shell dpkg-parsechangelog | grep Version: | cut -d' ' -f2 | sed -e 's/^[[:digit:]]*://' -e 's/[-].*//' -e 's/~/.0/' | head -n 1) -PACKAGE=$(shell dh_listpackages) +%: + dh $@ --buildsystem=python_distutils --with python2 -build: - dh_testdir - -clean: - dh_testdir - dh_testroot - dh_clean -d - -binary-indep: build - -binary-arch: build - dh_testdir - dh_testroot - dh_prep - dh_installdirs - - dh_installdocs - dh_installchangelogs - -# Copy the packages's files. - mkdir -p debian/$(PACKAGE)/opt/$(PACKAGE)-$(DEB_VERSION_EPOCH_UPSTREAM) - cp fuel-createmirror debian/$(PACKAGE)/opt/$(PACKAGE)-$(DEB_VERSION_EPOCH_UPSTREAM) - cp deb-mirror debian/$(PACKAGE)/opt/$(PACKAGE)-$(DEB_VERSION_EPOCH_UPSTREAM) - cp -r util debian/$(PACKAGE)/opt/$(PACKAGE)-$(DEB_VERSION_EPOCH_UPSTREAM) - cp -r config debian/$(PACKAGE)/opt/$(PACKAGE)-$(DEB_VERSION_EPOCH_UPSTREAM) - cp LICENSE debian/$(PACKAGE)/opt/$(PACKAGE)-$(DEB_VERSION_EPOCH_UPSTREAM) - cp README.md debian/$(PACKAGE)/opt/$(PACKAGE)-$(DEB_VERSION_EPOCH_UPSTREAM) - -# -# If you need to move files around in debian/$(PACKAGE) or do some -# binary patching, do it here -# +override_dh_clean: + rm -rf build + dh_clean -O--buildsystem=python_distutils -# This has been known to break on some wacky binaries. -# dh_strip - dh_compress -# dh_fixperms - dh_makeshlibs - dh_installdeb - -dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb +override_dh_auto_install: + set -e ; for pyvers in $(PYTHONS); do \ + python$$pyvers setup.py install --install-layout=deb \ + --root $(CURDIR)/debian/python-packetary; \ + done + set -e ; cd contrib/fuel_mirror/; \ + for pyvers in $(PYTHONS); do \ + python$$pyvers ./setup.py install --install-layout=deb \ + --root $(CURDIR)/debian/fuel-mirror; \ + done -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary +override_dh_fixperms: + set -e; chmod 755 $(CURDIR)/debian/fuel-mirror/usr/bin/fuel-createmirror + +override_dh_python2: + dh_python2 --no-guessing-deps + +override_dh_installcatalogs: +override_dh_installemacsen override_dh_installifupdown: +override_dh_installinfo override_dh_installmenu override_dh_installmime: +override_dh_installmodules override_dh_installlogcheck: +override_dh_installpam override_dh_installppp override_dh_installudev override_dh_installwm: +override_dh_installxfonts override_dh_gconf override_dh_icons override_dh_perl override_dh_usrlocal: +override_dh_installgsettings: \ No newline at end of file diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..46ebe02 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 26592e7..337a4d0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,12 +2,12 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -pbr>=1.6 +pbr>=0.8 Babel>=1.3 eventlet>=0.15 bintrees>=2.0.2 -chardet>=2.3.0 +chardet>=2.0.1 stevedore>=1.1.0 six>=1.5.2 -python-debian>=0.1.23 +python-debian>=0.1.21 lxml>=3.2 diff --git a/setup.cfg b/setup.cfg index 5aaa750..16d9991 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,6 @@ [metadata] name = packetary +version = 8.0.0 summary = The chain of tools to manage package`s lifecycle. description-file = README.rst @@ -12,7 +13,7 @@ classifier = Environment :: OpenStack Intended Audience :: Information Technology Intended Audience :: System Administrators - License :: OSI Approved :: Apache Software License + License :: OSI Approved :: GNU General Public License v2 (GPLv2) Operating System :: POSIX :: Linux Programming Language :: Python Programming Language :: Python :: 2 @@ -54,3 +55,8 @@ input_file = packetary/locale/packetary.pot keywords = _ gettext ngettext l_ lazy_gettext mapping_file = babel.cfg output_file = packetary/locale/packetary.pot + +[global] +setup-hooks = + pbr.hooks.setup_hook + setup_hooks.setup_hook diff --git a/setup_hooks.py b/setup_hooks.py new file mode 100644 index 0000000..5b16a78 --- /dev/null +++ b/setup_hooks.py @@ -0,0 +1,21 @@ +# Copyright 2015 Mirantis, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + + +def setup_hook(config): + import pbr + import pbr.packaging + + # this monkey patch is to avoid appending git version to version + pbr.packaging._get_version_from_git = lambda pre_version: pre_version diff --git a/specs/fuel-createmirror.spec b/specs/fuel-createmirror.spec deleted file mode 100644 index 16f0943..0000000 --- a/specs/fuel-createmirror.spec +++ /dev/null @@ -1,112 +0,0 @@ -%define name fuel-createmirror -%{!?version: %define version 8.0.0} -%{!?release: %define release 1} - -Name: %{name} -Version: %{version} -Release: %{release}%{?dist} -Summary: CLI script for MOS/upstream mirroring -URL: http://mirantis.com - -Group: Development/Tools -License: GPLv2 -Source0: %{name}-%{version}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot -BuildArch: noarch - -Requires: bash -Requires: docker-io -Requires: dpkg-devel -Requires: fuel-dockerctl -Requires: openssl -Requires: python -Requires: rsync - -%description - **fuel-createmirror -- utility for creating local mirrors of MOS and - upstream OS repositories - -%prep -rm -rf %{name}-%{version} -mkdir %{name}-%{version} -tar xzvf %{SOURCE0} -C %{name}-%{version} - -%build - -%install -rm -rf %{buildroot} -mkdir -p %{buildroot}/opt/%{name}-%{version} -cp %{name}-%{version}/%{name} %{buildroot}/opt/%{name}-%{version} -cp %{name}-%{version}/deb-mirror %{buildroot}/opt/%{name}-%{version} -cp -R %{name}-%{version}/util/ %{buildroot}/opt/%{name}-%{version} -cp -R %{name}-%{version}/config/ %{buildroot}/opt/%{name}-%{version} -cp %{name}-%{version}/LICENSE %{buildroot}/opt/%{name}-%{version} -cp %{name}-%{version}/README.md %{buildroot}/opt/%{name}-%{version} - -%clean -rm -rf %{buildroot} - -%post -ln -sf /opt/%{name}-%{version}/%{name} %{_bindir} -ln -sf /opt/%{name}-%{version}/config %{_sysconfdir}/%{name} - -%postun -if [ "$1" = "1" ]; then - rm -f %{_bindir}/%{name} - rm -f %{_sysconfdir}/%{name} - ln -sf /opt/%{name}-%{version}/%{name} %{_bindir} - ln -sf /opt/%{name}-%{version}/config %{_sysconfdir}/%{name} -else - rm -f %{_bindir}/%{name} - rm -f %{_sysconfdir}/%{name} -fi - -%files -%defattr(-,root,root) -%dir /opt/%{name}-%{version}/ -/opt/%{name}-%{version}/%{name} -/opt/%{name}-%{version}/deb-mirror -/opt/%{name}-%{version}/util/ -%config /opt/%{name}-%{version}/config/ -/opt/%{name}-%{version}/LICENSE -/opt/%{name}-%{version}/README.md - -%changelog -* Thu Sep 03 2015 Sergey Kulanov -- Bump to version 8.0 - -* Thu Aug 13 2015 vparakhin -- Switch MOS DEB repos to new format, update configs from fuel-main - -* Fri Aug 07 2015 Sergey Kulanov -- Bump version to 7.0. Update code from upstream - -* Fri Jul 24 2015 Alex Schultz -- Fixing permisions after rsync of pool data - -* Thu Jun 11 2015 vparakhin -- Add sysfsutils package to requirements - -* Fri Jun 5 2015 vparakhin -- Fix release ID hardcoded in fuel-createmirror - -* Thu Jun 4 2015 vparakhin -- Change netboot installer path for partial mirror - -* Tue Jun 2 2015 vparakhin -- Bypass http proxy while accessing Fuel Master node - -* Tue Jun 2 2015 mmosesohn -- Added proxy info to help - -* Tue May 12 2015 vparakhin -- Added fuel-package-updates integration - -* Thu Apr 30 2015 vparakhin -- Added instructions on repositories setup in Fuel UI - -* Tue Apr 28 2015 vparakhin -- Script name changed to fuel-createmirror - -* Thu Apr 23 2015 vparakhin -- Initial release diff --git a/specs/fuel-mirror.spec b/specs/fuel-mirror.spec new file mode 100644 index 0000000..cdc436e --- /dev/null +++ b/specs/fuel-mirror.spec @@ -0,0 +1,96 @@ +%define name fuel-mirror +%{!?version: %define version 8.0.0} +%{!?release: %define release 1} + +Name: %{name} +Version: %{version} +Release: %{release} +Source0: %{name}-%{version}.tar.gz +Summary: Utility to create RPM and DEB mirror +URL: http://mirantis.com +License: GPLv2 +Group: Utilities +BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot +Prefix: %{_prefix} +BuildRequires: git +BuildRequires: python-setuptools +BuildRequires: python-pbr +BuildArch: noarch + +Requires: python +Requires: python-babel >= 1.3 +Requires: python-cliff >= 1.7.0 +Requires: python-fuelclient >= 7.0.0 +Requires: python-packetary == %{version} +Requires: python-pbr >= 0.8 +Requires: python-six >= 1.5.2 +Requires: PyYAML >= 3.10 +# Workaroud for babel bug +Requires: pytz + +Obsoletes: fuel-createmirror + +%description +Provides two commands fuel-mirror and fuel-createmirror. +Second one is for backward compatibility with the previous +generation of the utility. These commands could be used +to create local copies of MOS and upstream deb and rpm +repositories. + +%package -n python-packetary +Summary: Library that allows to build and clone deb and rpm repositories +Group: Development/Libraries + +Requires: createrepo +Requires: python +Requires: python-babel >= 1.3 +Requires: python-bintrees >= 2.0.2 +Requires: python-chardet >= 2.0.1 +Requires: python-cliff >= 1.7.0 +Requires: python-debian >= 0.1.21 +Requires: python-eventlet >= 0.15 +Requires: python-lxml >= 1.1.23 +Requires: python-pbr >= 0.8 +Requires: python-six >= 1.5.2 +Requires: python-stevedore >= 1.1.0 +# Workaroud for babel bug +Requires: pytz + +%description -n python-packetary +Provides object model and API for dealing with deb +and rpm repositories. One can use this framework to +implement operations like building repository +from a set of packages, clone repository, find package +dependencies, mix repositories, pull out a subset of +packages into a separate repository, etc. + + +%prep +%setup -cq -n %{name}-%{version} + +%build + +cd %{_builddir}/%{name}-%{version} && python setup.py build +cd %{_builddir}/%{name}-%{version}/contrib/fuel_mirror && python setup.py build + +%install +cd %{_builddir}/%{name}-%{version} && python setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT --record=%{_builddir}/%{name}-%{version}/INSTALLED_FILES +cd %{_builddir}/%{name}-%{version}/contrib/fuel_mirror && python setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT --record=%{_builddir}/%{name}-%{version}/contrib/fuel_mirror/INSTALLED_FILES + +mkdir -p %{buildroot}/etc/%{name} +mkdir -p %{buildroot}/usr/bin +mkdir -p %{buildroot}/usr/share/%{name} +install -m 755 %{_builddir}/%{name}-%{version}/contrib/fuel_mirror/scripts/fuel-createmirror %{buildroot}/usr/bin/fuel-createmirror +install -m 755 %{_builddir}/%{name}-%{version}/contrib/fuel_mirror/etc/config.yaml %{buildroot}/etc/%{name}/config.yaml + +%clean +rm -rf $RPM_BUILD_ROOT + +%files -f %{_builddir}/%{name}-%{version}/contrib/fuel_mirror/INSTALLED_FILES +%defattr(0755,root,root) +/usr/bin/fuel-createmirror +%attr(0644,root,root) /etc/%{name}/config.yaml + + +%files -n python-packetary -f %{_builddir}/%{name}-%{version}/INSTALLED_FILES +%defattr(-,root,root) diff --git a/test-requirements.txt b/test-requirements.txt index 684ee0d..0c885d3 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,8 +2,6 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. --r requirements.txt - hacking<0.11,>=0.10.0 coverage>=3.6