[packages/ddcutil] - pl, completed dependencies - added python patch (-avoid-version for cython modules), package cytho

qboosh qboosh at pld-linux.org
Sun Jan 6 15:42:40 CET 2019


commit d7783ebb15e8cbf2a45574f0cc4f722926ad8e26
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Jan 6 15:47:33 2019 +0100

    - pl, completed dependencies
    - added python patch (-avoid-version for cython modules), package cython-based python interfaces

 ddcutil-python.patch |  22 +++++++++++
 ddcutil.spec         | 106 +++++++++++++++++++++++++++++++++++++++++++++++----
 2 files changed, 120 insertions(+), 8 deletions(-)
---
diff --git a/ddcutil.spec b/ddcutil.spec
index 522b390..9b98f9a 100644
--- a/ddcutil.spec
+++ b/ddcutil.spec
@@ -1,19 +1,36 @@
+#
+# Conditional build:
+%bcond_without	cython	# Python extension based on Cython
+
 Summary:	Query and change Linux monitor settings using DDC/CI and USB
+Summary(pl.UTF-8):	Odczyt i zmiana ustawień monitora spod Linuksa przy użyciu DDC/CI i USB
 Name:		ddcutil
 Version:	0.9.4
 Release:	1
 License:	GPL v2+
 Group:		X11/Applications
+#Source0Download: https://github.com/rockowitz/ddcutil/releases
+#TODO: use release tarballs: https://github.com/rockowitz/ddcutil/releases/download/v%{version}/%{name}-%{version}.tar.gz
 Source0:	https://github.com/rockowitz/ddcutil/archive/v%{version}.tar.gz
 # Source0-md5:	126bb0242916ced11d131e1ec94ad8a0
+Patch0:		%{name}-python.patch
 URL:		http://www.ddcutil.com/
 BuildRequires:	autoconf >= 2.69
 BuildRequires:	automake >= 1:1.11
+BuildRequires:	glib2-devel >= 1:2.32
 BuildRequires:	libdrm-devel >= 2.4.67
-BuildRequires:	libtool
+BuildRequires:	libtool >= 2:2
 BuildRequires:	libusb-devel >= 1.0.15
 BuildRequires:	pkgconfig
+%if %{with cython}
+BuildRequires:	python-Cython
+BuildRequires:	python-devel >= 1:2.6
+BuildRequires:	python3-Cython
+BuildRequires:	python3-devel >= 1:3.2
+%endif
+BuildRequires:	xorg-lib-libX11-devel
 BuildRequires:	xorg-lib-libXrandr-devel
+BuildRequires:	zlib-devel
 Requires:	libdrm >= 2.4.67
 Requires:	libusb >= 1.0.15
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -25,7 +42,7 @@ as brightness and color levels.
 ddcutil uses DDC/CI to communicate with monitors implementing MCCS
 (Monitor Control Command Set) over I2C. Normally, the video driver for
 the monitor exposes the I2C channel as devices named /dev/i2c-n. There
-is also psupport for monitors (such as Apple Cinema and Eizo
+is also support for monitors (such as Apple Cinema and Eizo
 ColorEdge) that implement MCCS using a USB connection.
 
 A particular use case for ddcutil is as part of color profile
@@ -34,25 +51,75 @@ settings currently in effect, e.g. red gain. ddcutil allows color
 related settings to be saved at the time a monitor is calibrated, and
 then restored when the calibration is applied.
 
+%description -l pl.UTF-8
+ddcutil to program do odczytu i zmiany ustawień monitora, takich jak
+jasność i poziomy kolorów.
+
+ddcutil wykorzystuje DDC/CI do komunikacji z monitorami obsługującymi
+MCCS (Monitor Control Command Set) po I2C. Zwykle sterownik obrazu dla
+monitora udostępnia kanał I2C jako urządzenia o nazwie /dev/i2c-n.
+Jest także obsługa monitorów obsługujących MCCS po połączeniu USB (jak
+Apple Cinema czy Eizo ColorEdge).
+
+Szczególnym przypadkiem użycia ddcutil jest część zarządzania
+profilami kolorów. Kalibracja monitora jest względem obecnych ustawień
+kolorów monitora, np. współczynnika czerwieni. ddcutil pozwala na
+zapisanie ustawień związanych z kolorami w czasie kalibracji monitora,
+a następnie odtwarzanie ich przy aplikowaniu kalibracji.
+
 %package devel
 Summary:	ddcutil header files
+Summary(pl.UTF-8):	Pliki nagłówkowe ddcutil
 Group:		X11/Development/Libraries
 Requires:	%{name} = %{version}-%{release}
+Requires:	glib2-devel >= 1:2.32
+Requires:	xorg-lib-libX11-devel
+Requires:	xorg-lib-libXrandr-devel
 
 %description devel
 ddcutil header files.
 
+%description devel -l pl.UTF-8
+Pliki nagłówkowe ddcutil.
+
+%package -n python-cyddc
+Summary:	Python 2 interface for ddcutil library
+Summary(pl.UTF-8):	Interfejs Pythona 2 do biblioteki ddcutil
+Group:		Libraries/Python
+Requires:	%{name} = %{version}-%{release}
+
+%description -n python-cyddc
+Python 2 (Cython based) interface for ddcutil library.
+
+%description -n python-cyddc -l pl.UTF-8
+Interfejs Pythona 2 do biblioteki ddcutil, oparty na Cythonie.
+
+%package -n python3-cyddc
+Summary:	Python 3 interface for ddcutil library
+Summary(pl.UTF-8):	Interfejs Pythona 3 do biblioteki ddcutil
+Group:		Libraries/Python
+Requires:	%{name} = %{version}-%{release}
+
+%description -n python3-cyddc
+Python 3 (Cython based) interface for ddcutil library.
+
+%description -n python3-cyddc -l pl.UTF-8
+Interfejs Pythona 3 do biblioteki ddcutil, oparty na Cythonie.
+
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 %{__libtoolize}
-%{__aclocal}
+%{__aclocal} -I m4
 %{__autoconf}
 %{__autoheader}
 %{__automake}
+# no --enable-gobject-api: "GObject implementation has been mothballed. TODO: delete or comment out this section"
 %configure \
 	--disable-silent-rules \
+	%{?with_cython:--enable-cython} \
 	--enable-drm \
 	--enable-lib \
 	--enable-usb \
@@ -63,7 +130,22 @@ ddcutil header files.
 rm -rf $RPM_BUILD_ROOT
 
 %{__make} install \
-	DESTDIR=$RPM_BUILD_ROOT
+	DESTDIR=$RPM_BUILD_ROOT \
+	resfiles=
+
+# distribute "resfiles" over destinations
+install -d $RPM_BUILD_ROOT%{_datadir}/cmake/Modules \
+	$RPM_BUILD_ROOT/etc/{X11/xorg.conf.d,udev/rules.d}
+cp -p data/usr/share/cmake/Modules/FindDDCUtil.cmake $RPM_BUILD_ROOT%{_datadir}/cmake/Modules
+# need customization if ever used
+#cp -p data/etc/udev/rules.d/*.rules $RPM_BUILD_ROOT/etc/udev/rules.d
+# xorg-driver-* package?
+#cp -p data/etc/X11/xorg.conf.d/*.conf $RPM_BUILD_ROOT/etc/X11/xorg.conf.d
+
+%if %{with cython}
+%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/*.la
+%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/*.la
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -73,17 +155,25 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc AUTHORS NEWS.md README.md
+%doc AUTHORS NEWS.md README.md data/etc/udev/rules.d/*.rules data/etc/X11/xorg.conf.d/*.conf
 %attr(755,root,root) %{_bindir}/ddcutil
 %attr(755,root,root) %{_libdir}/libddcutil.so.*.*.*
 %attr(755,root,root) %ghost %{_libdir}/libddcutil.so.0
 %{_mandir}/man1/ddcutil.1*
-%dir %{_datadir}/%{name}
-%dir %{_datadir}/%{name}/data
 
 %files devel
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_libdir}/libddcutil.so
 %{_includedir}/ddcutil*.h
 %{_pkgconfigdir}/ddcutil.pc
-%{_datadir}/%{name}/data/FindDDCUtil.cmake
+%{_datadir}/cmake/Modules/FindDDCUtil.cmake
+
+%if %{with cython}
+%files -n python-cyddc
+%defattr(644,root,root,755)
+%attr(755,root,root) %{py_sitedir}/cyddc2.so
+
+%files -n python3-cyddc
+%defattr(644,root,root,755)
+%attr(755,root,root) %{py3_sitedir}/cyddc3.so
+%endif
diff --git a/ddcutil-python.patch b/ddcutil-python.patch
new file mode 100644
index 0000000..f0eb274
--- /dev/null
+++ b/ddcutil-python.patch
@@ -0,0 +1,22 @@
+--- ddcutil-0.9.4/src/cython/Makefile.am.orig	2018-12-25 18:04:45.000000000 +0100
++++ ddcutil-0.9.4/src/cython/Makefile.am	2019-01-05 20:08:06.616448626 +0100
+@@ -27,8 +27,7 @@
+ 
+ # Global and order-independent shared library and program linker config flags and options 
+ cyddc2_la_LDFLAGS = 
+-cyddc2_la_LDFLAGS += -module -shared -export_dynamic -static
+-cyddc2_la_LDFLAGS += version_info '@LT_CURRENT@:@LT_REVISION@:@LT_AGE@'
++cyddc2_la_LDFLAGS += -module -shared -export_dynamic -avoid-version
+ 
+ # Link in the core library
+ cyddc2_la_LIBADD = \
+@@ -60,8 +59,7 @@
+ # -avoid-version   avoid versioning if possible (any effect on Linux?)
+ # -version-info
+ cyddc3_la_LDFLAGS = 
+-cyddc3_la_LDFLAGS += -module -shared -export_dynamic -static
+-cyddc3_la_LDFLAGS += version_info '@LT_CURRENT@:@LT_REVISION@:@LT_AGE@'
++cyddc3_la_LDFLAGS += -module -shared -export_dynamic -avoid-version
+ 
+ # Link in the core library
+ cyddc3_la_LIBADD = \
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ddcutil.git/commitdiff/d7783ebb15e8cbf2a45574f0cc4f722926ad8e26



More information about the pld-cvs-commit mailing list