summaryrefslogtreecommitdiffstats
path: root/php-pecl-mongo.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-pecl-mongo.spec')
-rw-r--r--php-pecl-mongo.spec227
1 files changed, 227 insertions, 0 deletions
diff --git a/php-pecl-mongo.spec b/php-pecl-mongo.spec
new file mode 100644
index 0000000..e7486cc
--- /dev/null
+++ b/php-pecl-mongo.spec
@@ -0,0 +1,227 @@
+%{!?phpname: %{expand: %%global phpname php}}
+%{!?__pecl: %{expand: %%global __pecl %{_bindir}/pecl}}
+
+%global pecl_name mongo
+
+# RPM 4.8
+%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$}
+%{?filter_setup}
+# RPM 4.9
+%global __provides_exclude_from %{?__provides_exclude_from:%__provides_exclude_from|}%{php_libdir}/.*\\.so$
+
+
+Summary: PHP MongoDB database driver
+Name: %{phpname}-pecl-mongo
+Version: 1.2.10
+Release: 2%{?dist}
+License: ASL 2.0
+Group: Development/Languages
+URL: http://pecl.php.net/package/%{pecl_name}
+
+Source: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
+
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+BuildRequires: %{phpname}-devel >= 5.1.0
+BuildRequires: %{phpname}-pear >= 1.4.9-1.2
+
+Requires(post): %{__pecl}
+Requires(postun): %{__pecl}
+Requires: %{phpname}(zend-abi) = %{php_zend_api}
+Requires: %{phpname}(api) = %{php_core_api}
+
+Provides: %{phpname}-pecl(%{pecl_name}) = %{version}-%{release}
+
+
+%description
+This package provides an interface for communicating with the MongoDB database
+in PHP.
+
+
+%prep
+%setup -c -q
+cd %{pecl_name}-%{version}
+
+extver=$(sed -n '/#define PHP_MONGO_VERSION/{s/.* "//;s/".*$//;p}' php_mongo.h)
+if test "x${extver}" != "x%{version}%{?pre}"; then
+ : Error: Upstream version is ${extver}, expecting %{version}.
+ exit 1
+fi
+
+cd ..
+
+cp -pr %{pecl_name}-%{version} %{pecl_name}-%{version}-zts
+
+%{__cat} >%{pecl_name}.ini << 'EOF'
+; Enable %{pecl_name} extension module
+extension=%{pecl_name}.so
+
+; option documentation: http://www.php.net/manual/en/mongo.configuration.php
+
+; If persistent connections are allowed.
+;mongo.allow_persistent = 1
+
+; Whether to reconnect to the database if the connection is lost.
+;mongo.auto_reconnect = 1
+
+; The number of bytes-per-chunk.
+; This number must be at least 100 less than 4 megabytes (max: 4194204)
+;mongo.chunk_size = 262144
+
+; A character to be used in place of $ in modifiers and comparisons.
+;mongo.cmd = $
+
+; Default hostname when nothing is passed to the constructor.
+;mongo.default_host = localhost
+
+; The default TCP port number. The database's default is 27017.
+;mongo.default_port = 27017
+
+; Return a BSON_LONG as an instance of MongoInt64
+; (instead of a primitive type).
+;mongo.long_as_object = 0
+
+; Use MongoDB native long (this will default to true for 1.1.0)
+mongo.native_long = true
+
+; If an exception should be thrown for non-UTF8 strings.
+; This option will be eliminated and exceptions always thrown for non-UTF8
+; strings starting with version 1.1.0.
+mongo.utf8 = 1
+EOF
+
+
+%build
+cd %{pecl_name}-%{version}
+%{_bindir}/phpize
+%configure --with-php-config=%{_bindir}/php-config
+%{__make} %{?_smp_mflags}
+
+cd ../%{pecl_name}-%{version}-zts
+%{_bindir}/zts-phpize
+%configure --with-php-config=%{_bindir}/zts-php-config
+%{__make} %{?_smp_mflags}
+
+
+%install
+rm -rf %{buildroot}
+
+make -C %{pecl_name}-%{version} \
+ install INSTALL_ROOT=%{buildroot}
+
+make -C %{pecl_name}-%{version}-zts \
+ install INSTALL_ROOT=%{buildroot}
+
+# Drop in the bit of configuration
+install -D -m 644 %{pecl_name}.ini %{buildroot}%{php_inidir}/%{pecl_name}.ini
+install -D -m 644 %{pecl_name}.ini %{buildroot}%{php_ztsinidir}/%{pecl_name}.ini
+
+# Install XML package description
+install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
+
+
+%clean
+rm -rf %{buildroot}
+
+
+%post
+%{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
+
+
+%postun
+if [ "$1" -eq "0" ]; then
+ %{pecl_uninstall} %{pecl_name} >/dev/null || :
+fi
+
+
+%check
+# only check if build extension can be loaded
+
+%{__php} -n \
+ -d extension_dir=%{pecl_name}-%{version}/modules \
+ -d extension=%{pecl_name}.so \
+ -i | grep "MongoDB Support => enabled"
+
+%{__ztsphp} -n \
+ -d extension_dir=%{pecl_name}-%{version}-zts/modules \
+ -d extension=%{pecl_name}.so \
+ -i | grep "MongoDB Support => enabled"
+
+
+%files
+%defattr(-, root, root, -)
+%doc %{pecl_name}-%{version}/README.md
+%config(noreplace) %{php_inidir}/%{pecl_name}.ini
+%config(noreplace) %{php_ztsinidir}/%{pecl_name}.ini
+%{php_extdir}/%{pecl_name}.so
+%{php_ztsextdir}/%{pecl_name}.so
+%{pecl_xmldir}/%{name}.xml
+
+
+%changelog
+* Tue Apr 10 2012 Remi Collet <RPMS@FamilleCollet.com> - 1.2.10-2
+- update to 1.2.10, php 5.4 build
+
+* Tue Apr 10 2012 Remi Collet <RPMS@FamilleCollet.com> - 1.2.10-1
+- update to 1.2.10, php 5.3 build
+
+* Thu Feb 23 2012 Remi Collet <RPMS@FamilleCollet.com> - 1.2.9-2
+- update to 1.2.9, php 5.4 build
+
+* Thu Feb 23 2012 Remi Collet <RPMS@FamilleCollet.com> - 1.2.9-1
+- update to 1.2.9, php 5.3 build
+
+* Wed Feb 22 2012 Remi Collet <RPMS@FamilleCollet.com> - 1.2.8-2
+- update to 1.2.8, php 5.4 build
+
+* Wed Feb 22 2012 Remi Collet <RPMS@FamilleCollet.com> - 1.2.8-1
+- update to 1.2.8, php 5.3 build
+
+* Thu Jan 05 2012 Remi Collet <RPMS@FamilleCollet.com> - 1.2.7-2
+- php 5.4 build
+
+* Thu Jan 05 2012 Remi Collet <RPMS@FamilleCollet.com> - 1.2.7-1
+- update to 1.2.7
+
+* Fri Nov 18 2011 Remi Collet <RPMS@FamilleCollet.com> - 1.2.6-2
+- php 5.4 build
+
+* Sun Oct 02 2011 Remi Collet <RPMS@FamilleCollet.com> - 1.2.6-1
+- update to 1.2.6
+
+* Fri Sep 16 2011 Remi Collet <RPMS@FamilleCollet.com> - 1.2.5-1
+- update to 1.2.5
+- clean spec
+- allow relocation
+- build zts extension
+
+* Sat Aug 27 2011 Remi Collet <RPMS@FamilleCollet.com> - 1.2.4-1
+- update to 1.2.4
+
+* Fri Aug 19 2011 Remi Collet <RPMS@FamilleCollet.com> - 1.2.3-1
+- update to 1.2.3
+
+* Mon Jul 17 2011 Remi Collet <RPMS@FamilleCollet.com> - 1.2.1-1
+- rebuild for remi repo
+
+* Sun Jul 17 2011 Christof Damian <christof@damian.net> - 1.2.1-1
+- upstream 1.2.1
+
+* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.10-5
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
+
+* Tue Oct 26 2010 Remi Collet <RPMS@FamilleCollet.com> - 1.0.10-4
+- rebuild for remi repo
+
+* Mon Oct 25 2010 Christof Damian <christof@damian.net> - 1.0.10-4
+- added link to option docs
+
+* Sat Oct 23 2010 Christof Damian <christof@damian.net> - 1.0.10-3
+- fix post
+- add example config with sensible defaults
+- add conditionals for EPEL + fix for check
+
+* Fri Oct 22 2010 Christof Damian <christof@damian.net> - 1.0.10-2
+- fixes for package review: requires and warnings
+
+* Wed Oct 20 2010 Christof Damian <christof@damian.net> - 1.0.10-1
+- Initial RPM