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