]>
Commit | Line | Data |
---|---|---|
1c140aca ER |
1 | # NOTE: |
2 | # - qt5 build fails to find files if rpm BUILD dir is symlink | |
3 | # | |
4 | # Conditional build: | |
5 | %bcond_without qt4 # Qt4 | |
6 | %bcond_without qt5 # Qt5 | |
4e5bdaab | 7 | %bcond_without fingerprint # build/include liblastfm_fingerprint |
1c140aca | 8 | |
4684897b | 9 | Summary: Library to access Last.fm features |
10 | Name: liblastfm | |
84425f4b ER |
11 | Version: 1.0.9 |
12 | Release: 1 | |
4684897b | 13 | License: GPL v3 |
14 | Group: Libraries | |
84425f4b ER |
15 | Source0: https://github.com/lastfm/liblastfm/archive/%{version}/%{name}-%{version}.tar.gz |
16 | # Source0-md5: 8748f423f66f2fbc38c39f9153d01a71 | |
84425f4b | 17 | URL: https://github.com/lastfm/liblastfm |
84425f4b | 18 | BuildRequires: cmake >= 2.8.6 |
ee9bbab0 | 19 | BuildRequires: libstdc++-devel |
c686ecc9 | 20 | BuildRequires: sed >= 4.0 |
4e5bdaab ER |
21 | %if %{with fingerprint} |
22 | BuildRequires: fftw3-single-devel | |
23 | BuildRequires: libsamplerate-devel | |
5e90fc68 | 24 | BuildRequires: pkgconfig |
4e5bdaab | 25 | %endif |
1c140aca | 26 | %if %{with qt4} |
ee9bbab0 | 27 | BuildRequires: QtDBus-devel |
1c140aca ER |
28 | BuildRequires: QtGui-devel |
29 | BuildRequires: QtNetwork-devel | |
1c140aca ER |
30 | BuildRequires: QtTest-devel |
31 | BuildRequires: QtXml-devel | |
32 | BuildRequires: qt4-build | |
33 | BuildRequires: qt4-qmake | |
5e90fc68 ER |
34 | %if %{with fingerprint} |
35 | BuildRequires: QtSql-devel | |
36 | %endif | |
1c140aca ER |
37 | %endif |
38 | %if %{with qt5} | |
ee9bbab0 | 39 | BuildRequires: Qt5DBus-devel |
1c140aca ER |
40 | BuildRequires: Qt5Gui-devel |
41 | BuildRequires: Qt5Network-devel | |
1c140aca ER |
42 | BuildRequires: Qt5Test-devel |
43 | BuildRequires: Qt5Xml-devel | |
44 | BuildRequires: qt5-build | |
45 | BuildRequires: qt5-qmake | |
5e90fc68 ER |
46 | %if %{with fingerprint} |
47 | BuildRequires: Qt5Sql-devel | |
48 | %endif | |
1c140aca | 49 | %endif |
4684897b | 50 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
51 | ||
1c140aca ER |
52 | # includedir files "conflict" |
53 | %define _duplicate_files_terminate_build 0 | |
54 | ||
4684897b | 55 | %description |
56 | liblastfm is a collection of libraries to help you integrate Last.fm | |
57 | services into your rich desktop software. It is officially supported | |
58 | software developed by Last.fm staff. | |
59 | ||
60 | %package devel | |
61 | Summary: Header files for %{name} | |
62 | Summary(pl.UTF-8): Pliki nagłówkowe %{name} | |
63 | Group: Development/Libraries | |
64 | Requires: %{name} = %{version}-%{release} | |
65 | ||
66 | %description devel | |
67 | Header files for %{name}. | |
68 | ||
69 | %description devel -l pl.UTF-8 | |
70 | Pliki nagłówkowe %{name}. | |
71 | ||
1c140aca ER |
72 | %package qt5 |
73 | Summary: Qt5 libraries to integrate Last.fm services | |
74 | Group: Libraries | |
75 | ||
76 | %description qt5 | |
77 | Qt5 libraries to integrate Last.fm services. | |
78 | ||
79 | ||
80 | %package qt5-devel | |
81 | Summary: Development files for liblastfm-qt5 | |
82 | Requires: %{name}-qt5 = %{version}-%{release} | |
83 | ||
84 | %description qt5-devel | |
85 | Development files for liblastfm-qt5. | |
86 | ||
4684897b | 87 | %prep |
84425f4b | 88 | %setup -q |
4684897b | 89 | |
90 | %build | |
1c140aca ER |
91 | %if %{with qt4} |
92 | install -d build-qt4 | |
93 | cd build-qt4 | |
84425f4b ER |
94 | %cmake \ |
95 | -DBUILD_WITH_QT4:BOOL=ON \ | |
4e5bdaab | 96 | -DBUILD_FINGERPRINT:BOOL=%{?with_fingerprint:ON}%{!?with_fingerprint:OFF} \ |
84425f4b | 97 | .. |
1c140aca ER |
98 | %{__make} |
99 | cd .. | |
100 | %endif | |
101 | ||
102 | %if %{with qt5} | |
103 | install -d build-qt5 | |
104 | cd build-qt5 | |
105 | %cmake \ | |
106 | -DBUILD_WITH_QT4:BOOL=OFF \ | |
4e5bdaab | 107 | -DBUILD_FINGERPRINT:BOOL=%{?with_fingerprint:ON}%{!?with_fingerprint:OFF} \ |
1c140aca ER |
108 | .. |
109 | %{__make} | |
110 | cd .. | |
111 | %endif | |
4684897b | 112 | |
113 | %install | |
114 | rm -rf $RPM_BUILD_ROOT | |
1c140aca ER |
115 | %if %{with qt4} |
116 | %{__make} -C build-qt4 install/fast \ | |
4684897b | 117 | DESTDIR=$RPM_BUILD_ROOT |
1c140aca ER |
118 | %endif |
119 | ||
120 | %if %{with qt5} | |
121 | %{__make} -C build-qt5 install/fast \ | |
122 | DESTDIR=$RPM_BUILD_ROOT | |
123 | %endif | |
4684897b | 124 | |
125 | %clean | |
126 | rm -rf $RPM_BUILD_ROOT | |
127 | ||
128 | %post -p /sbin/ldconfig | |
129 | %postun -p /sbin/ldconfig | |
130 | ||
1c140aca | 131 | %if %{with qt4} |
4684897b | 132 | %files |
133 | %defattr(644,root,root,755) | |
84425f4b | 134 | %doc README.md |
1c140aca ER |
135 | %attr(755,root,root) %{_libdir}/liblastfm.so.*.* |
136 | %attr(755,root,root) %ghost %{_libdir}/liblastfm.so.1 | |
4e5bdaab | 137 | %if %{with fingerprint} |
1c140aca ER |
138 | %attr(755,root,root) %{_libdir}/liblastfm_fingerprint.so.*.* |
139 | %attr(755,root,root) %ghost %{_libdir}/liblastfm_fingerprint.so.1 | |
4e5bdaab | 140 | %endif |
4684897b | 141 | |
142 | %files devel | |
143 | %defattr(644,root,root,755) | |
144 | %attr(755,root,root) %{_libdir}/%{name}.so | |
4e5bdaab | 145 | %if %{with fingerprint} |
4684897b | 146 | %attr(755,root,root) %{_libdir}/%{name}_fingerprint.so |
4e5bdaab | 147 | %endif |
4684897b | 148 | %{_includedir}/lastfm |
1c140aca ER |
149 | %endif |
150 | ||
151 | %if %{with qt5} | |
152 | %files qt5 | |
153 | %defattr(644,root,root,755) | |
154 | %doc README.md | |
155 | %attr(755,root,root) %{_libdir}/liblastfm5.so.*.*.* | |
156 | %attr(755,root,root) %ghost %{_libdir}/liblastfm5.so.1 | |
4e5bdaab | 157 | %if %{with fingerprint} |
1c140aca ER |
158 | %attr(755,root,root) %{_libdir}/liblastfm_fingerprint5.so.*.*.* |
159 | %attr(755,root,root) %ghost %{_libdir}/liblastfm_fingerprint5.so.1 | |
4e5bdaab | 160 | %endif |
1c140aca ER |
161 | |
162 | %files qt5-devel | |
163 | %defattr(644,root,root,755) | |
164 | %{_libdir}/liblastfm5.so | |
4e5bdaab | 165 | %if %{with fingerprint} |
1c140aca | 166 | %{_libdir}/liblastfm_fingerprint5.so |
4e5bdaab | 167 | %endif |
1c140aca ER |
168 | %{_includedir}/lastfm |
169 | %endif |