From 1fa1f5e468e57ee6315e6b81b8af485fa14e9722 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Tue, 22 Nov 2016 03:27:57 +0100 Subject: initial packaging Signed-off-by: Igor Gnatenko --- 0001-build-install-tests-into-libexecdir.patch | 26 +++++++++ graphene.spec | 78 ++++++++++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 0001-build-install-tests-into-libexecdir.patch create mode 100644 graphene.spec diff --git a/0001-build-install-tests-into-libexecdir.patch b/0001-build-install-tests-into-libexecdir.patch new file mode 100644 index 0000000..ef136fc --- /dev/null +++ b/0001-build-install-tests-into-libexecdir.patch @@ -0,0 +1,26 @@ +From aa7e9bb17cb6f1cb3970f9e0ce72d0fdd89ceaf5 Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko +Date: Tue, 22 Nov 2016 02:46:01 +0100 +Subject: [PATCH] build: install tests into libexecdir + +Tests are ELF files, so in case of multilib they will conflict. Using libexecdir will tell that this package is not multilib. +--- + src/tests/meson.build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/tests/meson.build b/src/tests/meson.build +index 0aa8365..fd238a1 100644 +--- a/src/tests/meson.build ++++ b/src/tests/meson.build +@@ -22,7 +22,7 @@ unit_tests = [ + foreach unit: unit_tests + exe = executable(unit, unit + '.c', + install: true, +- install_dir: join_paths(graphene_datadir, 'installed-tests', 'graphene-1.0'), ++ install_dir: join_paths(get_option('prefix'), get_option('libexecdir'), 'installed-tests', 'graphene-1.0'), + dependencies: graphene_dep, + include_directories: graphene_inc, + c_args: [ +-- +2.10.2 + diff --git a/graphene.spec b/graphene.spec new file mode 100644 index 0000000..1324b07 --- /dev/null +++ b/graphene.spec @@ -0,0 +1,78 @@ +%global nsver 1.0 + +%global commit 8a7a4a39c63000ca5f41ddfce8ce80d792f6b9cc +%global shortcommit %(c=%{commit}; echo ${c:0:7}) + +Name: graphene +Version: 1.5.1~git.7.%{shortcommit} +Release: 1%{?dist} +Summary: A thin layer of types for graphic libraries + +License: MIT +URL: https://github.com/ebassi/graphene +Source0: %{url}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz +# https://github.com/ebassi/graphene/pull/78 +Patch0001: 0001-build-install-tests-into-libexecdir.patch + +BuildRequires: gcc +BuildRequires: meson +BuildRequires: pkgconfig(gobject-2.0) + +%description +Graphene provides a small set of mathematical types needed to implement +graphic libraries that deal with 2D and 3D transformations and projections. + +%package devel +Summary: Development libraries and header files for %{name} +Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} + +%description devel +%{summary}. + +%package tests +Summary: Tests for %{name} +Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} + +%description tests +The %{name}-tests package contains tests that can be used to verify +the functionality of the installed %{name} package. + +%prep +%autosetup -n %{name}-%{commit} -p1 + +%build +# https://github.com/mesonbuild/meson/issues/1085 +export LC_ALL=C.UTF-8 +%meson +%meson_build + +%install +%meson_install + +%check +%meson_test + +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + +%files +%license LICENSE +%doc README.md CONTRIBUTING.md +%{_libdir}/libgraphene-%{nsver}.so.* +%dir %{_libdir}/girepository-1.0 +%{_libdir}/girepository-1.0/Graphene-1.0.typelib + +%files devel +%{_libdir}/libgraphene-%{nsver}.so +%{_libdir}/graphene-1.0/ +%{_includedir}/graphene-%{nsver}/ +%{_libdir}/pkgconfig/graphene-%{nsver}.pc +%{_libdir}/pkgconfig/graphene-gobject-%{nsver}.pc +%dir %{_datadir}/gir-1.0 +%{_datadir}/gir-1.0/Graphene-%{nsver}.gir + +%files tests +%dir %{_libexecdir}/installed-tests +%{_libexecdir}/installed-tests/graphene-%{nsver}/ + +%changelog -- cgit