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