File uthash.spec of Package uthash

# vim: set sw=4 ts=4 et nu:
# Copyright (c) 2012 Pascal Bleser <pascal.bleser@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 http://bugs.opensuse.org/

Name:               uthash
Version:            1.9.5
Release:            1.1
Summary:            Hash Table for C Structures
Source:             http://prdownloads.sourceforge.net/uthash/uthash-%{version}.tar.bz2
Patch1:             uthash-proceed_with_tests_without_prompt.patch
Patch2:             uthash-optflags.patch
URL:                http://uthash.sourceforge.net/
Group:              Development/Libraries/C and C++
License:            BSD-3-Clause
BuildRoot:          %{_tmppath}/build-%{name}-%{version}
Provides:           uthash-devel = %{version}
BuildRequires:      gcc make glibc-devel pkgconfig
BuildArch:          noarch

%description
Any C structure can be stored in a hash table using uthash. Just add a
UT_hash_handle to the structure and choose one or more fields in your structure
to act as the key. Then use these macros to store, retrieve or delete items
from the hash table. 

%prep
%setup -q
%patch1
%patch2
%__chmod 644 LICENSE

%build

%install
%__install -d "%{buildroot}%{_includedir}"
%__cp -a src/*.h "%{buildroot}%{_includedir}/"

%check
pushd tests
OPTFLAGS="%{optflags}" \
./all_funcs
popd

%files
%defattr(-,root,root)
%doc LICENSE README
%{_includedir}/*.h

%changelog
* Tue Feb 28 2012 pascal.bleser@opensuse.org
- initial version (1.9.5)