]>
Commit | Line | Data |
---|---|---|
392ecc1d JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without apidocs # API documentation | |
50ba0bd1 JP |
4 | |
5 | %ifarch %{ix86} %{x8664} x32 | |
6 | %define with_pci_io 1 | |
7 | %endif | |
8 | ||
392ecc1d JB |
9 | Summary: Flash ROM programming library |
10 | Summary(pl.UTF-8): Biblioteka do programowania pamięci Flash ROM | |
11 | Name: libflashrom | |
12 | Version: 0 | |
13 | %define gitref cdaebf16a766be01f8f3dfe17c05bc6626da2964 | |
14 | %define snap 20190207 | |
15 | %define rel 1 | |
16 | Release: 0.%{snap}.1 | |
17 | License: GPL v2+ | |
18 | Group: Libraries | |
19 | # releases? (currently only a copy of flashrom releases) https://github.com/fwupd/flashrom/releases | |
20 | # branch https://github.com/fwupd/flashrom/commits/wip/hughsie/fwupd | |
21 | Source0: https://github.com/fwupd/flashrom/archive/%{gitref}/flashrom-%{snap}.tar.gz | |
22 | # Source0-md5: f54475af56c26dd584f804aad4ed708f | |
b0f0b174 | 23 | Patch0: meson_undefined_var.patch |
392ecc1d JB |
24 | URL: https://github.com/fwupd/flashrom |
25 | %{?with_apidocs:BuildRequires: doxygen} | |
26 | BuildRequires: gcc >= 5:3.2 | |
27 | BuildRequires: libftdi1-devel >= 1.0 | |
28 | BuildRequires: libusb-compat-devel >= 0.1 | |
29 | BuildRequires: libusb-devel >= 1.0 | |
30 | BuildRequires: meson >= 0.47.0 | |
31 | BuildRequires: ninja >= 1.5 | |
32 | BuildRequires: pciutils-devel | |
33 | BuildRequires: pkgconfig | |
34 | BuildRequires: rpmbuild(macros) >= 1.736 | |
35 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
36 | ||
37 | %description | |
38 | Flash ROM programming library. | |
39 | ||
40 | %description -l pl.UTF-8 | |
41 | Biblioteka do programowania pamięci Flash ROM. | |
42 | ||
43 | %package devel | |
44 | Summary: Header files for libflashrom library | |
45 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libflashrom | |
46 | Group: Development/Libraries | |
47 | Requires: %{name} = %{version}-%{release} | |
48 | ||
49 | %description devel | |
50 | Header files for libflashrom library. | |
51 | ||
52 | %description devel -l pl.UTF-8 | |
53 | Pliki nagłówkowe biblioteki libflashrom. | |
54 | ||
55 | %package apidocs | |
56 | Summary: API documentation for libflashrom library | |
57 | Summary(pl.UTF-8): Dokumentacja API biblioteki libflashrom | |
58 | Group: Documentation | |
392ecc1d | 59 | BuildArch: noarch |
392ecc1d JB |
60 | |
61 | %description apidocs | |
62 | API documentation for libflashrom library. | |
63 | ||
64 | %description apidocs -l pl.UTF-8 | |
65 | Dokumentacja API biblioteki libflashrom. | |
66 | ||
67 | %prep | |
68 | %setup -q -n flashrom-%{gitref} | |
b0f0b174 | 69 | %patch0 -p0 |
392ecc1d JB |
70 | |
71 | %build | |
72393d0b | 72 | export CFLAGS="%{rpmcflags} -fcommon" |
50ba0bd1 JP |
73 | %meson build \ |
74 | %if %{without pci_io} | |
75 | -Dconfig_nic3com=false \ | |
76 | -Dconfig_nicrealtek=false \ | |
77 | -Dconfig_rayer_spi=false \ | |
78 | -Dconfig_satamv=false | |
79 | %endif | |
392ecc1d JB |
80 | |
81 | %ninja_build -C build | |
82 | ||
83 | %if %{with apidocs} | |
84 | doxygen | |
85 | %endif | |
86 | ||
87 | %install | |
88 | rm -rf $RPM_BUILD_ROOT | |
89 | ||
90 | %ninja_install -C build | |
91 | ||
92 | %clean | |
93 | rm -rf $RPM_BUILD_ROOT | |
94 | ||
95 | %post -p /sbin/ldconfig | |
96 | %postun -p /sbin/ldconfig | |
97 | ||
98 | %files | |
99 | %defattr(644,root,root,755) | |
100 | %doc README Documentation/*.txt | |
101 | %attr(755,root,root) %{_libdir}/libflashrom.so.*.*.* | |
102 | %attr(755,root,root) %ghost %{_libdir}/libflashrom.so.1 | |
103 | ||
104 | %files devel | |
105 | %defattr(644,root,root,755) | |
106 | %attr(755,root,root) %{_libdir}/libflashrom.so | |
107 | %{_includedir}/libflashrom.h | |
108 | %{_pkgconfigdir}/libflashrom.pc | |
109 | ||
110 | %if 0 | |
111 | # is it stable enough to obsolete one from flashrom.spec? | |
112 | %files tools | |
113 | %defattr(644,root,root,755) | |
114 | %attr(755,root,root) %{_sbindir}/flashrom | |
115 | %endif | |
116 | ||
117 | %if %{with apidocs} | |
118 | %files apidocs | |
119 | %defattr(644,root,root,755) | |
120 | %doc libflashrom-doc/html/{search,*.css,*.html,*.js,*.png} | |
121 | %endif |