From: Jakub Bogusz Date: Sat, 21 Nov 2020 21:15:36 +0000 (+0100) Subject: - new, last release of pdflib-lite (7.0.5p3) X-Git-Tag: auto/th/pdflib-lite-7.0.5p3-1~1 X-Git-Url: http://git.pld-linux.org/gitweb.cgi?a=commitdiff_plain;h=e07a09d2cbb18d82474989042b700725d47af03e;p=packages%2Fpdflib-lite.git - new, last release of pdflib-lite (7.0.5p3) - added format patch (fix build with -Werror=format-security) - added tcl patch (fix build with Tcl 8.6) - added modules patch (drop shared modules versioning) - added perl,python patches to adjust module paths - added libtool patch (fix for libtool 1.5+) - added system-libs patch (use system zlib and libpng) - added shared patch (link bindings and examples with shared libpdf) --- e07a09d2cbb18d82474989042b700725d47af03e diff --git a/pdflib-lite-format.patch b/pdflib-lite-format.patch new file mode 100644 index 0000000..783a2dd --- /dev/null +++ b/pdflib-lite-format.patch @@ -0,0 +1,14 @@ +--- PDFlib-Lite-7.0.5p3/bind/pdflib/perl/pdflib_pl.c.orig 2012-06-06 13:59:04.000000000 +0200 ++++ PDFlib-Lite-7.0.5p3/bind/pdflib/perl/pdflib_pl.c 2020-11-18 17:56:44.360124144 +0100 +@@ -378,10 +378,8 @@ + #define SWIG_exception(msg) croak(msg) + #define try PDF_TRY(p) + #define catch PDF_CATCH(p) { \ +- char errmsg[1024];\ +- sprintf(errmsg, "PDFlib Error [%d] %s: %s", PDF_get_errnum(p),\ ++ croak("PDFlib Error [%d] %s: %s", PDF_get_errnum(p),\ + PDF_get_apiname(p), PDF_get_errmsg(p));\ +- SWIG_exception(errmsg); \ + } + + /* }}} */ diff --git a/pdflib-lite-libtool.patch b/pdflib-lite-libtool.patch new file mode 100644 index 0000000..d9d14e0 --- /dev/null +++ b/pdflib-lite-libtool.patch @@ -0,0 +1,11 @@ +--- PDFlib-Lite-7.0.5p3/config/mkmainlib.inc.in.orig 2020-11-19 17:26:48.045119985 +0100 ++++ PDFlib-Lite-7.0.5p3/config/mkmainlib.inc.in 2020-11-19 18:24:35.243003229 +0100 +@@ -29,7 +29,7 @@ + @-if test "$(WITH_SHARED)" = "no"; then \ + cp .libs/$(MAINLIBNAME) .libs/$(MAINLIBNAME)i;\ + fi +- $(LIBTOOL) $(INSTALL_DATA) $(MAINLIBNAME) $(DESTDIR)$(libdir); ++ $(LIBTOOL) --mode=install $(INSTALL_DATA) $(MAINLIBNAME) $(DESTDIR)$(libdir); + @-if test "$(WITH_SHARED)" = "yes"; then \ + $(LIBTOOL) -n --finish $(DESTDIR)$(libdir);\ + else\ diff --git a/pdflib-lite-modules.patch b/pdflib-lite-modules.patch new file mode 100644 index 0000000..b6dced6 --- /dev/null +++ b/pdflib-lite-modules.patch @@ -0,0 +1,40 @@ +--- PDFlib-Lite-7.0.5p3/bind/pdflib/java/Makefile.orig 2012-06-06 13:59:04.000000000 +0200 ++++ PDFlib-Lite-7.0.5p3/bind/pdflib/java/Makefile 2020-11-18 21:27:58.221463946 +0100 +@@ -15,6 +15,7 @@ + + DEPLIBS = $(BIND_PDFLIBLINK) + LIBS = $(DEPLIBS) ++LDFLAGS += -avoid-version -shared + INCLUDES = $(PDFLIBINC) $(PDCORELIBINC) $(JAVAINCLUDE) + + LANG_LIBDIR = $(DESTDIR)$(libdir) +--- PDFlib-Lite-7.0.5p3/bind/pdflib/perl/Makefile.orig 2012-06-06 13:59:04.000000000 +0200 ++++ PDFlib-Lite-7.0.5p3/bind/pdflib/perl/Makefile 2020-11-18 20:42:08.533026953 +0100 +@@ -8,6 +8,7 @@ + + DEPLIBS = $(PDFLIBLINK) + LIBS = $(DEPLIBS) ++LDFLAGS += -avoid-version -shared + INCLUDES = $(PDFLIBINC) $(PERLBOOLDEF) $(PERLINCLUDE) + # special CFLAGS, as -ansi is not working here. + PDFPEDANTIC = +--- PDFlib-Lite-7.0.5p3/bind/pdflib/python/Makefile.orig 2012-06-06 13:59:04.000000000 +0200 ++++ PDFlib-Lite-7.0.5p3/bind/pdflib/python/Makefile 2020-11-18 20:42:49.736137070 +0100 +@@ -7,6 +7,7 @@ + + DEPLIBS = $(PDFLIBLINK) + LIBS = $(DEPLIBS) ++LDFLAGS += -avoid-version -shared + INCLUDES = $(PDFLIBINC) $(PYINCLUDE) $(PDCORELIBINC) + # special CFLAGS, as -ansi is not working here. + PDFPEDANTIC = +--- PDFlib-Lite-7.0.5p3/bind/pdflib/tcl/Makefile.orig 2020-11-18 19:10:38.999432975 +0100 ++++ PDFlib-Lite-7.0.5p3/bind/pdflib/tcl/Makefile 2020-11-18 20:43:08.889366642 +0100 +@@ -11,6 +11,7 @@ + PDFPEDANTIC = + DEPLIBS = $(PDFLIBLINK) + LIBS = $(DEPLIBS) $(TCLLIB) ++LDFLAGS += -avoid-version -shared + INCLUDES = $(PDFLIBINC) $(TCLINCLUDE) -DUSE_INTERP_RESULT + + LANG_LIBDIR = $(DESTDIR)$(TCLPACKAGEDIR) diff --git a/pdflib-lite-perl.patch b/pdflib-lite-perl.patch new file mode 100644 index 0000000..f05f4b0 --- /dev/null +++ b/pdflib-lite-perl.patch @@ -0,0 +1,11 @@ +--- PDFlib-Lite-7.0.5p3/configure.in.orig 2012-06-06 13:58:57.000000000 +0200 ++++ PDFlib-Lite-7.0.5p3/configure.in 2020-11-18 21:27:03.171762176 +0100 +@@ -751,7 +751,7 @@ + WITH_PERL=no + fi + +- PERLLIBDIR=`($PERL -e 'use Config; print $Config{sitearchexp};') 2>/dev/null` ++ PERLLIBDIR=`($PERL -e 'use Config; print $Config{vendorarchexp};') 2>/dev/null` + if test -z "$PERLLIBDIR" -o ! -d "$PERLLIBDIR"; then + AC_MSG_RESULT( unable to determine perl shared library directory) + fi diff --git a/pdflib-lite-python.patch b/pdflib-lite-python.patch new file mode 100644 index 0000000..0344d70 --- /dev/null +++ b/pdflib-lite-python.patch @@ -0,0 +1,13 @@ +--- PDFlib-Lite-7.0.5p3/configure.in.orig 2020-11-18 21:27:03.171762176 +0100 ++++ PDFlib-Lite-7.0.5p3/configure.in 2020-11-18 21:57:20.398584079 +0100 +@@ -896,8 +896,8 @@ + else + PYTHONLIBDIR=`cat << EOF | python + import sys +-import string +-print string.join(filter(lambda x: -1 != string.find(x, 'dynload'), sys.path)) ++from distutils import sysconfig ++print sysconfig.get_python_lib(1,0,prefix="$prefix") + EOF + ` + if test "$PYTHONLIBDIR" = "" ; then diff --git a/pdflib-lite-shared.patch b/pdflib-lite-shared.patch new file mode 100644 index 0000000..d5c4097 --- /dev/null +++ b/pdflib-lite-shared.patch @@ -0,0 +1,25 @@ +--- PDFlib-Lite-7.0.5p3/configure.in.orig 2020-11-21 10:31:33.597288532 +0100 ++++ PDFlib-Lite-7.0.5p3/configure.in 2020-11-21 13:28:30.903102986 +0100 +@@ -1332,7 +1332,7 @@ + PDFLIBLINK="\$(top_builddir)/libs/pdflib/.libs/libs_lib$PDFLIBNAME.al" + print "UNIVERSAL: .libs/libs_libpdflib.al" + else +- PDFLIBLINK="\$(top_builddir)/libs/pdflib/libs_lib$PDFLIBNAME\$(LA)" ++ PDFLIBLINK="\$(top_builddir)/libs/pdflib/lib$PDFLIBNAME\$(LA)" + fi + PDFLIB_LINK="\$(top_builddir)/libs/pdflib/libpdf_\$(LA)" + LIBTARGETS="$LIBTARGETS pdflib" +--- PDFlib-Lite-7.0.5p3/config/mkprogs.inc.in.orig 2020-11-20 21:35:27.446225689 +0100 ++++ PDFlib-Lite-7.0.5p3/config/mkprogs.inc.in 2020-11-20 21:50:38.807955086 +0100 +@@ -1,9 +1,9 @@ + PROGS_BUILD = $(LIBTOOL_CC) $(CC) -c $(CPPFLAGS) $(CFLAGS) $@.c + CXXPROGS_BUILD = $(LIBTOOL_CC) $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) \ + $@.cpp $(EXTRA_SOURCES) +-PROGS_LINK = $(LIBTOOL_LD) $(CC) -static -o $@ $@$(LO) $(LDFLAGS) \ ++PROGS_LINK = $(LIBTOOL_LD) $(CC) -o $@ $@$(LO) $(LDFLAGS) \ + $(EXTRA_OBJS) $(LIBS) $(EXTERNALLIBS) +-CXXPROGS_LINK = $(LIBTOOL_LD) $(CXX) -static -o $@ $@$(LO) \ ++CXXPROGS_LINK = $(LIBTOOL_LD) $(CXX) -o $@ $@$(LO) \ + $(CXXFLAGS) $(LDFLAGS) $(EXTRA_OBJS) $(LIBS) $(EXTERNALLIBS) + + all:: $(PROGS) diff --git a/pdflib-lite-system-libs.patch b/pdflib-lite-system-libs.patch new file mode 100644 index 0000000..7011574 --- /dev/null +++ b/pdflib-lite-system-libs.patch @@ -0,0 +1,160 @@ +--- PDFlib-Lite-7.0.5p3/configure.in.orig 2020-11-19 21:50:47.889308185 +0100 ++++ PDFlib-Lite-7.0.5p3/configure.in 2020-11-19 22:29:37.650020122 +0100 +@@ -1136,7 +1136,7 @@ + LIBTARGETS="$LIBTARGETS flate" + else + FLATELIBINC="" +- FLATELIBLINK="" ++ FLATELIBLINK="-lz" + fi + AC_SUBST(FLATELIBLINK) + AC_SUBST(FLATELIBINC) +@@ -1147,7 +1147,7 @@ + PNGLIBLINK="\$(top_builddir)/libs/png/libpng\$(LA)" + LIBTARGETS="$LIBTARGETS png" + else + PNGLIBINC="" +- PNGLIBLINK="" ++ PNGLIBLINK="-lpng" + fi + AC_SUBST(PNGLIBINC) +@@ -1160,7 +1160,7 @@ + LIBTARGETS="$LIBTARGETS tiff" + else + TIFFLIBINC="" +- TIFFLIBLINK="" ++ TIFFLIBLINK="-ltiff" + fi + AC_SUBST(TIFFLIBINC) + AC_SUBST(TIFFLIBLINK) +@@ -1172,7 +1172,7 @@ + LIBTARGETS="$LIBTARGETS jpeg" + else + JPEGLIBINC="" +- JPEGLIBLINK="" ++ JPEGLIBLINK="-ljpeg" + fi + AC_SUBST(JPEGLIBINC) + AC_SUBST(JPEGLIBLINK) +@@ -1184,7 +1184,7 @@ + LIBTARGETS="$LIBTARGETS expat" + else + EXPATLIBINC="" +- EXPATLIBLINK="" ++ EXPATLIBLINK="-lexpat" + fi + AC_SUBST(EXPATLIBINC) + AC_SUBST(EXPATLIBLINK) +@@ -1204,7 +1204,8 @@ + OPENSSLLIBLINK="-L/usr/local/ssl/lib -lcrypto -lssl" + LIBTARGETS="$LIBTARGETS expat" + else +- WITH_OPENSLL=no ++ OPENSSLLIBINC="-DPDF_FEATURE_DIGSIG -I/usr/include/openssl" ++ OPENSSLLIBLINK="-lcrypto -lssl" + fi + fi + AC_SUBST(OPENSSLLIBINC) +@@ -1235,7 +1236,8 @@ + LIBTARGETS="$LIBTARGETS icutle" + fi + else +- WITH_ICU=no ++ ICULIBINC="-I/usr/include/unicode" ++ ICULIBLINK="-licuio -licuuc -licui18n -licudata -licule -liculx" + fi + fi + +@@ -1621,7 +1621,7 @@ + + CFLAGS="$CFLAGS $PLATFORM" + +-PDFLIBCONVENIENT="$PDFLIB_LINK \$(top_builddir)/libs/pdflib/\$(OO)/pdflib\$(LO) $PDCORELIBLINK $PNGLIBLINK $FLATELIBLINK $TIFFLIBLINK $PDILIBLINK $JPEGLIBLINK $PLOPLIB_LINK $FONTLIBLINK $PDPAGELIBLINK $EXPATLIBLINK" ++PDFLIBCONVENIENT="$PDFLIB_LINK \$(top_builddir)/libs/pdflib/\$(OO)/pdflib\$(LO) $PDCORELIBLINK $PNGLIBLINK $FLATELIBLINK $TIFFLIBLINK $PDILIBLINK $JPEGLIBLINK $PLOPLIB_LINK $FONTLIBLINK $PDPAGELIBLINK" + + if test "$WITH_SHARED" = "no"; then + dnl We can generate a static lib only, but not a shared +--- PDFlib-Lite-7.0.5p3/libs/pdflib/p_jpeg.c.orig 2012-06-06 13:59:00.000000000 +0200 ++++ PDFlib-Lite-7.0.5p3/libs/pdflib/p_jpeg.c 2020-11-20 18:33:21.408750447 +0100 +@@ -52,7 +52,7 @@ + + #else + +-#include "jinclude.h" ++#include "jconfig.h" + #include "jpeglib.h" + + /* +@@ -302,7 +302,7 @@ + + cinfo->src = (struct jpeg_source_mgr *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, +- SIZEOF(pdf_source_mgr)); ++ sizeof(pdf_source_mgr)); + + src = (pdf_src_ptr) cinfo->src; + src->pub.init_source = pdf_init_JPEG_source; +@@ -345,7 +345,7 @@ + + dest->buffer = (JOCTET *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, +- OUTPUT_BUF_SIZE * SIZEOF(JOCTET)); ++ OUTPUT_BUF_SIZE * sizeof(JOCTET)); + + dest->pub.next_output_byte = dest->buffer; + dest->pub.free_in_buffer = OUTPUT_BUF_SIZE; +@@ -381,7 +381,7 @@ + + cinfo->dest = (struct jpeg_destination_mgr *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, +- SIZEOF(pdf_destination_mgr)); ++ sizeof(pdf_destination_mgr)); + + dest = (pdf_dest_ptr) cinfo->dest; + dest->pub.init_destination = pdf_init_JPEG_destination; +--- PDFlib-Lite-7.0.5p3/libs/pdflib/p_png.c.orig 2012-06-06 13:59:00.000000000 +0200 ++++ PDFlib-Lite-7.0.5p3/libs/pdflib/p_png.c 2020-11-20 20:15:40.512158737 +0100 +@@ -78,7 +78,7 @@ + static void + pdf_png_read_data(png_structp png_ptr, png_bytep data, png_size_t length) + { +- pdc_file *fp = (pdc_file *) png_ptr->io_ptr; ++ pdc_file *fp = (pdc_file *) png_get_io_ptr(png_ptr); + char *filename = (char *) pdc_file_name(fp); + + if (!PDC_OK_FREAD(fp, data, length)) +@@ -96,14 +96,14 @@ + static void + pdf_libpng_warning_handler(png_structp png_ptr, png_const_charp message) + { +- PDF *p = (PDF *)png_ptr->mem_ptr; ++ PDF *p = (PDF *)png_get_mem_ptr(png_ptr); + pdc_logg_cond(p->pdc, 5, trc_image, "\tlibpng warning: %s\n", message); + } + + static void + pdf_libpng_error_handler(png_structp png_ptr, png_const_charp message) + { +- PDF *p = (PDF *)png_ptr->mem_ptr; ++ PDF *p = (PDF *)png_get_mem_ptr(png_ptr); + + pdc_logg_cond(p->pdc, 5, trc_image, "\tlibpng error: %s\n", message); + +@@ -114,7 +114,7 @@ + static void * + pdf_libpng_malloc(png_structp png_ptr, size_t size) + { +- PDF *p = (PDF *)png_ptr->mem_ptr; ++ PDF *p = (PDF *)png_get_mem_ptr(png_ptr); + + return pdc_malloc(p->pdc, size, "libpng"); + } +@@ -122,7 +122,7 @@ + static void + pdf_libpng_free(png_structp png_ptr, void *mem) + { +- PDF *p = (PDF *)png_ptr->mem_ptr; ++ PDF *p = (PDF *)png_get_mem_ptr(png_ptr); + + pdc_free(p->pdc, mem); + } diff --git a/pdflib-lite-tcl.patch b/pdflib-lite-tcl.patch new file mode 100644 index 0000000..1fd2e67 --- /dev/null +++ b/pdflib-lite-tcl.patch @@ -0,0 +1,13 @@ +Force to build against Tcl 8.6 despite using deprecated API. + +--- PDFlib-Lite-7.0.5p3/bind/pdflib/tcl/Makefile.orig 2012-06-06 13:59:04.000000000 +0200 ++++ PDFlib-Lite-7.0.5p3/bind/pdflib/tcl/Makefile 2020-11-18 19:08:18.536860593 +0100 +@@ -11,7 +11,7 @@ + PDFPEDANTIC = + DEPLIBS = $(PDFLIBLINK) + LIBS = $(DEPLIBS) $(TCLLIB) +-INCLUDES = $(PDFLIBINC) $(TCLINCLUDE) ++INCLUDES = $(PDFLIBINC) $(TCLINCLUDE) -DUSE_INTERP_RESULT + + LANG_LIBDIR = $(DESTDIR)$(TCLPACKAGEDIR) + diff --git a/pdflib-lite.spec b/pdflib-lite.spec new file mode 100644 index 0000000..a6b4734 --- /dev/null +++ b/pdflib-lite.spec @@ -0,0 +1,433 @@ +# TODO: php, ruby +# +# Conditional build: +%bcond_without static_libs # static library +%bcond_without cxx # C++ binding +%bcond_without java # Java binding +%bcond_without perl # Perl binding +%bcond_without python # Python binding +%bcond_with ruby # Ruby binding (not finished in sources) +%bcond_without tcl # Tcl binding +%bcond_with system_libjpeg # system libjpeg library (included libtiff relies on libjpeg = 6b) +%bcond_without system_libpng # system libpng library +%bcond_with system_libtiff # system libtiff library (PDFLib uses modified version) +%bcond_without system_zlib # system ZLib library +# +Summary: PDFlib - A library for generating PDF on the fly +Summary(pl.UTF-8): PDFlib - biblioteka do tworzenia plików PDF w locie +Name: pdflib-lite +Version: 7.0.5p3 +Release: 1 +License: free for personal use +Group: Libraries +# originally http://www.pdflib.com/download/pdflib-family/pdflib-lite-7/ but no longer available; +# use a copy from other distro repo +Source0: http://ponce.cc/slackware/sources/repo/PDFlib-Lite-%{version}.tar.gz +# Source0-md5: 371d332d610a8b21a542bb7a2bdaf954 +Patch0: %{name}-format.patch +Patch1: %{name}-tcl.patch +Patch2: %{name}-modules.patch +Patch3: %{name}-perl.patch +Patch4: %{name}-python.patch +Patch5: %{name}-libtool.patch +Patch6: %{name}-system-libs.patch +Patch7: %{name}-shared.patch +URL: https://www.pdflib.com/ +BuildRequires: autoconf +BuildRequires: automake +%{?with_java:BuildRequires: jdk >= 1.4} +%{?with_system_libjpeg:BuildRequires: libjpeg-devel >= 6b} +%{?with_system_libpng:BuildRequires: libpng-devel >= 2:1.2.36} +%{?with_cxx:BuildRequires: libstdc++-devel} +%{?with_system_libtiff:BuildRequires: libtiff-devel >= 3.7.4} +BuildRequires: libtool +%{?with_perl:BuildRequires: perl-devel >= 5} +%{?with_python:BuildRequires: python-devel >= 2} +BuildRequires: rpmbuild(macros) >= 1.754 +%{?with_tcl:BuildRequires: tcl-devel >= 8.2} +%{?with_system_zlib:BuildRequires: zlib-devel >= 1.2.3} +%{?with_system_libjpeg:Requires: libjpeg >= 6b} +%{?with_system_libpng:Requires: libpng >= 2:1.2.36} +%{?with_system_libtiff:Requires: libtiff >= 3.7.4} +%{?with_system_zlib:Requires: zlib >= 1.2.3} +Obsoletes: pdflib < 5 +BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) + +%define tcl_ver %(echo `echo "puts [info tclversion]" | tclsh`) +%define tcl_libdir %{_libdir}/tcl%{tcl_ver} + +%description +PDFlib is a library for generating PDF files. It offers an API with +support for text, vector graphics, raster image, and hypertext. Call +PDFlib routines from within your client program and voila: dynamic PDF +files! + +PDFlib Lite is an open-source edition for basic PDF generation, free +for personal use. PDFlib Lite does not support all languages, and is +not available on EBCDIC platforms. PDFlib Lite supports only a subset +of PDFlib features. + +%description -l pl.UTF-8 +PDFlib to biblioteka do generowania plików PDF. Oferuje API z obsługą +tekstu, grafiki wektorowej, obrazów rastrowych i hipertekstu. Funkcje +biblioteki PDFlib można wywoływać z programów klienckich, otrzymując +dynamiczne pliki PDF. + +PDFlib Lite to wydanie biblioteki z otwartymi źródłami, pozwalające na +generowanie podstawowych plików PDF, darmowe do użytku osobistego. Nie +obsługuje wszystkich języków, nie jest dostępne na platformach EBCDIC. +Obsługuje tylko podzbiór możliwości pełnej wersji biblioteki PDFlib. + +%package devel +Summary: Header file for PDFlib Lite library +Summary(pl.UTF-8): Plik nagłówkowy biblioteki PDFlib Lite +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} +%{?with_system_libjpeg:BuildRequires: libjpeg-devel >= 6b} +%{?with_system_libpng:BuildRequires: libpng-devel >= 2:1.2.36} +%{?with_system_libtiff:BuildRequires: libtiff-devel >= 3.7.4} +%{?with_system_zlib:BuildRequires: zlib-devel >= 1.2.3} +Obsoletes: pdflib-devel < 5 + +%description devel +Header file for PDFlib Lite library. + +%description devel -l pl.UTF-8 +Plik nagłówkowy biblioteki PDFlib Lite. + +%package static +Summary: Static PDFlib Lite library +Summary(pl.UTF-8): Statyczna biblioteka PDFlib Lite +Group: Development/Libraries +Requires: %{name}-devel = %{version}-%{release} +Obsoletes: pdflib-static < 5 + +%description static +Static PDFlib Lite library. + +%description static -l pl.UTF-8 +Statyczna biblioteka PDFlib Lite. + +%package c++ +Summary: C++ binding for PDFlib Lite library +Summary(pl.UTF-8): Wiązania C++ do biblioteki PDFlib Lite +Group: Libraries +Requires: %{name} = %{version}-%{release} + +%description c++ +C++ binding for PDFlib Lite library. + +%description c++ -l pl.UTF-8 +Wiązania C++ do biblioteki PDFlib Lite. + +%package c++-devel +Summary: Header file for C++ PDFlib Lite binding +Summary(pl.UTF-8): Plik nagłówkowy wiązań C++ do biblioteki PDFlib Lite +Group: Development/Libraries +Requires: %{name}-c++ = %{version}-%{release} +Requires: %{name}-devel = %{version}-%{release} +Requires: libstdc++-devel + +%description c++-devel +Header file for C++ PDFlib Lite binding. + +%description c++-devel -l pl.UTF-8 +Plik nagłówkowy wiązań C++ do biblioteki PDFlib Lite. + +%package c++-static +Summary: Static C++ PDFlib Lite binding library +Summary(pl.UTF-8): Statyczna biblioteka wiązań C++ do biblioteki PDFlib Lite +Group: Development/Libraries +Requires: %{name}-c++-devel = %{version}-%{release} + +%description c++-static +Static C++ PDFlib Lite binding library. + +%description c++-static -l pl.UTF-8 +Statyczna biblioteka wiązań C++ do biblioteki PDFlib Lite. + +%package -n java-pdflib-lite +Summary: Java bindings for PDFlib Lite library +Summary(pl.UTF-8): Wiązania Javy do biblioteki PDFlib Lite +Group: Development/Languages/Java +Requires: %{name} = %{version}-%{release} +Obsoletes: pdflib-java < 5 + +%description -n java-pdflib-lite +Java bindings for PDFlib Lite library. + +%description -n java-pdflib-lite -l pl.UTF-8 +Wiązania Javy do biblioteki PDFlib Lite. + +%package -n java-pdflib-lite-javadoc +Summary: Documentation for Java PDFlib Lite binding +Summary(pl.UTF-8): Dokumentacja wiązań Javy do biblioteki PDFlib Lite +Group: Documentation +%{?noarchpackage} + +%description -n java-pdflib-lite-javadoc +Documentation for Java PDFlib Lite binding. + +%description -n java-pdflib-lite-javadoc -l pl.UTF-8 +Dokumentacja wiązań Javy do biblioteki PDFlib Lite. + +%package -n perl-pdflib-lite +Summary: Perl bindings for PDFlib Lite library +Summary(pl.UTF-8): Wiązania Perla do biblioteki PDFlib Lite +Group: Development/Languages/Perl +Requires: %{name} = %{version}-%{release} +Obsoletes: pdflib-perl < 5 +Obsoletes: pdflib-perl5 < 5 + +%description -n perl-pdflib-lite +Perl bindings for PDFlib Lite library. + +%description -n perl-pdflib-lite -l pl.UTF-8 +Wiązania Perla do biblioteki PDFlib Lite. + +%package -n python-pdflib-lite +Summary: Python 2 bindings for PDFlib Lite library +Summary(pl.UTF-8): Wiązania Pythona 2 do biblioteki PDFlib Lite +Group: Development/Languages/Python +Requires: %{name} = %{version}-%{release} +Obsoletes: pdflib-python < 5 +Obsoletes: pdflib-python1.5 < 5 + +%description -n python-pdflib-lite +Python 2 bindings for PDFlib Lite library. + +%description -n python-pdflib-lite -l pl.UTF-8 +Wiązania Pythona 2 do biblioteki PDFlib Lite. + +%package -n tcl-pdflib-lite +Summary: Tcl bindings for PDFlib Lite library +Summary(pl.UTF-8): Wiązania Tcl-a do biblioteki PDFlib Lite +Group: Development/Languages/Tcl +Requires: %{name} = %{version}-%{release} +Obsoletes: pdflib-tcl < 5 +Obsoletes: pdflib-tcl8.0 < 5 + +%description -n tcl-pdflib-lite +Tcl bindings for PDFlib Lite library. + +%description -n tcl-pdflib-lite -l pl.UTF-8 +Wiązania Tcl-a do biblioteki PDFlib Lite. + +%prep +%setup -q -n PDFlib-Lite-%{version} +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 + +%{?with_system_zlib:%{__rm} -r libs/flate} +%{?with_system_zlib:%{__sed} -i -e '/\/flate\// d' libs/pdflib/Make_objs2.inc} +%{?with_system_libjpeg:%{__rm} -r libs/jpeg} +%{?with_system_libjpeg:%{__sed} -i -e '/\/jpeg\// d' libs/pdflib/Make_objs2.inc} +%{?with_system_libpng:%{__rm} -r libs/png} +%{?with_system_libpng:%{__sed} -i -e '/\/png\// d' libs/pdflib/Make_objs2.inc} +%{?with_system_libtiff:%{__rm} -r libs/tiff} +%{?with_system_libtiff:%{__sed} -i -e '/\/tiff\// d' libs/pdflib/Make_objs2.inc} + +: >config/aclocal.m4 + +%build +%{__libtoolize} +%{__aclocal} --output config/aclocal.m4 +%{__autoconf} +%configure \ + %{!?with_cxx:--disable-cxx} \ + %{!?with_static_libs:--disable-static} \ + --with-java=%{?with_java:%{java_home}}%{!?with_java:no} \ +%if %{with perl} + --with-perl=%{__perl} \ + --with-perlincl=%{perl_archlib}/CORE \ +%else + --without-perl \ +%endif +%if %{with python} + --with-py=%{py_sitedir} \ + --with-pyincl=%{py_incdir} \ +%else + --without-py \ +%endif +%if %{with ruby} + --with-ruby=%{__ruby} \ + --with-rubyincl=%{ruby_rubyhdrdir} \ +%else + --without-ruby \ +%endif +%if %{with tcl} + --with-tcl=%{_bindir}/tclsh \ + --with-tclpkg=%{_libdir}/tcl%{tcl_ver} \ +%else + --without-tcl +%endif + +%{__make} + +%if %{with cxx} +cd bind/pdflib/cpp +../../../libtool --mode=link %{__cxx} -o libpdf_cpp.la pdflib.lo ../../../libs/pdflib/libpdf.la -rpath %{_libdir} +cd ../../.. +%endif + +%if %{with java} +%{__make} -C bind/pdflib/java javadoc +%endif + +%if %{with perl} +%{__make} -C bind/pdflib/perl +%endif + +%if %{with python} +%{__make} -C bind/pdflib/python +%endif + +%if %{with ruby} +%{__make} -C bind/pdflib/ruby +%endif + +%if %{with tcl} +%{__make} -C bind/pdflib/tcl +%endif + +%install +rm -rf $RPM_BUILD_ROOT + +%{__make} install \ + DESTDIR=$RPM_BUILD_ROOT + +%if %{with cxx} +cd bind/pdflib/cpp +../../../libtool --mode=install install libpdf_cpp.la $RPM_BUILD_ROOT%{_libdir} +cp -p pdflib.hpp $RPM_BUILD_ROOT%{_includedir} +cd ../../.. +%endif + +%if %{with java} +install -d $RPM_BUILD_ROOT{%{_javadir},%{_javadocdir}} +cp -p bind/pdflib/java/pdflib.jar $RPM_BUILD_ROOT%{_javadir} +cp -pr bind/pdflib/java/javadoc $RPM_BUILD_ROOT%{_javadocdir}/pdflib +%{__rm} $RPM_BUILD_ROOT%{_libdir}/libpdf_java.la +%endif + +%if %{with perl} +install -d $RPM_BUILD_ROOT%{perl_vendorarch} +%{__make} -C bind/pdflib/perl install \ + DESTDIR=$RPM_BUILD_ROOT +%{__rm} $RPM_BUILD_ROOT%{perl_vendorarch}/pdflib_pl.la +%endif + +%if %{with python} +install -d $RPM_BUILD_ROOT%{py_sitedir} +%{__make} -C bind/pdflib/python install \ + DESTDIR=$RPM_BUILD_ROOT +%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/pdflib_py.la +%endif + +%if %{with ruby} +%{__make} -C bind/pdflib/ruby install \ + DESTDIR=$RPM_BUILD_ROOT +%endif + +%if %{with tcl} +%{__make} -C bind/pdflib/tcl install \ + DESTDIR=$RPM_BUILD_ROOT +%{__rm} $RPM_BUILD_ROOT%{tcl_libdir}/pdflib/pdflib_tcl.la +%endif + +# ensure soname deps are generated +find $RPM_BUILD_ROOT%{_libdir} -name '*.so*' | xargs chmod 755 + +%clean +rm -rf $RPM_BUILD_ROOT + +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + +%post c++ -p /sbin/ldconfig +%postun c++ -p /sbin/ldconfig + +%post -n java-pdflib-lite -p /sbin/ldconfig +%postun -n java-pdflib-lite -p /sbin/ldconfig + +%files +%defattr(644,root,root,755) +%doc readme.txt doc/PDFlib-terms-and-conditions.pdf doc/pdflib/{PDFlib-Lite-license.pdf,changes.txt} +%attr(755,root,root) %{_bindir}/pdfimage +%attr(755,root,root) %{_bindir}/text2pdf +%attr(755,root,root) %{_libdir}/libpdf.so.*.*.* +%attr(755,root,root) %ghost %{_libdir}/libpdf.so.6 + +%files devel +%defattr(644,root,root,755) +%doc doc/pdflib/{PDFlib-API-reference.pdf,PDFlib-tutorial.pdf,compatibility.txt} +%attr(755,root,root) %{_bindir}/pdflib-config +%attr(755,root,root) %{_libdir}/libpdf.so +%{_libdir}/libpdf.la +%{_includedir}/pdflib.h + +%if %{with static_libs} +%files static +%defattr(644,root,root,755) +%{_libdir}/libpdf.a +%endif + +%if %{with cxx} +%files c++ +%defattr(644,root,root,755) +%attr(755,root,root) %{_libdir}/libpdf_cpp.so.*.*.* +%attr(755,root,root) %ghost %{_libdir}/libpdf_cpp.so.0 + +%files c++-devel +%defattr(644,root,root,755) +%attr(755,root,root) %{_libdir}/libpdf_cpp.so +%{_libdir}/libpdf_cpp.la +%{_includedir}/pdflib.hpp + +%if %{with static_libs} +%files c++-static +%defattr(644,root,root,755) +%{_libdir}/libpdf_cpp.a +%endif +%endif + +%if %{with java} +%files -n java-pdflib-lite +%defattr(644,root,root,755) +%doc bind/pdflib/java/readme.txt +%attr(755,root,root) %{_libdir}/libpdf_java.so +%{_javadir}/pdflib.jar + +%files -n java-pdflib-lite-javadoc +%defattr(644,root,root,755) +%{_javadocdir}/pdflib +%endif + +%if %{with perl} +%files -n perl-pdflib-lite +%defattr(644,root,root,755) +%doc bind/pdflib/perl/readme.txt +%{perl_vendorarch}/pdflib_pl.pm +%attr(755,root,root) %{perl_vendorarch}/pdflib_pl.so +%endif + +%if %{with perl} +%files -n python-pdflib-lite +%defattr(644,root,root,755) +%attr(755,root,root) %{py_sitedir}/pdflib_py.so +%endif + +%if %{with tcl} +%files -n tcl-pdflib-lite +%defattr(644,root,root,755) +%doc bind/pdflib/tcl/readme.txt +%dir %{tcl_libdir}/pdflib +%attr(755,root,root) %{tcl_libdir}/pdflib/pdflib_tcl.so +%{tcl_libdir}/pdflib/pkgIndex.tcl +%endif