]> git.pld-linux.org Git - packages/ddcutil.git/blob - ddcutil.spec
415105ba87e98d06afef9a4d692aa8e8f328fad6
[packages/ddcutil.git] / ddcutil.spec
1 #
2 # Conditional build:
3 %bcond_without  cython  # Python extension based on Cython
4
5 Summary:        Query and change Linux monitor settings using DDC/CI and USB
6 Summary(pl.UTF-8):      Odczyt i zmiana ustawień monitora spod Linuksa przy użyciu DDC/CI i USB
7 Name:           ddcutil
8 Version:        0.9.7
9 Release:        1
10 License:        GPL v2+
11 Group:          X11/Applications
12 #Source0Download: https://github.com/rockowitz/ddcutil/releases
13 #TODO: use release tarballs: https://github.com/rockowitz/ddcutil/releases/download/v%{version}/%{name}-%{version}.tar.gz
14 Source0:        https://github.com/rockowitz/ddcutil/archive/v%{version}.tar.gz
15 # Source0-md5:  427c956956ac8c9afdc8e18c76a8e3b0
16 Patch0:         %{name}-python.patch
17 URL:            http://www.ddcutil.com/
18 BuildRequires:  autoconf >= 2.69
19 BuildRequires:  automake >= 1:1.11
20 BuildRequires:  glib2-devel >= 1:2.32
21 BuildRequires:  libdrm-devel >= 2.4.67
22 BuildRequires:  libtool >= 2:2
23 BuildRequires:  libusb-devel >= 1.0.15
24 BuildRequires:  pkgconfig
25 %if %{with cython}
26 BuildRequires:  python-Cython
27 BuildRequires:  python-devel >= 1:2.6
28 BuildRequires:  python3-Cython
29 BuildRequires:  python3-devel >= 1:3.2
30 %endif
31 BuildRequires:  xorg-lib-libX11-devel
32 BuildRequires:  xorg-lib-libXrandr-devel
33 BuildRequires:  zlib-devel
34 Requires:       libdrm >= 2.4.67
35 Requires:       libusb >= 1.0.15
36 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37
38 %description
39 ddcutil is a program for querying and changing monitor settings, such
40 as brightness and color levels.
41
42 ddcutil uses DDC/CI to communicate with monitors implementing MCCS
43 (Monitor Control Command Set) over I2C. Normally, the video driver for
44 the monitor exposes the I2C channel as devices named /dev/i2c-n. There
45 is also support for monitors (such as Apple Cinema and Eizo
46 ColorEdge) that implement MCCS using a USB connection.
47
48 A particular use case for ddcutil is as part of color profile
49 management. Monitor calibration is relative to the monitor color
50 settings currently in effect, e.g. red gain. ddcutil allows color
51 related settings to be saved at the time a monitor is calibrated, and
52 then restored when the calibration is applied.
53
54 %description -l pl.UTF-8
55 ddcutil to program do odczytu i zmiany ustawień monitora, takich jak
56 jasność i poziomy kolorów.
57
58 ddcutil wykorzystuje DDC/CI do komunikacji z monitorami obsługującymi
59 MCCS (Monitor Control Command Set) po I2C. Zwykle sterownik obrazu dla
60 monitora udostępnia kanał I2C jako urządzenia o nazwie /dev/i2c-n.
61 Jest także obsługa monitorów obsługujących MCCS po połączeniu USB (jak
62 Apple Cinema czy Eizo ColorEdge).
63
64 Szczególnym przypadkiem użycia ddcutil jest część zarządzania
65 profilami kolorów. Kalibracja monitora jest względem obecnych ustawień
66 kolorów monitora, np. współczynnika czerwieni. ddcutil pozwala na
67 zapisanie ustawień związanych z kolorami w czasie kalibracji monitora,
68 a następnie odtwarzanie ich przy aplikowaniu kalibracji.
69
70 %package devel
71 Summary:        ddcutil header files
72 Summary(pl.UTF-8):      Pliki nagłówkowe ddcutil
73 Group:          X11/Development/Libraries
74 Requires:       %{name} = %{version}-%{release}
75 Requires:       glib2-devel >= 1:2.32
76 Requires:       xorg-lib-libX11-devel
77 Requires:       xorg-lib-libXrandr-devel
78
79 %description devel
80 ddcutil header files.
81
82 %description devel -l pl.UTF-8
83 Pliki nagłówkowe ddcutil.
84
85 %package -n python-cyddc
86 Summary:        Python 2 interface for ddcutil library
87 Summary(pl.UTF-8):      Interfejs Pythona 2 do biblioteki ddcutil
88 Group:          Libraries/Python
89 Requires:       %{name} = %{version}-%{release}
90
91 %description -n python-cyddc
92 Python 2 (Cython based) interface for ddcutil library.
93
94 %description -n python-cyddc -l pl.UTF-8
95 Interfejs Pythona 2 do biblioteki ddcutil, oparty na Cythonie.
96
97 %package -n python3-cyddc
98 Summary:        Python 3 interface for ddcutil library
99 Summary(pl.UTF-8):      Interfejs Pythona 3 do biblioteki ddcutil
100 Group:          Libraries/Python
101 Requires:       %{name} = %{version}-%{release}
102
103 %description -n python3-cyddc
104 Python 3 (Cython based) interface for ddcutil library.
105
106 %description -n python3-cyddc -l pl.UTF-8
107 Interfejs Pythona 3 do biblioteki ddcutil, oparty na Cythonie.
108
109 %prep
110 %setup -q
111 %patch0 -p1
112
113 %build
114 %{__libtoolize}
115 %{__aclocal} -I m4
116 %{__autoconf}
117 %{__autoheader}
118 %{__automake}
119 # no --enable-gobject-api: "GObject implementation has been mothballed. TODO: delete or comment out this section"
120 %configure \
121         --disable-silent-rules \
122         %{?with_cython:--enable-cython} \
123         --enable-drm \
124         --enable-lib \
125         --enable-usb \
126         --enable-x11
127 %{__make}
128
129 %install
130 rm -rf $RPM_BUILD_ROOT
131
132 %{__make} install \
133         DESTDIR=$RPM_BUILD_ROOT \
134         resfiles=
135
136 # distribute "resfiles" over destinations
137 install -d $RPM_BUILD_ROOT%{_datadir}/cmake/Modules \
138         $RPM_BUILD_ROOT/etc/{X11/xorg.conf.d,udev/rules.d}
139 cp -p data/usr/share/cmake/Modules/FindDDCUtil.cmake $RPM_BUILD_ROOT%{_datadir}/cmake/Modules
140 # need customization if ever used
141 #cp -p data/etc/udev/rules.d/*.rules $RPM_BUILD_ROOT/etc/udev/rules.d
142 # xorg-driver-* package?
143 #cp -p data/etc/X11/xorg.conf.d/*.conf $RPM_BUILD_ROOT/etc/X11/xorg.conf.d
144
145 %if %{with cython}
146 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/*.la
147 %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/*.la
148 %endif
149
150 %clean
151 rm -rf $RPM_BUILD_ROOT
152
153 %post   -p /sbin/ldconfig
154 %postun -p /sbin/ldconfig
155
156 %files
157 %defattr(644,root,root,755)
158 %doc AUTHORS NEWS.md README.md data/etc/udev/rules.d/*.rules data/etc/X11/xorg.conf.d/*.conf
159 %attr(755,root,root) %{_bindir}/ddcutil
160 %attr(755,root,root) %{_libdir}/libddcutil.so.*.*.*
161 %attr(755,root,root) %ghost %{_libdir}/libddcutil.so.1
162 %{_mandir}/man1/ddcutil.1*
163
164 %files devel
165 %defattr(644,root,root,755)
166 %attr(755,root,root) %{_libdir}/libddcutil.so
167 %{_includedir}/ddcutil*.h
168 %{_pkgconfigdir}/ddcutil.pc
169 %{_datadir}/cmake/Modules/FindDDCUtil.cmake
170
171 %if %{with cython}
172 %files -n python-cyddc
173 %defattr(644,root,root,755)
174 %attr(755,root,root) %{py_sitedir}/cyddc2.so
175
176 %files -n python3-cyddc
177 %defattr(644,root,root,755)
178 %attr(755,root,root) %{py3_sitedir}/cyddc3.so
179 %endif
This page took 0.066748 seconds and 2 git commands to generate.