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: 076b91f37ee434db80441e9028fe50a5
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 Provides: group(mongod)
50 Provides: user(mongod)
51 Requires(post,preun): /sbin/chkconfig
52 Requires(postun): /usr/sbin/groupdel
53 Requires(postun): /usr/sbin/userdel
54 Requires(pre): /bin/id
55 Requires(pre): /usr/bin/getgid
56 Requires(pre): /usr/sbin/groupadd
57 Requires(pre): /usr/sbin/useradd
61 Mongo (from "huMONGOus") is a schema-free document-oriented database.
63 This package provides the mongo server software, mongo sharding server
64 softwware, default configuration files, and init.d scripts.
67 %setup -q -n %{name}-src-r%{version}
70 find -type f -executable | xargs chmod a-x
74 --prefix=$RPM_BUILD_ROOT%{_prefix} \
79 # XXX really should have shared library here
82 rm -rf $RPM_BUILD_ROOT
83 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir}/man1} \
84 $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d,sysconfig} \
85 $RPM_BUILD_ROOT%{_var}/{lib,log}/mongo
88 --prefix=$RPM_BUILD_ROOT%{_prefix} \
93 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/mongod
94 cp -a rpm/mongod.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/mongod
96 cp -a %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/mongod
97 cp -a rpm/mongod.conf $RPM_BUILD_ROOT%{_sysconfdir}/mongod.conf
99 cp -a debian/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
101 touch $RPM_BUILD_ROOT%{_var}/log/mongo/mongod.log
104 rm -rf $RPM_BUILD_ROOT
107 %groupadd -g xxx -r mongod
108 %useradd -u xxx -r -g mongod -d %{_var}/lib/mongo -s /bin/false -c "MongoDB Database Server" mongod
111 /sbin/chkconfig --add mongod
112 %service mongod restart
115 if [ "$1" = "0" ]; then
116 %service -q mongod stop
117 /sbin/chkconfig --del mongod
121 if [ "$1" = "0" ]; then
127 %defattr(644,root,root,755)
128 %doc README GNU-AGPL-3.0.txt
129 %attr(755,root,root) %{_bindir}/mongo
130 %attr(755,root,root) %{_bindir}/mongodump
131 %attr(755,root,root) %{_bindir}/mongoexport
132 %attr(755,root,root) %{_bindir}/mongofiles
133 %attr(755,root,root) %{_bindir}/mongoimport
134 %attr(755,root,root) %{_bindir}/mongorestore
135 %attr(755,root,root) %{_bindir}/mongostat
136 %attr(755,root,root) %{_bindir}/bsondump
137 %{_mandir}/man1/mongo.1*
138 %{_mandir}/man1/mongod.1*
139 %{_mandir}/man1/mongodump.1*
140 %{_mandir}/man1/mongoexport.1*
141 %{_mandir}/man1/mongofiles.1*
142 %{_mandir}/man1/mongoimport.1*
143 %{_mandir}/man1/mongosniff.1*
144 %{_mandir}/man1/mongostat.1*
145 %{_mandir}/man1/mongorestore.1*
148 %defattr(644,root,root,755)
150 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mongod.conf
151 %attr(754,root,root) /etc/rc.d/init.d/mongod
152 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mongod
153 %config(noreplace) /etc/logrotate.d/mongod
154 %attr(755,root,root) %{_bindir}/mongod
155 %attr(755,root,root) %{_bindir}/mongos
156 %{_mandir}/man1/mongos.1*
157 %attr(755,mongod,mongod) %dir %{_var}/lib/mongo
158 %attr(755,mongod,mongod) %dir %{_var}/log/mongo
159 %attr(640,mongod,mongod) %config(noreplace) %verify(not md5 mtime size) %{_var}/log/mongo/mongod.log
162 %defattr(644,root,root,755)
164 %{_libdir}/libmongoclient.a
165 %{_libdir}/libmongoclient.so
166 #%{_libdir}/libmongotestfiles.a