]>
Commit | Line | Data |
---|---|---|
8f59c17f JK |
1 | # TODO: |
2 | # - fix 'libs' subpackage (disabled due to broken 'sharedclient' build option) | |
3 | # | |
69fbae1d | 4 | Summary: MongoDB client shell and tools |
7165862f | 5 | Summary(pl.UTF-8): Powłoka kliencka i narzędzia dla bazy danych MongoDB |
69fbae1d | 6 | Name: mongodb |
8f59c17f | 7 | Version: 2.2.0 |
3fb19a74 | 8 | Release: 1.1 |
c9011c68 | 9 | License: AGPL v3 |
69fbae1d | 10 | Group: Applications/Databases |
1987b887 | 11 | Source0: http://downloads.mongodb.org/src/%{name}-src-r%{version}.tar.gz |
8f59c17f | 12 | # Source0-md5: 832bdb6cc659176fd8d6b16a660ccfc6 |
1987b887 | 13 | Source1: %{name}.logrotate |
14 | Source2: %{name}.init | |
cf68c7a9 | 15 | Source3: mongod-default.conf |
3fb19a74 | 16 | Source4: mongod@.service |
8f59c17f | 17 | Patch0: %{name}-cflags.patch |
04298a8b | 18 | Patch1: %{name}-system-libs.patch |
8f59c17f JK |
19 | Patch2: boost-1.50.patch |
20 | Patch3: %{name}-install.patch | |
7165862f | 21 | URL: http://www.mongodb.org/ |
e39b997a | 22 | BuildRequires: boost-devel >= 1.50 |
f5624e0a | 23 | BuildRequires: libpcap-devel |
c5835a7a | 24 | BuildRequires: libstdc++-devel >= 6:4.0 |
c5756531 JK |
25 | %ifarch x86_64 |
26 | BuildRequires: libtcmalloc-devel | |
27 | %endif | |
1987b887 | 28 | BuildRequires: pcre-cxx-devel |
8f59c17f | 29 | BuildRequires: pcre-devel >= 8.30 |
69fbae1d | 30 | BuildRequires: readline-devel |
3fb19a74 | 31 | BuildRequires: rpmbuild(macros) >= 1.644 |
69fbae1d | 32 | BuildRequires: scons >= 1.2 |
75e22e92 | 33 | BuildRequires: sed >= 4.0 |
04298a8b | 34 | BuildRequires: snappy-devel |
69fbae1d | 35 | BuildRequires: v8-devel |
0a5d6bc7 | 36 | #Requires: %{name}-libs = %{version}-%{release} |
69fbae1d | 37 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
69fbae1d | 38 | |
39 | %description | |
40 | Mongo (from "huMONGOus") is a schema-free document-oriented database. | |
41 | It features dynamic profileable queries, full indexing, replication | |
42 | and fail-over support, efficient storage of large binary data objects, | |
43 | and auto-sharding. | |
44 | ||
45 | This package provides the mongo shell, import/export tools, and other | |
46 | client utilities. | |
47 | ||
7165862f JB |
48 | %description -l pl.UTF-8 |
49 | Mongo (od "huMONGOus") to baza danych zorientowana na dokumenty | |
50 | pozbawione schematu. Obsługuje dynamicznie profilowane zapytania, | |
51 | pełne indeksowanie, replikację i fail-over, wydajne składowanie dużych | |
52 | obiektów danych binarnych oraz automatyczne dzielenie. | |
53 | ||
54 | Ten pakiet zawiera powłokę mongo, narzędzia do eksportu/importu danych | |
55 | oraz inne narzędzia klienckie. | |
56 | ||
f5624e0a JB |
57 | %package libs |
58 | Summary: MongoDB client library | |
59 | Summary(pl.UTF-8): Biblioteka kliencka MongoDB | |
60 | Group: Libraries | |
61 | ||
62 | %description libs | |
63 | Mongo (from "huMONGOus") is a schema-free document-oriented database. | |
64 | ||
65 | This package provides the mongo client library. | |
66 | ||
67 | %description libs -l pl.UTF-8 | |
68 | Mongo (od "huMONGOus") to baza danych zorientowana na dokumenty | |
69 | pozbawione schematu. | |
70 | ||
71 | Ten pakiet zawiera bibliotekę kliencką mongo. | |
72 | ||
69fbae1d | 73 | %package devel |
f5624e0a JB |
74 | Summary: Header files for MongoDB client library |
75 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki klienckiej MongoDB | |
69fbae1d | 76 | Group: Development/Libraries |
8f59c17f JK |
77 | #Requires: %{name}-libs = %{version}-%{release} |
78 | Requires: %{name}-static = %{version}-%{release} | |
69fbae1d | 79 | |
80 | %description devel | |
81 | Mongo (from "huMONGOus") is a schema-free document-oriented database. | |
82 | ||
f5624e0a JB |
83 | This package provides the header files needed to develop MongoDB |
84 | client software. | |
69fbae1d | 85 | |
7165862f JB |
86 | %description devel -l pl.UTF-8 |
87 | Mongo (od "huMONGOus") to baza danych zorientowana na dokumenty | |
88 | pozbawione schematu. | |
89 | ||
f5624e0a JB |
90 | Ten pakiet zawiera pliki nagłówkowe potrzebne do tworzenia |
91 | oprogramowania klienckiego dla MongoDB. | |
92 | ||
93 | %package static | |
94 | Summary: Static MongoDB client library | |
95 | Summary(pl.UTF-8): Statyczna biblioteka kliencka MongoDB | |
96 | Group: Development/Libraries | |
0a5d6bc7 | 97 | #Requires: %{name}-libs = %{version}-%{release} |
f5624e0a JB |
98 | |
99 | %description static | |
100 | Mongo (from "huMONGOus") is a schema-free document-oriented database. | |
101 | ||
102 | This package provides the MongoDB static client library. | |
103 | ||
104 | %description static -l pl.UTF-8 | |
105 | Mongo (od "huMONGOus") to baza danych zorientowana na dokumenty | |
106 | pozbawione schematu. | |
107 | ||
108 | Ten pakiet zawiera statyczną bibliotekę kliencką MongoDB. | |
7165862f | 109 | |
748739f7 ER |
110 | %package server |
111 | Summary: MongoDB server, sharding server, and support scripts | |
7165862f | 112 | Summary(pl.UTF-8): Serwer MongoDB, serwer dzielący oraz skrypty pomocnicze |
748739f7 ER |
113 | Group: Applications/Databases |
114 | Requires: %{name} = %{version}-%{release} | |
3fb19a74 | 115 | Requires: systemd-units >= 38 |
aa21d651 | 116 | Requires(post,preun): /sbin/chkconfig |
40ec6826 ER |
117 | Requires(postun): /usr/sbin/groupdel |
118 | Requires(postun): /usr/sbin/userdel | |
119 | Requires(pre): /bin/id | |
120 | Requires(pre): /usr/bin/getgid | |
121 | Requires(pre): /usr/sbin/groupadd | |
122 | Requires(pre): /usr/sbin/useradd | |
aa21d651 | 123 | Requires: rc-scripts |
51f3a0fb JR |
124 | Provides: group(mongod) |
125 | Provides: user(mongod) | |
126 | Conflicts: logrotate < 3.8.0 | |
748739f7 ER |
127 | |
128 | %description server | |
129 | Mongo (from "huMONGOus") is a schema-free document-oriented database. | |
130 | ||
131 | This package provides the mongo server software, mongo sharding server | |
7165862f JB |
132 | software, default configuration files, and init.d scripts. |
133 | ||
134 | %description server -l pl.UTF-8 | |
135 | Mongo (od "huMONGOus") to baza danych zorientowana na dokumenty | |
136 | pozbawione schematu. | |
137 | ||
138 | Ten pakiet zawiera serwer mongo, serwer dzielący, pliki domyślnej | |
139 | konfiguracji oraz skrypty init.d. | |
748739f7 | 140 | |
69fbae1d | 141 | %prep |
142 | %setup -q -n %{name}-src-r%{version} | |
105f2c53 | 143 | %patch0 -p1 |
04298a8b JB |
144 | %patch1 -p1 |
145 | %patch2 -p1 | |
2d54e68a | 146 | %patch3 -p1 |
69fbae1d | 147 | |
d1b0fd13 ER |
148 | # Fix permissions |
149 | find -type f -executable | xargs chmod a-x | |
150 | ||
04298a8b | 151 | # force system pcre/js/snappy |
8f59c17f | 152 | %{__rm} -r src/third_party/{js-1.7,pcre-8.30,snappy,boost} |
04298a8b | 153 | |
69fbae1d | 154 | %build |
d1b0fd13 | 155 | %scons \ |
8f59c17f JK |
156 | CPPFLAGS="%{rpmcppflags} -DXP_UNIX" \ |
157 | --use-system-all=yes \ | |
158 | --extralib=pcrecpp,pcre,snappy \ | |
d1b0fd13 | 159 | --prefix=$RPM_BUILD_ROOT%{_prefix} \ |
8f59c17f | 160 | --full=all \ |
75e22e92 | 161 | --usev8 \ |
162 | --cxx=%{__cxx} | |
69fbae1d | 163 | |
69fbae1d | 164 | %install |
165 | rm -rf $RPM_BUILD_ROOT | |
d1b0fd13 | 166 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir}/man1} \ |
1a2080c0 | 167 | $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d,sysconfig,mongod} \ |
3fb19a74 JK |
168 | $RPM_BUILD_ROOT%{_var}/{lib,log{,/archive}}/mongo \ |
169 | $RPM_BUILD_ROOT%{systemdunitdir} | |
748739f7 | 170 | |
c9011c68 | 171 | # XXX: scons is so great, recompiles everything here! |
d1b0fd13 | 172 | %scons install \ |
8f59c17f JK |
173 | --use-system-all=yes \ |
174 | --extralib=pcrecpp,pcre,snappy \ | |
d1b0fd13 | 175 | --prefix=$RPM_BUILD_ROOT%{_prefix} \ |
8f59c17f | 176 | --full=all \ |
c9011c68 JB |
177 | --usev8 \ |
178 | --cxx=%{__cxx} | |
d1b0fd13 | 179 | |
7165862f | 180 | cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/mongod |
748739f7 | 181 | install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/mongod |
7165862f | 182 | cp -p rpm/mongod.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/mongod |
cf68c7a9 | 183 | install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/mongod/default.conf |
7165862f | 184 | cp -p debian/*.1 $RPM_BUILD_ROOT%{_mandir}/man1 |
69fbae1d | 185 | |
3fb19a74 JK |
186 | # mask out the LSB service |
187 | ln -s /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/mongod.service | |
188 | install %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/mongod@.service | |
189 | ||
748739f7 | 190 | touch $RPM_BUILD_ROOT%{_var}/log/mongo/mongod.log |
69fbae1d | 191 | |
138c04db JK |
192 | # for some reason these are installed twice, remove unwanted copies |
193 | for f in $RPM_BUILD_ROOT%{_includedir}/mongo/* ; do | |
46ee035d | 194 | rm -r "$RPM_BUILD_ROOT%{_includedir}/$(basename $f)" || : |
138c04db JK |
195 | done |
196 | ||
69fbae1d | 197 | %clean |
69fbae1d | 198 | rm -rf $RPM_BUILD_ROOT |
199 | ||
f5624e0a JB |
200 | %post libs -p /sbin/ldconfig |
201 | %postun libs -p /sbin/ldconfig | |
202 | ||
69fbae1d | 203 | %pre server |
5688efcd | 204 | %groupadd -g 258 -r mongod |
205 | %useradd -u 258 -r -g mongod -d %{_var}/lib/mongo -s /bin/false -c "MongoDB Database Server" mongod | |
69fbae1d | 206 | |
207 | %post server | |
aa21d651 ER |
208 | /sbin/chkconfig --add mongod |
209 | %service mongod restart | |
3fb19a74 JK |
210 | # our systemd macros cannot handle template (multi-instance) units yet |
211 | export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog | |
212 | /bin/systemd_booted && /bin/systemctl --quiet daemon-reload || : | |
213 | if [ $1 -eq 1 ]; then | |
214 | /bin/systemctl --quiet enable mongod@.service || : | |
215 | /bin/systemd_booted && echo 'Run "/bin/systemctl start mongod@default.service" to start mongod.' || : | |
216 | else | |
217 | /bin/systemd_booted && /bin/systemctl --quiet try-restart mongod@default.service || : | |
218 | fi | |
69fbae1d | 219 | |
220 | %preun server | |
aa21d651 ER |
221 | if [ "$1" = "0" ]; then |
222 | %service -q mongod stop | |
223 | /sbin/chkconfig --del mongod | |
3fb19a74 JK |
224 | export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog |
225 | /bin/systemd_booted && /bin/systemctl --quiet stop mongod@default.service || : | |
226 | /bin/systemctl --quiet disable mongod@.service || : | |
aa21d651 | 227 | fi |
69fbae1d | 228 | |
5688efcd | 229 | %postun server |
40ec6826 ER |
230 | if [ "$1" = "0" ]; then |
231 | %userremove mongod | |
232 | %groupremove mongod | |
233 | fi | |
3fb19a74 | 234 | %systemd_reload |
40ec6826 | 235 | |
1a2080c0 JK |
236 | %triggerpostun server -- %{name}-server < 2.0.6-3 |
237 | if [ -f %{_sysconfdir}/mongod.conf.rpmsave ] ; then | |
238 | cp -f %{_sysconfdir}/mongod/default.conf{,.rpmnew} || : | |
239 | echo "Moving %{_sysconfdir}/mongod.conf to %{_sysconfdir}/mongod/default.conf" | |
240 | mv -f %{_sysconfdir}/mongod.conf.rpmsave %{_sysconfdir}/mongod/default.conf | |
4f4a6eae | 241 | %service mongod restart |
1a2080c0 JK |
242 | fi |
243 | ||
69fbae1d | 244 | %files |
245 | %defattr(644,root,root,755) | |
246 | %doc README GNU-AGPL-3.0.txt | |
04298a8b | 247 | %attr(755,root,root) %{_bindir}/bsondump |
69fbae1d | 248 | %attr(755,root,root) %{_bindir}/mongo |
249 | %attr(755,root,root) %{_bindir}/mongodump | |
250 | %attr(755,root,root) %{_bindir}/mongoexport | |
251 | %attr(755,root,root) %{_bindir}/mongofiles | |
252 | %attr(755,root,root) %{_bindir}/mongoimport | |
90979303 JK |
253 | %attr(755,root,root) %{_bindir}/mongooplog |
254 | %attr(755,root,root) %{_bindir}/mongoperf | |
69fbae1d | 255 | %attr(755,root,root) %{_bindir}/mongorestore |
f5624e0a | 256 | %attr(755,root,root) %{_bindir}/mongosniff |
69fbae1d | 257 | %attr(755,root,root) %{_bindir}/mongostat |
04298a8b JB |
258 | %attr(755,root,root) %{_bindir}/mongotop |
259 | %{_mandir}/man1/bsondump.1* | |
69fbae1d | 260 | %{_mandir}/man1/mongo.1* |
69fbae1d | 261 | %{_mandir}/man1/mongodump.1* |
262 | %{_mandir}/man1/mongoexport.1* | |
263 | %{_mandir}/man1/mongofiles.1* | |
264 | %{_mandir}/man1/mongoimport.1* | |
265 | %{_mandir}/man1/mongosniff.1* | |
266 | %{_mandir}/man1/mongostat.1* | |
267 | %{_mandir}/man1/mongorestore.1* | |
268 | ||
8f59c17f | 269 | %if 0 |
f5624e0a JB |
270 | %files libs |
271 | %defattr(644,root,root,755) | |
272 | %attr(755,root,root) %{_libdir}/libmongoclient.so | |
8f59c17f | 273 | %endif |
f5624e0a JB |
274 | |
275 | %files devel | |
276 | %defattr(644,root,root,755) | |
277 | %{_includedir}/mongo | |
278 | ||
279 | %files static | |
280 | %defattr(644,root,root,755) | |
281 | %{_libdir}/libmongoclient.a | |
282 | ||
69fbae1d | 283 | %files server |
284 | %defattr(644,root,root,755) | |
2633a24f | 285 | #%dir %{_sysconfdir} |
1a2080c0 JK |
286 | %dir %{_sysconfdir}/mongod |
287 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mongod/default.conf | |
748739f7 ER |
288 | %attr(754,root,root) /etc/rc.d/init.d/mongod |
289 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mongod | |
69fbae1d | 290 | %config(noreplace) /etc/logrotate.d/mongod |
69fbae1d | 291 | %attr(755,root,root) %{_bindir}/mongod |
292 | %attr(755,root,root) %{_bindir}/mongos | |
f5624e0a | 293 | %{_mandir}/man1/mongod.1* |
69fbae1d | 294 | %{_mandir}/man1/mongos.1* |
295 | %attr(755,mongod,mongod) %dir %{_var}/lib/mongo | |
8f59c17f JK |
296 | %attr(775,root,mongod) %dir %{_var}/log/mongo |
297 | %attr(775,root,mongod) %dir %{_var}/log/archive/mongo | |
69fbae1d | 298 | %attr(640,mongod,mongod) %config(noreplace) %verify(not md5 mtime size) %{_var}/log/mongo/mongod.log |
3fb19a74 JK |
299 | %{systemdunitdir}/mongod.service |
300 | %{systemdunitdir}/mongod@.service |