%global github_owner tony2001 %global github_name pinba_extension %global github_version 1.1.2 %global github_commit edbc313f1b4fb8407bf7d5acf63fbb0359c7fb2e %global composer_vendor tony2001 %global composer_project pinba_extension %global php_min_ver 7.0.0 %{!?phpdir: %global phpdir %{_datadir}/php} Name: php-%{composer_project} Version: %{github_version} Release: 4%{?github_release}%{?dist} Summary: A pinba library for PHP Group: Development/Libraries License: MIT URL: https://github.com/%{github_owner}/%{github_name} # Run "php-gliph-get-source.sh" to create source Source0: %{name}-%{version}-%{github_commit}.tar.gz Source1: %{name}-get-source.sh BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) #BuildArch: noarch Requires: php(language) >= %{php_min_ver} BuildRequires: php-devel BuildRequires: php-cli # Standard "php-{COMPOSER_VENDOR}-{COMPOSER_PROJECT}" naming Provides: php-%{composer_vendor}-%{composer_project} = %{version}-%{release} # Composer #Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version} %description pinba is a graph library for PHP. %prep %setup -qn %{github_name}-%{github_commit} %build # Empty build section, nothing to build #cd idn-%{version} phpize %configure --with-php-config=%{_bindir}/php-config make %{?_smp_mflags} %install #rm -rf %{buildroot} #mkdir -p %{buildroot}%{phpdir} #cp -rp * %{buildroot}%{phpdir}/ make install INSTALL_ROOT=%{buildroot} # Create the ini location mkdir -p %{buildroot}/%{php_inidir} echo "extension=pinba.so" > %{buildroot}/%{php_inidir}/50-pinba.ini echo "pinba.server = \"x.x.x.x:port\"" >> %{buildroot}/%{php_inidir}/50-pinba.ini echo "pinba.enabled = \"On\"" >> %{buildroot}/%{php_inidir}/50-pinba.ini %check # Minimal load test %{_bindir}/php -n -d extension_dir=modules -d extension=pinba.so -m | grep pinba #make test #/root/rpmbuild/BUILD/pinba_extension-01c79388fbb7695b2f2306bb53942c7a43876145/modules %clean rm -rf %{buildroot} %files %defattr(-,root,root,-) #%{phpdir}/pinba_extension %{php_extdir}/pinba.so %config(noreplace) %{php_inidir}/50-pinba.ini %changelog * Fri Sep 2 2016 Ivan Lotina - initial spec - initial spec