uthash/uthash.spec
2016-12-29 23:06:46 +01:00

162 lines
4.2 KiB
RPMSpec

%global sover 0
%global git_url https://github.com/troydhanson/%{name}
%global common_desc \
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.
Name: uthash
Version: 2.0.1
Release: 3%{?dist}
Summary: A hash table for C structures
License: BSD
URL: http://troydhanson.github.io/uthash
Source0: %{git_url}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch0: %{git_url}/pull/98.patch#/%{name}-2.0.1_fix-asciidoc.patch
BuildRequires: asciidoc
BuildRequires: perl
%description
%{common_desc}
%package devel
Summary: A hash table for C structures (headers only)
Provides: %{name}-static == %{version}-%{release}
BuildArch: noarch
%description devel
%{common_desc}
%package -n libut
Summary: Library-implementation of utvector
%description -n libut
The utvector is an alternative to utarray. It is a bit more
efficient. It's object code, not just a header.
%package -n libut-devel
Summary: Development-files for libut
Requires: %{name}-devel == %{version}-%{release}
Requires: libut%{?_isa} == %{version}-%{release}
%description -n libut-devel
Development-files for libut.
%prep
%autosetup -p1
%build
%configure || :
export CFLAGS="-fPIC ${CFLAGS}"
%make_build -C libut
%{__cc} -shared ${CFLAGS} ${LDFLAGS} \
-Wl,-soname,libut.so.%{sover} \
-o libut/libut.so.%{sover} libut/*.o
%make_build -C doc
%install
%{__mkdir} -p html %{buildroot}%{_includedir} \
%{buildroot}%{_libdir}
%{__install} -pm 0644 src/*.h %{buildroot}%{_includedir}
%{__install} -pm 0755 libut/libut.so.0 %{buildroot}%{_libdir}
/bin/ln -s %{_libdir}/libut.so.0 %{buildroot}%{_libdir}/libut.so
%{__cp} -a doc/*.html doc/*.css doc/*.png html
%check
%configure || :
%make_build -C tests
%make_build -C tests/threads
%make_build -C libut/tests
%post -n libut -p /sbin/ldconfig
%postun -n libut -p /sbin/ldconfig
%files devel
%license LICENSE
%doc html/
%exclude %{_includedir}/utvector.h
%{_includedir}/ut*.h
%files -n libut
%license LICENSE
%{_libdir}/libut.so.%{sover}
%files -n libut-devel
%doc libut/README.md
%{_includedir}/libut.h
%{_includedir}/ringbuf.h
%{_includedir}/utvector.h
%{_libdir}/libut.so
%changelog
* Thu Dec 29 2016 Björn Esser <bjoern.esser@gmail.com> - 2.0.1-3
- Properly build the documentation
* Sun Dec 18 2016 Björn Esser <fedora@besser82.io> - 2.0.1-2
- Run testsuite with threads, too
* Sat Dec 17 2016 Björn Esser <fedora@besser82.io> - 2.0.1-1
- Update to new upstream release v2.0.1
- Introduce libut / libvector
- Add BR: perl
* Fri Feb 05 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.9-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.9.9-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Mon Aug 18 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.9.9-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.9.9-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Wed May 28 2014 Björn Esser <bjoern.esser@gmail.com> - 1.9.9-6
- add `%%global debug_package %%{nil}` to avoid empty debuginfo-pkg.
* Thu May 22 2014 Björn Esser <bjoern.esser@gmail.com> - 1.9.9-5
- revert "Root package should be noarch too".
- add provides %%{name} for -devel subpkg.
- add a note about why the mainpkg is arched.
* Wed May 21 2014 Peter Robinson <pbrobinson@fedoraproject.org> 1.9.9-4
- Root package should be noarch too
* Wed May 21 2014 Peter Robinson <pbrobinson@fedoraproject.org> 1.9.9-3
- Build as noarch
* Sun May 18 2014 Christopher Meng <rpm@cicku.me> - 1.9.9-2
- Move all files to -devel subpkg.
* Sat Mar 29 2014 Christopher Meng <rpm@cicku.me> - 1.9.9-1
- Update to 1.9.9
* Sat Jun 15 2013 Christopher Meng <rpm@cicku.me> - 1.9.8-3
- Add virtual provide.
- Remove 2 wrong tests.
* Fri Jun 14 2013 Christopher Meng <rpm@cicku.me> - 1.9.8-2
- Remove unneeded BR and make files section more clear.
* Sat Jun 01 2013 Christopher Meng <rpm@cicku.me> - 1.9.8-1
- Initial Package.