File tclap.spec of Package tclap

# norootforbuild

%if 0%{?suse_version} >= 1000
%define doc 1
%else
%define doc 0
%endif

Name:				 tclap
Version:			 1.2.0
Release:			 0
Summary:			 Templatized C++ Command Line Parser
# http://prdownloads.sourceforge.net/tclap/tclap-%{version}.tar.gz
Source:			 tclap-%{version}.tar.bz2
URL:				 http://tclap.sf.net
Group:			 Development/Libraries/C and C++
License:			 MIT
BuildRoot:		 %{_tmppath}/build-%{name}-%{version}
%if %doc
BuildRequires:	 doxygen graphviz
%endif #doc
BuildRequires:	 gcc-c++ libstdc++-devel
BuildRequires:	 make glibc-devel
BuildRequires:	 autoconf automake libtool pkgconfig
Provides:		 libtclap = %{version}
Provides:		 libtclap-devel = %{version}
%if 0%{?suse_version} >= 1030
BuildRequires:  licenses
Requires:       licenses
%endif
%if 0%{?suse_version} >= 1030
BuildRequires:	 fdupes
%endif

%description
TCLAP is a small, flexible library that provides a simple interface for
defining and accessing command line arguments. It was intially inspired by the
user friendly CLAP libary. The difference is that this library is templatized,
so the argument class is type independent. Type independence avoids
identical-except-for-type objects, such as IntArg, FloatArg, and StringArg.
While the library is not strictly compliant with the GNU or POSIX standards, it
is close. 

%if %doc
%package doc
Summary:			 API Documentation for %{name}
Group:			 Development/Libraries/C and C++

%description doc
This package contains the API documentation for TCLAP, the Templatized
C++ Command Line Parser.
%endif #doc

%prep
%setup -q

%build
%configure --enable-doxygen
%__make %{?jobs:-j%{jobs}}

%install
%makeinstall

%if %doc
%__install -d "%{buildroot}%{_docdir}/%{name}"
%__mv "%{buildroot}%{_datadir}/doc/tclap" "%{buildroot}%{_docdir}/%{name}/html"
%endif #doc

echo -n > docfiles.lst
for f in AUTHORS ChangeLog COPYING NEWS README; do
	 %__install -m0644 "$f" "%{buildroot}%{_docdir}/%{name}/$f"
	 echo "%doc %{_docdir}/%{name}/${f}" >> docfiles.lst
done

h=/usr/share/doc/licenses/md5/$(md5sum COPYING|cut -f1 -d" ")
test -e "$h" && %__ln_s -f "$h" .

%if %doc
%if 0%{?suse_version} >= 1030
%fdupes -s "%{buildroot}%{_docdir}/%{name}/html"
%endif
%endif #doc

%clean
%__rm -rf "%{buildroot}"

%files -f docfiles.lst
%defattr(-,root,root)
%doc %dir %{_docdir}/%{name} 
%{_includedir}/tclap
%{_libdir}/pkgconfig/tclap.pc

%if %doc
%files doc
%defattr(-,root,root)
%doc %dir %{_docdir}/%{name} 
%doc %{_docdir}/%{name}/html
%endif #doc

%changelog
# vim: set sw=3 ts=3 noet:
# Local Variables:
# mode: rpm-spec
# tab-width: 3
# End:
openSUSE Build Service is sponsored by