-
Notifications
You must be signed in to change notification settings - Fork 52
/
libmodulemd.spec.in
145 lines (105 loc) · 3.31 KB
/
libmodulemd.spec.in
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
%global libmodulemd_version @VERSION@
%if ( 0%{?fedora} && 0%{?fedora} <= 30 ) || ( 0%{?rhel} && 0%{?rhel} <= 7)
%global build_python2 1
%global meson_python_flags -Dwith_py3_overrides=true -Dwith_py2_overrides=true
%else
%global build_python2 0
%global meson_python_flags -Dwith_py3_overrides=true -Dwith_py2_overrides=false
%endif
Name: libmodulemd
Version: %{libmodulemd_version}
Release: 0%{?dist}.@DATETIME@
Summary: Module metadata manipulation library
License: MIT
URL: https://github.com/fedora-modularity/libmodulemd
Source0: %{url}/releases/download/%{name}-%{version}/modulemd-%{version}.tar.xz
BuildRequires: meson >= 0.47
BuildRequires: pkgconfig
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: pkgconfig(gobject-2.0)
BuildRequires: pkgconfig(gobject-introspection-1.0)
BuildRequires: pkgconfig(yaml-0.1)
BuildRequires: pkgconfig(gtk-doc)
%if %{build_python2}
BuildRequires: python2-devel
BuildRequires: python-gobject-base
%endif
BuildRequires: python3-devel
BuildRequires: python3-gobject-base
BuildRequires: valgrind
BuildRequires: glib2-doc
BuildRequires: rpm-devel
BuildRequires: file-devel
# Patches
%description
C Library for manipulating module metadata files.
See https://github.com/fedora-modularity/libmodulemd/blob/master/README.md for
more details.
%if %{build_python2}
%package -n python2-%{name}
Summary: Python 2 bindings for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: python-gobject-base
Requires: python-six
Obsoletes: python2-modulemd < 1.3.4
%description -n python2-%{name}
Python 2 bindings for %{name}
%endif
%package -n python3-%{name}
Summary: Python 3 bindings for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: python3-gobject-base
Requires: %{py3_dist six}
Obsoletes: python3-modulemd < 1.3.4
%description -n python3-%{name}
Python 3 bindings for %{name}
%package devel
Summary: Development files for libmodulemd
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
Development files for libmodulemd.
%prep
%autosetup -p1 -n modulemd-%{libmodulemd_version}
%build
%meson -Ddeveloper_build=false \
-Dskip_formatters=true \
%{meson_python_flags}
%if 0%{?rhel} && 0%{?rhel} <= 7
# ALERT!!! PURE HACK FOR EPEL!
# https://bugzilla.redhat.com/show_bug.cgi?id=1546757
sed -r -i -e "/g-ir-scanner/s/-l(gobject-2.0|glib-2.0|yaml)//g" %{_vpath_builddir}/build.ninja
%endif
%meson_build
%check
export LC_CTYPE=C.utf8
%ifnarch %{valgrind_arches}
export MMD_SKIP_VALGRIND=1
%endif
# The tests sometimes time out in CI, so give them a little extra time
%{__meson} test -C %{_vpath_builddir} %{?_smp_mesonflags} --print-errorlogs -t 5
%install
%meson_install
%files
%license COPYING
%doc README.md
%{_bindir}/modulemd-validator
%{_libdir}/%{name}.so.2*
%dir %{_libdir}/girepository-1.0
%{_libdir}/girepository-1.0/Modulemd-2.0.typelib
%files devel
%{_libdir}/%{name}.so
%{_libdir}/pkgconfig/modulemd-2.0.pc
%{_includedir}/modulemd-2.0/
%dir %{_datadir}/gir-1.0
%{_datadir}/gir-1.0/Modulemd-2.0.gir
%dir %{_datadir}/gtk-doc
%dir %{_datadir}/gtk-doc/html
%{_datadir}/gtk-doc/html/modulemd-2.0/
%if %{build_python2}
%files -n python2-%{name}
%{python2_sitearch}/gi/overrides/
%endif
%files -n python3-%{name}
%{python3_sitearch}/gi/overrides/
%changelog