diff options
author | biao716.wang <biao716.wang@samsung.com> | 2022-10-28 12:42:00 +0900 |
---|---|---|
committer | biao716.wang <biao716.wang@samsung.com> | 2022-10-28 22:27:21 +0900 |
commit | 1e5da010ab8cb514b495eb7c1d3afce6baec7f4d (patch) | |
tree | 5b76563463d1b46ff399bf99907c54e5ce03e561 /packaging | |
parent | b0bfbb2cab1b0ebdc9657c89de6bc21ab0de173b (diff) | |
download | git-buildpackage-1e5da010ab8cb514b495eb7c1d3afce6baec7f4d.tar.gz git-buildpackage-1e5da010ab8cb514b495eb7c1d3afce6baec7f4d.tar.bz2 git-buildpackage-1e5da010ab8cb514b495eb7c1d3afce6baec7f4d.zip |
port code from python2.x to python3.x
Change-Id: I798c72d07e44839cc5d1e25ec75fca0bd8068567
Signed-off-by: biao716.wang <biao716.wang@samsung.com>
Diffstat (limited to 'packaging')
-rwxr-xr-x | packaging/PKGBUILD | 10 | ||||
-rwxr-xr-x | packaging/git-buildpackage.spec | 81 |
2 files changed, 46 insertions, 45 deletions
diff --git a/packaging/PKGBUILD b/packaging/PKGBUILD index 60ffa9f6..b26bbb70 100755 --- a/packaging/PKGBUILD +++ b/packaging/PKGBUILD @@ -8,7 +8,7 @@ url="https://honk.sigxcpu.org/piki/projects/git-buildpackage/" license=('GPLv2') conflicts=('git-buildpackage') provides=('git-buildpackage') -makedepends=('python2-distribute' 'gtk-doc' 'docbook-sgml' 'docbook-utils') +makedepends=('python3-distribute' 'gtk-doc' 'docbook-sgml' 'docbook-utils') source=(git-buildpackage_${pkgver}.tar.gz) sha256sums=(SKIP) @@ -24,7 +24,7 @@ prepare() build() { cd $srcdir/$pkgbase-$pkgver WITHOUT_NOSETESTS=1 \ - python2 setup.py build + python3 setup.py build # Prepare apidocs epydoc -n git-buildpackage --no-sourcecode -o docs/apidocs/ \ @@ -36,12 +36,12 @@ build() { package_git-buildpackage-common() { depends=('man-db' - 'python2' + 'python3' 'git') optdepends=('pristine-tar: regenerate pristine tarballs') cd $srcdir/$pkgbase-$pkgver WITHOUT_NOSETESTS=1 \ - python2 setup.py install \ + python3 setup.py install \ --root="$pkgdir" \ --prefix=/usr \ -O1 @@ -56,7 +56,7 @@ package_git-buildpackage-rpm() { provides=("tizen-gbp-rpm=20160302") cd $srcdir/$pkgbase-$pkgver WITHOUT_NOSETESTS=1 \ - python2 setup.py install \ + python3 setup.py install \ --root="$pkgdir" \ --prefix=/usr \ -O1 diff --git a/packaging/git-buildpackage.spec b/packaging/git-buildpackage.spec index 880e862b..ef9ca93c 100755 --- a/packaging/git-buildpackage.spec +++ b/packaging/git-buildpackage.spec @@ -1,3 +1,4 @@ +%{!?python3_sitelib: %define python3_sitelib %(python3 -c 'import sysconfig; print(sysconfig.get_paths()["purelib"])')} # Add --without docs rpmbuild option, i.e. docs are enabled by default %bcond_without docs @@ -32,22 +33,22 @@ Source0: %{name}_%{version}.tar.gz %endif %if 0%{?fedora} || 0%{?centos_ver} || 0%{?tizen_version:1} -%define python_pkg_name python +%define python_pkg_name python3 %else -%define python_pkg_name python-base +%define python_pkg_name python3 %endif %if 0%{?tizen_version:1} -%define rpm_python_pkg_name python-rpm +%define rpm_python_pkg_name python3-rpm %else -%define rpm_python_pkg_name rpm-python +%define rpm_python_pkg_name rpm-python3 %endif Requires: %{name}-common = %{version}-%{release} Requires: %{dpkg_pkg_name} Requires: %{devscripts_pkg_name} -BuildRequires: python -BuildRequires: python-setuptools +BuildRequires: python3 +BuildRequires: python3-setuptools %if %{with docs} BuildRequires: docbook-utils @@ -59,8 +60,8 @@ BuildRequires: perl-podlators %endif %if 0%{?do_unittests} -BuildRequires: python-coverage -BuildRequires: python-nose +BuildRequires: python3-coverage +BuildRequires: python3-nose BuildRequires: git-core BuildRequires: %{man_pkg_name} BuildRequires: %{dpkg_pkg_name} @@ -150,7 +151,7 @@ Debian and the RPM tool set. %build -WITHOUT_NOSETESTS=1 %{__python} ./setup.py build +WITHOUT_NOSETESTS=1 python3 ./setup.py build %if %{with docs} # Prepare apidocs @@ -167,14 +168,14 @@ HAVE_SGML2X=0 make -C docs/ GIT_CEILING_DIRECTORIES=%{_builddir} \ GIT_AUTHOR_EMAIL=rpmbuild@example.com GIT_AUTHOR_NAME=rpmbuild \ GIT_COMMITTER_NAME=$GIT_AUTHOR_NAME GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL \ - %{__python} setup.py nosetests + python3 setup.py nosetests %endif %install rm -rf %{buildroot} -WITHOUT_NOSETESTS=1 %{__python} ./setup.py install --root=%{buildroot} --prefix=/usr -rm -rf %{buildroot}%{python_sitelib}/*info +WITHOUT_NOSETESTS=1 python3 ./setup.py install --root=%{buildroot} --prefix=/usr +rm -rf %{buildroot}%{python3_sitelib}/*info %if %{with docs} # Install man pages @@ -197,14 +198,14 @@ cat > files.list << EOF %{_bindir}/git-import-orig %{_bindir}/git-pbuilder %{_bindir}/gbp-create-remote-repo -%{python_sitelib}/gbp/deb -%{python_sitelib}/gbp/scripts/pq.py* -%{python_sitelib}/gbp/scripts/buildpackage.py* -%{python_sitelib}/gbp/scripts/dch.py* -%{python_sitelib}/gbp/scripts/import_dsc.py* -%{python_sitelib}/gbp/scripts/import_dscs.py* -%{python_sitelib}/gbp/scripts/import_orig.py* -%{python_sitelib}/gbp/scripts/create_remote_repo.py* +%{python3_sitelib}/gbp/deb +%{python3_sitelib}/gbp/scripts/pq.py* +%{python3_sitelib}/gbp/scripts/buildpackage.py* +%{python3_sitelib}/gbp/scripts/dch.py* +%{python3_sitelib}/gbp/scripts/import_dsc.py* +%{python3_sitelib}/gbp/scripts/import_dscs.py* +%{python3_sitelib}/gbp/scripts/import_orig.py* +%{python3_sitelib}/gbp/scripts/create_remote_repo.py* EOF %if %{with docs} @@ -237,20 +238,20 @@ done %{_bindir}/gbp %{_bindir}/gbp-clone %{_bindir}/gbp-pull -%dir %{python_sitelib}/gbp -%dir %{python_sitelib}/gbp/git -%dir %{python_sitelib}/gbp/pkg -%dir %{python_sitelib}/gbp/scripts -%dir %{python_sitelib}/gbp/scripts/common -%{python_sitelib}/gbp/*.py* -%{python_sitelib}/gbp/scripts/__init__.py* -%{python_sitelib}/gbp/scripts/clone.py* -%{python_sitelib}/gbp/scripts/config.py* -%{python_sitelib}/gbp/scripts/pull.py* -%{python_sitelib}/gbp/scripts/supercommand.py* -%{python_sitelib}/gbp/scripts/common/*.py* -%{python_sitelib}/gbp/git/*.py* -%{python_sitelib}/gbp/pkg/*.py* +%dir %{python3_sitelib}/gbp +%dir %{python3_sitelib}/gbp/git +%dir %{python3_sitelib}/gbp/pkg +%dir %{python3_sitelib}/gbp/scripts +%dir %{python3_sitelib}/gbp/scripts/common +%{python3_sitelib}/gbp/*.py* +%{python3_sitelib}/gbp/scripts/__init__.py* +%{python3_sitelib}/gbp/scripts/clone.py* +%{python3_sitelib}/gbp/scripts/config.py* +%{python3_sitelib}/gbp/scripts/pull.py* +%{python3_sitelib}/gbp/scripts/supercommand.py* +%{python3_sitelib}/gbp/scripts/common/*.py* +%{python3_sitelib}/gbp/git/*.py* +%{python3_sitelib}/gbp/pkg/*.py* %config %{_sysconfdir}/git-buildpackage %if %{with docs} %{_mandir}/man1/gbp.1* @@ -263,10 +264,10 @@ done %files rpm %defattr(-,root,root,-) -%dir %{python_sitelib}/gbp/rpm +%dir %{python3_sitelib}/gbp/rpm %{_bindir}/*rpm* -%{python_sitelib}/gbp/scripts/*rpm*.py* -%{python_sitelib}/gbp/rpm/*py* +%{python3_sitelib}/gbp/scripts/*rpm*.py* +%{python3_sitelib}/gbp/rpm/*py* %if %{with docs} %{_mandir}/man1/gbp-buildpackage-rpm.1* %{_mandir}/man1/gbp-import-orig-rpm.1* @@ -278,9 +279,9 @@ done %files bb %defattr(-,root,root,-) -%dir %{python_sitelib}/gbp/bb -%{python_sitelib}/gbp/scripts/*bb*.py* -%{python_sitelib}/gbp/bb/*py* +%dir %{python3_sitelib}/gbp/bb +%{python3_sitelib}/gbp/scripts/*bb*.py* +%{python3_sitelib}/gbp/bb/*py* %if %{with docs} |