2 # - pld useradd/groupadd (register uid/gid)
3 Summary: MongoDB client shell and tools
8 Group: Applications/Databases
9 URL: http://www.mongodb.org/
10 Source0: http://downloads.mongodb.org/src/%{name}-src-r%{version}.tar.gz
11 # Source0-md5: 358bfc52855a66d3c954e7f6f51bcd12
12 Source1: %{name}.logrotate
14 # BuildRequires: libpcap-devel
15 BuildRequires: boost-devel >= 1.42
16 BuildRequires: libstdc++-devel >= 6:4.0
17 BuildRequires: pcre-cxx-devel
18 BuildRequires: pcre-devel
19 BuildRequires: readline-devel
20 BuildRequires: rpmbuild(macros) >= 1.228
21 BuildRequires: scons >= 1.2
22 BuildRequires: v8-devel
23 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26 Mongo (from "huMONGOus") is a schema-free document-oriented database.
27 It features dynamic profileable queries, full indexing, replication
28 and fail-over support, efficient storage of large binary data objects,
31 This package provides the mongo shell, import/export tools, and other
35 Summary: Headers and libraries for mongo development
36 Group: Development/Libraries
37 Requires: %{name} = %{version}-%{release}
40 Mongo (from "huMONGOus") is a schema-free document-oriented database.
42 This package provides the mongo static library and header files needed
43 to develop mongo client software.
46 Summary: MongoDB server, sharding server, and support scripts
47 Group: Applications/Databases
48 Requires: %{name} = %{version}-%{release}
49 Requires(post,preun): /sbin/chkconfig
53 Mongo (from "huMONGOus") is a schema-free document-oriented database.
55 This package provides the mongo server software, mongo sharding server
56 softwware, default configuration files, and init.d scripts.
59 %setup -q -n %{name}-src-r%{version}
62 find -type f -executable | xargs chmod a-x
66 --prefix=$RPM_BUILD_ROOT%{_prefix} \
71 # XXX really should have shared library here
74 rm -rf $RPM_BUILD_ROOT
75 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir}/man1} \
76 $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d,sysconfig} \
77 $RPM_BUILD_ROOT%{_var}/{lib,log}/mongo
80 --prefix=$RPM_BUILD_ROOT%{_prefix} \
85 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/mongod
86 cp -a rpm/mongod.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/mongod
88 cp -a %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/mongod
89 cp -a rpm/mongod.conf $RPM_BUILD_ROOT%{_sysconfdir}/mongod.conf
91 cp -a debian/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
93 touch $RPM_BUILD_ROOT%{_var}/log/mongo/mongod.log
96 rm -rf $RPM_BUILD_ROOT
99 groupadd -r mongod 2>/dev/null || :
100 useradd -r -g mongod -d %{_var}/lib/mongo -s /sbin/nologin -c "user for MongoDB Database Server" mongod 2>/dev/null || :
103 /sbin/chkconfig --add mongod
104 %service mongod restart
107 if [ "$1" = "0" ]; then
108 %service -q mongod stop
109 /sbin/chkconfig --del mongod
113 %defattr(644,root,root,755)
114 %doc README GNU-AGPL-3.0.txt
115 %attr(755,root,root) %{_bindir}/mongo
116 %attr(755,root,root) %{_bindir}/mongodump
117 %attr(755,root,root) %{_bindir}/mongoexport
118 %attr(755,root,root) %{_bindir}/mongofiles
119 %attr(755,root,root) %{_bindir}/mongoimport
120 %attr(755,root,root) %{_bindir}/mongorestore
121 %attr(755,root,root) %{_bindir}/mongostat
122 %attr(755,root,root) %{_bindir}/bsondump
123 %{_mandir}/man1/mongo.1*
124 %{_mandir}/man1/mongod.1*
125 %{_mandir}/man1/mongodump.1*
126 %{_mandir}/man1/mongoexport.1*
127 %{_mandir}/man1/mongofiles.1*
128 %{_mandir}/man1/mongoimport.1*
129 %{_mandir}/man1/mongosniff.1*
130 %{_mandir}/man1/mongostat.1*
131 %{_mandir}/man1/mongorestore.1*
134 %defattr(644,root,root,755)
136 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mongod.conf
137 %attr(754,root,root) /etc/rc.d/init.d/mongod
138 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mongod
139 %config(noreplace) /etc/logrotate.d/mongod
140 %attr(755,root,root) %{_bindir}/mongod
141 %attr(755,root,root) %{_bindir}/mongos
142 %{_mandir}/man1/mongos.1*
143 %attr(755,mongod,mongod) %dir %{_var}/lib/mongo
144 %attr(755,mongod,mongod) %dir %{_var}/log/mongo
145 %attr(640,mongod,mongod) %config(noreplace) %verify(not md5 mtime size) %{_var}/log/mongo/mongod.log
148 %defattr(644,root,root,755)
150 %{_libdir}/libmongoclient.a
151 %{_libdir}/libmongoclient.so
152 #%{_libdir}/libmongotestfiles.a