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