]>
Commit | Line | Data |
---|---|---|
9b0a01c6 | 1 | # |
2 | # Conditional build: | |
bfe4146e JB |
3 | %bcond_without apidocs # gtk-doc based API documentation |
4 | %bcond_without python # Python (2.x) binding | |
5 | %bcond_without static_libs # static library | |
e09cb4d1 | 6 | # |
a0abb63b | 7 | %define src_name diacanvas2 |
5b8d28e3 | 8 | Summary: Library for easely creating diagrams |
a49265dd | 9 | Summary(pl.UTF-8): Biblioteka do prostego tworzenia diagramów |
5b8d28e3 | 10 | Name: diacanvas |
037ef109 | 11 | Version: 0.14.4 |
e2a5f64d | 12 | Release: 2 |
a9462101 | 13 | License: LGPL v2+ |
5b8d28e3 | 14 | Group: X11/Libraries |
bfe4146e | 15 | Source0: https://downloads.sourceforge.net/diacanvas/%{src_name}-%{version}.tar.gz |
037ef109 | 16 | # Source0-md5: b3db6c961de3023489a4d2419dab89bd |
e09cb4d1 | 17 | Patch0: %{name}-fix.patch |
bfe4146e JB |
18 | Patch1: %{name}-glib.patch |
19 | Patch2: %{name}-link.patch | |
d8c92f17 | 20 | URL: http://diacanvas.sourceforge.net/ |
bfe4146e JB |
21 | BuildRequires: autoconf |
22 | BuildRequires: automake | |
23 | %{?with_apidocs:BuildRequires: gtk-doc >= 1.0} | |
e09cb4d1 JB |
24 | BuildRequires: libart_lgpl-devel >= 2.0 |
25 | BuildRequires: libgnomecanvas-devel >= 2.0.0 | |
e09cb4d1 | 26 | # libgnomeprintui-devel >= 2.2.0 used for demo only |
bfe4146e JB |
27 | BuildRequires: libgnomeprint-devel >= 2.2.0 |
28 | BuildRequires: libtool | |
31e9f36c | 29 | BuildRequires: pkgconfig |
bfe4146e | 30 | %if %{with python} |
935d7d55 JB |
31 | # for canvas.defs |
32 | BuildRequires: python-gnome-devel >= 2.0.0 | |
33 | BuildRequires: python-pygtk-devel >= 1:2.0.0 | |
bfe4146e JB |
34 | %endif |
35 | BuildRequires: rpm-build >= 4.6 | |
36 | BuildRequires: rpmbuild(macros) >= 1.219 | |
e09cb4d1 JB |
37 | Requires: libart_lgpl >= 2.0 |
38 | Requires: libgnomecanvas >= 2.0.0 | |
39 | Requires: libgnomeprint >= 2.2.0 | |
5b8d28e3 | 40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
41 | ||
f2ba8991 | 42 | %define pydefsdir %(pkg-config --variable=defsdir pygtk-2.0) |
5b8d28e3 | 43 | |
44 | %description | |
5261bf0d | 45 | Library for easy diagrams creation. |
5b8d28e3 | 46 | |
9e568462 JR |
47 | %description -l pl.UTF-8 |
48 | Biblioteka do prostego tworzenia diagramów. | |
5b8d28e3 | 49 | |
50 | %package devel | |
51 | Summary: Diacanvas header files and development documentation | |
a49265dd | 52 | Summary(pl.UTF-8): Pliki nagłówkowe i dokumentacja biblioteki Diacanvas |
5b8d28e3 | 53 | Group: X11/Development/Libraries |
38f856b5 | 54 | Requires: %{name} = %{version}-%{release} |
e09cb4d1 JB |
55 | Requires: libart_lgpl-devel >= 2.0 |
56 | Requires: libgnomecanvas-devel >= 2.0.0 | |
57 | Requires: libgnomeprint-devel >= 2.2.0 | |
5b8d28e3 | 58 | |
59 | %description devel | |
60 | Diacanvas header files and development documentation. | |
61 | ||
9e568462 JR |
62 | %description devel -l pl.UTF-8 |
63 | Pliki nagłówkowe i dokumentacja biblioteki Diacanvas. | |
5b8d28e3 | 64 | |
65 | %package static | |
66 | Summary: Diacanvas static libraries | |
a49265dd | 67 | Summary(pl.UTF-8): Biblioteki statyczne Diacanvas |
5b8d28e3 | 68 | Group: X11/Development/Libraries |
38f856b5 | 69 | Requires: %{name}-devel = %{version}-%{release} |
5b8d28e3 | 70 | |
71 | %description static | |
72 | Diacanvas static libraries. | |
73 | ||
9e568462 | 74 | %description static -l pl.UTF-8 |
5b8d28e3 | 75 | Biblioteki statyczne Diacanvas. |
76 | ||
9b0a01c6 | 77 | %package apidocs |
7ac0a4c3 | 78 | Summary: Diacanvas API documentation |
a49265dd | 79 | Summary(pl.UTF-8): Dokumentacja API Diacanvas |
7ac0a4c3 JB |
80 | Group: Documentation |
81 | Requires: gtk-doc-common | |
bfe4146e | 82 | BuildArch: noarch |
9b0a01c6 | 83 | |
84 | %description apidocs | |
85 | Diacanvas API documentation. | |
86 | ||
9e568462 | 87 | %description apidocs -l pl.UTF-8 |
7ac0a4c3 JB |
88 | Dokumentacja API Diacanvas. |
89 | ||
5b8d28e3 | 90 | %package -n python-%{name} |
91 | Summary: Diacanvas Python bindings | |
a49265dd | 92 | Summary(pl.UTF-8): Wiązania języka Python do biblioteki Diacanvas |
5b8d28e3 | 93 | Group: Libraries/Python |
38f856b5 | 94 | Requires: %{name} = %{version}-%{release} |
a3e780e3 | 95 | %pyrequires_eq python-libs |
a9462101 | 96 | Requires: python-pygtk-gtk >= 1:2.0.0 |
5b8d28e3 | 97 | |
98 | %description -n python-%{name} | |
99 | Diacanvas Python bindings. | |
100 | ||
9e568462 JR |
101 | %description -n python-%{name} -l pl.UTF-8 |
102 | Wiązania języka Python do biblioteki Diacanvas. | |
5b8d28e3 | 103 | |
104 | %package -n python-%{name}-devel | |
105 | Summary: Diacanvas Python bindings development files | |
a49265dd | 106 | Summary(pl.UTF-8): Pliki dla programistów wiązań języka Python do biblioteki Diacanvas |
5b8d28e3 | 107 | Group: Development/Languages/Python |
38f856b5 | 108 | Requires: %{name} = %{version}-%{release} |
a9462101 | 109 | Requires: python-pygtk-devel >= 1:2.0.0 |
5b8d28e3 | 110 | |
111 | %description -n python-%{name}-devel | |
112 | Diacanvas Python bindings development files. | |
113 | ||
9e568462 JR |
114 | %description -n python-%{name}-devel -l pl.UTF-8 |
115 | Pliki dla programistów wiązań języka Python do biblioteki Diacanvas. | |
5b8d28e3 | 116 | |
117 | %prep | |
118 | %setup -q -n %{src_name}-%{version} | |
e09cb4d1 | 119 | %patch0 -p1 |
bfe4146e JB |
120 | %patch1 -p1 |
121 | %patch2 -p1 | |
5b8d28e3 | 122 | |
123 | %build | |
aef09e7b | 124 | %{__gtkdocize} |
bfe4146e JB |
125 | %{__libtoolize} |
126 | %{__aclocal} | |
127 | %{__autoconf} | |
128 | %{__autoheader} | |
129 | %{__automake} | |
5b8d28e3 | 130 | %configure \ |
bfe4146e | 131 | --enable-static%{!?with_static_libs:=no} \ |
5b8d28e3 | 132 | --enable-gnome-print \ |
bfe4146e JB |
133 | --enable-gtk-doc%{!?with_apidocs:=no} \ |
134 | %{?with_python:--enable-python} \ | |
6a0f346a | 135 | %{?with_apidocs:--with-html-dir=%{_gtkdocdir}} |
5b8d28e3 | 136 | |
6698c2f1 | 137 | %{__make} |
5b8d28e3 | 138 | |
139 | %install | |
140 | rm -rf $RPM_BUILD_ROOT | |
5b8d28e3 | 141 | |
f2957b22 | 142 | %{__make} install \ |
6698c2f1 | 143 | DESTDIR=$RPM_BUILD_ROOT |
5b8d28e3 | 144 | |
bfe4146e JB |
145 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libdiacanvas2.la |
146 | ||
147 | %if %{with python} | |
6698c2f1 | 148 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} |
149 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} | |
150 | %py_postclean | |
bfe4146e JB |
151 | %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/%{name}/*.la |
152 | %if %{with static_libs} | |
153 | %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/%{name}/*.a | |
154 | %endif | |
155 | %endif | |
38f856b5 | 156 | |
5b8d28e3 | 157 | %find_lang %{name} |
158 | ||
159 | %clean | |
160 | rm -rf $RPM_BUILD_ROOT | |
161 | ||
38f856b5 JB |
162 | %post -p /sbin/ldconfig |
163 | %postun -p /sbin/ldconfig | |
164 | ||
5b8d28e3 | 165 | %files -f %{name}.lang |
166 | %defattr(644,root,root,755) | |
167 | %doc README ChangeLog TODO NEWS AUTHORS | |
e09cb4d1 | 168 | %attr(755,root,root) %{_libdir}/libdiacanvas2.so.*.*.* |
bfe4146e | 169 | %attr(755,root,root) %ghost %{_libdir}/libdiacanvas2.so.0 |
5b8d28e3 | 170 | |
171 | %files devel | |
172 | %defattr(644,root,root,755) | |
e09cb4d1 | 173 | %attr(755,root,root) %{_libdir}/libdiacanvas2.so |
5b8d28e3 | 174 | %{_includedir}/diacanvas |
e09cb4d1 | 175 | %{_pkgconfigdir}/diacanvas2.pc |
5b8d28e3 | 176 | |
9b0a01c6 | 177 | %if %{with static_libs} |
5b8d28e3 | 178 | %files static |
179 | %defattr(644,root,root,755) | |
e09cb4d1 | 180 | %{_libdir}/libdiacanvas2.a |
9b0a01c6 | 181 | %endif |
182 | ||
183 | %if %{with apidocs} | |
184 | %files apidocs | |
185 | %defattr(644,root,root,755) | |
e09cb4d1 | 186 | %{_gtkdocdir}/diacanvas2 |
9b0a01c6 | 187 | %endif |
5b8d28e3 | 188 | |
bfe4146e | 189 | %if %{with python} |
5b8d28e3 | 190 | %files -n python-%{name} |
191 | %defattr(644,root,root,755) | |
192 | %dir %{py_sitedir}/%{name} | |
e09cb4d1 | 193 | %attr(755,root,root) %{py_sitedir}/%{name}/*module.so |
5b8d28e3 | 194 | %{py_sitedir}/%{name}/*.py[co] |
195 | ||
196 | %files -n python-%{name}-devel | |
197 | %defattr(644,root,root,755) | |
2f8a6457 JB |
198 | %{pydefsdir}/dia-boxed.defs |
199 | %{pydefsdir}/diacanvas.defs | |
200 | %{pydefsdir}/diageometry.defs | |
201 | %{pydefsdir}/diashape.defs | |
202 | %{pydefsdir}/diaview.defs | |
bfe4146e | 203 | %endif |