diff --git a/uthash.spec b/uthash.spec new file mode 100644 index 0000000..d608205 --- /dev/null +++ b/uthash.spec @@ -0,0 +1,87 @@ +Name: uthash +Version: 2.0.2 +Release: 6 +Summary: Hash table for C structures +License: BSD +URL: https://github.com/troydhanson/uthash +Source0: https://github.com/troydhanson/uthash/archive/v%{version}.tar.gz + +BuildRequires: asciidoc +Provides: libut == %{version}-%{release} libut-devel == %{version}-%{release} +Obsoletes: libut <= %{version}-%{release} libut-devel <= %{version}-%{release} + +%description +This package provides hash table for C structures. It isn't a library but a single +header file, so there is no library code to link against. It has been tested on +various platforms including Linux, Windows, Solaris, OpenBSD, FreeBSD and Android. +Most of operations on hash table are supported, such as add/replace, find, delete, +count, iterate and sort. + +%package devel +Summary: Header and library files for uthash + +%description devel +Header and library files for uthash + +%package help +Summary: Documentation for uthash +BuildArch: noarch + +%description help +Documentation for uthash +Provides: libut-doc == %{version}-%{release} +Obsoletes: libut-doc <= %{version}-%{release} + +%prep +%autosetup -p1 + +%build +cd doc/ +%make_build +cd .. + +cd libut/ +export CFLAGS="-fPIC" +%make_build +gcc -fPIC -shared -o libut.so.0 *.o + +%install +install -d %{buildroot}%{_prefix}/share/doc/uthash +cd doc/ +cp *.html *.txt *.css *.png %{buildroot}%{_prefix}/share/doc/uthash/ +cd .. + +cp libut/README.md %{buildroot}%{_prefix}/share/doc/uthash/ +install -d %{buildroot}%{_prefix}/share/licenses/uthash/ +cp LICENSE %{buildroot}%{_prefix}/share/licenses/uthash/ + +install -d %{buildroot}%{_includedir} +cd src/ +cp * %{buildroot}%{_includedir} +cd .. + +install -d %{buildroot}%{_libdir} +cd libut/ +cp libut.a %{buildroot}%{_libdir} +cp libut.so.0 %{buildroot}%{_libdir} +ln -s %{_libdir}/libut.so.0 %{buildroot}%{_libdir}/libut.so + +%files +%{_libdir}/libut.so.0 +%doc %{_prefix}/share/licenses/uthash/LICENSE +%doc %{_prefix}/share/doc/uthash/README.md + +%files devel +%{_libdir}/libut.so +%{_libdir}/libut.a +%{_includedir}/* +%exclude %{_includedir}/utvector.h + +%files help +%doc %{_prefix}/share/doc/uthash/* +%exclude %{_prefix}/share/doc/uthash/README.md + +%changelog +* Tue Dec 07 2019 lihao - 2.0.2-6 +- Package Init + diff --git a/v2.0.2.tar.gz b/v2.0.2.tar.gz new file mode 100644 index 0000000..6152067 Binary files /dev/null and b/v2.0.2.tar.gz differ