2 # - fix 'libs' subpackage (disabled due to broken 'sharedclient' build option)
4 Summary: MongoDB client shell and tools
5 Summary(pl.UTF-8): Powłoka kliencka i narzędzia dla bazy danych MongoDB
10 Group: Applications/Databases
11 Source0: http://downloads.mongodb.org/src/%{name}-src-r%{version}.tar.gz
12 # Source0-md5: 832bdb6cc659176fd8d6b16a660ccfc6
13 Source1: %{name}.logrotate
15 Patch0: %{name}-cflags.patch
16 Patch1: %{name}-system-libs.patch
17 Patch2: boost-1.50.patch
18 Patch3: %{name}-install.patch
19 URL: http://www.mongodb.org/
20 BuildRequires: boost-devel >= 1.50
21 BuildRequires: libpcap-devel
22 BuildRequires: libstdc++-devel >= 6:4.0
24 BuildRequires: libtcmalloc-devel
26 BuildRequires: pcre-cxx-devel
27 BuildRequires: pcre-devel >= 8.30
28 BuildRequires: readline-devel
29 BuildRequires: rpmbuild(macros) >= 1.228
30 BuildRequires: scons >= 1.2
31 BuildRequires: sed >= 4.0
32 BuildRequires: snappy-devel
33 BuildRequires: v8-devel
34 #Requires: %{name}-libs = %{version}-%{release}
35 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38 Mongo (from "huMONGOus") is a schema-free document-oriented database.
39 It features dynamic profileable queries, full indexing, replication
40 and fail-over support, efficient storage of large binary data objects,
43 This package provides the mongo shell, import/export tools, and other
46 %description -l pl.UTF-8
47 Mongo (od "huMONGOus") to baza danych zorientowana na dokumenty
48 pozbawione schematu. Obsługuje dynamicznie profilowane zapytania,
49 pełne indeksowanie, replikację i fail-over, wydajne składowanie dużych
50 obiektów danych binarnych oraz automatyczne dzielenie.
52 Ten pakiet zawiera powłokę mongo, narzędzia do eksportu/importu danych
53 oraz inne narzędzia klienckie.
56 Summary: MongoDB client library
57 Summary(pl.UTF-8): Biblioteka kliencka MongoDB
61 Mongo (from "huMONGOus") is a schema-free document-oriented database.
63 This package provides the mongo client library.
65 %description libs -l pl.UTF-8
66 Mongo (od "huMONGOus") to baza danych zorientowana na dokumenty
69 Ten pakiet zawiera bibliotekę kliencką mongo.
72 Summary: Header files for MongoDB client library
73 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki klienckiej MongoDB
74 Group: Development/Libraries
75 #Requires: %{name}-libs = %{version}-%{release}
76 Requires: %{name}-static = %{version}-%{release}
79 Mongo (from "huMONGOus") is a schema-free document-oriented database.
81 This package provides the header files needed to develop MongoDB
84 %description devel -l pl.UTF-8
85 Mongo (od "huMONGOus") to baza danych zorientowana na dokumenty
88 Ten pakiet zawiera pliki nagłówkowe potrzebne do tworzenia
89 oprogramowania klienckiego dla MongoDB.
92 Summary: Static MongoDB client library
93 Summary(pl.UTF-8): Statyczna biblioteka kliencka MongoDB
94 Group: Development/Libraries
95 #Requires: %{name}-libs = %{version}-%{release}
98 Mongo (from "huMONGOus") is a schema-free document-oriented database.
100 This package provides the MongoDB static client library.
102 %description static -l pl.UTF-8
103 Mongo (od "huMONGOus") to baza danych zorientowana na dokumenty
106 Ten pakiet zawiera statyczną bibliotekę kliencką MongoDB.
109 Summary: MongoDB server, sharding server, and support scripts
110 Summary(pl.UTF-8): Serwer MongoDB, serwer dzielący oraz skrypty pomocnicze
111 Group: Applications/Databases
112 Requires: %{name} = %{version}-%{release}
113 Requires(post,preun): /sbin/chkconfig
114 Requires(postun): /usr/sbin/groupdel
115 Requires(postun): /usr/sbin/userdel
116 Requires(pre): /bin/id
117 Requires(pre): /usr/bin/getgid
118 Requires(pre): /usr/sbin/groupadd
119 Requires(pre): /usr/sbin/useradd
121 Provides: group(mongod)
122 Provides: user(mongod)
123 Conflicts: logrotate < 3.8.0
126 Mongo (from "huMONGOus") is a schema-free document-oriented database.
128 This package provides the mongo server software, mongo sharding server
129 software, default configuration files, and init.d scripts.
131 %description server -l pl.UTF-8
132 Mongo (od "huMONGOus") to baza danych zorientowana na dokumenty
135 Ten pakiet zawiera serwer mongo, serwer dzielący, pliki domyślnej
136 konfiguracji oraz skrypty init.d.
139 %setup -q -n %{name}-src-r%{version}
146 find -type f -executable | xargs chmod a-x
148 # force system pcre/js/snappy
149 %{__rm} -r src/third_party/{js-1.7,pcre-8.30,snappy,boost}
153 CPPFLAGS="%{rpmcppflags} -DXP_UNIX" \
154 --use-system-all=yes \
155 --extralib=pcrecpp,pcre,snappy \
156 --prefix=$RPM_BUILD_ROOT%{_prefix} \
162 rm -rf $RPM_BUILD_ROOT
163 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir}/man1} \
164 $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d,sysconfig,mongod} \
165 $RPM_BUILD_ROOT%{_var}/{lib,log{,/archive}}/mongo
167 # XXX: scons is so great, recompiles everything here!
169 --use-system-all=yes \
170 --extralib=pcrecpp,pcre,snappy \
171 --prefix=$RPM_BUILD_ROOT%{_prefix} \
176 cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/mongod
177 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/mongod
178 cp -p rpm/mongod.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/mongod
179 cp -p rpm/mongod.conf $RPM_BUILD_ROOT%{_sysconfdir}/mongod/default.conf
180 cp -p debian/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
182 touch $RPM_BUILD_ROOT%{_var}/log/mongo/mongod.log
184 # for some reason these are installed twice, remove unwanted copies
185 for f in $RPM_BUILD_ROOT%{_includedir}/mongo/* ; do
186 rm -r "$RPM_BUILD_ROOT%{_includedir}/$(basename $f)" || :
190 rm -rf $RPM_BUILD_ROOT
192 %post libs -p /sbin/ldconfig
193 %postun libs -p /sbin/ldconfig
196 %groupadd -g 258 -r mongod
197 %useradd -u 258 -r -g mongod -d %{_var}/lib/mongo -s /bin/false -c "MongoDB Database Server" mongod
200 /sbin/chkconfig --add mongod
201 %service mongod restart
204 if [ "$1" = "0" ]; then
205 %service -q mongod stop
206 /sbin/chkconfig --del mongod
210 if [ "$1" = "0" ]; then
215 %triggerpostun server -- %{name}-server < 2.0.6-3
216 if [ -f %{_sysconfdir}/mongod.conf.rpmsave ] ; then
217 cp -f %{_sysconfdir}/mongod/default.conf{,.rpmnew} || :
218 echo "Moving %{_sysconfdir}/mongod.conf to %{_sysconfdir}/mongod/default.conf"
219 mv -f %{_sysconfdir}/mongod.conf.rpmsave %{_sysconfdir}/mongod/default.conf
220 %service mongod restart
224 %defattr(644,root,root,755)
225 %doc README GNU-AGPL-3.0.txt
226 %attr(755,root,root) %{_bindir}/bsondump
227 %attr(755,root,root) %{_bindir}/mongo
228 %attr(755,root,root) %{_bindir}/mongodump
229 %attr(755,root,root) %{_bindir}/mongoexport
230 %attr(755,root,root) %{_bindir}/mongofiles
231 %attr(755,root,root) %{_bindir}/mongoimport
232 %attr(755,root,root) %{_bindir}/mongooplog
233 %attr(755,root,root) %{_bindir}/mongoperf
234 %attr(755,root,root) %{_bindir}/mongorestore
235 %attr(755,root,root) %{_bindir}/mongosniff
236 %attr(755,root,root) %{_bindir}/mongostat
237 %attr(755,root,root) %{_bindir}/mongotop
238 %{_mandir}/man1/bsondump.1*
239 %{_mandir}/man1/mongo.1*
240 %{_mandir}/man1/mongodump.1*
241 %{_mandir}/man1/mongoexport.1*
242 %{_mandir}/man1/mongofiles.1*
243 %{_mandir}/man1/mongoimport.1*
244 %{_mandir}/man1/mongosniff.1*
245 %{_mandir}/man1/mongostat.1*
246 %{_mandir}/man1/mongorestore.1*
250 %defattr(644,root,root,755)
251 %attr(755,root,root) %{_libdir}/libmongoclient.so
255 %defattr(644,root,root,755)
259 %defattr(644,root,root,755)
260 %{_libdir}/libmongoclient.a
263 %defattr(644,root,root,755)
265 %dir %{_sysconfdir}/mongod
266 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mongod/default.conf
267 %attr(754,root,root) /etc/rc.d/init.d/mongod
268 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mongod
269 %config(noreplace) /etc/logrotate.d/mongod
270 %attr(755,root,root) %{_bindir}/mongod
271 %attr(755,root,root) %{_bindir}/mongos
272 %{_mandir}/man1/mongod.1*
273 %{_mandir}/man1/mongos.1*
274 %attr(755,mongod,mongod) %dir %{_var}/lib/mongo
275 %attr(775,root,mongod) %dir %{_var}/log/mongo
276 %attr(775,root,mongod) %dir %{_var}/log/archive/mongo
277 %attr(640,mongod,mongod) %config(noreplace) %verify(not md5 mtime size) %{_var}/log/mongo/mongod.log