Blame SPECS/uthash.spec

5c7e92
%global sover 0
5c7e92
%global git_url https://github.com/troydhanson/%{name}
5c7e92
5c7e92
%global common_desc							\
5c7e92
Any C structure can be stored in a hash table using uthash.  Just	\
5c7e92
add a UT_hash_handle to the structure and choose one or more fields	\
5c7e92
in your structure to act as the key.  Then use these macros to store,	\
5c7e92
retrieve or delete items from the hash table.
5c7e92
5c7e92
# Setup _pkgdocdir if not defined already
5c7e92
%{!?_pkgdocdir:%global _pkgdocdir %{_docdir}/%{name}-%{version}}
5c7e92
5c7e92
5c7e92
Name:		uthash
5c7e92
Version:	2.0.2
5c7e92
Release:	4%{?dist}
5c7e92
Summary:	A hash table for C structures
5c7e92
5c7e92
License:	BSD
5c7e92
URL:		http://troydhanson.github.io/%{name}
5c7e92
Source0:	%{git_url}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
5c7e92
5c7e92
%if (0%{?rhel} && 0%{?rhel} <= 6)
5c7e92
# Downstream patch for asciidoc generation.
5c7e92
Patch1000:	%{name}-%{version}_fix-asciidoc.patch
5c7e92
%endif # (0#{?rhel} && 0#{?rhel} <= 6)
5c7e92
5c7e92
BuildRequires:	asciidoc
5c7e92
BuildRequires:	perl-interpreter
5c7e92
5c7e92
%description
5c7e92
%{common_desc}
5c7e92
5c7e92
5c7e92
%package	devel
5c7e92
Summary:	A hash table for C structures (headers only)
5c7e92
5c7e92
Provides:	%{name}-static	== %{version}-%{release}
5c7e92
5c7e92
BuildArch:	noarch
5c7e92
5c7e92
%description    devel
5c7e92
%{common_desc}
5c7e92
5c7e92
5c7e92
%package doc
5c7e92
Summary:	Documentation-files for %{name}.
5c7e92
BuildArch:	noarch
5c7e92
5c7e92
%description doc
5c7e92
This package contains the documentation-files for %{name}.
5c7e92
5c7e92
5c7e92
%package -n libut
5c7e92
Summary:	Library-implementation of utvector
5c7e92
5c7e92
%description -n libut
5c7e92
The utvector is an alternative to utarray.  It is a bit more
5c7e92
efficient.  It's object code, not just a header.
5c7e92
5c7e92
5c7e92
%package -n libut-devel
5c7e92
Summary:	Development-files for libut
5c7e92
5c7e92
Requires:	%{name}-devel	== %{version}-%{release}
5c7e92
Requires:	libut%{?_isa}	== %{version}-%{release}
5c7e92
5c7e92
%description -n libut-devel
5c7e92
Development-files for libut.
5c7e92
5c7e92
5c7e92
%prep
5c7e92
%autosetup -p 1
5c7e92
5c7e92
5c7e92
%build
5c7e92
%configure || :
5c7e92
export CFLAGS="-fPIC ${CFLAGS}"
5c7e92
%make_build -C libut
5c7e92
%{__cc} -shared ${CFLAGS} ${LDFLAGS}					\
5c7e92
	-Wl,-soname,libut.so.%{sover}					\
5c7e92
	-o libut/libut.so.%{sover} libut/*.o
5c7e92
%make_build -C doc
5c7e92
5c7e92
5c7e92
%install
5c7e92
%{__mkdir} -p html							\
5c7e92
	%{buildroot}%{_includedir}					\
5c7e92
	%{buildroot}%{_libdir}						\
5c7e92
	%{buildroot}%{_pkgdocdir}/{html,libut}
5c7e92
%{__install} -pm 0644 src/*.h %{buildroot}%{_includedir}
5c7e92
%{__install} -pm 0755 libut/libut.so.0 %{buildroot}%{_libdir}
5c7e92
/bin/ln -s %{_libdir}/libut.so.0 %{buildroot}%{_libdir}/libut.so
5c7e92
5c7e92
# Install doc.
5c7e92
%{__install} -pm 0644 doc/*.txt %{buildroot}%{_pkgdocdir}
5c7e92
%{__install} -pm 0644 doc/*.html doc/*.css doc/*.png %{buildroot}%{_pkgdocdir}/html
5c7e92
%{__install} -pm 0644 libut/README.md %{buildroot}%{_pkgdocdir}/libut
5c7e92
%if (0%{?rhel} && 0%{?rhel} <= 6)
5c7e92
%{__install} -pm 0644 LICENSE %{buildroot}%{_pkgdocdir}
5c7e92
%endif # (0#{?rhel} && 0#{?rhel} <= 6)
5c7e92
5c7e92
5c7e92
%check
5c7e92
%configure || :
5c7e92
%make_build -C tests
5c7e92
%make_build -C tests/threads
5c7e92
%make_build -C libut/tests
5c7e92
5c7e92
5c7e92
%post -n libut -p /sbin/ldconfig
5c7e92
%postun -n libut -p /sbin/ldconfig
5c7e92
5c7e92
5c7e92
%files devel
5c7e92
%if !(0%{?rhel} && 0%{?rhel} <= 6)
5c7e92
%license LICENSE
5c7e92
%else  # !(0%{?rhel} && 0%{?rhel} <= 6)
5c7e92
%doc %{_pkgdocdir}/LICENSE
5c7e92
%endif # !(0%{?rhel} && 0%{?rhel} <= 6)
5c7e92
%doc %dir %{_pkgdocdir}
5c7e92
%exclude %{_includedir}/utvector.h
5c7e92
%{_includedir}/ut*.h
5c7e92
5c7e92
%files doc
5c7e92
%if !(0%{?rhel} && 0%{?rhel} <= 6)
5c7e92
%license %{_datadir}/licenses/%{name}*
5c7e92
%endif # !(0%{?rhel} && 0%{?rhel} <= 6)
5c7e92
%doc %{_pkgdocdir}
5c7e92
5c7e92
%files -n libut
5c7e92
%if !(0%{?rhel} && 0%{?rhel} <= 6)
5c7e92
%license %{_datadir}/licenses/%{name}*
5c7e92
%else  # !(0%{?rhel} && 0%{?rhel} <= 6)
5c7e92
%doc %{_pkgdocdir}/LICENSE
5c7e92
%endif # !(0%{?rhel} && 0%{?rhel} <= 6)
5c7e92
%doc %dir %{_pkgdocdir}
5c7e92
%{_libdir}/libut.so.%{sover}
5c7e92
5c7e92
%files -n libut-devel
5c7e92
%doc %dir %{_pkgdocdir}
5c7e92
%doc %{_pkgdocdir}/libut
5c7e92
%{_includedir}/libut.h
5c7e92
%{_includedir}/ringbuf.h
5c7e92
%{_includedir}/utvector.h
5c7e92
%{_libdir}/libut.so
5c7e92
5c7e92
5c7e92
%changelog
5c7e92
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.2-4
5c7e92
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
5c7e92
5c7e92
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.2-3
5c7e92
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
5c7e92
5c7e92
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.2-2
5c7e92
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
5c7e92
5c7e92
* Sat Mar 04 2017 Björn Esser <besser82@fedoraproject.org> - 2.0.2-1
5c7e92
- New upstream release (rhbz#1429106)
5c7e92
5c7e92
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-7
5c7e92
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
5c7e92
5c7e92
* Fri Dec 30 2016 Björn Esser <bjoern.esser@gmail.com> - 2.0.1-6
5c7e92
- Fix dir-ownership in %%doc
5c7e92
5c7e92
* Fri Dec 30 2016 Björn Esser <bjoern.esser@gmail.com> - 2.0.1-5
5c7e92
- Introduce doc-subpackage
5c7e92
- Use unified %%_pkgdocdir
5c7e92
- Updated Patch0 and use on el <= 6, only
5c7e92
- Rename Patch0 --> Patch 1000
5c7e92
- Clean-up indentation
5c7e92
5c7e92
5c7e92
* Thu Dec 29 2016 Björn Esser <bjoern.esser@gmail.com> - 2.0.1-4
5c7e92
- Include plain ascii-docs, too
5c7e92
5c7e92
* Thu Dec 29 2016 Björn Esser <bjoern.esser@gmail.com> - 2.0.1-3
5c7e92
- Properly build the documentation
5c7e92
5c7e92
* Sun Dec 18 2016 Björn Esser <fedora@besser82.io> - 2.0.1-2
5c7e92
- Run testsuite with threads, too
5c7e92
5c7e92
* Sat Dec 17 2016 Björn Esser <fedora@besser82.io> - 2.0.1-1
5c7e92
- Update to new upstream release v2.0.1
5c7e92
- Introduce libut / libvector
5c7e92
- Add BR: perl
5c7e92
5c7e92
* Fri Feb 05 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.9-10
5c7e92
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
5c7e92
5c7e92
* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.9.9-9
5c7e92
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
5c7e92
5c7e92
* Mon Aug 18 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.9.9-8
5c7e92
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
5c7e92
5c7e92
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.9.9-7
5c7e92
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
5c7e92
5c7e92
* Wed May 28 2014 Björn Esser <bjoern.esser@gmail.com> - 1.9.9-6
5c7e92
- add `%%global debug_package %%{nil}` to avoid empty debuginfo-pkg.
5c7e92
5c7e92
* Thu May 22 2014 Björn Esser <bjoern.esser@gmail.com> - 1.9.9-5
5c7e92
- revert "Root package should be noarch too".
5c7e92
- add provides %%{name} for -devel subpkg.
5c7e92
- add a note about why the mainpkg is arched.
5c7e92
5c7e92
* Wed May 21 2014 Peter Robinson <pbrobinson@fedoraproject.org> 1.9.9-4
5c7e92
- Root package should be noarch too
5c7e92
5c7e92
* Wed May 21 2014 Peter Robinson <pbrobinson@fedoraproject.org> 1.9.9-3
5c7e92
- Build as noarch
5c7e92
5c7e92
* Sun May 18 2014 Christopher Meng <rpm@cicku.me> - 1.9.9-2
5c7e92
- Move all files to -devel subpkg.
5c7e92
5c7e92
* Sat Mar 29 2014 Christopher Meng <rpm@cicku.me> - 1.9.9-1
5c7e92
- Update to 1.9.9
5c7e92
5c7e92
* Sat Jun 15 2013 Christopher Meng <rpm@cicku.me> - 1.9.8-3
5c7e92
- Add virtual provide.
5c7e92
- Remove 2 wrong tests.
5c7e92
5c7e92
* Fri Jun 14 2013 Christopher Meng <rpm@cicku.me> - 1.9.8-2
5c7e92
- Remove unneeded BR and make files section more clear.
5c7e92
5c7e92
* Sat Jun 01 2013 Christopher Meng <rpm@cicku.me> - 1.9.8-1
5c7e92
- Initial Package.