-
Notifications
You must be signed in to change notification settings - Fork 3
/
anmp.spec
232 lines (181 loc) · 5.36 KB
/
anmp.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# clang <= 3.7 doesnt build with build-id
%if %{defined fedora}
%undefine _missing_build_ids_terminate_build
%endif
%define soname 0
%define builddir build
Name: anmp
Version: 10
Release: 0
License: GPL-2.0
Summary: Another Nameless Music Player
Url: https://www.github.com/derselbst/ANMP
Group: Development/Libraries/C and C++
Source0: anmp-%{version}.tar.bz2
%define sffile OldSeiterPiano.sf2
Source1: %{sffile}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires: libanmp%{soname} = %{version}
%if 0%{?suse_version}
%ifarch x86_64
BuildRequires: clang >= 3.5
%else
BuildRequires: gcc-c++ >= 4.8
%endif
%endif
%if 0%{?mageia}
BuildRequires: cmake >= 1:3.1.0
%else
BuildRequires: cmake >= 3.1.0
%endif
BuildRequires: pkgconfig(fluidsynth) >= 2.2.0
BuildRequires: pkgconfig(smf)
BuildRequires: libaopsf-devel
BuildRequires: libcue-devel
BuildRequires: libgme-devel
BuildRequires: libmad-devel pkgconfig(id3tag)
BuildRequires: pkgconfig(sndfile)
BuildRequires: libmodplug-devel
BuildRequires: vgmstream-devel
%ifarch x86_64 i586 i686
BuildRequires: lazyusf2-devel
%endif
# SuSE specific:
# everything newer openSUSE Leap 15.0 or openSUSE Tumbleweed
%if 0%{?sle_version} >= 150000 || 0%{?suse_version} > 1500
BuildRequires: ffmpeg-4-libavcodec-devel
BuildRequires: ffmpeg-4-libavformat-devel
BuildRequires: ffmpeg-4-libavutil-devel
BuildRequires: ffmpeg-4-libswresample-devel
BuildRequires: update-desktop-files
%endif
# CentOS specific:
%if %{defined centos_version}
%endif
# Fedora specific:
%if %{defined fedora}
%endif
# Mageia specific:
%if %{defined mageia}
%endif
# RedHat specific:
%if %{defined rhel_version}
%endif
BuildRequires: pkgconfig(alsa)
BuildRequires: pkgconfig(jack) pkgconfig(samplerate)
BuildRequires: pkgconfig(portaudio-2.0)
BuildRequires: libebur128-devel
BuildRequires: pkgconfig(Qt5Widgets)
BuildRequires: pkgconfig(Qt5DBus)
BuildRequires: pkgconfig(Qt5OpenGL)
%description
A MusicPlayer capable of playing various formats.
The key features are:
- gapless playback
- cue sheets
- arbitrary (forward) looping of songs
- easy attempt to implement new formats
%package -n libanmp%{soname}
Summary: Core lib for %{name}
Group: Development/Libraries/C and C++
%description -n libanmp%{soname}
Library providing basic functionality for %{name}
%package devel
Summary: Development files for %{name}
Group: Development/Libraries/C and C++
Requires: libanmp%{soname} = %{version}
%description devel
Development files for %{name}
%package progs
Summary: Programs for %{name}
Group: Development/Libraries/C and C++
Requires: libanmp%{soname} = %{version}
%description progs
Additional useful tools for %{name}
%prep
%setup -q
%build
mkdir -p %{builddir}
cd %{builddir}
# clang fails linking the stack guard on ppc64 and has problems with std::atomic on i586
# but clang is cool, so use it on x86_64, else fallback to gcc
%if 0%{?suse_version}
%ifarch x86_64
export CC=clang
export CXX=clang++
%endif
%endif
cmake .. \
-DFLUIDSYNTH_DEFAULT_SF2=%{_datadir}/%{name}/%{sffile} \
-DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \
-DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \
-DLIB_INSTALL_DIR:PATH=%{_libdir} \
-DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir} \
-DSHARE_INSTALL_PREFIX:PATH=%{_datadir} \
-DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_C_FLAGS="${CFLAGS:-%optflags} -DNDEBUG" \
-DCMAKE_CXX_FLAGS="${CXXFLAGS:-%optflags} -DNDEBUG" \
-DCMAKE_EXE_LINKER_FLAGS="-Wl,--as-needed -Wl,--no-undefined -Wl,-z,now" \
-DCMAKE_MODULE_LINKER_FLAGS="-Wl,--as-needed -Wl,--no-undefined -Wl,-z,now" \
-DCMAKE_SHARED_LINKER_FLAGS="-Wl,--as-needed -Wl,--no-undefined -Wl,-z,now" \
%if "%{?_lib}" == "lib64"
-DLIB_SUFFIX=64 \
%endif
-DCMAKE_SKIP_RPATH:BOOL=ON \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DBUILD_SHARED_LIBS:BOOL=ON \
-DBUILD_STATIC_LIBS:BOOL=OFF \
-DCMAKE_COLOR_MAKEFILE:BOOL=OFF \
-DCMAKE_INSTALL_DO_STRIP:BOOL=OFF \
-DCMAKE_MODULES_INSTALL_DIR=%{_datadir}/cmake/Modules
make %{?_smp_mflags}
%install
make VERBOSE=1 DESTDIR=%{buildroot} install/fast -C %{builddir}
ln -s /%{_bindir}/anmp-qt %{buildroot}/%{_bindir}/anmp
mkdir -p %{buildroot}%{_datadir}/%{name}/
install %{SOURCE1} %{buildroot}%{_datadir}/%{name}/
%if 0%{?suse_version}
%suse_update_desktop_file -i anmp
%endif
%check
cd %{builddir}
export CTEST_OUTPUT_ON_FAILURE=1
export LD_LIBRARY_PATH=%{buildroot}/%{_libdir}/:$LD_LIBRARY_PATH
%if !%{defined fedora}
make check
%endif
%post -n libanmp%{soname} -p /sbin/ldconfig
%if 0%{?suse_version}
%desktop_database_post
#icon_theme_cache_post
#icon_theme_cache_post HighContrast
%mime_database_post
%endif
%postun -n libanmp%{soname} -p /sbin/ldconfig
%if 0%{?suse_version}
%desktop_database_postun
#icon_theme_cache_postun
#icon_theme_cache_postun HighContrast
%mime_database_postun
%endif
%files
%defattr(-,root,root)
%{_bindir}/anmp
%{_bindir}/anmp-qt
%dir %{_datadir}/%{name}/
%{_datadir}/%{name}/%{sffile}
%if 0%{?suse_version}
%{_datadir}/applications/anmp.desktop
%endif
%files devel
%defattr(-,root,root)
%{_libdir}/libanmp.so
%{_includedir}/anmp/
%files -n libanmp%{soname}
%defattr(-,root,root)
%{_libdir}/libanmp.so.*
%files progs
%defattr(-,root,root)
%{_bindir}/anmp-normalize
%{_bindir}/anmp-dump