File taskwarrior.spec of Package taskwarrior

#
# spec file for package taskwarrior
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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/
#


Name:           taskwarrior
Version:        2.1.2
Release:        0
Summary:        Command-line todo list manager
License:        MIT
Group:          Productivity/Office/Organizers
Url:            http://taskwarrior.org
Source0:        http://www.taskwarrior.org/download/task-%{version}.tar.gz
#PATCH-FIX-OPENSUSE: skip the INSTALL from files intended for the installation
Patch0:         task-skip-INSTALL.patch
# PATCH-FIX-UPSTREAM taskwarrior-gcc47.patch dimstar@opensuse.org -- Fix build with gcc 4.7
Patch2:         taskwarrior-gcc47.patch
BuildRequires:  cmake >= 2.8
BuildRequires:  gcc-c++
BuildRequires:  libuuid-devel
BuildRequires:  lua-devel
# for completion
BuildRequires:  bash
BuildRequires:  vim-base
BuildRequires:  zsh
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
# use the name as other distributions, so 
# zypper in task will work as well
Provides:       task = %{version}-%{release}

%description
It maintains a list of tasks that you want to do, allowing you to add/remove,
and otherwise manipulate them. Task has a rich list of subcommands that allow
you to do sophisticated things with it. You'll find it has customizable
reports, charts, GTD features, Lua extensions, device synching and more.

Taskwarrior is a very active project involving people around the globe - check
often for updates.

%prep
%setup -q -n task-%{version}
%patch0 -p1
%patch2 -p1

%build
cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
      -DCMAKE_C_FLAGS="%{optflags}" \
      -DCMAKE_CXX_FLAGS="%{optflags}" \
      -DCMAKE_BUILD_TYPE=Release \
      -DCMAKE_SKIP_RPATH=1 \
      .

make %{?_smp_mflags}

%install
%make_install

# this integration stuff might be in CMakeList.txt, but ...
%define scriptsdir %{buildroot}%{_datadir}/doc/task/scripts/
%define zshdir %(ls -1d %{_datadir}/zsh/[4-9]*)

install -m 0755 -d %{buildroot}%{_sysconfdir}/bash_completion.d/
mv %{scriptsdir}bash/task.sh %{buildroot}%{_sysconfdir}/bash_completion.d/
rmdir %{scriptsdir}bash

install -m 0755 -d %{buildroot}%{zshdir}/functions/
mv %{scriptsdir}zsh/_task %{buildroot}%{zshdir}/functions/
rmdir %{scriptsdir}zsh

install -m 0755 -d %{buildroot}%{_datadir}/vim/site/ftdetect/
install -m 0755 -d %{buildroot}%{_datadir}/vim/site/syntax/
mv %{scriptsdir}vim/ftdetect/*vim %{buildroot}%{_datadir}/vim/site/ftdetect
mv %{scriptsdir}vim/syntax/*vim %{buildroot}%{_datadir}/vim/site/syntax
rm -rf %{scriptsdir}vim

%files
%defattr(-,root,root)
%doc %{_datadir}/doc/task/AUTHORS
%doc %{_datadir}/doc/task/COPYING
%doc %{_datadir}/doc/task/ChangeLog
%doc %{_datadir}/doc/task/NEWS
%doc %{_datadir}/doc/task/README
%{_bindir}/task
%{_datadir}/doc/task
%{_datadir}/man/man1/task*
%{_datadir}/man/man5/task*
%config %{_sysconfdir}/bash_completion.d/task.sh
%{zshdir}/functions/_task
%{_datadir}/vim/site/ftdetect/task.vim
%{_datadir}/vim/site/syntax/task*.vim

%changelog
openSUSE Build Service is sponsored by