]>
Commit | Line | Data |
---|---|---|
b8f9753f JB |
1 | # |
2 | # Conditional build: | |
8fe07087 JB |
3 | %bcond_without apidocs # API documentation |
4 | %bcond_without static_libs # static library | |
0c72b7a8 | 5 | %bcond_without vala # Vala API |
b45f2707 | 6 | |
b8f9753f JB |
7 | Summary: GUsb - GObject wrapper for libusb1 library |
8 | Summary(pl.UTF-8): GUsb - obudowanie GObject biblioteki libusb1 | |
9 | Name: libgusb | |
eca90f63 | 10 | Version: 0.4.2 |
34638842 | 11 | Release: 1 |
b8f9753f JB |
12 | License: LGPL v2.1+ |
13 | Group: Libraries | |
4d22d43d | 14 | Source0: https://people.freedesktop.org/~hughsient/releases/%{name}-%{version}.tar.xz |
eca90f63 | 15 | # Source0-md5: 32367173c06f1837e9cb943e778764cd |
8fe07087 | 16 | BuildRequires: gcc >= 5:3.2 |
c6fb2f40 | 17 | BuildRequires: glib2-devel >= 1:2.44.0 |
0c72b7a8 | 18 | BuildRequires: gobject-introspection-devel >= 1.29 |
eca90f63 JP |
19 | %{?with_apidocs:BuildRequires: gi-docgen >= 2021.1} |
20 | BuildRequires: json-glib-devel >= 1.1.1 | |
52721825 | 21 | BuildRequires: libusb-devel >= 1.0.22 |
eca90f63 | 22 | BuildRequires: meson >= 0.49.0 |
0f59d908 | 23 | BuildRequires: ninja >= 1.5 |
b8f9753f | 24 | BuildRequires: pkgconfig |
e164c17c | 25 | BuildRequires: rpm-build >= 4.6 |
0f59d908 | 26 | BuildRequires: rpmbuild(macros) >= 1.736 |
8fe07087 | 27 | BuildRequires: sed >= 4.0 |
b8f9753f | 28 | BuildRequires: tar >= 1:1.22 |
0c72b7a8 | 29 | %{?with_vala:BuildRequires: vala >= 2:0.16} |
b8f9753f | 30 | BuildRequires: xz |
c6fb2f40 | 31 | Requires: glib2 >= 1:2.44.0 |
52721825 | 32 | Requires: libusb >= 1.0.22 |
b8f9753f JB |
33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
34 | ||
35 | %description | |
36 | GUsb is a GObject wrapper for libusb1 that makes it easy to do | |
37 | asynchronous control, bulk and interrupt transfers with proper | |
38 | cancellation and integration into a mainloop. This makes it easy to | |
39 | integrate low level USB transfers with your high-level application or | |
40 | system daemon. | |
41 | ||
42 | %description -l pl.UTF-8 | |
43 | GUsb to obudowanie GObject biblioteki libusb1, ułatwiające | |
b45f2707 ER |
44 | asynchroniczne sterowanie oraz przesyłanie danych (typu bulk jak i z |
45 | użyciem przerwań) z właściwym przerywaniem i integracją w głównej | |
b8f9753f JB |
46 | pętli. Ułatwia to integrowanie niskopoziomowego przesyłania danych po |
47 | USB w wysokopoziomowej aplikacji lub demonie systemowym. | |
48 | ||
49 | %package devel | |
50 | Summary: Header files for GUsb library | |
51 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki GUsb | |
52 | Group: Development/Libraries | |
53 | Requires: %{name} = %{version}-%{release} | |
c6fb2f40 | 54 | Requires: glib2-devel >= 1:2.44.0 |
52721825 | 55 | Requires: libusb-devel >= 1.0.22 |
b8f9753f JB |
56 | |
57 | %description devel | |
58 | Header files for GUsb library. | |
59 | ||
60 | %description devel -l pl.UTF-8 | |
61 | Pliki nagłówkowe biblioteki GUsb. | |
62 | ||
63 | %package static | |
64 | Summary: Static GUsb library | |
65 | Summary(pl.UTF-8): Statyczna biblioteka GUsb | |
66 | Group: Development/Libraries | |
67 | Requires: %{name}-devel = %{version}-%{release} | |
68 | ||
69 | %description static | |
70 | Static GUsb library. | |
71 | ||
72 | %description static -l pl.UTF-8 | |
73 | Statyczna biblioteka GUsb. | |
74 | ||
75 | %package apidocs | |
76 | Summary: GUsb API documentation | |
77 | Summary(pl.UTF-8): Dokumentacja API biblioteki GUsb | |
78 | Group: Documentation | |
b4e7b800 | 79 | BuildArch: noarch |
b8f9753f JB |
80 | |
81 | %description apidocs | |
82 | API and internal documentation for GUsb library. | |
83 | ||
84 | %description apidocs -l pl.UTF-8 | |
85 | Dokumentacja API biblioteki GUsb. | |
86 | ||
0c72b7a8 JB |
87 | %package -n vala-libgusb |
88 | Summary: Vala API for libgusb | |
89 | Summary(pl.UTF-8): API języka Vala do libgusb | |
90 | Group: Development/Libraries | |
91 | Requires: %{name}-devel = %{version}-%{release} | |
92 | Requires: vala >= 2:0.16 | |
b45f2707 | 93 | BuildArch: noarch |
0c72b7a8 JB |
94 | |
95 | %description -n vala-libgusb | |
96 | Vala API for libgusb. | |
97 | ||
98 | %description -n vala-libgusb -l pl.UTF-8 | |
99 | API języka Vala do libgusb. | |
100 | ||
b8f9753f JB |
101 | %prep |
102 | %setup -q | |
b8f9753f | 103 | |
8fe07087 JB |
104 | %if %{with static_libs} |
105 | %{__sed} -i -e 's/shared_library/library/' gusb/meson.build | |
106 | %endif | |
107 | ||
b8f9753f | 108 | %build |
43182ba7 | 109 | %meson build \ |
eca90f63 | 110 | -Ddocs=%{__true_false apidocs} \ |
43182ba7 | 111 | -Dvapi=%{__true_false vala} |
8fe07087 | 112 | |
0f59d908 | 113 | %ninja_build -C build |
b8f9753f JB |
114 | |
115 | %install | |
116 | rm -rf $RPM_BUILD_ROOT | |
117 | ||
0f59d908 | 118 | %ninja_install -C build |
b8f9753f | 119 | |
eca90f63 JP |
120 | %if %{with apidocs} |
121 | install -d $RPM_BUILD_ROOT%{_gtkdocdir} | |
122 | %{__mv} $RPM_BUILD_ROOT%{_docdir}/libgusb $RPM_BUILD_ROOT%{_gtkdocdir} | |
123 | %endif | |
124 | ||
b8f9753f JB |
125 | %clean |
126 | rm -rf $RPM_BUILD_ROOT | |
127 | ||
128 | %post -p /sbin/ldconfig | |
129 | %postun -p /sbin/ldconfig | |
130 | ||
131 | %files | |
132 | %defattr(644,root,root,755) | |
8fe07087 | 133 | %doc AUTHORS MAINTAINERS NEWS README.md |
4d22d43d | 134 | %attr(755,root,root) %{_bindir}/gusbcmd |
b8f9753f JB |
135 | %attr(755,root,root) %{_libdir}/libgusb.so.*.*.* |
136 | %attr(755,root,root) %ghost %{_libdir}/libgusb.so.2 | |
0c72b7a8 | 137 | %{_libdir}/girepository-1.0/GUsb-1.0.typelib |
b8f9753f JB |
138 | |
139 | %files devel | |
140 | %defattr(644,root,root,755) | |
141 | %attr(755,root,root) %{_libdir}/libgusb.so | |
142 | %{_includedir}/gusb-1 | |
0c72b7a8 | 143 | %{_datadir}/gir-1.0/GUsb-1.0.gir |
b8f9753f JB |
144 | %{_pkgconfigdir}/gusb.pc |
145 | ||
8fe07087 | 146 | %if %{with static_libs} |
b8f9753f JB |
147 | %files static |
148 | %defattr(644,root,root,755) | |
149 | %{_libdir}/libgusb.a | |
8fe07087 | 150 | %endif |
b8f9753f JB |
151 | |
152 | %if %{with apidocs} | |
153 | %files apidocs | |
154 | %defattr(644,root,root,755) | |
eca90f63 | 155 | %{_gtkdocdir}/libgusb |
b8f9753f | 156 | %endif |
0c72b7a8 JB |
157 | |
158 | %if %{with vala} | |
159 | %files -n vala-libgusb | |
160 | %defattr(644,root,root,755) | |
8fe07087 | 161 | %{_datadir}/vala/vapi/gusb.deps |
0c72b7a8 JB |
162 | %{_datadir}/vala/vapi/gusb.vapi |
163 | %endif |