%define git 20130131

Summary: A .NET based build tool
Summary(ja): .NET ベースのビルドツール
Name: nant
Version: 0.92
Release: 1%{?git:.git%{git}}%{?_dist_release}
License: GPLv2+ and LGPLv2+
Group: Development/Tools
URL: http://nant.sourceforge.net/

#Source0: http://downloads.sourceforge.net/nant/%{name}-%{version}-src.tar.gz
# git clone //github.com/letiemble/nant.git
Source0: %{name}.tar.xz

BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: dos2unix
BuildRequires: mono-core
BuildRequires: mono-devel
BuildRequires: pkgconfig

Autoreq: no
Requires: mono-core
Requires: mono-data
Requires: mono-web
Requires: mono-winforms
#Requires: mono(System)
#Requires: mono(System.Data)
#Requires: mono(System.Drawing)
#Requires: mono(System.Web)
#Requires: mono(System.Windows.Forms)
#Requires: mono(System.Xml)
#Requires: mono(mscorlib)

# ignore some bundled dlls
%define _use_internal_dependency_generator 0
%define __find_provides env sh -c 'filelist=($(grep -v log4net.dll | grep -v scvs.exe | grep -v nunit | grep -v NDoc | grep -v neutral)) && { printf "%s\\n" "${filelist[@]}" | /usr/lib/rpm/find-provides && printf "%s\\n" "${filelist[@]}" | /usr/lib/rpm/mono-find-provides ; } | sort | uniq'
%define __find_requires env sh -c 'filelist=($(cat)) && { printf "%s\\n" "${filelist[@]}" |  /usr/lib/rpm/mono-find-requires ; } | sort | uniq'

Vendor: Project Vine
Distribution: Vine Linux

%description
NAnt is a .NET based build tool. In theory it is kind of like make
without make's wrinkles. In practice it's a lot like Ant.

%package devel
Summary:        NAnt pkgconfig files
License:        LGPLv2
Group:          Development/Libraries
Requires:       nant = %{version}-%{release}

%description devel
This package contains the pkgconfig files for NAnt.

%prep
%setup -q -n %{name}

%build
make TARGET=mono-4.5 MCS="gmcs -sdk:4"

%install
rm -rf $RPM_BUILD_ROOT
make install prefix=%{_prefix} DESTDIR=$RPM_BUILD_ROOT TARGET=mono-4.5 MCS="gmcs -sdk:4" docdir=%{_docdir}

mkdir -p $RPM_BUILD_ROOT%{_datadir}/pkgconfig
mv $RPM_BUILD_ROOT%{_prefix}/lib/pkgconfig/%{name}.pc $RPM_BUILD_ROOT%{_datadir}/pkgconfig

chmod -x $RPM_BUILD_ROOT%{_datadir}/NAnt/bin/lib/common/2.0/nunit-console.exe.config
dos2unix $RPM_BUILD_ROOT%{_datadir}/NAnt/bin/lib/common/2.0/nunit-console.exe.config

rm -rf _docs
mkdir -p _docs
mv $RPM_BUILD_ROOT%{_docdir}/NAnt/* _docs

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc COPYING.txt README.txt _docs/*
%{_bindir}/nant
%dir %{_datadir}/NAnt
%{_datadir}/NAnt/*

%files devel
%defattr(-,root,root)
%{_datadir}/pkgconfig/%{name}.pc

%changelog
* Sat Mar 28 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 0.92-1.git20140131
- updated to 0.92+git based on OpenSUSE
- built with mono 3.12.1

* Mon Apr 25 2011 Shu KONNO <owa@bg.wakwak.com> 0.90-3
- rebuilt with mono-2.10.1-3

* Sun Apr 03 2011 Shu KONNO <owa@bg.wakwak.com> 0.90-2
- rebuilt with mono-2.10.1

* Tue Oct 12 2010 Shu KONNO <owa@bg.wakwak.com> 0.90-1
- initial build for VineSeed

