summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--3_01.txt68
-rw-r--r--php-pecl-ncurses.spec78
-rw-r--r--xml2changelog34
3 files changed, 128 insertions, 52 deletions
diff --git a/3_01.txt b/3_01.txt
new file mode 100644
index 0000000..6059c80
--- /dev/null
+++ b/3_01.txt
@@ -0,0 +1,68 @@
+--------------------------------------------------------------------
+ The PHP License, version 3.01
+Copyright (c) 1999 - 2014 The PHP Group. All rights reserved.
+--------------------------------------------------------------------
+
+Redistribution and use in source and binary forms, with or without
+modification, is permitted provided that the following conditions
+are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+ 3. The name "PHP" must not be used to endorse or promote products
+ derived from this software without prior written permission. For
+ written permission, please contact group@php.net.
+
+ 4. Products derived from this software may not be called "PHP", nor
+ may "PHP" appear in their name, without prior written permission
+ from group@php.net. You may indicate that your software works in
+ conjunction with PHP by saying "Foo for PHP" instead of calling
+ it "PHP Foo" or "phpfoo"
+
+ 5. The PHP Group may publish revised and/or new versions of the
+ license from time to time. Each version will be given a
+ distinguishing version number.
+ Once covered code has been published under a particular version
+ of the license, you may always continue to use it under the terms
+ of that version. You may also choose to use such covered code
+ under the terms of any subsequent version of the license
+ published by the PHP Group. No one other than the PHP Group has
+ the right to modify the terms applicable to covered code created
+ under this License.
+
+ 6. Redistributions of any form whatsoever must retain the following
+ acknowledgment:
+ "This product includes PHP software, freely available from
+ <http://www.php.net/software/>".
+
+THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND
+ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PHP
+DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+OF THE POSSIBILITY OF SUCH DAMAGE.
+
+--------------------------------------------------------------------
+
+This software consists of voluntary contributions made by many
+individuals on behalf of the PHP Group.
+
+The PHP Group can be contacted via Email at group@php.net.
+
+For more information on the PHP Group and the PHP project,
+please see <http://www.php.net>.
+
+PHP includes the Zend Engine, freely available at
+<http://www.zend.com>.
diff --git a/php-pecl-ncurses.spec b/php-pecl-ncurses.spec
index 4d37447..cefeaa3 100644
--- a/php-pecl-ncurses.spec
+++ b/php-pecl-ncurses.spec
@@ -1,19 +1,31 @@
-%{!?__pecl: %{expand: %%global __pecl %{_bindir}/pecl}}
+# spec file for php-pecl-ncurses
+#
+# Copyright (c) 2007-2014 Remi Collet
+# License: CC-BY-SA
+# http://creativecommons.org/licenses/by-sa/3.0/
+#
+# Please, preserve the changelog entries
+#
+%{!?php_inidir: %global php_inidir %{_sysconfdir}/php.d}
+%{!?__pecl: %global __pecl %{_bindir}/pecl}
+%{!?__php: %global __php %{_bindir}/php}
%global pecl_name ncurses
+%global with_zts 0%{?__ztsphp:1}
Summary: Terminal screen handling and optimization package
Name: php-pecl-ncurses
Version: 1.0.2
-Release: 1%{?dist}.5
+Release: 5%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
License: PHP
Group: Development/Languages
URL: http://pecl.php.net/package/ncurses
Source: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
-Source2: xml2changelog
# https://bugs.php.net/65862 - Please Provides LICENSE file
+# URL from ncurses.c
+Source1: http://www.php.net/license/3_01.txt
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: php-devel
@@ -41,10 +53,15 @@ Obsoletes: php54-pecl-%{pecl_name}
%if "%{php_version}" > "5.5"
Obsoletes: php55u-pecl-%{pecl_name}
%endif
+%if "%{php_version}" > "5.6"
+Obsoletes: php56u-pecl-%{pecl_name}
+%endif
-# Filter private shared
+%if 0%{?fedora} < 20
+# Filter shared private
%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$}
%{?filter_setup}
+%endif
%description
@@ -60,49 +77,64 @@ line.
%prep
%setup -c -q
-%{_bindir}/php %{SOURCE2} package.xml >CHANGELOG
cat >%{pecl_name}.ini << 'EOF'
; Enable %{pecl_name} extension module
extension=%{pecl_name}.so
EOF
-cp -pr %{pecl_name}-%{version} %{pecl_name}-%{version}-zts
+mv %{pecl_name}-%{version} NTS
+
+cp %{SOURCE1} NTS/LICENSE
+
+%if %{with_zts}
+cp -r NTS ZTS
+%endif
%build
-cd %{pecl_name}-%{version}
+cd NTS
%{_bindir}/phpize
%configure --enable-ncursesw \
--with-php-config=%{_bindir}/php-config
make %{?_smp_mflags}
-cd ../%{pecl_name}-%{version}-zts
+%if %{with_zts}
+cd ../ZTS
%{_bindir}/zts-phpize
%configure --enable-ncursesw \
--with-php-config=%{_bindir}/zts-php-config
make %{?_smp_mflags}
+%endif
%install
rm -rf %{buildroot}
-make -C %{pecl_name}-%{version} \
- install INSTALL_ROOT=%{buildroot}
-
-make -C %{pecl_name}-%{version}-zts \
- install INSTALL_ROOT=%{buildroot}
+make -C NTS install INSTALL_ROOT=%{buildroot}
# Install XML package description
install -Dpm 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
# install config file
install -Dpm 644 %{pecl_name}.ini %{buildroot}%{php_inidir}/%{pecl_name}.ini
+
+%if %{with_zts}
+make -C ZTS install INSTALL_ROOT=%{buildroot}
install -Dpm 644 %{pecl_name}.ini %{buildroot}%{php_ztsinidir}/%{pecl_name}.ini
+%endif
+
+# Test & Documentation
+for i in $(grep 'role="test"' package.xml | sed -e 's/^.*name="//;s/".*$//')
+do install -Dpm 644 NTS/$i %{buildroot}%{pecl_testdir}/%{pecl_name}/$i
+done
+for i in LICENSE $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//')
+do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
+done
%check
-cd %{pecl_name}-%{version}
+cd NTS
TEST_PHP_EXECUTABLE=%{__php} \
REPORT_EXIT_STATUS=1 \
@@ -112,7 +144,8 @@ NO_INTERACTION=1 \
-d extension_dir=modules \
-d extension=%{pecl_name}.so \
-cd ../%{pecl_name}-%{version}-zts
+%if %{with_zts}
+cd ../ZTS
TEST_PHP_EXECUTABLE=%{__ztsphp} \
REPORT_EXIT_STATUS=1 \
@@ -121,6 +154,7 @@ NO_INTERACTION=1 \
-n -q \
-d extension_dir=modules \
-d extension=%{pecl_name}.so \
+%endif
%clean
@@ -139,15 +173,23 @@ fi
%files
%defattr(-, root, root, -)
-%doc CHANGELOG %{pecl_name}-%{version}/{CREDITS,example1.php}
+%doc %{pecl_docdir}/%{pecl_name}
+%doc %{pecl_testdir}/%{pecl_name}
%config(noreplace) %{php_inidir}/%{pecl_name}.ini
-%config(noreplace) %{php_ztsinidir}/%{pecl_name}.ini
%{php_extdir}/%{pecl_name}.so
-%{php_ztsextdir}/%{pecl_name}.so
%{pecl_xmldir}/%{name}.xml
+%if %{with_zts}
+%config(noreplace) %{php_ztsinidir}/%{pecl_name}.ini
+%{php_ztsextdir}/%{pecl_name}.so
+%endif
%changelog
+* Sat Mar 8 2014 Remi Collet <remi@fedoraproject.org> - 1.0.2-2
+- cleanups
+- install doc in pecl_docdir
+- install tests in pecl_testdir
+
* Fri Nov 30 2012 Remi Collet <remi@fedoraproject.org> - 1.0.2-1.1
- rebuild
diff --git a/xml2changelog b/xml2changelog
deleted file mode 100644
index c114873..0000000
--- a/xml2changelog
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-$prog=array_shift($_SERVER['argv']);
-if ($_SERVER['argc']<2) die ("usage : " . $prog . " path_to_package.xml [ --debug ]\n");
-$file=array_shift($_SERVER['argv']);
-
-($xml=simplexml_load_file($file)) || die ($file . " not found !\n");
-if (in_array("--debug", $_SERVER['argv'])) print_r($xml);
-
-if ($xml['version'] >= "2"){ // Package.xml V 2.0
- printf("*** Version %s (%s) - API %s (%s) - %s\n\n%s\n\n",
- $xml->version->release, $xml->stability->release,
- $xml->version->api, $xml->stability->api,
- $xml->date, $xml->notes);
- $new=$xml->version->release;
-
- if (isset($xml->changelog->release) && count($xml->changelog->release))
- foreach($xml->changelog->release as $rel) {
- $old=$rel->version->release;
- if ("$old" != "$new") {
- printf("*** Version %s (%s) - API %s (%s) - %s\n\n%s\n\n",
- $rel->version->release, $rel->stability->release,
- $rel->version->api, $rel->stability->api,
- $rel->date, $rel->notes);
- }
- }
-} else { // Package.xml V 1.0
- printf("* Version %s (%s) - %s\n\n%s\n\n",
- $xml->release->version, $xml->release->state, $xml->release->date, $xml->release->notes);
-
- foreach($xml->changelog->release as $rel)
- printf("* Version %s (%s) - %s\n\n%s\n\n",
- $rel->version, $rel->state, $rel->date, $rel->notes);
-}
-?>