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