]> git.pld-linux.org Git - packages/libechonest.git/blob - libechonest.spec
add qt5
[packages/libechonest.git] / libechonest.spec
1 #
2 # Conditional build:
3 %bcond_with     tests           # build with tests. tests need active internet connection
4 %bcond_without  qt4                     # Qt4
5 %bcond_without  qt5                     # Qt5
6
7 Summary:        C++ wrapper for the Echo Nest API
8 Name:           libechonest
9 Version:        2.3.1
10 Release:        1
11 License:        GPL v2+
12 Group:          Libraries
13 Source0:        http://files.lfranchi.com/%{name}-%{version}.tar.bz2
14 # Source0-md5:  d8c60545b056145dc66882971a0acf9c
15 URL:            https://projects.kde.org/projects/playground/libs/libechonest
16 BuildRequires:  cmake
17 BuildRequires:  pkgconfig
18 BuildRequires:  qjson-devel
19 %if %{with qt4}
20 BuildRequires:  QtNetwork-devel
21 BuildRequires:  qt4-build
22 %endif
23 %if %{with qt5}
24 BuildRequires:  Qt5Network-devel
25 %endif
26 BuildRequires:  rpmbuild(macros) >= 1.605
27 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28
29 # includedir files "conflict"
30 %define         _duplicate_files_terminate_build   0
31
32 # Unresolved symbol __stack_chk_fail in libechonest.so.2.1.0
33 %ifarch i486
34 %define skip_post_check_so      libechonest.so.%{version}
35 %endif
36
37 %description
38 libechonest is a collection of Qt4 classes designed to make a
39 developer's life easy when trying to use the APIs provided by The Echo
40 Nest.
41
42 %package devel
43 Summary:        Development files for %{name}
44 Group:          Development/Libraries
45 Requires:       %{name} = %{version}-%{release}
46
47 %description devel
48 The %{name}-devel package contains libraries and header files for
49 developing applications that use %{name}.
50
51 %package -n libechonest-qt5
52 Summary:        libechonest Qt5 bindings
53 Group:          Libraries
54
55 %description -n libechonest-qt5
56 libechonest is a collection of Qt5 classes designed to make a
57 developer's life easy when trying to use the APIs provided by The Echo
58 Nest.
59
60 %package -n libechonest-qt5-devel
61 Summary:        Development files for libechonest-qt5
62 Group:          Development/Libraries
63 Requires:       libechonest-qt5 = %{version}-%{release}
64
65 %description -n libechonest-qt5-devel
66 Development files for libechonest-qt5.
67
68 %prep
69 %setup -q
70
71 %build
72 install -d build-qt4
73 cd build-qt4
74 %cmake \
75         -DBUILD_WITH_QT4:BOOL=ON \
76         -DECHONEST_BUILD_TESTS:BOOL=%{?with_tests:ON}%{!?with_tests:OFF} \
77         ..
78 %{__make}
79
80 %if %{with tests}
81 export PKG_CONFIG_PATH=$(pwd)
82 test "$(pkg-config --modversion libechonest)" = "%{version}"
83 %{__make} test ARGS="--timeout 300 --output-on-failure"
84 %endif
85
86 cd ..
87
88 %if %{with qt5}
89 install -d build-qt5
90 cd build-qt5
91 %cmake \
92         -DBUILD_WITH_QT4:BOOL=OFF \
93         -DECHONEST_BUILD_TESTS:BOOL=%{?with_tests:ON}%{!?with_tests:OFF} \
94         ..
95 %{__make}
96
97 %if %{with tests}
98 export PKG_CONFIG_PATH=$(pwd)
99 test "$(pkg-config --modversion libechonest5)" = "%{version}"
100 %{__make} test ARGS="--timeout 300 --output-on-failure"
101 %endif
102 %endif
103
104 %install
105 rm -rf $RPM_BUILD_ROOT
106 %if %{with qt4}
107 %{__make} -C build-qt4 install/fast \
108         DESTDIR=$RPM_BUILD_ROOT
109 %endif
110
111 %if %{with qt5}
112 %{__make} -C build-qt5 install/fast \
113         DESTDIR=$RPM_BUILD_ROOT
114 %endif
115
116 %clean
117 rm -rf $RPM_BUILD_ROOT
118
119 %post   -p /sbin/ldconfig
120 %postun -p /sbin/ldconfig
121
122 %post   -n libechonest-qt5 -p /sbin/ldconfig
123 %postun -n libechonest-qt5 -p /sbin/ldconfig
124
125 %if %{with qt4}
126 %files
127 %defattr(644,root,root,755)
128 %doc AUTHORS README TODO
129 %attr(755,root,root) %{_libdir}/libechonest.so.*.*.*
130 # yes, SONAME is "libechonest.so.2.3"
131 %ghost %{_libdir}/libechonest.so.2.3
132
133 %files devel
134 %defattr(644,root,root,755)
135 %{_includedir}/echonest
136 %{_libdir}/libechonest.so
137 %{_pkgconfigdir}/libechonest.pc
138 %endif
139
140 %if %{with qt5}
141 %files -n libechonest-qt5
142 %doc AUTHORS README TODO
143 %attr(755,root,root) %{_libdir}/libechonest5.so.*.*.*
144 # yes, SONAME is "libechonest5.so.2.3"
145 %ghost %{_libdir}/libechonest5.so.2.3
146
147 %files -n libechonest-qt5-devel
148 %{_includedir}/echonest
149 %{_libdir}/libechonest5.so
150 %{_pkgconfigdir}/libechonest5.pc
151 %endif
This page took 0.069268 seconds and 3 git commands to generate.