]> git.pld-linux.org Git - packages/mongodb.git/blob - mongodb.spec
47a316545523804660daa46358ac0fd09f3637ec
[packages/mongodb.git] / mongodb.spec
1 # TODO: pass rpmldflags
2 Summary:        MongoDB client shell and tools
3 Summary(pl.UTF-8):      Powłoka kliencka i narzędzia dla bazy danych MongoDB
4 Name:           mongodb
5 Version:        2.0.6
6 Release:        4
7 License:        AGPL v3
8 Group:          Applications/Databases
9 Source0:        http://downloads.mongodb.org/src/%{name}-src-r%{version}.tar.gz
10 # Source0-md5:  b3b32fecdcbe8e8068ec2989be9d2da4
11 Source1:        %{name}.logrotate
12 Source2:        %{name}.init
13 Patch0:         config.patch
14 Patch1:         %{name}-system-libs.patch
15 Patch2:         %{name}-build.patch
16 Patch3:         boost-1.50.patch
17 URL:            http://www.mongodb.org/
18 BuildRequires:  boost-devel >= 1.42
19 BuildRequires:  libpcap-devel
20 BuildRequires:  libstdc++-devel >= 6:4.0
21 BuildRequires:  pcre-cxx-devel
22 BuildRequires:  pcre-devel
23 BuildRequires:  readline-devel
24 BuildRequires:  rpmbuild(macros) >= 1.228
25 BuildRequires:  scons >= 1.2
26 BuildRequires:  sed >= 4.0
27 BuildRequires:  snappy-devel
28 BuildRequires:  v8-devel
29 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
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
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
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
65 %package devel
66 Summary:        Header files for MongoDB client library
67 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki klienckiej MongoDB
68 Group:          Development/Libraries
69 Requires:       %{name}-libs = %{version}-%{release}
70
71 %description devel
72 Mongo (from "huMONGOus") is a schema-free document-oriented database.
73
74 This package provides the header files needed to develop MongoDB
75 client software.
76
77 %description devel -l pl.UTF-8
78 Mongo (od "huMONGOus") to baza danych zorientowana na dokumenty
79 pozbawione schematu.
80
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.
100
101 %package server
102 Summary:        MongoDB server, sharding server, and support scripts
103 Summary(pl.UTF-8):      Serwer MongoDB, serwer dzielący oraz skrypty pomocnicze
104 Group:          Applications/Databases
105 Requires:       %{name} = %{version}-%{release}
106 Requires(post,preun):   /sbin/chkconfig
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
113 Requires:       rc-scripts
114 Provides:       group(mongod)
115 Provides:       user(mongod)
116 Conflicts:      logrotate < 3.8.0
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
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.
130
131 %prep
132 %setup -q -n %{name}-src-r%{version}
133 %patch0 -p1
134 %patch1 -p1
135 %patch2 -p1
136 %patch3 -p1
137 %{__sed} -i -e 's,-O3,%{rpmcxxflags} %{rpmcppflags},' SConstruct
138
139 # Fix permissions
140 find -type f -executable | xargs chmod a-x
141
142 # force system pcre/js/snappy
143 %{__rm} -r third_party/{js-1.7,pcre-7.4,snappy,*.py}
144
145 %build
146 %scons \
147         --prefix=$RPM_BUILD_ROOT%{_prefix} \
148         --sharedclient \
149         --full all \
150         --usev8 \
151         --cxx=%{__cxx}
152
153 %install
154 rm -rf $RPM_BUILD_ROOT
155 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir}/man1} \
156         $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d,sysconfig,mongod} \
157         $RPM_BUILD_ROOT%{_var}/{lib,log}/mongo
158
159 # XXX: scons is so great, recompiles everything here!
160 %scons install \
161         --prefix=$RPM_BUILD_ROOT%{_prefix} \
162         --sharedclient \
163         --full \
164         --usev8 \
165         --cxx=%{__cxx}
166
167 cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/mongod
168 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/mongod
169 cp -p rpm/mongod.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/mongod
170 cp -p rpm/mongod.conf $RPM_BUILD_ROOT%{_sysconfdir}/mongod/default.conf
171 cp -p debian/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
172
173 touch $RPM_BUILD_ROOT%{_var}/log/mongo/mongod.log
174
175 %clean
176 rm -rf $RPM_BUILD_ROOT
177
178 %post   libs -p /sbin/ldconfig
179 %postun libs -p /sbin/ldconfig
180
181 %pre server
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
184
185 %post server
186 /sbin/chkconfig --add mongod
187 %service mongod restart
188
189 %preun server
190 if [ "$1" = "0" ]; then
191         %service -q mongod stop
192         /sbin/chkconfig --del mongod
193 fi
194
195 %postun server
196 if [ "$1" = "0" ]; then
197         %userremove mongod
198         %groupremove mongod
199 fi
200
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
206         %service mongod restart
207 fi
208
209 %files
210 %defattr(644,root,root,755)
211 %doc README GNU-AGPL-3.0.txt
212 %attr(755,root,root) %{_bindir}/bsondump
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
219 %attr(755,root,root) %{_bindir}/mongosniff
220 %attr(755,root,root) %{_bindir}/mongostat
221 %attr(755,root,root) %{_bindir}/mongotop
222 %{_mandir}/man1/bsondump.1*
223 %{_mandir}/man1/mongo.1*
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
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
244 %files server
245 %defattr(644,root,root,755)
246 #%dir %{_sysconfdir}
247 %dir %{_sysconfdir}/mongod
248 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mongod/default.conf
249 %attr(754,root,root) /etc/rc.d/init.d/mongod
250 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mongod
251 %config(noreplace) /etc/logrotate.d/mongod
252 %attr(755,root,root) %{_bindir}/mongod
253 %attr(755,root,root) %{_bindir}/mongos
254 %{_mandir}/man1/mongod.1*
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
This page took 0.073095 seconds and 2 git commands to generate.