[packages/dtc] - updated to 1.4.7 - added python patch, build python module

qboosh qboosh at pld-linux.org
Fri Aug 24 21:02:43 CEST 2018


commit 2b797ed5c4be6c3a9ec914dba0c848c9d9b377d7
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Fri Aug 24 21:05:26 2018 +0200

    - updated to 1.4.7
    - added python patch, build python module

 dtc-python.patch | 19 +++++++++++++++++++
 dtc.spec         | 43 +++++++++++++++++++++++++++++++++++++++----
 2 files changed, 58 insertions(+), 4 deletions(-)
---
diff --git a/dtc.spec b/dtc.spec
index 246253d..6e7ef6e 100644
--- a/dtc.spec
+++ b/dtc.spec
@@ -1,21 +1,27 @@
 #
 # Conditional build:
+%bcond_without	python		# Python module
 %bcond_without	verbose		# verbose build (V=1)
 
 Summary:	The Device Tree Compiler
 Summary(pl.UTF-8):	Kompilator drzewiastej struktury urządzeń
 Name:		dtc
-Version:	1.4.4
+Version:	1.4.7
 Release:	1
 License:	GPL v2+ (dtc), GPL v2+ or BSD (fdt library)
 Group:		Libraries
 Source0:	https://www.kernel.org/pub/software/utils/dtc/%{name}-%{version}.tar.xz
-# Source0-md5:	290318bab4d9e61e7fb7426b4666ad4d
+# Source0-md5:	cdf3bfae59374fdcd2bbc5ae4f0e835e
+Patch0:		%{name}-python.patch
 URL:		http://www.devicetree.org/Device_Tree_Compiler
 BuildRequires:	bison
 BuildRequires:	flex
 BuildRequires:	tar >= 1:1.22
 BuildRequires:	xz
+%if %{with python}
+BuildRequires:	python-devel >= 2
+BuildRequires:	swig-python
+%endif
 Requires:	libfdt = %{version}-%{release}
 Obsoletes:	dtc-doc < 1.3.0-2
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -78,14 +84,28 @@ Static fdt library.
 %description -n libfdt-static -l pl.UTF-8
 Statyczna biblioteka fdt.
 
+%package -n python-libfdt
+Summary:	Python binding for fdt library
+Summary(pl.UTF-8):	Wiązanie Pythona do biblioteki fdt
+License:	GPL v2+ or BSD
+Group:		Libraries/Python
+
+%description -n python-libfdt
+Python binding for fdt library.
+
+%description -n python-libfdt -l pl.UTF-8
+Wiązanie Pythona do biblioteki fdt.
+
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 %{__make} \
 	%{?with_verbose:V=1} \
 	CC="%{__cc}" \
-	CFLAGS="%{rpmcflags} -fPIC"
+	CFLAGS="%{rpmcflags} -fPIC" \
+	%{!?with_python:NO_PYTHON=1}
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -93,7 +113,13 @@ rm -rf $RPM_BUILD_ROOT
 	DESTDIR=$RPM_BUILD_ROOT \
 	%{?with_verbose:V=1} \
 	PREFIX=%{_prefix} \
-	LIBDIR=%{_libdir}
+	LIBDIR=%{_libdir} \
+	%{!?with_python:NO_PYTHON=1} \
+	SETUP_PREFIX=%{_prefix}
+
+%if %{with python}
+%py_postclean
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -109,6 +135,7 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_bindir}/dtdiff
 %attr(755,root,root) %{_bindir}/fdtdump
 %attr(755,root,root) %{_bindir}/fdtget
+%attr(755,root,root) %{_bindir}/fdtoverlay
 %attr(755,root,root) %{_bindir}/fdtput
 
 %files -n libfdt
@@ -127,3 +154,11 @@ rm -rf $RPM_BUILD_ROOT
 %files -n libfdt-static
 %defattr(644,root,root,755)
 %{_libdir}/libfdt.a
+
+%if %{with python}
+%files -n python-libfdt
+%defattr(644,root,root,755)
+%attr(755,root,root) %{py_sitedir}/_libfdt.so
+%{py_sitedir}/pylibfdt
+%{py_sitedir}/libfdt-%{version}-py*.egg-info
+%endif
diff --git a/dtc-python.patch b/dtc-python.patch
new file mode 100644
index 0000000..d2ef468
--- /dev/null
+++ b/dtc-python.patch
@@ -0,0 +1,19 @@
+--- dtc-1.4.7/pylibfdt/Makefile.pylibfdt.orig	2018-07-23 05:00:50.000000000 +0200
++++ dtc-1.4.7/pylibfdt/Makefile.pylibfdt	2018-08-24 20:25:46.505442238 +0200
+@@ -8,7 +8,7 @@
+ define run_setup
+ 	SOURCES="$(1)" CPPFLAGS="$(CPPFLAGS)" OBJDIR="$(PYLIBFDT_objdir)"
+ 	VERSION="$(dtc_version)"
+-	$(PYLIBFDT_objdir)/setup.py --quiet $(2)
++	$(PYLIBFDT_objdir)/setup.py $(2)
+ endef
+ 
+ $(PYMODULE): $(PYLIBFDT_srcs)
+@@ -19,6 +19,6 @@
+ install_pylibfdt: $(PYMODULE)
+ 	$(VECHO) INSTALL-PYLIB; \
+ 	$(call run_setup, $(PYLIBFDT_srcs), \
+-		install $(if $(SETUP_PREFIX),--prefix=$(SETUP_PREFIX)))
++		install --optimize=2 $(if $(SETUP_PREFIX),--prefix=$(SETUP_PREFIX)) $(if $(DESTDIR),--root=$(DESTDIR)))
+ 
+ PYLIBFDT_cleanfiles = libfdt_wrap.c libfdt.py libfdt.pyc _libfdt.so
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/dtc.git/commitdiff/2b797ed5c4be6c3a9ec914dba0c848c9d9b377d7



More information about the pld-cvs-commit mailing list