2011-06-29 08:16:32 +02:00
|
|
|
#
|
2021-06-15 19:03:16 +02:00
|
|
|
# spec file
|
2011-06-29 08:16:32 +02:00
|
|
|
#
|
2023-03-28 11:06:12 +02:00
|
|
|
# Copyright (c) 2023 SUSE LLC
|
2011-06-29 08:16:32 +02:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2018-09-19 10:19:11 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2011-06-29 08:16:32 +02:00
|
|
|
#
|
|
|
|
|
|
|
|
|
2023-05-19 16:38:06 +02:00
|
|
|
%if 0%{?fedora_version}%{?rhel}
|
2020-05-29 13:42:55 +02:00
|
|
|
%define _pkg_base %nil
|
|
|
|
%else
|
|
|
|
%define _pkg_base -base
|
|
|
|
%endif
|
|
|
|
|
2020-05-07 11:35:26 +02:00
|
|
|
%define flavor @BUILD_FLAVOR@%nil
|
|
|
|
%if "%{flavor}" == ""
|
|
|
|
%define nsuffix %nil
|
|
|
|
%else
|
|
|
|
%define nsuffix -test
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if 0%{?suse_version} && 0%{?suse_version} >= 1220 && "%{flavor}" == "test"
|
2019-05-03 17:26:27 +02:00
|
|
|
%bcond_without obs_scm_testsuite
|
|
|
|
%else
|
|
|
|
%bcond_with obs_scm_testsuite
|
|
|
|
%endif
|
|
|
|
|
2020-05-07 11:35:26 +02:00
|
|
|
# special guard for flavor test, yet --without test being specified
|
|
|
|
%if "%{flavor}" == "test" && %{without obs_scm_testsuite}
|
|
|
|
ExclusiveArch: skip-build
|
|
|
|
%endif
|
|
|
|
|
2023-05-19 16:38:06 +02:00
|
|
|
%if 0%{?suse_version} >= 1315 || 0%{?fedora_version} >= 29 || 0%{?rhel} >= 8
|
2019-04-26 14:41:15 +02:00
|
|
|
%bcond_without python3
|
|
|
|
%else
|
|
|
|
%bcond_with python3
|
|
|
|
%endif
|
|
|
|
|
2019-05-03 17:26:27 +02:00
|
|
|
# This list probably needs to be extended
|
|
|
|
# logic seems to be if python < 2.7 ; then needs_external_argparse ; fi
|
2019-06-05 16:49:19 +02:00
|
|
|
%if (0%{?centos_version} == 6) || (0%{?suse_version} && 0%{?suse_version} < 1315) || (0%{?fedora_version} && 0%{?fedora_version} < 26)
|
2019-05-03 17:26:27 +02:00
|
|
|
%bcond_without needs_external_argparse
|
|
|
|
%else
|
|
|
|
%bcond_with needs_external_argparse
|
|
|
|
%endif
|
|
|
|
|
2019-04-26 14:41:15 +02:00
|
|
|
%if %{with python3}
|
|
|
|
%define use_python python3
|
2019-05-03 17:26:27 +02:00
|
|
|
%define use_test test3
|
2019-04-26 14:41:15 +02:00
|
|
|
%else
|
|
|
|
%define use_python python
|
2019-05-03 17:26:27 +02:00
|
|
|
%define use_test test
|
2019-04-26 14:41:15 +02:00
|
|
|
%endif
|
|
|
|
|
2019-03-06 16:59:59 +01:00
|
|
|
%if 0%{?suse_version}
|
2019-04-26 14:41:15 +02:00
|
|
|
%define pyyaml_package %{use_python}-PyYAML
|
2019-05-03 17:26:27 +02:00
|
|
|
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150100
|
2019-03-06 16:59:59 +01:00
|
|
|
%define locale_package glibc-locale-base
|
|
|
|
%else
|
|
|
|
%define locale_package glibc-locale
|
|
|
|
%endif
|
|
|
|
%endif
|
2019-04-26 14:41:15 +02:00
|
|
|
|
2023-05-19 16:38:06 +02:00
|
|
|
%if 0%{?fedora_version} || 0%{?rhel}
|
|
|
|
%if 0%{?fedora_version} >= 29 || 0%{?rhel} >= 8
|
2019-05-03 17:26:27 +02:00
|
|
|
%define pyyaml_package %{use_python}-PyYAML
|
|
|
|
%else
|
2019-04-26 14:41:15 +02:00
|
|
|
%define pyyaml_package PyYAML
|
2019-05-03 17:26:27 +02:00
|
|
|
%endif
|
|
|
|
|
2023-05-19 16:38:06 +02:00
|
|
|
%if 0%{?fedora_version} >= 24 || 0%{?rhel} >= 8
|
2019-03-06 16:59:59 +01:00
|
|
|
%define locale_package glibc-langpack-en
|
2019-04-09 19:03:57 +02:00
|
|
|
%else
|
|
|
|
%define locale_package glibc-common
|
2019-03-06 16:59:59 +01:00
|
|
|
%endif
|
2019-03-29 15:16:15 +01:00
|
|
|
%endif
|
2019-03-06 16:59:59 +01:00
|
|
|
|
2019-04-26 14:41:15 +02:00
|
|
|
%if 0%{?mageia} || 0%{?mandriva_version}
|
|
|
|
%define pyyaml_package python-yaml
|
|
|
|
%define locale_package locales
|
|
|
|
%endif
|
|
|
|
|
2021-06-21 09:03:30 +02:00
|
|
|
# Mageia 8 has package names python-*
|
|
|
|
# but requires python3 in shebang
|
2023-05-19 16:38:06 +02:00
|
|
|
%if 0%{?mageia} >= 8 || 0%{?rhel} >= 8
|
2021-06-21 09:03:30 +02:00
|
|
|
%define python_path %{_bindir}/python3
|
|
|
|
%else
|
|
|
|
%define python_path %{_bindir}/%{use_python}
|
|
|
|
%endif
|
|
|
|
|
2019-05-03 17:26:27 +02:00
|
|
|
# avoid code duplication
|
|
|
|
%define scm_common_dep \
|
|
|
|
Requires: obs-service-obs_scm-common = %version-%release \
|
|
|
|
%{nil}
|
|
|
|
|
|
|
|
%define scm_dependencies \
|
|
|
|
Requires: git-core \
|
|
|
|
%if 0%{?suse_version} >= 1315 \
|
|
|
|
Recommends: bzr \
|
|
|
|
Recommends: mercurial \
|
|
|
|
Recommends: subversion \
|
|
|
|
Recommends: obs-service-download_files \
|
2020-04-30 10:34:07 +02:00
|
|
|
Recommends: %{use_python}-keyring \
|
|
|
|
Recommends: %{use_python}-keyrings.alt \
|
2019-05-03 17:26:27 +02:00
|
|
|
%endif \
|
|
|
|
%{nil}
|
|
|
|
|
|
|
|
######## END OF MACROS AND FUN ###################################
|
2016-04-08 09:10:41 +02:00
|
|
|
|
2020-05-07 11:35:26 +02:00
|
|
|
%define pkg_name obs-service-tar_scm
|
|
|
|
Name: %{pkg_name}%{nsuffix}
|
2023-05-19 16:38:06 +02:00
|
|
|
%define version_unconverted 0.10.36
|
|
|
|
Version: 0.10.36
|
2012-12-03 16:29:20 +01:00
|
|
|
Release: 0
|
2017-04-20 08:24:11 +02:00
|
|
|
Summary: An OBS source service: create tar ball from svn/git/hg
|
2018-03-09 08:40:44 +01:00
|
|
|
License: GPL-2.0-or-later
|
2012-02-14 09:38:12 +01:00
|
|
|
Group: Development/Tools/Building
|
2020-01-24 16:46:27 +01:00
|
|
|
URL: https://github.com/openSUSE/obs-service-tar_scm
|
2020-05-07 11:35:26 +02:00
|
|
|
Source: %{pkg_name}-%{version}.tar.gz
|
2019-04-26 14:41:15 +02:00
|
|
|
|
2016-05-20 07:52:54 +02:00
|
|
|
# Fix build on Ubuntu by disabling mercurial tests, not applied in rpm
|
|
|
|
# based distributions
|
2016-07-27 17:31:54 +02:00
|
|
|
#Patch0: 0001-Debianization-disable-running-mercurial-tests.patch
|
2019-04-26 14:41:15 +02:00
|
|
|
|
2017-04-18 11:27:21 +02:00
|
|
|
%if %{with obs_scm_testsuite}
|
2019-03-06 16:59:59 +01:00
|
|
|
BuildRequires: %{locale_package}
|
2020-05-07 11:35:26 +02:00
|
|
|
BuildRequires: %{pkg_name} = %{version}
|
2020-04-30 10:34:07 +02:00
|
|
|
BuildRequires: %{use_python}-keyring
|
|
|
|
BuildRequires: %{use_python}-keyrings.alt
|
2019-04-26 14:41:15 +02:00
|
|
|
BuildRequires: %{use_python}-six
|
2020-07-20 14:06:12 +02:00
|
|
|
BuildRequires: %{use_python}-unittest2
|
2012-02-16 17:16:22 +01:00
|
|
|
BuildRequires: bzr
|
2015-07-24 11:23:11 +02:00
|
|
|
BuildRequires: git-core
|
2012-02-16 17:16:22 +01:00
|
|
|
BuildRequires: mercurial
|
2018-03-09 08:40:44 +01:00
|
|
|
BuildRequires: subversion
|
2023-05-19 16:38:06 +02:00
|
|
|
%if !%{with python3}
|
|
|
|
BuildRequires: %{use_python}-mock
|
|
|
|
%endif
|
2019-04-26 14:41:15 +02:00
|
|
|
%endif
|
|
|
|
|
2019-05-03 17:26:27 +02:00
|
|
|
BuildRequires: %{locale_package}
|
2019-04-26 14:41:15 +02:00
|
|
|
BuildRequires: %{pyyaml_package}
|
2019-05-03 17:26:27 +02:00
|
|
|
%if %{with needs_external_argparse}
|
|
|
|
BuildRequires: %{use_python}-argparse
|
|
|
|
%endif
|
2019-04-26 14:41:15 +02:00
|
|
|
BuildRequires: %{use_python}-dateutil
|
2019-05-03 17:26:27 +02:00
|
|
|
# Why do we need this? we dont use it as runtime requires later
|
2019-04-26 14:41:15 +02:00
|
|
|
BuildRequires: %{use_python}-lxml
|
|
|
|
|
2019-05-03 17:26:27 +02:00
|
|
|
%if %{with python3}
|
2020-05-29 13:42:55 +02:00
|
|
|
BuildRequires: %{use_python}%{_pkg_base}
|
2019-06-05 16:49:19 +02:00
|
|
|
# Fix missing Requires in python3-pbr in Leap42.3
|
|
|
|
BuildRequires: %{use_python}-setuptools
|
2019-05-03 17:26:27 +02:00
|
|
|
%else
|
2017-04-18 11:27:21 +02:00
|
|
|
BuildRequires: python >= 2.6
|
2018-05-23 10:00:31 +02:00
|
|
|
%endif
|
2019-05-03 17:26:27 +02:00
|
|
|
%scm_common_dep
|
|
|
|
%scm_dependencies
|
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
2017-04-12 16:06:22 +02:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
BuildArch: noarch
|
2023-05-19 16:38:06 +02:00
|
|
|
Requires: %{python_path}
|
2017-04-12 16:06:22 +02:00
|
|
|
|
|
|
|
%description
|
|
|
|
This is a source service for openSUSE Build Service.
|
|
|
|
|
|
|
|
It supports downloading from svn, git, hg and bzr repositories.
|
|
|
|
|
|
|
|
%package -n obs-service-obs_scm-common
|
2017-04-20 08:24:11 +02:00
|
|
|
Summary: Common parts of SCM handling services
|
2017-04-12 16:06:22 +02:00
|
|
|
Group: Development/Tools/Building
|
2019-03-06 16:59:59 +01:00
|
|
|
Requires: %{locale_package}
|
2019-04-26 14:41:15 +02:00
|
|
|
Requires: %{pyyaml_package}
|
|
|
|
Requires: %{use_python}-dateutil
|
2019-05-03 17:26:27 +02:00
|
|
|
%if %{with needs_external_argparse}
|
2019-04-26 14:41:15 +02:00
|
|
|
Requires: %{use_python}-argparse
|
2017-04-14 13:50:02 +02:00
|
|
|
%endif
|
2017-04-12 16:06:22 +02:00
|
|
|
|
|
|
|
%description -n obs-service-obs_scm-common
|
2019-05-03 17:26:27 +02:00
|
|
|
This is a source service for openSUSE Build Service.
|
|
|
|
|
|
|
|
It supports downloading from svn, git, hg and bzr repositories.
|
|
|
|
|
|
|
|
This package holds the shared files for different services.
|
2017-04-12 16:06:22 +02:00
|
|
|
|
|
|
|
%package -n obs-service-tar
|
|
|
|
Summary: Creates a tar archive from local directory
|
|
|
|
Group: Development/Tools/Building
|
|
|
|
Provides: obs-service-tar_scm:/usr/lib/obs/service/tar.service
|
2019-05-03 17:26:27 +02:00
|
|
|
%scm_common_dep
|
2017-04-12 16:06:22 +02:00
|
|
|
|
|
|
|
%description -n obs-service-tar
|
2017-04-20 08:24:11 +02:00
|
|
|
Creates a tar archive from local directory
|
2017-04-12 16:06:22 +02:00
|
|
|
|
2017-04-12 16:43:36 +02:00
|
|
|
%package -n obs-service-obs_scm
|
2017-04-20 08:24:11 +02:00
|
|
|
Summary: Creates a OBS cpio from a remote SCM resource
|
2017-04-12 16:06:22 +02:00
|
|
|
Group: Development/Tools/Building
|
2017-04-12 20:24:18 +02:00
|
|
|
Provides: obs-service-tar_scm:/usr/lib/obs/service/obs_scm.service
|
2019-05-03 17:26:27 +02:00
|
|
|
%scm_common_dep
|
|
|
|
%scm_dependencies
|
2017-04-12 16:06:22 +02:00
|
|
|
|
2017-04-12 16:43:36 +02:00
|
|
|
%description -n obs-service-obs_scm
|
2017-04-20 08:24:11 +02:00
|
|
|
Creates a OBS cpio from a remote SCM resource.
|
|
|
|
|
|
|
|
This can be used to work directly in local git checkout and can be packaged
|
|
|
|
into a tar ball during build time.
|
2017-04-12 16:06:22 +02:00
|
|
|
|
|
|
|
%package -n obs-service-appimage
|
|
|
|
Summary: Handles source downloads defined in appimage.yml files
|
|
|
|
Group: Development/Tools/Building
|
2019-05-03 17:26:27 +02:00
|
|
|
%scm_common_dep
|
|
|
|
%scm_dependencies
|
2017-04-12 16:06:22 +02:00
|
|
|
|
|
|
|
%description -n obs-service-appimage
|
2017-04-20 08:24:11 +02:00
|
|
|
Experimental appimage support: This parses appimage.yml files for SCM
|
|
|
|
resources and packages them.
|
2017-04-12 16:06:22 +02:00
|
|
|
|
|
|
|
%package -n obs-service-snapcraft
|
|
|
|
Summary: Handles source downloads defined in snapcraft.yaml files
|
|
|
|
Group: Development/Tools/Building
|
|
|
|
Provides: obs-service-tar_scm:/usr/lib/obs/service/snapcraft.service
|
2019-05-03 17:26:27 +02:00
|
|
|
%scm_common_dep
|
|
|
|
%scm_dependencies
|
2010-10-18 14:49:18 +02:00
|
|
|
|
2017-04-12 16:06:22 +02:00
|
|
|
%description -n obs-service-snapcraft
|
2017-04-20 08:24:11 +02:00
|
|
|
Experimental snapcraft support: This parses snapcraft.yaml files for SCM
|
|
|
|
resources and packages them.
|
2010-10-18 14:49:18 +02:00
|
|
|
|
2020-03-16 12:16:47 +01:00
|
|
|
%if 0%{?enable_gbp}
|
2020-02-26 10:46:29 +01:00
|
|
|
%package -n obs-service-gbp
|
|
|
|
Summary: Creates Debian source artefacts from a Git repository
|
|
|
|
Group: Development/Tools/Building
|
|
|
|
Requires: git-buildpackage >= 0.6.0
|
|
|
|
Requires: obs-service-obs_scm-common = %version-%release
|
2020-05-29 13:42:55 +02:00
|
|
|
%if 0%{?enable_gbp}
|
2020-02-26 10:46:29 +01:00
|
|
|
Provides: obs-service-tar_scm:/usr/lib/obs/service/obs_gbp.service
|
2020-05-29 13:42:55 +02:00
|
|
|
%endif
|
2020-02-26 10:46:29 +01:00
|
|
|
|
|
|
|
%description -n obs-service-gbp
|
|
|
|
Debian git-buildpackage workflow support: uses gbp to create Debian
|
|
|
|
source artefacts (.dsc, .origin.tar.gz and .debian.tar.gz if non-native).
|
2020-03-16 12:16:47 +01:00
|
|
|
%endif
|
2010-10-18 14:49:18 +02:00
|
|
|
|
|
|
|
%prep
|
2016-04-08 09:10:41 +02:00
|
|
|
%setup -q -n obs-service-tar_scm-%version
|
2010-10-18 14:49:18 +02:00
|
|
|
|
|
|
|
%build
|
|
|
|
|
|
|
|
%install
|
2020-05-07 11:35:26 +02:00
|
|
|
%if %{without obs_scm_testsuite}
|
2021-06-21 09:03:30 +02:00
|
|
|
make install DESTDIR="%{buildroot}" PREFIX="%{_prefix}" SYSCFG="%{_sysconfdir}" PYTHON="%{python_path}" WITH_GBP="%{enable_gbp}"
|
2012-02-16 12:06:33 +01:00
|
|
|
|
2020-05-07 11:35:26 +02:00
|
|
|
%else
|
2021-02-15 08:49:38 +01:00
|
|
|
|
2019-05-03 17:26:27 +02:00
|
|
|
# moved conditional to the top as it helps to have it all in one place and only rely on the bcond_with here.
|
2012-02-15 17:34:15 +01:00
|
|
|
%check
|
2014-10-05 13:44:20 +02:00
|
|
|
# No need to run PEP8 tests here; that would require a potentially
|
|
|
|
# brittle BuildRequires: python-pep8, and any style issues are already
|
|
|
|
# caught by Travis CI.
|
2019-04-26 14:41:15 +02:00
|
|
|
make %{use_test}
|
2017-04-12 16:43:36 +02:00
|
|
|
%endif
|
2012-02-15 17:34:15 +01:00
|
|
|
|
2020-05-07 11:35:26 +02:00
|
|
|
%if %{without obs_scm_testsuite}
|
2010-10-18 14:49:18 +02:00
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
2017-04-12 18:03:02 +02:00
|
|
|
%{_prefix}/lib/obs/service/tar_scm.service
|
2017-04-12 16:06:22 +02:00
|
|
|
|
|
|
|
%files -n obs-service-obs_scm-common
|
|
|
|
%defattr(-,root,root)
|
2020-11-10 17:27:59 +01:00
|
|
|
%license COPYING
|
2012-12-03 16:29:20 +01:00
|
|
|
%dir %{_prefix}/lib/obs
|
2017-04-12 16:06:22 +02:00
|
|
|
%dir %{_prefix}/lib/obs/service
|
|
|
|
%{_prefix}/lib/obs/service/TarSCM
|
2017-04-12 20:24:18 +02:00
|
|
|
%{_prefix}/lib/obs/service/tar_scm
|
2012-12-03 16:29:20 +01:00
|
|
|
%dir %{_sysconfdir}/obs
|
|
|
|
%dir %{_sysconfdir}/obs/services
|
2020-04-30 10:34:07 +02:00
|
|
|
%verify (not user group) %dir %{_sysconfdir}/obs/services/tar_scm.d
|
2021-03-12 09:45:56 +01:00
|
|
|
%config(noreplace) %{_sysconfdir}/obs/services/*
|
2020-05-29 13:42:55 +02:00
|
|
|
%ghost %dir %{_sysconfdir}/obs/services/tar_scm.d/python_keyring
|
2010-10-18 14:49:18 +02:00
|
|
|
|
2017-04-12 16:06:22 +02:00
|
|
|
%files -n obs-service-tar
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%{_prefix}/lib/obs/service/tar
|
|
|
|
%{_prefix}/lib/obs/service/tar.service
|
|
|
|
|
2017-04-12 18:03:02 +02:00
|
|
|
%files -n obs-service-obs_scm
|
2017-04-12 16:06:22 +02:00
|
|
|
%defattr(-,root,root)
|
2017-04-12 18:03:02 +02:00
|
|
|
%{_prefix}/lib/obs/service/obs_scm
|
|
|
|
%{_prefix}/lib/obs/service/obs_scm.service
|
2017-04-12 16:06:22 +02:00
|
|
|
|
|
|
|
%files -n obs-service-appimage
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%{_prefix}/lib/obs/service/appimage*
|
|
|
|
|
|
|
|
%files -n obs-service-snapcraft
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%{_prefix}/lib/obs/service/snapcraft*
|
|
|
|
|
2020-03-16 12:16:47 +01:00
|
|
|
%if 0%{?enable_gbp}
|
2020-02-26 10:46:29 +01:00
|
|
|
%files -n obs-service-gbp
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%{_prefix}/lib/obs/service/obs_gbp*
|
2020-03-16 12:16:47 +01:00
|
|
|
%endif
|
2020-05-07 11:35:26 +02:00
|
|
|
%endif
|
2020-02-26 10:46:29 +01:00
|
|
|
|
2011-06-29 08:16:32 +02:00
|
|
|
%changelog
|