From 9e41d4b2675ac3ecae0823df751d0bfe9a846da3 Mon Sep 17 00:00:00 2001 From: TizenOpenSource Date: Mon, 22 Jan 2024 13:28:22 +0900 Subject: [PATCH 1/2] Bump to 1.8.0 Signed-off-by: TizenOpenSource --- packaging/apply_PIE_option.patch | 36 +++++++++++ packaging/baselibs.conf | 1 + packaging/json-glib.manifest | 8 +++ packaging/json-glib.spec | 131 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 176 insertions(+) create mode 100644 packaging/apply_PIE_option.patch create mode 100644 packaging/baselibs.conf create mode 100644 packaging/json-glib.manifest create mode 100644 packaging/json-glib.spec diff --git a/packaging/apply_PIE_option.patch b/packaging/apply_PIE_option.patch new file mode 100644 index 0000000..1f432e3 --- /dev/null +++ b/packaging/apply_PIE_option.patch @@ -0,0 +1,36 @@ +diff --git a/json-glib/meson.build b/json-glib/meson.build +index e13e688..3f6856c 100644 +--- a/json-glib/meson.build ++++ b/json-glib/meson.build +@@ -137,6 +137,7 @@ foreach t: tools + + executable(bin_name, bin_sources, + c_args: json_c_args, ++ link_args: '-pie', + dependencies: json_glib_dep, + install: true) + endforeach +diff --git a/json-glib/tests/meson.build b/json-glib/tests/meson.build +index 1eb56c8..ad1b24b 100644 +--- a/json-glib/tests/meson.build ++++ b/json-glib/tests/meson.build +@@ -46,6 +46,7 @@ foreach t: tests + exe = executable( + t, '@0@.c'.format(t), + c_args: json_c_args, ++ link_args: '-pie', + install: true, + install_dir: installed_test_bindir, + dependencies: [ json_glib_dep, ], +diff --git a/meson.build b/meson.build +index a5e945b..cab2d8f 100644 +--- a/meson.build ++++ b/meson.build +@@ -131,6 +131,7 @@ if get_option('default_library') != 'static' + endif + endif + ++test_cflags += '-fPIC' + common_cflags = cc.get_supported_arguments(test_cflags) + + if get_option('debug') diff --git a/packaging/baselibs.conf b/packaging/baselibs.conf new file mode 100644 index 0000000..d85c0f0 --- /dev/null +++ b/packaging/baselibs.conf @@ -0,0 +1 @@ +libjson-glib diff --git a/packaging/json-glib.manifest b/packaging/json-glib.manifest new file mode 100644 index 0000000..93cab65 --- /dev/null +++ b/packaging/json-glib.manifest @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/packaging/json-glib.spec b/packaging/json-glib.spec new file mode 100644 index 0000000..9edc547 --- /dev/null +++ b/packaging/json-glib.spec @@ -0,0 +1,131 @@ +Name: json-glib +Version: 1.8.0 +Release: 0 +Summary: Library for JavaScript Object Notation format +License: LGPL-2.1+ +Group: Development/Libraries/C and C++ +Url: https://wiki.gnome.org/Projects/JsonGlib +Source0: https://download.gnome.org/sources/json-glib/1.6/%{name}-%{version}.tar.xz +Source99: baselibs.conf +Source1001: json-glib.manifest +Source1002: apply_PIE_option.patch +BuildRequires: gettext +BuildRequires: gobject-introspection-devel +BuildRequires: pkgconfig(glib-2.0) +BuildRequires: meson + +%description +JSON-GLib provides a parser and a generator GObject classes and various +wrappers for the complex data types employed by JSON, such as arrays +and objects. + +JSON-GLib uses GLib native data types and the generic value container +GValue for ease of development. It also provides integration with the +GObject classes for direct serialization into, and deserialization from, +JSON data streams. + +%package -n libjson-glib +Summary: Library for JavaScript Object Notation format +# To make lang subpackage installable +Group: Development/Libraries/C and C++ +Recommends: %{name}-lang +Provides: %{name} = %{version} + +%description -n libjson-glib +JSON is a lightweight data-interchange format. It is comparatively +easy for humans to read and write, and for machines to parse and generate. + +JSON-GLib provides a parser and a generator GObject classes and various +wrappers for the complex data types employed by JSON, such as arrays +and objects. + +JSON-GLib uses GLib native data types and the generic value container +GValue for ease of development. It also provides integration with the +GObject classes for direct serialization into, and deserialization from, +JSON data streams. + +%package -n typelib-Json +Summary: Introspection bindings for libjson-glib +Group: System/Libraries + +%description -n typelib-Json +JSON-GLib provides a parser and a generator GObject classes and various +wrappers for the complex data types employed by JSON, such as arrays +and objects. + +This package provides the GObject Introspection bindings for JSON-GLib. + +%package devel +Summary: Development files for libjson-glib +Group: Development/Libraries/C and C++ +Requires: libjson-glib = %{version} +Requires: typelib-Json = %{version} +#BuildRequires: gettext +#BuildRequires: gtk-doc + +%description devel +JSON-GLib provides a parser and a generator GObject classes and various +wrappers for the complex data types employed by JSON, such as arrays +and objects. + +This package contains development files needed to develop with the +json-glib library. + +%lang_package + +%prep +%setup -q +cp %{SOURCE1001} . +%{__patch} -p1 < %{SOURCE1002} + +%build +export CFLAGS+=" -fPIC" + +mkdir -p builddir +meson --prefix /usr --libdir %{_libdir} builddir + + +%check +ninja -C builddir meson-test || exit 0 + +%install +DESTDIR=%{buildroot} ninja -C builddir install +find %{buildroot}%{_libdir} -name '*.la' -delete -print +%find_lang %{name}-1.0 + +mv %{name}-1.0.lang %{name}.lang +%__rm -rf %{buildroot}%{_datadir}/gtk-doc + +%post -n libjson-glib -p /sbin/ldconfig + +%postun -n libjson-glib -p /sbin/ldconfig + +%files -n libjson-glib +%manifest %{name}.manifest +%defattr(-,root,root) +%{_bindir}/json-glib-format +%{_bindir}/json-glib-validate +%license COPYING +%{_libdir}/*.so.* + +%files -n typelib-Json +%manifest %{name}.manifest +%defattr(-,root,root) +%{_libdir}/girepository-1.0/Json-1.0.typelib + +%files devel +%manifest %{name}.manifest +%defattr(-,root,root) +%{_includedir}/%{name}-1.0 +%{_libdir}/*.so +%{_libdir}/pkgconfig/*.pc +%{_datadir}/gir-1.0/*.gir +%dir %{_datadir}/installed-tests +%dir %{_libexecdir}/installed-tests +%{_datadir}/installed-tests/json-glib-1.0/ +%{_libexecdir}/installed-tests/json-glib-1.0/ + +#%files lang -f %{name}-1.0.lang + +%changelog + -- 2.7.4 From 694e5707eae405e037cdafc5c164e83504ff3612 Mon Sep 17 00:00:00 2001 From: JinWang An Date: Wed, 22 May 2024 17:18:22 +0900 Subject: [PATCH 2/2] Change LGPL-2.1+ to LGPL-2.1-or-later Change-Id: Ie31354374bb6f9fcecd9d8f29850a18e028b2fd2 Signed-off-by: JinWang An --- packaging/json-glib.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/json-glib.spec b/packaging/json-glib.spec index 9edc547..51ec9dc 100644 --- a/packaging/json-glib.spec +++ b/packaging/json-glib.spec @@ -2,7 +2,7 @@ Name: json-glib Version: 1.8.0 Release: 0 Summary: Library for JavaScript Object Notation format -License: LGPL-2.1+ +License: LGPL-2.1-or-later Group: Development/Libraries/C and C++ Url: https://wiki.gnome.org/Projects/JsonGlib Source0: https://download.gnome.org/sources/json-glib/1.6/%{name}-%{version}.tar.xz -- 2.7.4