File php7-snappy.spec of Package php7-snappy

# norootforbuild

%define pkg_name    php-ext-snappy
#
Name: php7-snappy
Version: 0.1.0
Release: 29.1
Group: Productivity/Networking/Web/Servers
BuildRoot: %{_tmppath}/%{pkg_name}-%{version}-build
BuildRequires: php7-devel gcc-c++
URL: http://pecl.php.net/
Source: http://pecl.php.net/package/%{pkg_name}/%{pkg_name}-%{version}.tgz
Summary: PHP SNAPPY de/compression extension
License: PHP
%if %{?php_zend_api}0
Requires:     php(zend-abi) = %{php_zend_api}
Requires:     php(api) = %{php_core_api}
%else
%requires_eq php7
%endif
Requires: libsnappy1 => 1.1.2

Patch1:	php-ext-snappy.patch
Patch2: php-ext-snappy-1.patch

%description

	 	This package handles LZF de/compression.	
Authors:
---------
	marcin gibula <mg@iceni.pl>
		

%prep

%setup -q -n %{pkg_name}-%{version}

%patch1 -p1
%patch2 -p1

%{__mkdir} %{name}

%build
/usr/bin/phpize
#pushd %{name}
#
#CFLAGS="%{optflags}"
#CXXFLAGS="%{optflags}"
#%if 0%{?suse_version} > 1000
#CFLAGS="$CFLAGS -fstack-protector"
#CXXFLAGS="$CXXFLAGS -fstack-protector"
#%endif

export CFLAGS
export CXXFLAGS

./configure --with-libdir=%{_lib} LIBTOOL='/usr/bin/libtool --tag=CC'

%{__make} %{?jobs:-j%jobs} LIBTOOL='/usr/bin/libtool --tag=CC'

# popd



%install

%makeinstall INSTALL_ROOT=%{buildroot}

rm -f %{buildroot}%{_libdir}/php7/extensions/snappy.a

%{__mkdir_p} %{buildroot}%{_sysconfdir}/php7/conf.d

echo "; comment out next line to disable snappy  extension in php" > %{buildroot}%{_sysconfdir}/php7/conf.d/snappy.ini
echo "extension = snappy.so" >> %{buildroot}%{_sysconfdir}/php7/conf.d/snappy.ini

%clean

%{__rm} -rf %{buildroot}

%files
%defattr(644,root,root,755)
%{_libdir}/php7/extensions/snappy.so
%dir /usr/include/php7/ext/snappy
/usr/include/php7/ext/snappy/php_snappy.h
%config(noreplace) %{_sysconfdir}/php7/conf.d/snappy.ini


%doc CREDITS
%doc COPYING.snappy
%doc EXPERIMENTAL
%doc LICENSE
%doc README.md

%changelog
* Fri May 30 2014 matjaz.godec@agenda.si
- first version SPEC remade from php7-lzf