File tla.spec of Package tla

#
# spec file for package fastforward
#
# Copyright (c) 2010-2015 Peter Conrad <obs@quisquis.de>
#
# 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 http://bugs.opensuse.org/

Summary: GNU Arch Revision Control System
Name: tla
Version: 1.3.5
Release: 2
License: GPL-2.0+
Group: Development/Tools/Version Control
#Original Source: ftp://ftp.gnu.org/pub/gnu/gnu-arch/%%{name}-%%{version}.tar.gz
Source: %{name}-%{version}.tar.bz2
# tla bash completion from jblack@gnuarch.org--2004/tlacontrib--devo--1.2
#Original Source1: http://mirrors.sourcecontrol.net/jblack@gnuarch.org--2004/tlacontrib/tlacontrib--devo/tlacontrib--devo--1.2/base-0/tlacontrib--devo--1.2--base-0.tar.gz
Source1: tlacontrib--devo--1.2--base-0.tar.bz2
Source2: %{name}-rpmlintrc
Source3: http://arch.savannah.gnu.org/archives/gnu-arch/atai@atai.org--public/tla--atai--1.3/patch-73/tla--atai--1.3--patch-73.patches.tar.gz
Source4: http://arch.savannah.gnu.org/archives/gnu-arch/atai@atai.org--public/hackerlab--atai--1.1/patch-12/hackerlab--atai--1.1--patch-12.patches.tar.gz
Patch: http://lists.gnu.org/archive/html/gnu-arch-users/2009-03/txtP1Ud3lhV8L.txt
Patch1: tla-1.3.5-obs-warnings.patch
Patch2: tla-1.3.5-tar121.patch
Patch3: tla-1.3.5-global-neon.patch
Patch4: tla-1.3.5-getaddrinfo.patch
Patch5: tla-1.3.5-memfuncs.patch
URL: http://www.gnu.org/software/gnu-arch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: gawk, bash, libneon-devel

%description
GNU arch is a revision control system, similar in purpose to tools such as CVS, SCCS, and
Subversion. It is used to keep track of the changes made to a source tree and to help
programmers combine and otherwise manipulate changes made by multiple people or at different
times.

GNU arch has some features that make it particularly useful for public free software projects:
- it's easy to learn
- it's inexpensive and easy to administer
- it's a distributed system so there's no need to give write permission to every project
  participant
- it has excellent support for the kinds of branching and merging that can make a free software
  project team shine.

Another goal of the arch project is to help free software development projects work better:
migrating from CVS or another system to arch should help your project operate more effectively.

GNU Arch was created and written mainly by Tom Lord.

%prep
%setup
%patch -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
rm -rf src/expat src/libneon
tar xfj "%{S:1}"
tar xfz "%{S:3}"
find tla--atai--1.3--patch-73.patches/patches/{libarch,tests,tla} \
     -name \*.patch -exec cat '{}' \; | \
  patch -d src/tla -p 1 -F 0
tar xfz "%{S:4}"
patch -d src/hackerlab -p 1 -F 0 <hackerlab--atai--1.1--patch-12.patches/patches/hash/sha1.c.patch

%build
cd src
mkdir build
cd build
../configure --prefix="%{_prefix}" 
make CFLAGS="%{optflags} -fno-strict-aliasing"

%check
cd src/build
make test

%install
rm -rf src/docs-tla/PLUGIN
cd src/build
make destdir="%{buildroot}" install
# grrr....
rm -f "%{buildroot}%{_bindir}/awiki"
gawk="`which gawk`"
if [ ! -x "$gawk" ]; then
    echo "ERROR: gawk not found or not executable"
    exit 1
fi
( echo "#!$gawk -f" ; tail -n +2 "../tla/=gpg-check.awk" ) >"%{buildroot}%{_bindir}/gpg-check"
chmod 755 "%{buildroot}%{_bindir}/gpg-check"
mkdir -p "%{buildroot}%{_sysconfdir}/bash_completion.d"
%__sed 's=~/\.tla-commands=/etc/bash_completion.d/.tla.commands=' < ../../tlacontrib--devo--1.2--base-0/bash-complete/tla-bash-complete >"%{buildroot}%{_sysconfdir}/bash_completion.d/tla-bash-complete.sh"
HOME="`pwd`" bash ../../tlacontrib--devo--1.2--base-0/bash-complete/gen-tla-commands "%{buildroot}%{_bindir}/tla"
%__mv .tla-commands "%{buildroot}%{_sysconfdir}/bash_completion.d/.tla.commands"
chmod 644 "%{buildroot}%{_sysconfdir}/bash_completion.d/tla"*
mkdir -p "%{buildroot}%{_sysconfdir}/skel/.arch-params/signing"
# See http://lists.gnu.org/archive/html/gnu-arch-users/2005-03/msg00101.html
# for a better proposal
echo 'gawk -f /usr/bin/gpg-check -v gpg_command="gpg --verify-files -"' >"%{buildroot}%{_sysconfdir}/skel/.arch-params/signing/=default"
%__debug_install_post

%clean
[ "%{buildroot}" = "/" ] || rm -rf "%{buildroot}"

%files
%defattr(-,root,root)
%doc src/COPYING =RELEASE-ID
%doc src/docs-tla/
%{_bindir}/tla
%{_bindir}/gpg-check
%config %{_sysconfdir}/bash_completion.d/tla-bash-complete.sh
%config %{_sysconfdir}/bash_completion.d/.tla.commands
%config(noreplace) %{_sysconfdir}/skel/.arch-params/

%changelog
openSUSE Build Service is sponsored by