summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pdflib-lite.spec73
1 files changed, 57 insertions, 16 deletions
diff --git a/pdflib-lite.spec b/pdflib-lite.spec
index 89b83d0..cb56f7f 100644
--- a/pdflib-lite.spec
+++ b/pdflib-lite.spec
@@ -1,11 +1,20 @@
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%{!?python_include: %global python_include %(%{__python} -c "from distutils.sysconfig import get_python_inc; print get_python_inc(0)")}
+%if 0%{?rhel} == 8
+%global with_python 0
+%global with_perl 0
+%else
+%global with_python 1
+%global with_perl 1
+%endif
+
+
Summary: Portable C library for dynamically generating PDF files
Name: pdflib-lite
# Remenber to check the URL after changing this...
Version: 7.0.5
-Release: 7%{?dist}
+Release: 8%{?dist}
License: Distributable
URL: http://www.pdflib.com/
@@ -39,6 +48,7 @@ for generating PDF, nor does it require any other tools.
This package contains the files needed for compiling programs that will use
the PDFlib library.
+%if %{with_python}
%package python
Summary: Python shared library for pdflib
BuildRequires: python-devel
@@ -54,7 +64,9 @@ for generating PDF, nor does it require any other tools.
This package contains the library needed for python programs
that will use the PDFlib library.
+%endif
+%if %{with_perl}
%package perl
Summary: Perl shared library for pdflib
Requires: %{name} = %{version}-%{release}
@@ -73,6 +85,7 @@ for generating PDF, nor does it require any other tools.
This package contains the library needed for perl programs
that will use the PDFlib library.
+%endif
%prep
@@ -93,6 +106,12 @@ sed -i -e 's,^PYTHONLIBDIR.*,PYTHONLIBDIR = %{python_sitearch},' \
--with-java=no \
--with-ruby=no \
--with-tcl=no \
+%if ! %{with_python}
+ --with-py=no \
+%endif
+%if ! %{with_perl}
+ --with-perl=no \
+%endif
--enable-large_files --enable-tiffwrite
# for x86_64 build
@@ -100,35 +119,43 @@ sed -e s@/usr/lib@%{_libdir}@ -i libtool
sed -e /redhat-hardened-ld/s@%{_libdir}@/usr/lib@ -i libtool
%{__make} %{?_smp_mflags}
-for lang in perl python
-do
- %{__make} -C bind/pdflib/$lang
-done
+
+%if %{with_python}
+%{__make} -C bind/pdflib/python
+%endif
+
+%if %{with_perl}
+%{__make} -C bind/pdflib/python
+%endif
+
%install
rm -rf examples
+make install DESTDIR=%{buildroot}
+
+%if %{with_python}
mkdir -p %{buildroot}%{python_sitearch}
-mkdir -p %{buildroot}%{perl_vendorarch}
+make -C bind/pdflib/python install DESTDIR=%{buildroot}
+rm %{buildroot}%{python_sitearch}/*.{la,a}
+chmod +x %{buildroot}%{python_sitearch}/pdflib_py.so*
+%endif
-make install DESTDIR=%{buildroot}
-for lang in perl python
-do
- make -C bind/pdflib/$lang install DESTDIR=%{buildroot}
-done
+%if %{with_perl}
+mkdir -p %{buildroot}%{perl_vendorarch}
+make -C bind/pdflib/perl install DESTDIR=%{buildroot}
+rm %{buildroot}%{perl_vendorarch}/*.{la,a}
+chmod +x %{buildroot}%{perl_vendorarch}/pdflib_pl.so*
+%endif
install -p -m 0644 bind/pdflib/cpp/pdflib.hpp %{buildroot}%{_includedir}/pdflib.hpp
rm %{buildroot}%{_libdir}/*.{la,a}
-rm %{buildroot}%{python_sitearch}/*.{la,a}
-rm %{buildroot}%{perl_vendorarch}/*.{la,a}
# require to extract debuginfo
chmod +x %{buildroot}%{_libdir}/libpdf*
-chmod +x %{buildroot}%{python_sitearch}/pdflib_py.so*
-chmod +x %{buildroot}%{perl_vendorarch}/pdflib_pl.so*
# Only sources
-mkdir -p examples/{c,cpp,perl,php,python}
+mkdir -p examples/{c,cpp,php}
cp -r bind/pdflib/data examples/data
cp bind/pdflib/c/*.c \
bind/pdflib/c/Makefile \
@@ -138,14 +165,20 @@ cp bind/pdflib/cpp/*.cpp \
bind/pdflib/cpp/Makefile \
bind/pdflib/cpp/readme.txt \
examples/cpp
+%if %{with_perl}
+mkdir -p examples/perl
cp bind/pdflib/perl/*.pl \
bind/pdflib/perl/Makefile \
bind/pdflib/perl/readme.txt \
examples/perl
+%endif
+%if %{with_python}
+mkdir -p examples/python
cp bind/pdflib/python/*.py \
bind/pdflib/python/Makefile \
bind/pdflib/python/readme.txt \
examples/python
+%endif
cp bind/pdflib/php/*.php \
bind/pdflib/php/readme.txt \
examples/php
@@ -176,17 +209,25 @@ cp bind/pdflib/php/examples.php5/*.php \
%{_libdir}/*.so
+%if %{with_python}
%files python
%doc doc/pdflib/PDFlib-Lite-license.pdf
%{python_sitearch}/pdflib_py.so*
+%endif
+%if %{with_perl}
%files perl
%doc doc/pdflib/PDFlib-Lite-license.pdf
%{perl_vendorarch}/pdflib_pl.*
+%endif
%changelog
+* Wed Dec 12 2018 Remi Collet <remi@remirepo.net> - 7.0.5-8
+- cleanup for EL-8, drop perl and python subpackage
+ which have to be build as part of the modules
+
* Wed Aug 22 2018 Remi Collet <remi@remirepo.net> - 7.0.5-7
- Add patch to work around false positive in format-security check
(From rpmfusion, by Paul Howarth )