%define mongo_user mongo %define mongo_group mongo %define mongo_confdir %{_sysconfdir}/mongo %define mongo_home %{_localstatedir}/lib/mongo %define mongo_logdir %{_localstatedir}/log/mongo %define mongod_service mongod Name: mongo Version: 1.3.2 Release: 1%{?dist} Summary: Mongo client shell and tools Group: Applications/Databases License: AGPLv3 URL: http://www.mongodb.org Source0: http://downloads.mongodb.org/src/mongodb-src-r%{version}.tar.gz # init-script: Source1: %{mongod_service}.init Source2: %{mongod_service}.logrotate Source3: mongod.conf BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: js-devel, boost-devel, pcre-devel, libpcap-devel BuildRequires: ncurses-devel, readline-devel BuildRequires: scons # to run tests #BuildRequires: unittest-devel %description Mongo (from "huMONGOus") is a schema-free document-oriented database. It features dynamic profileable queries, full indexing, replication and fail-over support, efficient storage of large binary data objects, and auto-sharding. This package provides the mongo shell, import/export tools, and other client utilities. %package server Summary: Mongo server, sharding server and support scripts Group: Applications/Databases Requires(pre): shadow-utils Requires(post): chkconfig Requires(preun): chkconfig # This is for /sbin/service Requires(preun): initscripts Requires(postun): initscripts %description server Mongo (from "huMONGOus") is a schema-free document-oriented database. This package provides the mongo server software, mongo sharding server softwware, default configuration files, and init.d scripts. %package devel Summary: Headers and libraries for mongo development Group: Development/Libraries Requires: %{name} = %{version}-%{release} Provides: %{name}-static = %{version}-%{release} %description devel Mongo (from "huMONGOus") is a schema-free document-oriented database. This package provides the mongo static library and header files needed to develop mongo client software. %prep %setup -q -n mongodb-src-r%{version} %build scons %{?_smp_mflags} --prefix=%{_prefix} --extralib=ncurses,readline all %install rm -rf %{buildroot} scons %{?_smp_mflags} --prefix=%{buildroot}%{_prefix} install install -p -D -m 755 %{SOURCE1} %{buildroot}%{_initrddir}/%{mongod_service} install -p -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{mongod_service} install -p -D -m 644 %{SOURCE3} %{buildroot}%{mongo_confdir}/mongod.conf install -p -d -m 0755 %{buildroot}%{mongo_logdir} pushd debian for manfile in *.1 do install -p -D -m 644 ${manfile} %{buildroot}%{_mandir}/man1/${manfile} done popd %clean rm -rf %{buildroot} %pre server %{_sbindir}/groupadd -f -r %{mongo_group} %{_sbindir}/useradd -r -m -c "MongoDB Database Server" -s /sbin/false \ -d %{mongo_home} -g %{mongo_group} %{mongo_user} 2>/dev/null || : %post server /sbin/chkconfig --add %{mongod_service} %preun server if [ $1 = 0 ] ; then /sbin/service %{mongod_service} stop >/dev/null 2>&1 /sbin/chkconfig --del %{mongod_service} fi %postun server if [ "$1" -ge "1" ] ; then /sbin/service %{mongod_service} condrestart >/dev/null 2>&1 || : fi %files %defattr(-,root,root,-) %doc README GNU-AGPL-3.0.txt %{_bindir}/mongo %{_bindir}/mongodump %{_bindir}/mongoexport %{_bindir}/mongofiles %{_bindir}/mongoimport %{_bindir}/mongorestore %{_bindir}/mongosniff %{_mandir}/man1/mongo.1* %{_mandir}/man1/mongodump.1* %{_mandir}/man1/mongoexport.1* %{_mandir}/man1/mongofiles.1* %{_mandir}/man1/mongoimport.1* %{_mandir}/man1/mongorestore.1* %{_mandir}/man1/mongosniff.1* %files server %defattr(-,root,root,-) %{_bindir}/mongod %{_bindir}/mongos %{_mandir}/man1/mongos.1* %{_mandir}/man1/mongod.1* %{_initrddir}/%{mongod_service} %dir %{mongo_confdir} %config(noreplace) %{_sysconfdir}/logrotate.d/%{mongod_service} %config(noreplace) %{mongo_confdir}/mongod.conf %attr(0755,%{mongo_user},%{mongo_group}) %dir %{mongo_logdir} %files devel %defattr(-,root,root,-) %{_includedir}/mongo %{_libdir}/libmongoclient.a %changelog * Wed Feb 24 2010 Jeremy Hinegardner - 1.3.2-1 - Update to 1.3.2 * Fri Dec 17 2009 Nathan Witmer - 1.2.0-0 - updating to 1.2.0 * Fri Oct 2 2009 Ionuț Arțăriși - 1.0.0-3 - fixed libpath issue for 64bit systems * Thu Oct 1 2009 Ionuț Arțăriși - 1.0.0-2 - added virtual -static package * Mon Aug 31 2009 Ionuț Arțăriși - 1.0.0-1 - Initial release.