Bump to 1.8.0 accepted/tizen_unified accepted/tizen_unified_toolchain accepted/tizen_unified_x sandbox/json-glib_1.8.0 tizen accepted/tizen/unified/20240131.064030 accepted/tizen/unified/20240131.064138 accepted/tizen/unified/20240131.064231 accepted/tizen/unified/toolchain/20240311.070018 accepted/tizen/unified/x/20240205.064026
authorTizenOpenSource <tizenopensrc@samsung.com>
Mon, 22 Jan 2024 04:28:22 +0000 (13:28 +0900)
committerTizenOpenSource <tizenopensrc@samsung.com>
Mon, 22 Jan 2024 04:28:22 +0000 (13:28 +0900)
Signed-off-by: TizenOpenSource <tizenopensrc@samsung.com>
packaging/apply_PIE_option.patch [new file with mode: 0644]
packaging/baselibs.conf [new file with mode: 0644]
packaging/json-glib.manifest [new file with mode: 0644]
packaging/json-glib.spec [new file with mode: 0644]

diff --git a/packaging/apply_PIE_option.patch b/packaging/apply_PIE_option.patch
new file mode 100644 (file)
index 0000000..1f432e3
--- /dev/null
@@ -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 (file)
index 0000000..d85c0f0
--- /dev/null
@@ -0,0 +1 @@
+libjson-glib
diff --git a/packaging/json-glib.manifest b/packaging/json-glib.manifest
new file mode 100644 (file)
index 0000000..93cab65
--- /dev/null
@@ -0,0 +1,8 @@
+<manifest>
+ <request>
+    <domain name="_"/>
+ </request>
+ <assign>
+   <filesystem path="/usr/bin/*" exec_label="none" />
+ </assign>
+</manifest>
diff --git a/packaging/json-glib.spec b/packaging/json-glib.spec
new file mode 100644 (file)
index 0000000..9edc547
--- /dev/null
@@ -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
+