]> git.pld-linux.org Git - packages/mongodb.git/blobdiff - mongodb.spec
Version: 2.2.0
[packages/mongodb.git] / mongodb.spec
index faaaa62f8764cb4569118706189374c8039fe8eb..2fdd988fd7da1556b150b7e5fbbf7c64848cb11f 100644 (file)
@@ -1,27 +1,34 @@
-# TODO: pass rpmldflags, rpmcppflags
+# TODO:
+#      - fix 'libs' subpackage (disabled due to broken 'sharedclient' build option)
+#
 Summary:       MongoDB client shell and tools
 Summary(pl.UTF-8):     Powłoka kliencka i narzędzia dla bazy danych MongoDB
 Name:          mongodb
-Version:       1.8.3
+Version:       2.2.0
 Release:       0.1
-License:       AGPL 3.0
+License:       AGPL v3
 Group:         Applications/Databases
 Source0:       http://downloads.mongodb.org/src/%{name}-src-r%{version}.tar.gz
-# Source0-md5: 662e7ad6ff9f8e4d16c72c038b4a0c60
+# Source0-md5: 832bdb6cc659176fd8d6b16a660ccfc6
 Source1:       %{name}.logrotate
 Source2:       %{name}.init
-Patch0:                config.patch
+Patch0:                %{name}-cflags.patch
+Patch1:                %{name}-system-libs.patch
+Patch2:                boost-1.50.patch
+Patch3:                %{name}-install.patch
 URL:           http://www.mongodb.org/
 BuildRequires: boost-devel >= 1.42
 BuildRequires: libpcap-devel
 BuildRequires: libstdc++-devel >= 6:4.0
 BuildRequires: pcre-cxx-devel
-BuildRequires: pcre-devel
+BuildRequires: pcre-devel >= 8.30
 BuildRequires: readline-devel
 BuildRequires: rpmbuild(macros) >= 1.228
 BuildRequires: scons >= 1.2
 BuildRequires: sed >= 4.0
+BuildRequires: snappy-devel
 BuildRequires: v8-devel
+Requires:      %{name}-libs = %{version}-%{release}
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -62,7 +69,8 @@ Ten pakiet zawiera bibliotekę kliencką mongo.
 Summary:       Header files for MongoDB client library
 Summary(pl.UTF-8):     Pliki nagłówkowe biblioteki klienckiej MongoDB
 Group:         Development/Libraries
-Requires:      %{name}-libs = %{version}-%{release}
+#Requires:     %{name}-libs = %{version}-%{release}
+Requires:      %{name}-static = %{version}-%{release}
 
 %description devel
 Mongo (from "huMONGOus") is a schema-free document-oriented database.
@@ -99,8 +107,6 @@ Summary:     MongoDB server, sharding server, and support scripts
 Summary(pl.UTF-8):     Serwer MongoDB, serwer dzielący oraz skrypty pomocnicze
 Group:         Applications/Databases
 Requires:      %{name} = %{version}-%{release}
-Provides:      group(mongod)
-Provides:      user(mongod)
 Requires(post,preun):  /sbin/chkconfig
 Requires(postun):      /usr/sbin/groupdel
 Requires(postun):      /usr/sbin/userdel
@@ -109,6 +115,9 @@ Requires(pre):      /usr/bin/getgid
 Requires(pre): /usr/sbin/groupadd
 Requires(pre): /usr/sbin/useradd
 Requires:      rc-scripts
+Provides:      group(mongod)
+Provides:      user(mongod)
+Conflicts:     logrotate < 3.8.0
 
 %description server
 Mongo (from "huMONGOus") is a schema-free document-oriented database.
@@ -126,37 +135,45 @@ konfiguracji oraz skrypty init.d.
 %prep
 %setup -q -n %{name}-src-r%{version}
 %patch0 -p1
-%{__sed} -i 's,-O3,%{rpmcxxflags},;/,\.\.\/v8/d' SConstruct
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
 
 # Fix permissions
 find -type f -executable | xargs chmod a-x
 
+# force system pcre/js/snappy
+%{__rm} -r src/third_party/{js-1.7,pcre-8.30,snappy,boost}
+
 %build
 %scons \
+       CPPFLAGS="%{rpmcppflags} -DXP_UNIX" \
+       --use-system-all=yes \
+       --extralib=pcrecpp,pcre,snappy \
        --prefix=$RPM_BUILD_ROOT%{_prefix} \
-       --sharedclient \
-       --full all \
+       --full=all \
        --usev8 \
        --cxx=%{__cxx}
 
-# XXX really should have shared library here
-
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir}/man1} \
-       $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d,sysconfig} \
+       $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d,sysconfig,mongod} \
        $RPM_BUILD_ROOT%{_var}/{lib,log}/mongo
 
+# XXX: scons is so great, recompiles everything here!
 %scons install \
+       --use-system-all=yes \
+       --extralib=pcrecpp,pcre,snappy \
        --prefix=$RPM_BUILD_ROOT%{_prefix} \
-       --sharedclient \
-       --full \
-       --usev8
+       --full=all \
+       --usev8 \
+       --cxx=%{__cxx}
 
 cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/mongod
 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/mongod
 cp -p rpm/mongod.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/mongod
-cp -p rpm/mongod.conf $RPM_BUILD_ROOT%{_sysconfdir}/mongod.conf
+cp -p rpm/mongod.conf $RPM_BUILD_ROOT%{_sysconfdir}/mongod/default.conf
 cp -p debian/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
 
 touch $RPM_BUILD_ROOT%{_var}/log/mongo/mongod.log
@@ -187,9 +204,18 @@ if [ "$1" = "0" ]; then
        %groupremove mongod
 fi
 
+%triggerpostun server -- %{name}-server < 2.0.6-3
+if [ -f %{_sysconfdir}/mongod.conf.rpmsave ] ; then
+       cp -f %{_sysconfdir}/mongod/default.conf{,.rpmnew} || :
+       echo "Moving %{_sysconfdir}/mongod.conf to %{_sysconfdir}/mongod/default.conf"
+       mv -f %{_sysconfdir}/mongod.conf.rpmsave %{_sysconfdir}/mongod/default.conf
+       %service mongod restart
+fi
+
 %files
 %defattr(644,root,root,755)
 %doc README GNU-AGPL-3.0.txt
+%attr(755,root,root) %{_bindir}/bsondump
 %attr(755,root,root) %{_bindir}/mongo
 %attr(755,root,root) %{_bindir}/mongodump
 %attr(755,root,root) %{_bindir}/mongoexport
@@ -198,7 +224,8 @@ fi
 %attr(755,root,root) %{_bindir}/mongorestore
 %attr(755,root,root) %{_bindir}/mongosniff
 %attr(755,root,root) %{_bindir}/mongostat
-%attr(755,root,root) %{_bindir}/bsondump
+%attr(755,root,root) %{_bindir}/mongotop
+%{_mandir}/man1/bsondump.1*
 %{_mandir}/man1/mongo.1*
 %{_mandir}/man1/mongodump.1*
 %{_mandir}/man1/mongoexport.1*
@@ -208,9 +235,11 @@ fi
 %{_mandir}/man1/mongostat.1*
 %{_mandir}/man1/mongorestore.1*
 
+%if 0
 %files libs
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_libdir}/libmongoclient.so
+%endif
 
 %files devel
 %defattr(644,root,root,755)
@@ -222,8 +251,9 @@ fi
 
 %files server
 %defattr(644,root,root,755)
-%dir %{_sysconfdir}
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mongod.conf
+#%dir %{_sysconfdir}
+%dir %{_sysconfdir}/mongod
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mongod/default.conf
 %attr(754,root,root) /etc/rc.d/init.d/mongod
 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mongod
 %config(noreplace) /etc/logrotate.d/mongod
@@ -232,5 +262,6 @@ fi
 %{_mandir}/man1/mongod.1*
 %{_mandir}/man1/mongos.1*
 %attr(755,mongod,mongod) %dir %{_var}/lib/mongo
-%attr(755,mongod,mongod) %dir %{_var}/log/mongo
+%attr(775,root,mongod) %dir %{_var}/log/mongo
+%attr(775,root,mongod) %dir %{_var}/log/archive/mongo
 %attr(640,mongod,mongod) %config(noreplace) %verify(not md5 mtime size) %{_var}/log/mongo/mongod.log
This page took 0.037565 seconds and 4 git commands to generate.