diff --git a/.copr/Makefile b/.copr/Makefile new file mode 100644 index 0000000000..6b4b26a795 --- /dev/null +++ b/.copr/Makefile @@ -0,0 +1,26 @@ +# +# Copyright 2022 the Pacemaker project contributors +# +# The version control history for this file may have further details. +# +# This source code is licensed under the GNU General Public License version 2 +# or later (GPLv2+) WITHOUT ANY WARRANTY. +# + +# This file is used by the ClusterLabs COPR project: +# https://copr.fedorainfracloud.org/coprs/g/ClusterLabs/devel/ + +# These should be provided by COPR, so these are just fallbacks +MAKE ?= make +outdir ?= . +spec ?= .. + +LAST_RELEASE = + +srpm: + dnf -y install git + cd "$(spec)"/rpm \ + && echo "$$(git rev-list --count $$(git describe --tags --abbrev=0)..HEAD)" \ + > build.counter \ + && $(MAKE) -f Makefile.am srpm \ + && cp SRPMS/*.src.rpm "$(outdir)" diff --git a/.tito.spec.tmpl b/.tito.spec.tmpl deleted file mode 100644 index a4b6af0632..0000000000 --- a/.tito.spec.tmpl +++ /dev/null @@ -1 +0,0 @@ -Name: pacemaker diff --git a/.tito/custom.py b/.tito/custom.py deleted file mode 100644 index 9f0efec9d9..0000000000 --- a/.tito/custom.py +++ /dev/null @@ -1,60 +0,0 @@ -# -*- coding: UTF-8 -*- -"""Tito ad-hoc module for custom git repo -> spec + archive metamorphosis""" - -__author__ = "Jan Pokorný " -__copyright__ = "Copyright 2016-2020 the Pacemaker project contributors" -__license__ = "LGPLv2.1+ WITHOUT ANY WARRANTY" - - -from os.path import basename, join -from shutil import copyfile - -from tito.builder.main import BuilderBase -from tito.builder.fetch import FetchBuilder -from tito.common import error_out, run_command, get_spec_version_and_release - - -class NativeFetchBuilder(FetchBuilder): - """ - A specialized FetchBuilder to just setup the specfile + archive - using package-native scripts, which currently boils down to a sequence - that needs to be configured via fetch_prep_command option in builder - section (e.g., "./autogen.sh && ./configure && make dist foo.spec"). - - Uses code of src/tito/builder/fetch.py from the tito project as a template. - """ - REQUIRED_ARGS = [] - - def __init__(self, name=None, tag=None, build_dir=None, - config=None, user_config=None, - args=None, **kwargs): - - BuilderBase.__init__(self, name=name, build_dir=build_dir, - config=config, - user_config=user_config, args=args, **kwargs) - - if tag: - error_out("FetchBuilder does not support building specific tags.") - - if not config.has_option('builder', 'fetch_prep_command'): - error_out("NativeFetchBuilder requires fetch_prep_command.") - - self.build_tag = '%s-%s' % ( - self.project_name, - get_spec_version_and_release(self.start_dir, - '%s.spec' % self.project_name) - ) - - def tgz(self): - self.ran_tgz = True - self._create_build_dirs() - - print("Fetching sources...") - run_command(self.config.get('builder', 'fetch_prep_command')) - manual_sources = [run_command("ls -1t *.tar.* | head -n1")] - self.spec_file = self.project_name + '.spec' - for s in manual_sources: - base_name = basename(s) - dest_filepath = join(self.rpmbuild_sourcedir, base_name) - copyfile(s, dest_filepath) - self.sources.append(dest_filepath) diff --git a/.tito/tito.props b/.tito/tito.props deleted file mode 100644 index 58d1971d51..0000000000 --- a/.tito/tito.props +++ /dev/null @@ -1,21 +0,0 @@ -[buildconfig] -builder = custom.NativeFetchBuilder -tagger = tito.tagger.VersionTagger -lib_dir = .tito - -[builder] -fetch_prep_command = $(test $(id -u) -eq 0 && echo "ln -s" || echo :) \ - /usr/bin/false /usr/local/bin/rpmbuild \ - && git rev-list --count HEAD ^$(git describe \ - --tags --abbrev=0) > build.counter \ - && export WITH="$(git rev-parse --abbrev-ref --quiet HEAD \ - | grep -vqE '^[1-9].[0-9][0-9]*$' \ - || echo '--with pre_release')" \ - && { make srpm-temp || :; } \ - && test -z "${WITH}" || { \ - echo '%define _with_pre_release --with-pre_release' \ - > new.spec \ - && cat pacemaker.spec >> new.spec \ - && mv new.spec pacemaker.spec; } \ - && $(test $(id -u) -eq 0 && echo "rm -f" || echo :) \ - /usr/local/bin/rpmbuild