uthash/uthash.spec

91 lines
2.4 KiB
RPMSpec
Raw Permalink Normal View History

2020-01-13 15:26:17 +08:00
Name: uthash
2020-06-02 16:31:19 +08:00
Version: 2.0.2
Release: 7
2020-01-13 15:26:17 +08:00
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
2020-06-02 16:31:19 +08:00
Patch6000: uthash-2.0.2-add-stack-protector-strong-flag.patch
2020-01-13 15:26:17 +08:00
BuildRequires: asciidoc
2020-06-02 16:31:19 +08:00
Provides: libut == %{version}-%{release} libut-devel == %{version}-%{release}
Obsoletes: libut <= %{version}-%{release} libut-devel <= %{version}-%{release}
2020-01-13 15:26:17 +08:00
%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
2020-06-02 16:31:19 +08:00
Provides: libut-doc == %{version}-%{release}
Obsoletes: libut-doc <= %{version}-%{release}
2020-01-13 15:26:17 +08:00
%prep
%autosetup -p1
%build
cd doc/
2020-03-18 11:10:30 +08:00
%make_build V=1
2020-01-13 15:26:17 +08:00
cd ..
2020-06-02 16:31:19 +08:00
cd libut/
export CFLAGS="-fPIC"
%make_build
gcc -fPIC -shared -o libut.so.0 *.o
2020-01-13 15:26:17 +08:00
%install
install -d %{buildroot}%{_prefix}/share/doc/uthash
2020-06-02 16:31:19 +08:00
cd doc/
cp *.html *.txt *.css *.png %{buildroot}%{_prefix}/share/doc/uthash/
cd ..
cp libut/README.md %{buildroot}%{_prefix}/share/doc/uthash/
2020-01-13 15:26:17 +08:00
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}
2020-06-02 16:31:19 +08:00
cd libut/
cp libut.a %{buildroot}%{_libdir}
cp libut.so.0 %{buildroot}%{_libdir}
ln -s %{_libdir}/libut.so.0 %{buildroot}%{_libdir}/libut.so
2020-01-13 15:26:17 +08:00
%files
2020-06-02 16:31:19 +08:00
%{_libdir}/libut.so.0
2020-01-13 15:26:17 +08:00
%doc %{_prefix}/share/licenses/uthash/LICENSE
%doc %{_prefix}/share/doc/uthash/README.md
%files devel
2020-06-02 16:31:19 +08:00
%{_libdir}/libut.so
%{_libdir}/libut.a
2020-01-13 15:26:17 +08:00
%{_includedir}/*
%files help
%doc %{_prefix}/share/doc/uthash/*
%exclude %{_prefix}/share/doc/uthash/README.md
%changelog
2020-06-02 10:47:00 +08:00
* Thu Mar 18 2020 zhangtao <zhangtao221@huawei.com> - 2.0.2-7
2020-03-18 11:10:30 +08:00
- Add stack-protector-strong flag
2020-06-02 10:47:00 +08:00
* Sat Dec 07 2019 lihao <lihao129@huawei.com> - 2.0.2-6
2020-01-13 15:26:17 +08:00
- Package Init