Change LGPL-2.1+ to LGPL-2.1-or-later
[platform/upstream/json-glib.git] / packaging / json-glib.spec
1 Name:           json-glib
2 Version:        1.8.0
3 Release:        0
4 Summary:        Library for JavaScript Object Notation format
5 License:        LGPL-2.1+
6 Group:          Development/Libraries/C and C++
7 Url:            https://wiki.gnome.org/Projects/JsonGlib
8 Source0:        https://download.gnome.org/sources/json-glib/1.6/%{name}-%{version}.tar.xz
9 Source99:       baselibs.conf
10 Source1001:     json-glib.manifest
11 Source1002:     apply_PIE_option.patch
12 BuildRequires:  gettext
13 BuildRequires:  gobject-introspection-devel
14 BuildRequires:  pkgconfig(glib-2.0)
15 BuildRequires:  meson
16
17 %description
18 JSON-GLib provides a parser and a generator GObject classes and various
19 wrappers for the complex data types employed by JSON, such as arrays
20 and objects.
21
22 JSON-GLib uses GLib native data types and the generic value container
23 GValue for ease of development. It also provides integration with the
24 GObject classes for direct serialization into, and deserialization from,
25 JSON data streams.
26
27 %package -n libjson-glib
28 Summary:        Library for JavaScript Object Notation format
29 # To make lang subpackage installable
30 Group:          Development/Libraries/C and C++
31 Recommends:     %{name}-lang
32 Provides:       %{name} = %{version}
33
34 %description -n libjson-glib
35 JSON is a lightweight data-interchange format. It is comparatively
36 easy for humans to read and write, and for machines to parse and generate.
37
38 JSON-GLib provides a parser and a generator GObject classes and various
39 wrappers for the complex data types employed by JSON, such as arrays
40 and objects.
41
42 JSON-GLib uses GLib native data types and the generic value container
43 GValue for ease of development. It also provides integration with the
44 GObject classes for direct serialization into, and deserialization from,
45 JSON data streams.
46
47 %package -n typelib-Json
48 Summary:        Introspection bindings for libjson-glib
49 Group:          System/Libraries
50
51 %description -n typelib-Json
52 JSON-GLib provides a parser and a generator GObject classes and various
53 wrappers for the complex data types employed by JSON, such as arrays
54 and objects.
55
56 This package provides the GObject Introspection bindings for JSON-GLib.
57
58 %package devel
59 Summary:        Development files for libjson-glib
60 Group:          Development/Libraries/C and C++
61 Requires:       libjson-glib = %{version}
62 Requires:       typelib-Json = %{version}
63 #BuildRequires:  gettext
64 #BuildRequires:  gtk-doc
65
66 %description devel
67 JSON-GLib provides a parser and a generator GObject classes and various
68 wrappers for the complex data types employed by JSON, such as arrays
69 and objects.
70
71 This package contains development files needed to develop with the
72 json-glib library.
73
74 %lang_package
75
76 %prep
77 %setup -q
78 cp %{SOURCE1001} .
79 %{__patch} -p1 < %{SOURCE1002}
80
81 %build
82 export CFLAGS+=" -fPIC"
83
84 mkdir -p builddir
85 meson --prefix /usr --libdir %{_libdir} builddir
86
87
88 %check
89 ninja -C builddir meson-test || exit 0
90
91 %install
92 DESTDIR=%{buildroot} ninja -C builddir install
93 find %{buildroot}%{_libdir} -name '*.la' -delete -print
94 %find_lang %{name}-1.0
95
96 mv %{name}-1.0.lang %{name}.lang
97 %__rm -rf %{buildroot}%{_datadir}/gtk-doc
98
99 %post -n libjson-glib -p /sbin/ldconfig
100
101 %postun -n libjson-glib -p /sbin/ldconfig
102
103 %files -n libjson-glib
104 %manifest %{name}.manifest
105 %defattr(-,root,root)
106 %{_bindir}/json-glib-format
107 %{_bindir}/json-glib-validate
108 %license COPYING
109 %{_libdir}/*.so.*
110
111 %files -n typelib-Json
112 %manifest %{name}.manifest
113 %defattr(-,root,root)
114 %{_libdir}/girepository-1.0/Json-1.0.typelib
115
116 %files devel
117 %manifest %{name}.manifest
118 %defattr(-,root,root)
119 %{_includedir}/%{name}-1.0
120 %{_libdir}/*.so
121 %{_libdir}/pkgconfig/*.pc
122 %{_datadir}/gir-1.0/*.gir
123 %dir %{_datadir}/installed-tests
124 %dir %{_libexecdir}/installed-tests
125 %{_datadir}/installed-tests/json-glib-1.0/
126 %{_libexecdir}/installed-tests/json-glib-1.0/
127
128 #%files lang -f %{name}-1.0.lang
129
130 %changelog
131