]> git.pld-linux.org Git - packages/dtc.git/blobdiff - dtc.spec
- updated to 1.5.1
[packages/dtc.git] / dtc.spec
index 2989d88b134b037a00445f747ac6a7af7bbd54dd..592344afc91273884ec6242a56e8b6185b3f36c1 100644 (file)
--- a/dtc.spec
+++ b/dtc.spec
@@ -1,19 +1,40 @@
+#
 # Conditional build:
+%bcond_without python          # Python module (any)
+%bcond_without python2         # CPython 2.x module
+%bcond_without python3         # CPython 3.x module
 %bcond_without verbose         # verbose build (V=1)
 
+%if %{without python}
+%undefine      with_python2
+%undefine      with_python3
+%endif
 Summary:       The Device Tree Compiler
-Summary(pl.UTF-8): Kompilator drzewiastej struktury urządzeń
+Summary(pl.UTF-8):     Kompilator drzewiastej struktury urządzeń
 Name:          dtc
-Version:       1.2.0
-Release:       0.1
-License:       GPL v2 (dtc), GPL/BSD (fdt library)
+Version:       1.5.1
+Release:       1
+License:       GPL v2+ (dtc), GPL v2+ or BSD (fdt library)
 Group:         Libraries
-Source0:       http://www.jdl.com/software/%{name}-v%{version}.tgz
-# Source0-md5: 0f1841de79abbff57691adc31d5f3525
-URL:           http://git.jdl.com/gitweb/
+Source0:       https://www.kernel.org/pub/software/utils/dtc/%{name}-%{version}.tar.xz
+# Source0-md5: d5b67727ee6d168fd83023e995565341
+Patch0:                %{name}-python.patch
+URL:           http://www.devicetree.org/Device_Tree_Compiler
 BuildRequires: bison
 BuildRequires: flex
-Requires:      %{name}-doc = %{version}-%{release}
+BuildRequires: tar >= 1:1.22
+BuildRequires: xz
+%if %{with python}
+%if %{with python2}
+BuildRequires: python-devel >= 2
+%endif
+%if %{with python3}
+BuildRequires: python3-devel >= 1:3.2
+%endif
+BuildRequires: swig-python >= 2.0.10
+%endif
+Requires:      libfdt = %{version}-%{release}
+Obsoletes:     dtc-doc < 1.3.0-2
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %{?debug:%define with_verbose 1}
@@ -31,74 +52,166 @@ innym. Najczęściej format wejściowy to "dts", intuicyjny i łatwy w
 odczycie (tzw. human readable), natomiast wyjściowy to "dtb" lub
 inaczej format binarny.
 
-%package devel
+%package -n libfdt
+Summary:       Device tree library
+Summary(pl.UTF-8):     Biblioteka drzewiastej struktury urządzeń
+License:       GPL v2+ or BSD
+Group:         Libraries
+Obsoletes:     dtc-doc < 1.3.0-2
+# does not require base. see README.license
+
+%description -n libfdt
+Device tree library.
+
+%description -n libfdt -l pl.UTF-8
+Biblioteka drzewiastej struktury urządzeń.
+
+%package -n libfdt-devel
 Summary:       Header files for fdt library
 Summary(pl.UTF-8):     Pliki nagłówkowe biblioteki fdt
+License:       GPL v2+ or BSD
 Group:         Development/Libraries
-Requires:      %{name}-doc = %{version}-%{release}
-# does not require base. see README.license
+Requires:      libfdt = %{version}-%{release}
+Obsoletes:     dtc-devel
+Obsoletes:     dtc-doc < 1.3.0-2
 
-%description devel
+%description -n libfdt-devel
 Header files for fdt library.
 
-%description devel -l pl.UTF-8
+%description -n libfdt-devel -l pl.UTF-8
 Pliki nagłówkowe biblioteki fdt.
 
-%package static
+%package -n libfdt-static
 Summary:       Static fdt library
 Summary(pl.UTF-8):     Statyczna biblioteka fdt
+License:       GPL v2+ or BSD
 Group:         Development/Libraries
-Requires:      %{name}-devel = %{version}-%{release}
+Requires:      libfdt-devel = %{version}-%{release}
+Obsoletes:     dtc-static
 
-%description static
+%description -n libfdt-static
 Static fdt library.
 
-%description static -l pl.UTF-8
+%description -n libfdt-static -l pl.UTF-8
 Statyczna biblioteka fdt.
 
-%package doc
-Summary:        Dtc documentation
-Summary(pl.UTF-8):      Dokumentacja dla dtc
-Group:          Development/Libraries
+%package -n python-libfdt
+Summary:       Python 2 binding for fdt library
+Summary(pl.UTF-8):     Wiązanie Pythona 2 do biblioteki fdt
+License:       GPL v2+ or BSD
+Group:         Libraries/Python
 
-%description doc
-Dtc package documentation.
+%description -n python-libfdt
+Python 2 binding for fdt library.
 
-%description doc -l pl.UTF-8
-Dokumentacja pakietu dtc.
+%description -n python-libfdt -l pl.UTF-8
+Wiązanie Pythona 2 do biblioteki fdt.
+
+%package -n python3-libfdt
+Summary:       Python 3 binding for fdt library
+Summary(pl.UTF-8):     Wiązanie Pythona 3 do biblioteki fdt
+License:       GPL v2+ or BSD
+Group:         Libraries/Python
+
+%description -n python3-libfdt
+Python 3 binding for fdt library.
+
+%description -n python3-libfdt -l pl.UTF-8
+Wiązanie Pythona 3 do biblioteki fdt.
 
 %prep
-%setup -q -n %{name}-v%{version}
+%setup -q
+%patch0 -p1
 
 %build
-%{__make} \
+%{__make} -j1 \
        %{?with_verbose:V=1} \
        CC="%{__cc}" \
-       CFLAGS="%{rpmcflags}"
+       CFLAGS="%{rpmcflags} -fPIC" \
+       NO_PYTHON=1
+
+%if %{with python}
+cd pylibfdt
+
+%if %{with python2}
+%py_build
+%endif
+%if %{with python3}
+%py3_build
+%endif
+%endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
-%{__make} install \
+
+%{__make} -j1 install \
+       DESTDIR=$RPM_BUILD_ROOT \
        %{?with_verbose:V=1} \
        PREFIX=%{_prefix} \
        LIBDIR=%{_libdir} \
-       DESTDIR=$RPM_BUILD_ROOT
+       NO_PYTHON=1 \
+       SETUP_PREFIX=%{_prefix}
+
+%if %{with python}
+cd pylibfdt
+
+%if %{with python2}
+%py_install
+
+%py_postclean
+%endif
+%if %{with python3}
+%py3_install
+%endif
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%post  -n libfdt -p /sbin/ldconfig
+%postun        -n libfdt -p /sbin/ldconfig
+
 %files
 %defattr(644,root,root,755)
+%doc README README.license
+%attr(755,root,root) %{_bindir}/convert-dtsv0
 %attr(755,root,root) %{_bindir}/dtc
+%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 devel
+%files -n libfdt
 %defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libfdt-1.5.0.so
+%attr(755,root,root) %ghost %{_libdir}/libfdt.so.1
+
+%files -n libfdt-devel
+%defattr(644,root,root,755)
+%doc TODO Documentation/manual.txt
+%attr(755,root,root) %{_libdir}/libfdt.so
 %{_includedir}/fdt.h
 %{_includedir}/libfdt.h
+%{_includedir}/libfdt_env.h
 
-%files static
+%files -n libfdt-static
 %defattr(644,root,root,755)
 %{_libdir}/libfdt.a
 
-%files doc
-%doc TODO README.license Documentation/manual.txt
+%if %{with python2}
+%files -n python-libfdt
+%defattr(644,root,root,755)
+%attr(755,root,root) %{py_sitedir}/_libfdt.so
+%{py_sitedir}/libfdt.py[co]
+%{py_sitedir}/libfdt-1.5.0-py*.egg-info
+%endif
+
+%if %{with python3}
+%files -n python3-libfdt
+%defattr(644,root,root,755)
+%attr(755,root,root) %{py3_sitedir}/_libfdt.cpython-*.so
+%{py3_sitedir}/libfdt.py
+%{py3_sitedir}/__pycache__/libfdt.cpython-*.py[co]
+%{py3_sitedir}/libfdt-1.5.0-py*.egg-info
+%endif
This page took 0.041971 seconds and 4 git commands to generate.