diff options
-rw-r--r-- | .gitignore | 9 | ||||
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | PHPINFO | 8 | ||||
-rw-r--r-- | REFLECTION | 729 | ||||
-rw-r--r-- | php-pecl-ps.spec | 199 |
5 files changed, 949 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..01f0400 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +clog +package-*.xml +*.tgz +*.tar.bz2 +*.tar.gz +*.tar.xz +*.tar.xz.asc +*.src.rpm +*/*rpm diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..13af741 --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +SRCDIR := $(shell pwd) +NAME := $(shell basename $(SRCDIR)) +include ../../../common/Makefile + @@ -0,0 +1,8 @@ + +ps + +PS Support => enabled +PSlib Version => 0.4.5 +Extension Version => 1.4.2 +Revision => $Revision$ +GD Support => disabled diff --git a/REFLECTION b/REFLECTION new file mode 100644 index 0000000..b34bbdd --- /dev/null +++ b/REFLECTION @@ -0,0 +1,729 @@ +Extension [ <persistent> extension #124 ps version 1.4.2 ] { + + - Constants [6] { + Constant [ int PS_LINECAP_BUTT ] { 0 } + Constant [ int PS_LINECAP_ROUND ] { 1 } + Constant [ int PS_LINECAP_SQUARED ] { 2 } + Constant [ int PS_LINEJOIN_MITER ] { 0 } + Constant [ int PS_LINEJOIN_ROUND ] { 1 } + Constant [ int PS_LINEJOIN_BEVEL ] { 2 } + } + + - Functions { + Function [ <internal:ps> function ps_new ] { + + - Parameters [0] { + } + } + Function [ <internal:ps> function ps_delete ] { + + - Parameters [1] { + Parameter #0 [ <optional> $psdoc ] + } + } + Function [ <internal:ps> function ps_open_file ] { + + - Parameters [2] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <optional> $filename ] + } + } + Function [ <internal:ps> function ps_get_buffer ] { + + - Parameters [1] { + Parameter #0 [ <optional> $psdoc ] + } + } + Function [ <internal:ps> function ps_close ] { + + - Parameters [1] { + Parameter #0 [ <optional> $psdoc ] + } + } + Function [ <internal:ps> function ps_begin_page ] { + + - Parameters [3] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $width ] + Parameter #2 [ <required> $height ] + } + } + Function [ <internal:ps> function ps_end_page ] { + + - Parameters [1] { + Parameter #0 [ <optional> $psdoc ] + } + } + Function [ <internal:ps> function ps_get_value ] { + + - Parameters [3] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $key ] + Parameter #2 [ <optional> $modifier ] + } + } + Function [ <internal:ps> function ps_set_value ] { + + - Parameters [3] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $key ] + Parameter #2 [ <required> $value ] + } + } + Function [ <internal:ps> function ps_get_parameter ] { + + - Parameters [3] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $key ] + Parameter #2 [ <optional> $modifier ] + } + } + Function [ <internal:ps> function ps_set_parameter ] { + + - Parameters [3] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $key ] + Parameter #2 [ <required> $value ] + } + } + Function [ <internal:ps> function ps_findfont ] { + + - Parameters [4] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $fontname ] + Parameter #2 [ <required> $encoding ] + Parameter #3 [ <required> $embed ] + } + } + Function [ <internal:ps> function ps_setfont ] { + + - Parameters [3] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $font ] + Parameter #2 [ <required> $fontsize ] + } + } + Function [ <internal:ps> function ps_show ] { + + - Parameters [2] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $text ] + } + } + Function [ <internal:ps> function ps_show_xy ] { + + - Parameters [4] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $text ] + Parameter #2 [ <required> $x-coor ] + Parameter #3 [ <required> $y-coor ] + } + } + Function [ <internal:ps> function ps_show2 ] { + + - Parameters [3] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $text ] + Parameter #2 [ <required> $length ] + } + } + Function [ <internal:ps> function ps_show_xy2 ] { + + - Parameters [5] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $text ] + Parameter #2 [ <required> $length ] + Parameter #3 [ <required> $x-coor ] + Parameter #4 [ <required> $y-coor ] + } + } + Function [ <internal:ps> function ps_continue_text ] { + + - Parameters [2] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $text ] + } + } + Function [ <internal:ps> function ps_show_boxed ] { + + - Parameters [8] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $text ] + Parameter #2 [ <required> $x-coor ] + Parameter #3 [ <required> $y-coor ] + Parameter #4 [ <required> $width ] + Parameter #5 [ <required> $height ] + Parameter #6 [ <required> $mode ] + Parameter #7 [ <optional> $feature ] + } + } + Function [ <internal:ps> function ps_stringwidth ] { + + - Parameters [4] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $text ] + Parameter #2 [ <optional> $font ] + Parameter #3 [ <optional> $size ] + } + } + Function [ <internal:ps> function ps_string_geometry ] { + + - Parameters [4] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $text ] + Parameter #2 [ <optional> $font ] + Parameter #3 [ <optional> $size ] + } + } + Function [ <internal:ps> function ps_set_text_pos ] { + + - Parameters [3] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $x-coor ] + Parameter #2 [ <required> $y-coor ] + } + } + Function [ <internal:ps> function ps_setdash ] { + + - Parameters [3] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $black ] + Parameter #2 [ <required> $white ] + } + } + Function [ <internal:ps> function ps_setpolydash ] { + + - Parameters [2] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $darray ] + } + } + Function [ <internal:ps> function ps_setflat ] { + + - Parameters [2] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $value ] + } + } + Function [ <internal:ps> function ps_setlinejoin ] { + + - Parameters [2] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $value ] + } + } + Function [ <internal:ps> function ps_setlinecap ] { + + - Parameters [2] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $value ] + } + } + Function [ <internal:ps> function ps_setmiterlimit ] { + + - Parameters [2] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $value ] + } + } + Function [ <internal:ps> function ps_setlinewidth ] { + + - Parameters [2] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $width ] + } + } + Function [ <internal:ps> function ps_setoverprintmode ] { + + - Parameters [2] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $mode ] + } + } + Function [ <internal:ps> function ps_save ] { + + - Parameters [1] { + Parameter #0 [ <optional> $psdoc ] + } + } + Function [ <internal:ps> function ps_restore ] { + + - Parameters [1] { + Parameter #0 [ <optional> $psdoc ] + } + } + Function [ <internal:ps> function ps_translate ] { + + - Parameters [3] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $x-coor ] + Parameter #2 [ <required> $y-coor ] + } + } + Function [ <internal:ps> function ps_scale ] { + + - Parameters [3] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $x-scale ] + Parameter #2 [ <required> $y-scale ] + } + } + Function [ <internal:ps> function ps_rotate ] { + + - Parameters [2] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $angle ] + } + } + Function [ <internal:ps> function ps_moveto ] { + + - Parameters [3] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $x-coor ] + Parameter #2 [ <required> $y-coor ] + } + } + Function [ <internal:ps> function ps_lineto ] { + + - Parameters [3] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $x-coor ] + Parameter #2 [ <required> $y-coor ] + } + } + Function [ <internal:ps> function ps_curveto ] { + + - Parameters [7] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $x1 ] + Parameter #2 [ <required> $y1 ] + Parameter #3 [ <required> $x2 ] + Parameter #4 [ <required> $y2 ] + Parameter #5 [ <required> $x3 ] + Parameter #6 [ <required> $y3 ] + } + } + Function [ <internal:ps> function ps_circle ] { + + - Parameters [4] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $x-coor ] + Parameter #2 [ <required> $y-coor ] + Parameter #3 [ <required> $radius ] + } + } + Function [ <internal:ps> function ps_arc ] { + + - Parameters [6] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $x-coor ] + Parameter #2 [ <required> $y-coor ] + Parameter #3 [ <required> $radius ] + Parameter #4 [ <required> $start ] + Parameter #5 [ <required> $end ] + } + } + Function [ <internal:ps> function ps_arcn ] { + + - Parameters [6] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $x-coor ] + Parameter #2 [ <required> $y-coor ] + Parameter #3 [ <required> $radius ] + Parameter #4 [ <required> $alpha ] + Parameter #5 [ <required> $beta ] + } + } + Function [ <internal:ps> function ps_rect ] { + + - Parameters [5] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $x-coor ] + Parameter #2 [ <required> $y-coor ] + Parameter #3 [ <required> $width ] + Parameter #4 [ <required> $height ] + } + } + Function [ <internal:ps> function ps_closepath ] { + + - Parameters [1] { + Parameter #0 [ <optional> $psdoc ] + } + } + Function [ <internal:ps> function ps_stroke ] { + + - Parameters [1] { + Parameter #0 [ <optional> $psdoc ] + } + } + Function [ <internal:ps> function ps_closepath_stroke ] { + + - Parameters [1] { + Parameter #0 [ <optional> $psdoc ] + } + } + Function [ <internal:ps> function ps_fill ] { + + - Parameters [1] { + Parameter #0 [ <optional> $psdoc ] + } + } + Function [ <internal:ps> function ps_fill_stroke ] { + + - Parameters [1] { + Parameter #0 [ <optional> $psdoc ] + } + } + Function [ <internal:ps> function ps_clip ] { + + - Parameters [1] { + Parameter #0 [ <optional> $psdoc ] + } + } + Function [ <internal:ps> function ps_open_image_file ] { + + - Parameters [5] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $type ] + Parameter #2 [ <required> $filename ] + Parameter #3 [ <required> $stringparam ] + Parameter #4 [ <optional> $intparam ] + } + } + Function [ <internal:ps> function ps_open_image ] { + + - Parameters [10] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $type ] + Parameter #2 [ <required> $source ] + Parameter #3 [ <required> $data ] + Parameter #4 [ <required> $length ] + Parameter #5 [ <required> $width ] + Parameter #6 [ <required> $height ] + Parameter #7 [ <required> $components ] + Parameter #8 [ <required> $bpc ] + Parameter #9 [ <required> $params ] + } + } + Function [ <internal:ps> function ps_close_image ] { + + - Parameters [2] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $image ] + } + } + Function [ <internal:ps> function ps_place_image ] { + + - Parameters [5] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $image ] + Parameter #2 [ <required> $x-coor ] + Parameter #3 [ <required> $y-coor ] + Parameter #4 [ <required> $scale ] + } + } + Function [ <internal:ps> function ps_add_bookmark ] { + + - Parameters [4] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $string ] + Parameter #2 [ <optional> $parent ] + Parameter #3 [ <optional> $open ] + } + } + Function [ <internal:ps> function ps_set_info ] { + + - Parameters [3] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $fieldname ] + Parameter #2 [ <required> $value ] + } + } + Function [ <internal:ps> function ps_include_file ] { + + - Parameters [2] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $filename ] + } + } + Function [ <internal:ps> function ps_add_note ] { + + - Parameters [9] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $llx ] + Parameter #2 [ <required> $lly ] + Parameter #3 [ <required> $urx ] + Parameter #4 [ <required> $ury ] + Parameter #5 [ <required> $contents ] + Parameter #6 [ <required> $title ] + Parameter #7 [ <required> $icon ] + Parameter #8 [ <required> $open ] + } + } + Function [ <internal:ps> function ps_add_pdflink ] { + + - Parameters [8] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $llx ] + Parameter #2 [ <required> $lly ] + Parameter #3 [ <required> $urx ] + Parameter #4 [ <required> $ury ] + Parameter #5 [ <required> $filename ] + Parameter #6 [ <required> $page ] + Parameter #7 [ <required> $dest ] + } + } + Function [ <internal:ps> function ps_add_locallink ] { + + - Parameters [7] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $llx ] + Parameter #2 [ <required> $lly ] + Parameter #3 [ <required> $urx ] + Parameter #4 [ <required> $ury ] + Parameter #5 [ <required> $page ] + Parameter #6 [ <required> $dest ] + } + } + Function [ <internal:ps> function ps_add_launchlink ] { + + - Parameters [6] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $llx ] + Parameter #2 [ <required> $lly ] + Parameter #3 [ <required> $urx ] + Parameter #4 [ <required> $ury ] + Parameter #5 [ <required> $filename ] + } + } + Function [ <internal:ps> function ps_add_weblink ] { + + - Parameters [6] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $llx ] + Parameter #2 [ <required> $lly ] + Parameter #3 [ <required> $urx ] + Parameter #4 [ <required> $ury ] + Parameter #5 [ <required> $url ] + } + } + Function [ <internal:ps> function ps_set_border_style ] { + + - Parameters [3] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $style ] + Parameter #2 [ <required> $width ] + } + } + Function [ <internal:ps> function ps_set_border_color ] { + + - Parameters [4] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $red ] + Parameter #2 [ <required> $green ] + Parameter #3 [ <required> $blue ] + } + } + Function [ <internal:ps> function ps_set_border_dash ] { + + - Parameters [3] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $black ] + Parameter #2 [ <required> $white ] + } + } + Function [ <internal:ps> function ps_setcolor ] { + + - Parameters [7] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $type ] + Parameter #2 [ <required> $colorspace ] + Parameter #3 [ <required> $c1 ] + Parameter #4 [ <required> $c2 ] + Parameter #5 [ <required> $c3 ] + Parameter #6 [ <required> $c4 ] + } + } + Function [ <internal:ps> function ps_makespotcolor ] { + + - Parameters [2] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $spotcolor ] + } + } + Function [ <internal:ps> function ps_begin_pattern ] { + + - Parameters [6] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $width ] + Parameter #2 [ <required> $height ] + Parameter #3 [ <required> $xstep ] + Parameter #4 [ <required> $ystep ] + Parameter #5 [ <required> $painttype ] + } + } + Function [ <internal:ps> function ps_end_pattern ] { + + - Parameters [1] { + Parameter #0 [ <optional> $psdoc ] + } + } + Function [ <internal:ps> function ps_begin_template ] { + + - Parameters [3] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $width ] + Parameter #2 [ <required> $height ] + } + } + Function [ <internal:ps> function ps_end_template ] { + + - Parameters [1] { + Parameter #0 [ <optional> $psdoc ] + } + } + Function [ <internal:ps> function ps_shfill ] { + + - Parameters [2] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $psshading ] + } + } + Function [ <internal:ps> function ps_shading ] { + + - Parameters [11] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $type ] + Parameter #2 [ <required> $x0 ] + Parameter #3 [ <required> $y0 ] + Parameter #4 [ <required> $x1 ] + Parameter #5 [ <required> $y1 ] + Parameter #6 [ <required> $c1 ] + Parameter #7 [ <required> $c2 ] + Parameter #8 [ <required> $c3 ] + Parameter #9 [ <required> $c4 ] + Parameter #10 [ <required> $optlist ] + } + } + Function [ <internal:ps> function ps_shading_pattern ] { + + - Parameters [2] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $psshading ] + } + } + Function [ <internal:ps> function ps_begin_font ] { + + - Parameters [9] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $fontname ] + Parameter #2 [ <required> $a ] + Parameter #3 [ <required> $b ] + Parameter #4 [ <required> $c ] + Parameter #5 [ <required> $d ] + Parameter #6 [ <required> $e ] + Parameter #7 [ <required> $f ] + Parameter #8 [ <optional> $optlist ] + } + } + Function [ <internal:ps> function ps_end_font ] { + + - Parameters [1] { + Parameter #0 [ <optional> $psdoc ] + } + } + Function [ <internal:ps> function ps_begin_glyph ] { + + - Parameters [7] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $name ] + Parameter #2 [ <required> $wx ] + Parameter #3 [ <required> $llx ] + Parameter #4 [ <required> $lly ] + Parameter #5 [ <required> $urx ] + Parameter #6 [ <required> $ury ] + } + } + Function [ <internal:ps> function ps_end_glyph ] { + + - Parameters [1] { + Parameter #0 [ <optional> $psdoc ] + } + } + Function [ <internal:ps> function ps_hyphenate ] { + + - Parameters [2] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $word ] + } + } + Function [ <internal:ps> function ps_symbol ] { + + - Parameters [2] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $ord ] + } + } + Function [ <internal:ps> function ps_symbol_name ] { + + - Parameters [3] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $ord ] + Parameter #2 [ <optional> $font ] + } + } + Function [ <internal:ps> function ps_symbol_width ] { + + - Parameters [4] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $ord ] + Parameter #2 [ <optional> $font ] + Parameter #3 [ <optional> $width ] + } + } + Function [ <internal:ps> function ps_glyph_show ] { + + - Parameters [2] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $name ] + } + } + Function [ <internal:ps> function ps_glyph_width ] { + + - Parameters [4] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $name ] + Parameter #2 [ <optional> $font ] + Parameter #3 [ <optional> $size ] + } + } + Function [ <internal:ps> function ps_glyph_list ] { + + - Parameters [2] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <optional> $font ] + } + } + Function [ <internal:ps> function ps_add_kerning ] { + + - Parameters [5] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $glyphname1 ] + Parameter #2 [ <required> $glyphname2 ] + Parameter #3 [ <required> $kern ] + Parameter #4 [ <optional> $font ] + } + } + Function [ <internal:ps> function ps_add_ligature ] { + + - Parameters [5] { + Parameter #0 [ <required> $psdoc ] + Parameter #1 [ <required> $glyphname1 ] + Parameter #2 [ <required> $glyphname2 ] + Parameter #3 [ <required> $glyphname3 ] + Parameter #4 [ <optional> $font ] + } + } + } +} + diff --git a/php-pecl-ps.spec b/php-pecl-ps.spec new file mode 100644 index 0000000..bfb52fe --- /dev/null +++ b/php-pecl-ps.spec @@ -0,0 +1,199 @@ +# remirepo spec file for php-pecl-ps +# +# Copyright (c) 2021 Remi Collet +# License: CC-BY-SA +# http://creativecommons.org/licenses/by-sa/4.0/ +# +# Please, preserve the changelog entries +# +%{?scl: %scl_package php-pecl-ps} + +%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} +%global pecl_name ps + +Summary: An extension to create PostScript files +Name: %{?scl_prefix}php-pecl-ps +Version: 1.4.2 +Release: 1%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')} +License: BSD +Group: Development/Languages +URL: https://pecl.php.net/package/%{pecl_name} + +Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz + +BuildRequires: make +BuildRequires: %{?dtsprefix}gcc +BuildRequires: %{?scl_prefix}php-devel >= 7.0 +BuildRequires: %{?scl_prefix}php-pear +BuildRequires: pslib-devel + +Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} +Requires: %{?scl_prefix}php(api) = %{php_core_api} +%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}} + +Provides: %{?scl_prefix}php-%{pecl_name} = %{version} +Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version} +Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version} +Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version} + + +%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} +# Other third party repo stuff +%if "%{php_version}" > "7.4" +Obsoletes: php74-pecl-%{pecl_name} +%endif +%if "%{php_version}" > "8.0" +Obsoletes: php80-pecl-%{pecl_name} +%endif +%if "%{php_version}" > "8.1" +Obsoletes: php81-pecl-%{pecl_name} +%endif +%endif + + +%description +Ps is an extension similar to the pdf extension but for creating PostScript +files. Its api is modelled after the pdf extension. + +Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')%{?scl: as Software Collection (%{scl} by %{?scl_vendor}%{!?scl_vendor:rh})}. + + +%prep +%setup -c -q + +mv %{pecl_name}-%{version} NTS + +# Don't install/register tests +sed -e 's/role="test"/role="src"/' \ + %{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \ + -i package.xml + +pushd NTS +# https://github.com/steinm/ps/issues/1 +sed -e 's/HAVE_LIBGD/DISABLE_LIBGD/' -i *.c + +# Check version +extver=$(sed -n '/#define PHP_PS_VERSION/{s/.* "//;s/".*$//;p}' php_ps.h) +if test "x${extver}" != "x%{version}"; then + : Error: Upstream version is ${extver}, expecting %{version}. + exit 1 +fi +popd + +%if %{with_zts} +cp -pr NTS ZTS +%endif + +# Create the config file +cat > %{ini_name} << 'EOF' +; Enable %{pecl_name} extension module +extension=%{pecl_name}.so +EOF + + +%build +%{?dtsenable} + +cd NTS +%{_bindir}/phpize +%configure --with-php-config=%{_bindir}/php-config +make %{?_smp_mflags} + +%if %{with_zts} +cd ../ZTS +%{_bindir}/zts-phpize +%configure --with-php-config=%{_bindir}/zts-php-config +make %{?_smp_mflags} +%endif + + +%install +%{?dtsenable} + +make -C NTS install-modules INSTALL_ROOT=%{buildroot} + +# Drop in the bit of configuration +install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} + +# Install XML package description +install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml + +%if %{with_zts} +make -C ZTS install-modules INSTALL_ROOT=%{buildroot} +install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} +%endif + +# Documentation +cd NTS +for i in $(grep 'role="doc"' ../package.xml | sed -e 's/^.*name="//;s/".*$//') +do install -Dpm 644 $i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i +done + + +%check +: Minimal load test for NTS extension +cd NTS +%{_bindir}/php --no-php-ini \ + --define extension=modules/%{pecl_name}.so \ + --modules | grep %{pecl_name} + +: Upstream test suite for NTS extension +TEST_PHP_EXECUTABLE=%{_bindir}/php \ +TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \ +%{_bindir}/php -n run-tests.php -q --show-diff + + +%if %{with_zts} +: Minimal load test for ZTS extension +cd ../ZTS +%{__ztsphp} --no-php-ini \ + --define extension=modules/%{pecl_name}.so \ + --modules | grep %{pecl_name} + +: Upstream test suite for ZTS extension +TEST_PHP_EXECUTABLE=%{__ztsphp} \ +TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \ +%{__ztsphp} -n run-tests.php -q --show-diff +%endif + + +%if 0%{?fedora} < 24 && 0%{?rhel} < 8 +# when pear installed alone, after us +%triggerin -- %{?scl_prefix}php-pear +if [ -x %{__pecl} ] ; then + %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : +fi + +# posttrans as pear can be installed after us +%posttrans +if [ -x %{__pecl} ] ; then + %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : +fi + +%postun +if [ $1 -eq 0 -a -x %{__pecl} ] ; then + %{pecl_uninstall} %{pecl_name} >/dev/null || : +fi +%endif + + +%files +#%%{?_licensedir:%%license NTS/LICENSE} +%doc %{pecl_docdir}/%{pecl_name} +%{pecl_xmldir}/%{name}.xml + +%config(noreplace) %{php_inidir}/%{ini_name} +%{php_extdir}/%{pecl_name}.so + +%if %{with_zts} +%config(noreplace) %{php_ztsinidir}/%{ini_name} +%{php_ztsextdir}/%{pecl_name}.so +%endif + + +%changelog +* Sun Sep 26 2021 Remi Collet <remi@remirepo.net> - 1.4.2-1 +- new package +- open https://github.com/steinm/ps/pull/2 cleanup +- open https://github.com/steinm/ps/issues/1 broken build with gd +- open https://github.com/steinm/ps/issues/3 missing LICENSE file |