]>
Commit | Line | Data |
---|---|---|
d7783ebb JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without cython # Python extension based on Cython | |
4 | ||
ee308c4a | 5 | Summary: Query and change Linux monitor settings using DDC/CI and USB |
d7783ebb | 6 | Summary(pl.UTF-8): Odczyt i zmiana ustawień monitora spod Linuksa przy użyciu DDC/CI i USB |
ee308c4a | 7 | Name: ddcutil |
6ed62b85 JP |
8 | Version: 0.9.8 |
9 | Release: 1 | |
ee308c4a JP |
10 | License: GPL v2+ |
11 | Group: X11/Applications | |
d7783ebb | 12 | #Source0Download: https://github.com/rockowitz/ddcutil/releases |
4ea8e712 | 13 | #TODO: use named tarballs: https://github.com/rockowitz/ddcutil/archive/v%{version}/%{name}-%{version}.tar.gz |
ee308c4a | 14 | Source0: https://github.com/rockowitz/ddcutil/archive/v%{version}.tar.gz |
6ed62b85 | 15 | # Source0-md5: 77b5964fd6b3a220d89140c6d02b4965 |
d7783ebb | 16 | Patch0: %{name}-python.patch |
ee308c4a JP |
17 | URL: http://www.ddcutil.com/ |
18 | BuildRequires: autoconf >= 2.69 | |
19 | BuildRequires: automake >= 1:1.11 | |
d7783ebb | 20 | BuildRequires: glib2-devel >= 1:2.32 |
ee308c4a | 21 | BuildRequires: libdrm-devel >= 2.4.67 |
d7783ebb | 22 | BuildRequires: libtool >= 2:2 |
ee308c4a JP |
23 | BuildRequires: libusb-devel >= 1.0.15 |
24 | BuildRequires: pkgconfig | |
d7783ebb JB |
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 | |
ee308c4a | 32 | BuildRequires: xorg-lib-libXrandr-devel |
d7783ebb | 33 | BuildRequires: zlib-devel |
ee308c4a JP |
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 | |
d7783ebb | 45 | is also support for monitors (such as Apple Cinema and Eizo |
ee308c4a JP |
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 | ||
d7783ebb JB |
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 | ||
ee308c4a JP |
70 | %package devel |
71 | Summary: ddcutil header files | |
d7783ebb | 72 | Summary(pl.UTF-8): Pliki nagłówkowe ddcutil |
ee308c4a JP |
73 | Group: X11/Development/Libraries |
74 | Requires: %{name} = %{version}-%{release} | |
d7783ebb JB |
75 | Requires: glib2-devel >= 1:2.32 |
76 | Requires: xorg-lib-libX11-devel | |
77 | Requires: xorg-lib-libXrandr-devel | |
ee308c4a JP |
78 | |
79 | %description devel | |
80 | ddcutil header files. | |
81 | ||
d7783ebb JB |
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 | ||
ee308c4a JP |
109 | %prep |
110 | %setup -q | |
d7783ebb | 111 | %patch0 -p1 |
ee308c4a JP |
112 | |
113 | %build | |
114 | %{__libtoolize} | |
d7783ebb | 115 | %{__aclocal} -I m4 |
ee308c4a JP |
116 | %{__autoconf} |
117 | %{__autoheader} | |
118 | %{__automake} | |
d7783ebb | 119 | # no --enable-gobject-api: "GObject implementation has been mothballed. TODO: delete or comment out this section" |
ee308c4a JP |
120 | %configure \ |
121 | --disable-silent-rules \ | |
d7783ebb | 122 | %{?with_cython:--enable-cython} \ |
ee308c4a JP |
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 \ | |
d7783ebb JB |
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 | |
ee308c4a JP |
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) | |
d7783ebb | 158 | %doc AUTHORS NEWS.md README.md data/etc/udev/rules.d/*.rules data/etc/X11/xorg.conf.d/*.conf |
ee308c4a JP |
159 | %attr(755,root,root) %{_bindir}/ddcutil |
160 | %attr(755,root,root) %{_libdir}/libddcutil.so.*.*.* | |
6ed62b85 | 161 | %attr(755,root,root) %ghost %{_libdir}/libddcutil.so.2 |
ee308c4a | 162 | %{_mandir}/man1/ddcutil.1* |
ee308c4a JP |
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 | |
d7783ebb JB |
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 |