Parcourir la source

php-ext-clearsilver-0.4-17

Tomohiro "Tomo-p" KATO il y a 3 ans
Parent
commit
ecf4e92b08
1 fichiers modifiés avec 78 ajouts et 12 suppressions
  1. 78 12
      p/php-ext-clearsilver/php-ext-clearsilver-vl.spec

+ 78 - 12
p/php-ext-clearsilver/php-ext-clearsilver-vl.spec

@@ -1,6 +1,7 @@
 %bcond_with php5
 %bcond_without php74
 %bcond_without php80
+%bcond_without php81
 
 %define modname clearsilver
 
@@ -8,21 +9,21 @@ Summary: ClearSilver extension for PHP
 Summary(ja): PHP用ClearSilverモジュール
 Name: php-ext-%{modname}
 Version: 0.4
-Release: 16%{_dist_release}
+Release: 17%{_dist_release}
+Group: programming
+Vendor: Project Vine
+Distribution: Vine Linux
+Packager: tomop
+
+License: The PHP License
 URL: http://www.geodata.soton.ac.uk/software/php_clearsilver/
 Source: php-%{modname}-%{version}.tar.gz
 Patch0: php-clearsilver-0.4-php5.6.0.patch
 Patch2: php-clearsilver-0.4-php7.2.0.patch
 Patch3: php-clearsilver-0.4-php8.0.0.patch
-License: The PHP License
-Group: programming
 BuildRequires: clearsilver, zlib-devel
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
 
-Vendor: Project Vine
-Distribution: Vine Linux
-Packager: tomop
-
 %description
 This module adds ClearSilver functions to PHP.
 
@@ -46,7 +47,6 @@ This module adds ClearSilver functions to PHP.
 
 %description -n php5-ext-%{modname} -l ja
 このモジュールはPHPにClearSilverテンプレート機能を追加します。
-
 %endif
 
 
@@ -65,7 +65,6 @@ This module adds ClearSilver functions to PHP.
 
 %description -n php74-ext-%{modname} -l ja
 このモジュールはPHPにClearSilverテンプレート機能を追加します。
-
 %endif
 
 
@@ -84,7 +83,24 @@ This module adds ClearSilver functions to PHP.
 
 %description -n php80-ext-%{modname} -l ja
 このモジュールはPHPにClearSilverテンプレート機能を追加します。
+%endif
+
+
+%if %{with php81}
+%package -n php81-ext-%{modname}
+Summary: ClearSilver extension for PHP-8.1
+Summary(ja): PHP-8.1用ClearSilverモジュール
+Group: programming
+BuildRequires: php81-devel
+%if "%{?req_php81_api}" != ""
+Requires: %{req_php81_api}
+%endif
 
+%description -n php81-ext-%{modname}
+This module adds ClearSilver functions to PHP.
+
+%description -n php81-ext-%{modname} -l ja
+このモジュールはPHPにClearSilverテンプレート機能を追加します。
 %endif
 
 
@@ -118,8 +134,17 @@ pushd php-clearsilver-%{version}-php80
 popd
 %endif
 
+%if %{with php81}
+cp -a php-clearsilver-%{version} php-clearsilver-%{version}-php81
+pushd php-clearsilver-%{version}-php81
+%patch3 -p1 -b .php80
+popd
+%endif
+
 
 %build
+export CFLAGS="%{optflags} -Wno-format-security"
+
 %if %{with php5}
 pushd php-clearsilver-%{version}-php5
 phpize5
@@ -148,6 +173,15 @@ aclocal
 popd
 %endif
 
+%if %{with php81}
+pushd php-clearsilver-%{version}-php81
+phpize81
+aclocal
+%configure --with-php-config=/usr/bin/php-config81
+%__make %{_smp_mflags}
+popd
+%endif
+
 
 %install
 rm -rf %{buildroot}
@@ -156,7 +190,7 @@ pushd php-clearsilver-%{version}-php5
 mkdir -p %{buildroot}%{_libdir}/php5/
 mkdir -p %{buildroot}%{_sysconfdir}/php5/php.d
 
-install -m644 modules/%{modname}.so %{buildroot}%{_libdir}/php5/
+install -m755 modules/%{modname}.so %{buildroot}%{_libdir}/php5/
 
 cat > %{buildroot}%{_sysconfdir}/php5/php.d/%{modname}.ini <<EOF
 ; Enable %{modname} extension module
@@ -170,7 +204,7 @@ pushd php-clearsilver-%{version}-php74
 mkdir -p %{buildroot}%{_libdir}/php74/
 mkdir -p %{buildroot}%{_sysconfdir}/php74/php.d
 
-install -m644 modules/%{modname}.so %{buildroot}%{_libdir}/php74/
+install -m755 modules/%{modname}.so %{buildroot}%{_libdir}/php74/
 
 cat > %{buildroot}%{_sysconfdir}/php74/php.d/%{modname}.ini <<EOF
 ; Enable %{modname} extension module
@@ -184,7 +218,7 @@ pushd php-clearsilver-%{version}-php80
 mkdir -p %{buildroot}%{_libdir}/php80/
 mkdir -p %{buildroot}%{_sysconfdir}/php80/php.d
 
-install -m644 modules/%{modname}.so %{buildroot}%{_libdir}/php80/
+install -m755 modules/%{modname}.so %{buildroot}%{_libdir}/php80/
 
 cat > %{buildroot}%{_sysconfdir}/php80/php.d/%{modname}.ini <<EOF
 ; Enable %{modname} extension module
@@ -194,6 +228,21 @@ popd
 %endif
 
 
+%if %{with php81}
+pushd php-clearsilver-%{version}-php81
+mkdir -p %{buildroot}%{_libdir}/php81/
+mkdir -p %{buildroot}%{_sysconfdir}/php81/php.d
+
+install -m755 modules/%{modname}.so %{buildroot}%{_libdir}/php81/
+
+cat > %{buildroot}%{_sysconfdir}/php81/php.d/%{modname}.ini <<EOF
+; Enable %{modname} extension module
+extension=%{modname}.so
+EOF
+popd
+%endif
+
+
 %check
 %if %{with php5}
 pushd php-clearsilver-%{version}-php5
@@ -213,6 +262,12 @@ make test TEST_PHPDBG_EXECUTABLE=/usr/bin/phpdbg80 NO_INTERACTION=1
 popd
 %endif
 
+%if %{with php81}
+pushd php-clearsilver-%{version}-php81
+make test TEST_PHPDBG_EXECUTABLE=/usr/bin/phpdbg81 NO_INTERACTION=1
+popd
+%endif
+
 
 %clean
 rm -rf %{buildroot}
@@ -242,8 +297,19 @@ rm -rf %{buildroot}
 %{_sysconfdir}/php80/php.d/*
 %endif
 
+%if %{with php81}
+%files -n php81-ext-%{modname}
+%defattr(-,root,root)
+%doc CREDITS INSTALL LICENSE README doc
+%{_libdir}/php81/*
+%{_sysconfdir}/php81/php.d/*
+%endif
+
 
 %changelog
+* Fri Nov 26 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.4-17
+- added php81 support.
+
 * Sat Dec 19 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.4-16
 - added php80 support.
 - dropped php73 support.