+++ /dev/null
-pkgbase='git-buildpackage'
-pkgname=('git-buildpackage-rpm' 'git-buildpackage-common' 'git-buildpackage-doc')
-pkgver=0.6.27
-pkgrel=0
-pkgdesc="Tools from Debian to integrate the package build system with Git"
-arch=(any)
-url="https://honk.sigxcpu.org/piki/projects/git-buildpackage/"
-license=('GPLv2')
-conflicts=('git-buildpackage')
-provides=('git-buildpackage')
-makedepends=('python3-distribute' 'gtk-doc' 'docbook-sgml' 'docbook-utils')
-source=(git-buildpackage_${pkgver}.tar.gz)
-sha256sums=(SKIP)
-
-prepare()
-{
- cd "$srcdir/$pkgbase-${pkgver}"
- for patch_file in $(find ../../ -maxdepth 1 -name '*.patch' |sort)
- do
- patch -p1 -i $patch_file
- done
-}
-
-build() {
- cd $srcdir/$pkgbase-$pkgver
- WITHOUT_NOSETESTS=1 \
- python3 setup.py build
-
-# Prepare apidocs
- epydoc -n git-buildpackage --no-sourcecode -o docs/apidocs/ \
- gbp*.py git*.py gbp/
-
-# HTML docs
- HAVE_SGML2X=0 make -C docs/
-}
-
-package_git-buildpackage-common() {
- depends=('man-db'
- 'python3'
- 'git')
- optdepends=('pristine-tar: regenerate pristine tarballs')
- cd $srcdir/$pkgbase-$pkgver
- WITHOUT_NOSETESTS=1 \
- python3 setup.py install \
- --root="$pkgdir" \
- --prefix=/usr \
- -O1
- rm $pkgdir/usr/lib/python*/site-packages/*info -rf
- rm $pkgdir/usr/bin/*rpm*
- rm $pkgdir/usr/lib/python*/site-packages/gbp/rpm -rf
- rm $pkgdir/usr/lib/python*/site-packages/gbp/scripts/*rpm*.py* -rf
-}
-
-package_git-buildpackage-rpm() {
- depends=("git-buildpackage-common=$pkgver-$pkgrel" "rpm")
- provides=("tizen-gbp-rpm=20160302")
- cd $srcdir/$pkgbase-$pkgver
- WITHOUT_NOSETESTS=1 \
- python3 setup.py install \
- --root="$pkgdir" \
- --prefix=/usr \
- -O1
- rm $pkgdir/usr/lib/python*/site-packages/*info -rf
- rm -rf $pkgdir/etc
- find $pkgdir/usr/bin -mindepth 1 -maxdepth 1 ! -name '*rpm*' -delete
- find $pkgdir/usr/lib/python*/site-packages/gbp -mindepth 1 -maxdepth 1 -type f -o -type d ! -name rpm -a ! -name scripts |xargs rm -rf
- find $pkgdir/usr/lib/python*/site-packages/gbp/scripts -mindepth 1 -maxdepth 1 ! -name '*rpm*.py*' |xargs rm -rf
-}
-
-package_git-buildpackage-doc() {
- cd $srcdir/$pkgbase-$pkgver
-# Install man pages
- mandir=/usr/share/man
- install -d ${pkgdir}/${mandir}/man1 ${pkgdir}/${mandir}/man5
- install docs/*.1 ${pkgdir}/${mandir}/man1
- install docs/*.5 ${pkgdir}/${mandir}/man5
-
-# Install html documentation
- mkdir -p ${pkgdir}/${docdir}/${pkgbase}
- cp -r docs/manual-html ${pkgdir}/${docdir}/${pkgbase}
- cp -r docs/apidocs ${pkgdir}/${docdir}/${pkgbase}
-}
-# vim:set ts=2 sw=2 et:
%{!?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
-#current disable docs.
-%bcond_with docs
+%bcond_without docs
+%if 0%{?centos_ver} && 0%{?centos_ver} >= 7
+%define __python /usr/bin/python3
+%endif
+%if 0%{?centos_ver} && 0%{?centos_ver} == 7
+%define __python3 /usr/bin/python3
+%endif
Name: git-buildpackage
Summary: Build packages from git
URL: https://honk.sigxcpu.org/piki/projects/git-buildpackage/
Source0: %{name}_%{version}.tar.gz
-
# Conditional package names for requirements
-%if 0%{?fedora} || 0%{?centos_ver}
+%if 0%{?fedora} || 0%{?centos_ver} >= 7
+%define dpkg_pkg_name dpkg-dev
+%else
+%if 0%{?centos_ver}
%define dpkg_pkg_name dpkg-devel
%else
%define dpkg_pkg_name dpkg
%endif
-
-%if 0%{?suse_version} && 0%{?suse_version} < 1230
-%define devscripts_pkg_name devscripts-fixes
-%else
-%define devscripts_pkg_name devscripts
%endif
%if 0%{?fedora}
%define man_pkg_name man
%endif
-%if 0%{?fedora} || 0%{?centos_ver} || 0%{?tizen_version:1}
-%define python_pkg_name python3
+%if 0%{?suse_version}
+%define python_pkg_name python-base
%else
%define python_pkg_name python3
%endif
%if 0%{?tizen_version:1}
-%define rpm_python_pkg_name python3-rpm
+%define rpm_python_pkg_name python-rpm
+%else
+%if 0%{?centos_ver} && 0%{?centos_ver} == 7
+%define rpm_python_pkg_name rpm-python
%else
%define rpm_python_pkg_name python3-rpm
%endif
+%endif
Requires: %{name}-common = %{version}-%{release}
Requires: %{dpkg_pkg_name}
-Requires: %{devscripts_pkg_name}
+%if 0%{?fedora} || 0%{?centos_ver} && 0%{?centos_ver} == 7
+Requires: devscripts
+%endif
BuildRequires: python3
BuildRequires: python3-setuptools
%if %{with docs}
+%if 0%{?centos_ver} && 0%{?centos_ver} >= 8
+BuildRequires: docbook2X
+%else
+%if 0%{?centos_ver} && 0%{?centos_ver} == 7
BuildRequires: docbook-utils
+%else
+BuildRequires: docbook2x
+%endif
+%endif
BuildRequires: gtk-doc
-BuildRequires: epydoc
+%if 0%{?suse_version}
+BuildRequires: libxslt-tools
+%endif
%if 0%{?fedora}
BuildRequires: perl-podlators
%endif
%if 0%{?do_unittests}
BuildRequires: python3-coverage
+BuildRequires: python3-mock
BuildRequires: python3-nose
BuildRequires: git-core
BuildRequires: %{man_pkg_name}
BuildRequires: %{dpkg_pkg_name}
+BuildRequires: devscripts
BuildRequires: rpm-build
BuildRequires: %{rpm_python_pkg_name}
BuildRequires: pristine-tar
BuildRequires: unzip
-BuildRequires: libzip
+BuildRequires: /usr/bin/zipmerge
BuildRequires: gnupg
# Missing dep of dpkg in openSUSE
%if 0%{?suse_version}
Requires: git-core
Requires: %{man_pkg_name}
Requires: %{python_pkg_name}
-Requires: python3-python-dateutil
-%if 0%{?suse_version} || 0%{?tizen_version:1}
-Recommends: pristine-tar
-Recommends: unzip
-Recommends: libzip
-%else
-Requires: pristine-tar
+Requires: python3-setuptools
+Requires: python3-dateutil
+%if 0%{?centos_ver} && 0%{?centos_ver} <= 7
Requires: unzip
-Requires: libzip
+Requires: /usr/bin/zipmerge
+%else
+Recommends: unzip
+Recommends: /usr/bin/zipmerge
+Recommends: pristine-tar
%endif
%description common
Requires: %{name}-common = %{version}-%{release}
Requires: rpm
Requires: %{rpm_python_pkg_name}
-%if 0%{?suse_version} || 0%{?tizen_version:1}
-Recommends: rpm-build
-%else
+%if 0%{?centos_ver} && 0%{?centos_ver} <= 7
Requires: rpm-build
+%else
+Recommends: rpm-build
%endif
-Provides: tizen-gbp-rpm = 20231130
+Provides: tizen-gbp-rpm = 20240328
%description rpm
Set of tools from Debian that integrate the package build system with Git.
This package contains the tools for building RPM packages.
-
-%package bb
-Summary: Build with BitBake from git
-Group: Development/Tools/Building
-Requires: %{name}-common = %{version}-%{release}
-Requires: %{name}-rpm = %{version}-%{release}
-%if 0%{?suse_version} || 0%{?tizen_version:1}
-Recommends: bitbake
-%endif
-
-%description bb
-Set of tools from Debian that integrate the package build system with Git.
-This package contains the tools for building with the BitBake tool.
-
-
%if %{with docs}
%package doc
Summary: Documentation for the git-buildpackage suite
%setup -q -n %{name}-%{version}
-
%build
WITHOUT_NOSETESTS=1 %{__python3} ./setup.py build
%if %{with docs}
-# Prepare apidocs
-epydoc -n git-buildpackage --no-sourcecode -o docs/apidocs/ \
- gbp*.py git*.py gbp/
-
# HTML docs
HAVE_SGML2X=0 make -C docs/
%endif
%install
rm -rf %{buildroot}
-WITHOUT_NOSETESTS=1 %{__python3} ./setup.py install --root=%{buildroot} --prefix=/usr
-rm -rf %{buildroot}%{python3_sitelib}/*info
-
-#remove __pycache directory
-find %{buildroot}%{python3_sitelib} -name "__pycache__" | xargs rm -rfv
+DEB_PYTHON_INSTALL_LAYOUT=deb_system WITHOUT_NOSETESTS=1 %{__python3} ./setup.py install --root=%{buildroot} --prefix=/usr --install-lib=%{python3_sitelib}
+find %{buildroot} -name __pycache__ | xargs -r rm -r
+mkdir -p %{buildroot}/usr/share/%{name}
+mv %{buildroot}/usr/bin/gbp-builder-mock %{buildroot}/usr/share/%{name}/
+mkdir -p %{buildroot}/%{_sysconfdir}/git-buildpackage/
+mv %{buildroot}/usr/share/%{name}/gbp.conf %{buildroot}/%{_sysconfdir}/git-buildpackage/
%if %{with docs}
# Install man pages
# Install html documentation
mkdir -p %{buildroot}%{_docdir}/%{name}
cp -r docs/manual-html %{buildroot}%{_docdir}/%{name}
-cp -r docs/apidocs %{buildroot}%{_docdir}/%{name}
%endif
cat > files.list << EOF
-%{_bindir}/gbp-pq
-%{_bindir}/git-buildpackage
-%{_bindir}/git-dch
-%{_bindir}/git-import-dsc
-%{_bindir}/git-import-dscs
-%{_bindir}/git-import-orig
%{_bindir}/git-pbuilder
-%{_bindir}/gbp-create-remote-repo
%{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/export_orig.py*
+%{python3_sitelib}/gbp/scripts/import_ref.py*
%{python3_sitelib}/gbp/scripts/import_dsc.py*
%{python3_sitelib}/gbp/scripts/import_dscs.py*
%{python3_sitelib}/gbp/scripts/import_orig.py*
%{_mandir}/man1/gbp-buildpackage.1*
%{_mandir}/man1/gbp-create-remote-repo.1*
%{_mandir}/man1/gbp-dch.1*
+%{_mandir}/man1/gbp-export-orig.1*
%{_mandir}/man1/gbp-import-dsc.1*
%{_mandir}/man1/gbp-import-dscs.1*
%{_mandir}/man1/gbp-import-orig.1*
+%{_mandir}/man1/gbp-import-ref.1*
%{_mandir}/man1/gbp-pq.1*
%{_mandir}/man1/git-pbuilder.1*
EOF
%endif
-# Disable the debian tools for CentOS
-%if 0%{?centos_version}
+# Disable the Debian tools for old CentOS
+%if 0%{?centos_ver} && 0%{?centos_ver} < 7
for f in `cat files.list`; do
rm -rfv %{buildroot}/$f
done
%files common
%defattr(-,root,root,-)
%{_bindir}/gbp
-%{_bindir}/gbp-clone
-%{_bindir}/gbp-pull
%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-*
%{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/pristine_tar.py*
%{python3_sitelib}/gbp/scripts/pull.py*
+%{python3_sitelib}/gbp/scripts/push.py*
+%{python3_sitelib}/gbp/scripts/setup_gitattributes.py*
%{python3_sitelib}/gbp/scripts/supercommand.py*
+%{python3_sitelib}/gbp/scripts/tag.py*
%{python3_sitelib}/gbp/scripts/common/*.py*
%{python3_sitelib}/gbp/git/*.py*
%{python3_sitelib}/gbp/pkg/*.py*
+%exclude %{python3_sitelib}/gbp/__pycache__/*.pyc
+%exclude %{python3_sitelib}/gbp/git/__pycache__/*.pyc
+%exclude %{python3_sitelib}/gbp/pkg/__pycache__/*.pyc
+%exclude %{python3_sitelib}/gbp/scripts/__pycache__/*.pyc
+%exclude %{python3_sitelib}/gbp/scripts/common/__pycache__/*.pyc
%config %{_sysconfdir}/git-buildpackage
%if %{with docs}
%{_mandir}/man1/gbp.1*
%{_mandir}/man1/gbp-clone.1*
%{_mandir}/man1/gbp-config.1*
+%{_mandir}/man1/gbp-pristine-tar.1*
%{_mandir}/man1/gbp-pull.1*
+%{_mandir}/man1/gbp-push.1*
+%{_mandir}/man1/gbp-setup-gitattributes.1*
+%{_mandir}/man1/gbp-tag.1*
%{_mandir}/man5/*.5*
%endif
%files rpm
%defattr(-,root,root,-)
%dir %{python3_sitelib}/gbp/rpm
-%{_bindir}/*rpm*
%{python3_sitelib}/gbp/scripts/*rpm*.py*
%{python3_sitelib}/gbp/rpm/*py*
+/usr/share/git-buildpackage/gbp-builder-mock
%if %{with docs}
%{_mandir}/man1/gbp-buildpackage-rpm.1*
-%{_mandir}/man1/gbp-import-orig-rpm.1*
-%{_mandir}/man1/gbp-import-srpm.1*
%{_mandir}/man1/gbp-pq-rpm.1*
+%{_mandir}/man1/gbp-import-srpm.1*
%{_mandir}/man1/gbp-rpm-ch.1*
%endif
-%files bb
-%defattr(-,root,root,-)
-%dir %{python3_sitelib}/gbp/bb
-%{python3_sitelib}/gbp/scripts/*bb*.py*
-%{python3_sitelib}/gbp/bb/*py*
-
-
%if %{with docs}
%files doc
%defattr(-,root,root,-)