File git-flow-avh.spec of Package git-flow-avh

#
# spec file for package git-flow-avh
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2012 Togan Muftuoglu toganm@opensuse.org
#
# 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.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%define shversion  1.0.3
%define gfcomplver 0.6.0
%define gitexecdir %{_libexecdir}/git
#
Name:           git-flow-avh
Version:        1.12.3
Release:        0
Summary:        Git Extensions to Provide High-Level Workflow
License:        BSD-2-Clause
Group:          Development/Tools/Other
URL:            https://github.com/petervanderdoes/gitflow
Source0:        gitflow-avh-%{version}.tar.gz
Source1:        git-flow-completion-%{gfcomplver}.tar.gz
Source10:       README.markdown
BuildRequires:  bash-completion
BuildRequires:  fish
BuildRequires:  git-core
BuildRequires:  zsh
#
Requires:       git
Conflicts:      git-flow
BuildArch:      noarch
%if 0%{?suse_version}
BuildRequires:  fdupes
%endif

%description
AVH Edition of the Git extensions to provide high-level repository
operations for Vincent Driessen's branching model.

%package        bash-completion
Summary:        Bash Completion for %{name}
Group:          System/X11/Terminals
Requires:       %{name} = %{version}
Requires:       bash-completion
Supplements:    packageand(%{name}:bash)
BuildArch:      noarch

%description    bash-completion
Bash command line completion support for %{name} - completion
of subcommands, parameters and keywords for the git flow command.

%package fish-completion
Summary:        Fish Completion for %{name}
Group:          System/X11/Terminals
Requires:       %{name} = %{version}
Requires:       fish
Supplements:    packageand(%{name}:fish)
BuildArch:      noarch

%description    fish-completion
fish command line completion support for %{name} - completion
of subcommands, parameters and keywords for the git flow command.

%package        zsh-completion
Summary:        ZSH Completion for %{name}
Group:          System/X11/Terminals
Requires:       %{name} = %{version}
Requires:       zsh
Supplements:    packageand(%{name}:zsh)
BuildArch:      noarch

%description    zsh-completion
Zsh command line completion support for %{name} - completion
of subcommands, parameters and keywords for the git flow command.

%prep
%setup -q -n gitflow-avh-%{version}
tar xzvf %{SOURCE1}

cp %{SOURCE10} .

%build
# Remove she bang line
sed -i 1d git-flow-completion-%{gfcomplver}/*.{bash,zsh}

# Remove the *.plugin.zsh, it's only a link:
[[ -e git-flow-completion-%{gfcomplver}/git-flow-completion.plugin.zsh ]] && \
   rm git-flow-completion-%{gfcomplver}/git-flow-completion.plugin.zsh

%install
EXEC_FILES=git-flow
SCRIPT_FILES="$(find -type f -name 'git-flow-*' -maxdepth 1) gitflow-common gitflow-shFlags"

install -v -d -m 0755 %{buildroot}%{_bindir} \
  %{buildroot}%{_docdir}/gitflow/hooks \
  %{buildroot}%{_datadir}/{bash-completion,fish}/completions \
  %{buildroot}%{_sysconfdir}/zsh_completion.d \
  %{buildroot}%{gitexecdir}

install -v -m 0644 $SCRIPT_FILES %{buildroot}%{gitexecdir}
install -v -m 0755 $EXEC_FILES   %{buildroot}%{gitexecdir}

for h in hooks/*; do
  install -v -m 0644 $h %{buildroot}%{_docdir}/gitflow/hooks
done

##
install -v -m 0644 git-flow-completion-%{gfcomplver}/*.bash  %{buildroot}%{_datadir}/bash-completion/completions/git-flow
install -v -m 0644 git-flow-completion-%{gfcomplver}/*.zsh   %{buildroot}%{_sysconfdir}/zsh_completion.d/git-flow
install -v -m 0644 git-flow-completion-%{gfcomplver}/*.fish  %{buildroot}%{_datadir}/fish/completions/git-flow.fish

%if 0%{?suse_version}
 %fdupes -s %{buildroot}%{gitexecdir}
%endif


%files
%doc AUTHORS README.markdown README.md CHANGELOG.md
%license LICENSE
#
%{gitexecdir}/git-flow*
%{gitexecdir}/gitflow*
#
%dir %{_docdir}/gitflow/
%dir %{_docdir}/gitflow/hooks
%{_docdir}/gitflow/hooks/*

%files bash-completion
%{_datadir}/bash-completion/completions/*

%files fish-completion
%{_datadir}/fish/completions/git-flow.fish

%files zsh-completion
%config %{_sysconfdir}/zsh_completion.d/git-flow

%changelog
openSUSE Build Service is sponsored by