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