Pārlūkot izejas kodu

php-ext-clearsilver-0.4-8

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@9787 ec354946-7b23-47d6-9f5a-488ba84defc7
tomop 8 gadi atpakaļ
vecāks
revīzija
f3fb59b7d8
1 mainītis faili ar 128 papildinājumiem un 15 dzēšanām
  1. 128 15
      p/php-ext-clearsilver/php-ext-clearsilver-vl.spec

+ 128 - 15
p/php-ext-clearsilver/php-ext-clearsilver-vl.spec

@@ -1,19 +1,29 @@
+%bcond_without php5
+%bcond_with php70
+
+%define modname clearsilver
+
 Summary: ClearSilver extension for PHP
 Summary(ja): PHP用ClearSilverモジュール
-Name: php-ext-clearsilver
+Name: php-ext-%{modname}
 Version: 0.4
-Release: 6%{_dist_release}
+Release: 8%{_dist_release}
 URL: http://www.geodata.soton.ac.uk/software/php_clearsilver/
-Source: php-clearsilver-%{version}.tar.gz
+Source: php-%{modname}-%{version}.tar.gz
 Patch0: php-clearsilver-0.4-php5.5.0.patch
+Patch1: php-clearsilver-0.4-cgifunctions.patch
+Patch2: php-clearsilver-0.4-php7.0.0.patch
 License: The PHP License
 Group: Development/Languages
-BuildRequires: clearsilver, php5-devel
+BuildRequires: clearsilver, zlib-devel
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
-Provides: php5-ext-clearsilver
 
-%if "%{?req_php_api}" != ""
-Requires: %{req_php_api}
+%if %{with php5}
+BuildRequires: php5-devel
+%endif
+
+%if %{with php70}
+BuildRequires: php70-devel
 %endif
 
 Vendor: Project Vine
@@ -26,41 +36,144 @@ This module adds ClearSilver functions to PHP.
 %description -l ja
 このモジュールはPHPにClearSilverテンプレート機能を追加します。
 
+%if %{with php5}
+%package -n php5-ext-%{modname}
+Summary: ClearSilver extension for PHP-5.6.x
+Summary(ja): PHP-5.6.x用ClearSilverモジュール
+Group: Development/Languages
+%if "%{?req_php5_api}" != ""
+Requires: %{req_php5_api}
+%endif
+Obsoletes: php-ext-clearsilver < 0.4-7
+
+%description -n php5-ext-%{modname}
+This module adds ClearSilver functions to PHP.
+
+%description -n php5-ext-%{modname} -l ja
+このモジュールはPHPにClearSilverテンプレート機能を追加します。
+
+%endif
+
+%if %{with php70}
+%package -n php70-ext-%{modname}
+Summary: ClearSilver extension for PHP-7.0.x
+Summary(ja): PHP-7.0.x用ClearSilverモジュール
+Group: Development/Languages
+%if "%{?req_php70_api}" != ""
+Requires: %{req_php70_api}
+%endif
+
+%description -n php70-ext-%{modname}
+This module adds ClearSilver functions to PHP.
+
+%description -n php70-ext-%{modname} -l ja
+このモジュールはPHPにClearSilverテンプレート機能を追加します。
+
+%endif
+
 %prep
-%setup -q -n php-clearsilver-%{version}
+%setup -q -c -n php-%{modname}-%{version}
+
+cp -a php-%{modname}-%{version}/{CREDITS,INSTALL,LICENSE,README,doc} ./
+
+%if %{with php5}
+cp -a php-clearsilver-%{version} php-clearsilver-%{version}-php5
+pushd php-clearsilver-%{version}-php5
 %patch0 -p1 -b .php55
+%patch1 -p1 -b .cgifunctions
+popd
+%endif
+
+%if %{with php70}
+cp -a php-clearsilver-%{version} php-clearsilver-%{version}-php70
+pushd php-clearsilver-%{version}-php70
+%patch0 -p1 -b .php55
+%patch1 -p1 -b .cgifunctions
+%patch2 -p1 -b .php70
+popd
+%endif
 
 %build
+%if %{with php5}
+pushd php-clearsilver-%{version}-php5
+aclocal
+autoconf
+phpize5
+libtoolize --copy --force
+%configure --with-php-config=/usr/bin/php-config5
+%__make %{_smp_mflags}
+popd
+%endif
+
+%if %{with php70}
+pushd php-clearsilver-%{version}-php70
 aclocal
 autoconf
-phpize
+phpize70
 libtoolize --copy --force
-%configure
+%configure --with-php-config=/usr/bin/php-config70
 %__make %{_smp_mflags}
+popd
+%endif
 
 %install
 rm -rf %{buildroot}
+%if %{with php5}
+pushd php-clearsilver-%{version}-php5
 mkdir -p %{buildroot}%{_libdir}/php5/
 mkdir -p %{buildroot}%{_sysconfdir}/php5/php.d
 
-install -m644 modules/clearsilver.so %{buildroot}%{_libdir}/php5/
+install -m644 modules/%{modname}.so %{buildroot}%{_libdir}/php5/
 
-cat > %{buildroot}%{_sysconfdir}/php5/php.d/clearsilver.ini <<EOF
-; Enable clearsilver extension module
-extension=clearsilver.so
+cat > %{buildroot}%{_sysconfdir}/php5/php.d/%{modname}.ini <<EOF
+; Enable %{modname} extension module
+extension=%{modname}.so
 EOF
+popd
+%endif
 
+%if %{with php70}
+pushd php-clearsilver-%{version}-php70
+mkdir -p %{buildroot}%{_libdir}/php70/
+mkdir -p %{buildroot}%{_sysconfdir}/php70/php.d
+
+install -m644 modules/%{modname}.so %{buildroot}%{_libdir}/php70/
+
+cat > %{buildroot}%{_sysconfdir}/php70/php.d/%{modname}.ini <<EOF
+; Enable %{modname} extension module
+extension=%{modname}.so
+EOF
+popd
+%endif
 
 %clean
 rm -rf %{buildroot}
 
-%files
+%if %{with php5}
+%files -n php5-ext-%{modname}
 %defattr(-,root,root)
 %doc CREDITS INSTALL LICENSE README doc
 %{_libdir}/php5/*
 %{_sysconfdir}/php5/php.d/*
+%endif
+
+%if %{with php70}
+%files -n php70-ext-%{modname}
+%defattr(-,root,root)
+%doc CREDITS INSTALL LICENSE README doc
+%{_libdir}/php70/*
+%{_sysconfdir}/php70/php.d/*
+%endif
 
 %changelog
+* Thu Nov  5 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.4-8
+- fixed summary.
+- fixed php70 stuff.
+
+* Thu Nov  5 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.4-7
+- added CGI functions.
+- added support for php70.
+
 * Fri Apr 10 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.4-6
 - rebuilt with php5-5.6.7.