[12516] | 1 | # needs launching memcached |
---|
| 2 | %bcond_with test |
---|
| 3 | |
---|
| 4 | %define build_targets 74 80 |
---|
| 5 | %define extname memcached |
---|
| 6 | |
---|
| 7 | %global gitdate 20201219 |
---|
| 8 | %global githash bfb0a66809d43080219ab5381235f848c91eff7e |
---|
| 9 | |
---|
| 10 | %define srcdir php-%{extname}-%{?githash:%{githash}}%{!?githash:%{version}} |
---|
| 11 | |
---|
| 12 | Summary: memcached extension for PHP |
---|
| 13 | Summary(ja): PHP用memcached拡張 |
---|
| 14 | Name: php-ext-memcached |
---|
| 15 | Version: 3.1.5%{?gitdate:.git%{gitdate}} |
---|
| 16 | Release: 1%{_dist_release} |
---|
| 17 | Group: programming |
---|
| 18 | Vendor: Project Vine |
---|
| 19 | Distribution: Vine Linux |
---|
| 20 | Packager: tomop |
---|
| 21 | |
---|
| 22 | License: The PHP License |
---|
| 23 | %if %{?githash:1}%{!?githash:0} |
---|
| 24 | Source: https://github.com/php-memcached-dev/php-memcached/archive/%{githash}.tar.gz |
---|
| 25 | %else |
---|
| 26 | Source: https://github.com/php-memcached-dev/php-memcached/archive/v3.1.5.tar.gz#/php-%{extname}-%{version}.tar.gz |
---|
| 27 | %endif |
---|
| 28 | Patch0: sess_prefix.patch |
---|
| 29 | BuildRequires: libmemcached-devel |
---|
| 30 | BuildRequires: zlib-devel |
---|
| 31 | BuildRoot: %{_tmppath}/%{name}-%{version}-root |
---|
| 32 | |
---|
| 33 | %description |
---|
| 34 | This module enable to access memcached in PHP scripts. |
---|
| 35 | |
---|
| 36 | %description -l ja |
---|
| 37 | このモジュールは、PHPスクリプト中でmemcachedにアクセスできるようにします。 |
---|
| 38 | |
---|
| 39 | |
---|
| 40 | %package -n php74-ext-%{extname} |
---|
| 41 | Summary: memcached extension for PHP-7.4 |
---|
| 42 | Summary(ja): PHP-7.4用memcached拡張 |
---|
| 43 | Group: programming |
---|
| 44 | BuildRequires: php74-devel |
---|
| 45 | %if "%{?req_php74_api}" != "" |
---|
| 46 | Requires: %{req_php74_api} |
---|
| 47 | %endif |
---|
| 48 | |
---|
| 49 | %description -n php74-ext-%{extname} |
---|
| 50 | This module enable to access memcached in PHP scripts. |
---|
| 51 | |
---|
| 52 | %description -n php74-ext-%{extname} -l ja |
---|
| 53 | このモジュールは、PHPスクリプト中でmemcachedにアクセスできるようにします。 |
---|
| 54 | |
---|
| 55 | |
---|
| 56 | %package -n php80-ext-%{extname} |
---|
| 57 | Summary: memcached extension for PHP-8.0 |
---|
| 58 | Summary(ja): PHP-8.0用memcached拡張 |
---|
| 59 | Group: programming |
---|
| 60 | BuildRequires: php80-devel |
---|
| 61 | %if "%{?req_php80_api}" != "" |
---|
| 62 | Requires: %{req_php80_api} |
---|
| 63 | %endif |
---|
| 64 | |
---|
| 65 | %description -n php80-ext-%{extname} |
---|
| 66 | This module enable to access memcached in PHP scripts. |
---|
| 67 | |
---|
| 68 | %description -n php80-ext-%{extname} -l ja |
---|
| 69 | このモジュールは、PHPスクリプト中でmemcachedにアクセスできるようにします。 |
---|
| 70 | |
---|
| 71 | |
---|
| 72 | %debug_package |
---|
| 73 | |
---|
| 74 | |
---|
| 75 | %prep |
---|
| 76 | %setup -T -c -a 0 -n %{srcdir} |
---|
| 77 | pushd %{srcdir} |
---|
| 78 | |
---|
| 79 | mkdir -p ../docs |
---|
| 80 | cp -f CREDITS LICENSE README* ChangeLog ../docs/ |
---|
| 81 | popd |
---|
| 82 | |
---|
| 83 | for v in %{build_targets}; do |
---|
| 84 | cp -a %{srcdir} php${v} |
---|
| 85 | done |
---|
| 86 | |
---|
| 87 | |
---|
| 88 | %build |
---|
| 89 | for v in %{build_targets}; do |
---|
| 90 | pushd php${v} |
---|
| 91 | phpize${v} |
---|
| 92 | %configure --with-php-config=php-config${v} |
---|
| 93 | %__make %{?_smp_mflags} |
---|
| 94 | popd |
---|
| 95 | done |
---|
| 96 | |
---|
| 97 | |
---|
| 98 | %install |
---|
| 99 | rm -rf %{buildroot} |
---|
| 100 | |
---|
| 101 | cat > memcached.ini <<EOF |
---|
| 102 | ; Enable memcached extension module |
---|
| 103 | extension=memcached.so |
---|
| 104 | |
---|
| 105 | EOF |
---|
| 106 | |
---|
| 107 | cat %{srcdir}/memcached.ini >> memcached.ini |
---|
| 108 | |
---|
| 109 | for v in %{build_targets}; do |
---|
| 110 | pushd php${v} |
---|
| 111 | |
---|
| 112 | mkdir -p %{buildroot}%{_libdir}/php${v}/ |
---|
| 113 | mkdir -p %{buildroot}%{_sysconfdir}/php${v}/php.d |
---|
| 114 | %makeinstall INSTALL_ROOT=%{buildroot} |
---|
| 115 | |
---|
| 116 | install -m644 ../memcached.ini %{buildroot}%{_sysconfdir}/php${v}/php.d/memcached.ini |
---|
| 117 | |
---|
| 118 | cat > ../files.php${v} <<EOF |
---|
| 119 | %%defattr(-,root,root) |
---|
| 120 | %%doc docs/* |
---|
| 121 | %{_libdir}/php${v}/* |
---|
| 122 | %%config(noreplace) %{_sysconfdir}/php${v}/php.d/* |
---|
| 123 | EOF |
---|
| 124 | |
---|
| 125 | popd |
---|
| 126 | done |
---|
| 127 | |
---|
| 128 | |
---|
| 129 | %check |
---|
| 130 | %if %{with test} |
---|
| 131 | for v in %{build_targets}; do |
---|
| 132 | pushd php${v} |
---|
| 133 | NO_INTERACTION=yes TEST_PHPDBG_EXECUTABLE=/usr/bin/phpdbg${v} make test |
---|
| 134 | popd |
---|
| 135 | done |
---|
| 136 | %endif |
---|
| 137 | |
---|
| 138 | |
---|
| 139 | %clean |
---|
| 140 | rm -rf %{buildroot} |
---|
| 141 | |
---|
| 142 | %files -n php74-ext-%{extname} -f files.php74 |
---|
| 143 | %files -n php80-ext-%{extname} -f files.php80 |
---|
| 144 | |
---|
| 145 | |
---|
| 146 | %changelog |
---|
| 147 | * Sat Dec 19 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> |
---|
| 148 | - added php80 support. |
---|
| 149 | - dropped php73 support. |
---|
| 150 | |
---|
| 151 | * Thu Dec 19 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.1.5-1 |
---|
| 152 | - new upstream release. |
---|
| 153 | - added php74 support. |
---|
| 154 | |
---|
| 155 | * Fri Dec 21 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.1.1-1 |
---|
| 156 | - new upstream release. |
---|
| 157 | - dropped Patch1: fixed in upstream. |
---|
| 158 | - drooped php72 support. |
---|
| 159 | |
---|
| 160 | * Sat Dec 08 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0.5-1 |
---|
| 161 | - added php73 support. |
---|
| 162 | |
---|
| 163 | * Wed Dec 20 2017 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0.4-1 |
---|
| 164 | - new upstream release. |
---|
| 165 | |
---|
| 166 | * Thu Mar 16 2017 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0.3-1 |
---|
| 167 | - initial build for Vine Linux. |
---|