[master 4/16] Build the python3-blivet subpackage

M4rtinK installerbot-noreply at redhat.com
Fri Apr 10 13:38:10 UTC 2015


From: Vratislav Podzimek <vpodzime at redhat.com>

---
 Makefile           |  9 +++++----
 python-blivet.spec | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 91a038e..9f60551 100644
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,7 @@ RC_RELEASE ?= $(shell date -u +0.1.%Y%m%d%H%M%S)
 RELEASE_TAG=$(PKGNAME)-$(VERSION)-$(RELEASE)
 VERSION_TAG=$(PKGNAME)-$(VERSION)
 
+PYTHON=python2
 ZANATA_PULL_ARGS = --transdir ./po/
 ZANATA_PUSH_ARGS = --srcdir ./po/ --push-type source --force
 
@@ -27,7 +28,7 @@ po-empty:
 
 test:
 	@echo "*** Running unittests ***"
-	PYTHONPATH=.:tests/ python -m unittest discover -v -s tests/ -p '*_test.py'
+	PYTHONPATH=.:tests/ $(PYTHON) -m unittest discover -v -s tests/ -p '*_test.py'
 
 coverage:
 	@which coverage || (echo "*** Please install python-coverage ***"; exit 2)
@@ -38,10 +39,10 @@ coverage:
 clean:
 	-rm *.tar.gz blivet/*.pyc blivet/*/*.pyc ChangeLog
 	$(MAKE) -C po clean
-	python setup.py -q clean --all
+	$(PYTHON) setup.py -q clean --all
 
 install:
-	python setup.py install --root=$(DESTDIR)
+	$(PYTHON) setup.py install --root=$(DESTDIR)
 	$(MAKE) -C po install
 
 ChangeLog:
@@ -79,7 +80,7 @@ local: po-pull
 	@rm -rf $(PKGNAME)-$(VERSION).tar.gz
 	@rm -rf /tmp/$(PKGNAME)-$(VERSION) /tmp/$(PKGNAME)
 	@dir=$$PWD; cp -a $$dir /tmp/$(PKGNAME)-$(VERSION)
-	@cd /tmp/$(PKGNAME)-$(VERSION) ; python setup.py -q sdist
+	@cd /tmp/$(PKGNAME)-$(VERSION) ; $(PYTHON) setup.py -q sdist
 	@cp /tmp/$(PKGNAME)-$(VERSION)/dist/$(PKGNAME)-$(VERSION).tar.gz .
 	@rm -rf /tmp/$(PKGNAME)-$(VERSION)
 	@echo "The archive is in $(PKGNAME)-$(VERSION).tar.gz"
diff --git a/python-blivet.spec b/python-blivet.spec
index 3444510..6681ddb 100644
--- a/python-blivet.spec
+++ b/python-blivet.spec
@@ -8,6 +8,7 @@ License: LGPLv2+
 Group: System Environment/Libraries
 %define realname blivet
 Source0: http://github.com/dwlehman/blivet/archive/%{realname}-%{version}.tar.gz
+%global with_python3 1
 
 # Versions of required components (done so we make sure the buildrequires
 # match the requires versions of things).
@@ -22,6 +23,10 @@ BuildArch: noarch
 BuildRequires: gettext
 BuildRequires: python-setuptools
 
+%if 0%{with_python3}
+BuildRequires: python3-devel python3-setuptools
+%endif
+
 Requires: python
 Requires: python-six
 Requires: python-kickstart >= %{pykickstartver}
@@ -32,6 +37,7 @@ Requires: pyparted >= %{pypartedver}
 Requires: dosfstools
 Requires: e2fsprogs >= %{e2fsver}
 Requires: lsof
+Requires: libselinux-python
 Requires: libblockdev >= %{libblockdevver}
 Requires: libblockdev-plugins-all >= %{libblockdevver}
 
@@ -39,9 +45,36 @@ Requires: libblockdev-plugins-all >= %{libblockdevver}
 The python-blivet package is a python module for examining and modifying
 storage configuration.
 
+%if 0%{with_python3}
+%package -n python3-%{realname}
+Summary: A python3 package for examining and modifying storage configuration.
+Requires: python3
+Requires: python3-six
+Requires: python3-kickstart
+Requires: python3-pyudev
+Requires: parted >= %{partedver}
+Requires: python3-pyparted >= %{pypartedver}
+Requires: libselinux-python3
+Requires: libblockdev >= %{libblockdevver}
+Requires: libblockdev-plugins-all >= %{libblockdevver}
+Requires: util-linux >= %{utillinuxver}
+Requires: dosfstools
+Requires: e2fsprogs >= %{e2fsver}
+Requires: lsof
+
+%description -n python3-%{realname}
+The python3-%{realname} is a python3 package for examining and modifying storage
+configuration.
+%endif
+
 %prep
 %setup -q -n %{realname}-%{version}
 
+%if 0%{?with_python3}
+rm -rf %{py3dir}
+cp -a . %{py3dir}
+%endif
+
 %build
 make
 
@@ -50,12 +83,25 @@ rm -rf %{buildroot}
 make DESTDIR=%{buildroot} install
 %find_lang %{realname}
 
+%if 0%{?with_python3}
+pushd %{py3dir}
+make PYTHON=%{__python3} DESTDIR=%{buildroot} install
+popd
+%endif
+
 %files -f %{realname}.lang
 %defattr(-,root,root,-)
 %license COPYING
 %doc README ChangeLog examples
 %{python_sitelib}/*
 
+%if 0%{?with_python3}
+%files -n python3-%{realname}
+%license COPYING
+%doc README ChangeLog examples
+%{python3_sitelib}/*
+%endif
+
 %changelog
 * Fri Mar 27 2015 Brian C. Lane <bcl at redhat.com> - 1.2-1
 - Fix pylint unused variable warnings (vtrefny)


-- 
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/c0b143353219999f1926c75c1ea9e5d6038ce3f8


More information about the anaconda-patches mailing list