[packages/diacanvas] - added glib patch (adjust for glib headers usage changes) - added link patch (-lm is needed) - adde
qboosh
qboosh at pld-linux.org
Wed Jun 23 17:28:26 CEST 2021
commit bfe4146ebc7233e3a80bac86d499afe8d25e7f45
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Wed Jun 23 17:31:11 2021 +0200
- added glib patch (adjust for glib headers usage changes)
- added link patch (-lm is needed)
- added python bcond
- drop .la file
- noarch apidocs
diacanvas-glib.patch | 11 +++++++++++
diacanvas-link.patch | 11 +++++++++++
diacanvas.spec | 47 +++++++++++++++++++++++++++++++++++++----------
3 files changed, 59 insertions(+), 10 deletions(-)
---
diff --git a/diacanvas.spec b/diacanvas.spec
index 309c1cb..2a5003a 100644
--- a/diacanvas.spec
+++ b/diacanvas.spec
@@ -1,7 +1,8 @@
#
# Conditional build:
-%bcond_without apidocs # disable gtk-doc
-%bcond_without static_libs # don't build static library
+%bcond_without apidocs # gtk-doc based API documentation
+%bcond_without python # Python (2.x) binding
+%bcond_without static_libs # static library
#
%define src_name diacanvas2
Summary: Library for easely creating diagrams
@@ -11,19 +12,28 @@ Version: 0.14.4
Release: 2
License: LGPL v2+
Group: X11/Libraries
-Source0: http://dl.sourceforge.net/diacanvas/%{src_name}-%{version}.tar.gz
+Source0: https://downloads.sourceforge.net/diacanvas/%{src_name}-%{version}.tar.gz
# Source0-md5: b3db6c961de3023489a4d2419dab89bd
Patch0: %{name}-fix.patch
+Patch1: %{name}-glib.patch
+Patch2: %{name}-link.patch
URL: http://diacanvas.sourceforge.net/
-%{?with_apidocs:BuildRequires: gtk-doc >= 1.0}
+BuildRequires: autoconf
+BuildRequires: automake
+%{?with_apidocs:BuildRequires: gtk-doc >= 1.0}
BuildRequires: libart_lgpl-devel >= 2.0
BuildRequires: libgnomecanvas-devel >= 2.0.0
-BuildRequires: libgnomeprint-devel >= 2.2.0
# libgnomeprintui-devel >= 2.2.0 used for demo only
+BuildRequires: libgnomeprint-devel >= 2.2.0
+BuildRequires: libtool
BuildRequires: pkgconfig
+%if %{with python}
# for canvas.defs
BuildRequires: python-gnome-devel >= 2.0.0
BuildRequires: python-pygtk-devel >= 1:2.0.0
+%endif
+BuildRequires: rpm-build >= 4.6
+BuildRequires: rpmbuild(macros) >= 1.219
Requires: libart_lgpl >= 2.0
Requires: libgnomecanvas >= 2.0.0
Requires: libgnomeprint >= 2.2.0
@@ -69,6 +79,7 @@ Summary: Diacanvas API documentation
Summary(pl.UTF-8): Dokumentacja API Diacanvas
Group: Documentation
Requires: gtk-doc-common
+BuildArch: noarch
%description apidocs
Diacanvas API documentation.
@@ -106,13 +117,20 @@ Pliki dla programistów wiązań języka Python do biblioteki Diacanvas.
%prep
%setup -q -n %{src_name}-%{version}
%patch0 -p1
+%patch1 -p1
+%patch2 -p1
%build
+%{__libtoolize}
+%{__aclocal}
+%{__autoconf}
+%{__autoheader}
+%{__automake}
%configure \
- --%{?with_static_libs:en}%{!?with_static_libs:dis}able-static \
+ --enable-static%{!?with_static_libs:=no} \
--enable-gnome-print \
- --enable-python \
- --%{?with_apidocs:en}%{!?with_apidocs:dis}able-gtk-doc \
+ --enable-gtk-doc%{!?with_apidocs:=no} \
+ %{?with_python:--enable-python} \
%{?with_apidocs:--with-html-dir=%{_gtkdocdir}}
%{__make}
@@ -123,10 +141,17 @@ rm -rf $RPM_BUILD_ROOT
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/libdiacanvas2.la
+
+%if %{with python}
%py_comp $RPM_BUILD_ROOT%{py_sitedir}
%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
%py_postclean
-rm -f $RPM_BUILD_ROOT%{py_sitedir}/%{name}/*.{la,a}
+%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/%{name}/*.la
+%if %{with static_libs}
+%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/%{name}/*.a
+%endif
+%endif
%find_lang %{name}
@@ -140,11 +165,11 @@ rm -rf $RPM_BUILD_ROOT
%defattr(644,root,root,755)
%doc README ChangeLog TODO NEWS AUTHORS
%attr(755,root,root) %{_libdir}/libdiacanvas2.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libdiacanvas2.so.0
%files devel
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libdiacanvas2.so
-%{_libdir}/libdiacanvas2.la
%{_includedir}/diacanvas
%{_pkgconfigdir}/diacanvas2.pc
@@ -160,6 +185,7 @@ rm -rf $RPM_BUILD_ROOT
%{_gtkdocdir}/diacanvas2
%endif
+%if %{with python}
%files -n python-%{name}
%defattr(644,root,root,755)
%dir %{py_sitedir}/%{name}
@@ -169,3 +195,4 @@ rm -rf $RPM_BUILD_ROOT
%files -n python-%{name}-devel
%defattr(644,root,root,755)
%{pydefsdir}/dia*.defs
+%endif
diff --git a/diacanvas-glib.patch b/diacanvas-glib.patch
new file mode 100644
index 0000000..8f1d9cd
--- /dev/null
+++ b/diacanvas-glib.patch
@@ -0,0 +1,11 @@
+--- diacanvas2-0.14.4/diacanvas/dia-canvas.c.orig 2005-01-28 09:11:03.000000000 +0100
++++ diacanvas2-0.14.4/diacanvas/dia-canvas.c 2021-06-20 12:07:45.643449521 +0200
+@@ -18,7 +18,7 @@
+ */
+
+ #include <math.h>
+-#include <glib/garray.h>
++#include <glib.h>
+ #include <libart_lgpl/art_rect.h>
+ #include <libart_lgpl/art_affine.h>
+ #include <pango/pangoft2.h>
diff --git a/diacanvas-link.patch b/diacanvas-link.patch
new file mode 100644
index 0000000..a129622
--- /dev/null
+++ b/diacanvas-link.patch
@@ -0,0 +1,11 @@
+--- diacanvas2-0.14.4/diacanvas/Makefile.am.orig 2006-01-03 13:51:06.000000000 +0100
++++ diacanvas2-0.14.4/diacanvas/Makefile.am 2021-06-23 17:14:13.009629728 +0200
+@@ -114,7 +114,7 @@
+ libdiacanvas2include_HEADERS = $(all_headers) diatypebuiltins.h diamarshal.h dia-features.h
+ libdiacanvas2_la_SOURCES = $(all_sources)
+ libdiacanvas2_la_LDFLAGS = $(no_undefined)
+-libdiacanvas2_la_LIBADD = $(DIACANVAS2_LIBS)
++libdiacanvas2_la_LIBADD = $(DIACANVAS2_LIBS) -lm
+
+ # Do the unit tests!
+ test: all
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/diacanvas.git/commitdiff/bfe4146ebc7233e3a80bac86d499afe8d25e7f45
More information about the pld-cvs-commit
mailing list