-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
libogg.spec
143 lines (117 loc) · 3.3 KB
/
libogg.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
%define major 0
%define libname %mklibname ogg %{major}
%define devname %mklibname ogg -d
%define lib32name libogg%{major}
%define dev32name libogg-devel
%global optflags %{optflags} -O3
# flac uses libogg, audiofile uses flac, wine uses audiofile
%ifarch %{x86_64}
%bcond_without compat32
%else
%bcond_with compat32
%endif
# (tpg) enable PGO build
%bcond_without pgo
Summary: Ogg Bitstream Library
Name: libogg
Version: 1.3.5
Release: 4
Group: System/Libraries
License: BSD
Url: http://www.xiph.org/
Source0: http://downloads.xiph.org/releases/ogg/%{name}-%{version}.tar.xz
BuildRequires: cmake
BuildRequires: ninja
%description
Libogg is a library for manipulating ogg bitstreams. It handles
both making ogg bitstreams and getting packets from ogg bitstreams.
%package -n %{libname}
Summary: Main library for %{name}
Group: System/Libraries
%description -n %{libname}
This package contains the library needed to run programs dynamically
linked with %{name}.
%package -n %{devname}
Summary: Headers for developing programs that will use %{name}
Group: Development/C
Requires: %{libname} = %{version}-%{release}
%description -n %{devname}
This package contains the headers that programmers will need to develop
applications which will use %{name}.
%if %{with compat32}
%package -n %{lib32name}
Summary: Main library for %{name} (32-bit)
Group: System/Libraries
BuildRequires: libc6
Requires: libc6
%description -n %{lib32name}
This package contains the library needed to run programs dynamically
linked with %{name}.
%package -n %{dev32name}
Summary: Headers for developing programs that will use %{name} (32-bit)
Group: Development/C
Requires: %{devname} = %{version}-%{release}
Requires: %{lib32name} = %{version}-%{release}
%description -n %{dev32name}
This package contains the headers that programmers will need to develop
applications which will use %{name}.
%endif
%prep
%autosetup -p1
%build
export CONFIGURE_TOP="$(pwd)"
%if %{with compat32}
%cmake32 -DBUILD_SHARED_LIBS=ON -G Ninja
cd ..
%ninja_build -C build32
%endif
%if %{with pgo}
%define _vpath_builddir pgo
mkdir pgo
export LD_LIBRARY_PATH="$(pwd)"
CFLAGS="%{optflags} -fprofile-generate" \
CXXFLAGS="%{optflags} -fprofile-generate" \
LDFLAGS="%{build_ldflags} -fprofile-generate" \
%cmake -DBUILD_SHARED_LIBS=ON -G Ninja
%ninja_build
%ninja_test ||:
unset LD_LIBRARY_PATH
llvm-profdata merge --output=%{name}-llvm.profdata $(find . -name "*.profraw" -type f)
PROFDATA="$(realpath %{name}-llvm.profdata)"
rm -f *.profraw
ninja clean
rm -rf pgo
%undefine _vpath_builddir
CFLAGS="%{optflags} -fprofile-use=$PROFDATA" \
CXXFLAGS="%{optflags} -fprofile-use=$PROFDATA" \
LDFLAGS="%{build_ldflags} -fprofile-use=$PROFDATA" \
%endif
%cmake -DBUILD_SHARED_LIBS=ON -G Ninja
cd ..
%ninja_build
cd ..
%install
%if %{with compat32}
%ninja_install -C build32
%endif
%ninja_install -C build
rm -rf %{buildroot}%{_docdir}/libogg/
%files -n %{libname}
%{_libdir}/libogg.so.%{major}*
%files -n %{devname}
%doc AUTHORS CHANGES
%doc doc/*.html doc/*.png doc/*.txt
%{_includedir}/ogg/*.h
%{_libdir}/*.so
%{_libdir}/pkgconfig/*
%dir %{_libdir}/cmake/Ogg
%{_libdir}/cmake/Ogg/*.cmake
%if %{with compat32}
%files -n %{lib32name}
%{_prefix}/lib/libogg.so.%{major}*
%files -n %{dev32name}
%{_prefix}/lib/*.so
%{_prefix}/lib/pkgconfig/*
%dir %{_prefix}/lib/cmake/Ogg
%{_prefix}/lib/cmake/Ogg/*.cmake
%endif