@@ 1,29 1,27 @@
Name: libucl
Version: 0.8.1
-Release: 5%{?dist}
+Release: 7%{?dist}
Summary: Universal configuration library parser
License: BSD and MIT
URL: https://github.com/vstakhov/libucl
Source0: %{url}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
+BuildRequires: python3-devel
BuildRequires: make
BuildRequires: gcc
BuildRequires: libtool
BuildRequires: autoconf
-BuildRequires: uthash-devel
+BuildRequires: libtree-devel
+BuildRequires: mum-hash-devel
-# Packaging those partially-bundled library headers and wire them to the build
-# would be a pain so we keep them bundled for the time being.
+# Partial http://troydhanson.github.io/uthash (BSD) - 2.x is shipped in Fedora.
+Provides: bundled(uthash) = 1.9.8
-# Partial https://github.com/attractivechaos/klib (MIT)
-Provides: bundled(klib-devel)
-# Partial https://github.com/vnmakarov/mum-hash (MIT)
-Provides: bundled(mum-hash-devel)
-# Partial https://piumarta.com/software/tree/ (MIT)
-Provides: bundled(libtree-devel)
-# Partial http://troydhanson.github.io/uthash (BSD) - already in Fedora.
-Provides: bundled(uthash-devel)
+# Partial and patched https://github.com/attractivechaos/klib (MIT).
+# Upstream is not released as a single archive and only provide per-file
+# versioning.
+Provides: bundled(klib)
%description
%{summary}.
@@ 35,7 33,6 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
%{summary}.
-
%package -n python3-libucl
Summary: Python bindings for libucl
Requires: %{name}%{?_isa} = %{version}-%{release}
@@ 49,6 46,15 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
# pkg-config: remove trailing slash from standard include dir.
sed -i 's/includedir}\/$/includedir}/' libucl.pc.in
+# Remove bundled libraries.
+sed -i '/mum\.h/d' src/Makefile.am
+sed -i '/tree\.h/d' src/Makefile.am
+sed -i 's/ucl_chartable.h \\/ucl_chartable.h/' src/Makefile.am
+rm src/mum.h src/tree.h
+
+# Set include/lib dir for python bindings.
+sed -i "s%language = 'c'%language = \'c\', include_dirs = [ \"../include\"], library_dirs = [ \"../src/.libs\"]%" python/setup.py
+
# Run autoconf.
./autogen.sh
@@ 60,7 66,7 @@ done
%configure --disable-static
%build
-%make_build
+V=1 %make_build
(cd python; %py3_build)
%install
@@ 89,6 95,13 @@ rm %{buildroot}%{_libdir}/%{name}.la
%{python3_sitearch}/ucl*
%changelog
+* Fri Apr 09 2021 Timothée Floure <fnux@fedoraproject.org> - 0.8.1-7
+- Add missing python3-devel dependency.
+- Fix include and lib dirs when building python subpackage.
+
+* Wed Mar 24 2021 Timothée Floure <fnux@fedoraproject.org> - 0.8.1-6
+- Unbundle mum-hash and libtree.
+
* Sat Mar 06 2021 Timothée Floure <fnux@fedoraproject.org> - 0.8.1-5
- Mark bundled libraries and adapt license.
- Package Python bindings.