]>
Commit | Line | Data |
---|---|---|
5688efcd | 1 | # |
d1b0fd13 | 2 | # TODO |
5688efcd | 3 | # - pass our rpm*cflags, use CXX |
4 | # | |
69fbae1d | 5 | Summary: MongoDB client shell and tools |
6 | Name: mongodb | |
5688efcd | 7 | Version: 1.6.4 |
d1b0fd13 | 8 | Release: 0.1 |
69fbae1d | 9 | License: AGPL 3.0 |
10 | Group: Applications/Databases | |
d1b0fd13 | 11 | URL: http://www.mongodb.org/ |
1987b887 | 12 | Source0: http://downloads.mongodb.org/src/%{name}-src-r%{version}.tar.gz |
5688efcd | 13 | # Source0-md5: 4df15dba13d7e743f0148127122baec6 |
1987b887 | 14 | Source1: %{name}.logrotate |
15 | Source2: %{name}.init | |
69fbae1d | 16 | # BuildRequires: libpcap-devel |
17 | BuildRequires: boost-devel >= 1.42 | |
c5835a7a | 18 | BuildRequires: libstdc++-devel >= 6:4.0 |
1987b887 | 19 | BuildRequires: pcre-cxx-devel |
c07fcde2 | 20 | BuildRequires: pcre-devel |
69fbae1d | 21 | BuildRequires: readline-devel |
aa21d651 | 22 | BuildRequires: rpmbuild(macros) >= 1.228 |
69fbae1d | 23 | BuildRequires: scons >= 1.2 |
24 | BuildRequires: v8-devel | |
69fbae1d | 25 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
69fbae1d | 26 | |
27 | %description | |
28 | Mongo (from "huMONGOus") is a schema-free document-oriented database. | |
29 | It features dynamic profileable queries, full indexing, replication | |
30 | and fail-over support, efficient storage of large binary data objects, | |
31 | and auto-sharding. | |
32 | ||
33 | This package provides the mongo shell, import/export tools, and other | |
34 | client utilities. | |
35 | ||
69fbae1d | 36 | %package devel |
1987b887 | 37 | Summary: Headers and libraries for mongo development |
69fbae1d | 38 | Group: Development/Libraries |
c5835a7a | 39 | Requires: %{name} = %{version}-%{release} |
69fbae1d | 40 | |
41 | %description devel | |
42 | Mongo (from "huMONGOus") is a schema-free document-oriented database. | |
43 | ||
44 | This package provides the mongo static library and header files needed | |
45 | to develop mongo client software. | |
46 | ||
748739f7 ER |
47 | %package server |
48 | Summary: MongoDB server, sharding server, and support scripts | |
49 | Group: Applications/Databases | |
50 | Requires: %{name} = %{version}-%{release} | |
40ec6826 ER |
51 | Provides: group(mongod) |
52 | Provides: user(mongod) | |
aa21d651 | 53 | Requires(post,preun): /sbin/chkconfig |
40ec6826 ER |
54 | Requires(postun): /usr/sbin/groupdel |
55 | Requires(postun): /usr/sbin/userdel | |
56 | Requires(pre): /bin/id | |
57 | Requires(pre): /usr/bin/getgid | |
58 | Requires(pre): /usr/sbin/groupadd | |
59 | Requires(pre): /usr/sbin/useradd | |
aa21d651 | 60 | Requires: rc-scripts |
748739f7 ER |
61 | |
62 | %description server | |
63 | Mongo (from "huMONGOus") is a schema-free document-oriented database. | |
64 | ||
65 | This package provides the mongo server software, mongo sharding server | |
66 | softwware, default configuration files, and init.d scripts. | |
67 | ||
69fbae1d | 68 | %prep |
69 | %setup -q -n %{name}-src-r%{version} | |
70 | ||
d1b0fd13 ER |
71 | # Fix permissions |
72 | find -type f -executable | xargs chmod a-x | |
73 | ||
69fbae1d | 74 | %build |
d1b0fd13 ER |
75 | %scons \ |
76 | --prefix=$RPM_BUILD_ROOT%{_prefix} \ | |
77 | --sharedclient \ | |
78 | --full all \ | |
79 | --usev8 | |
69fbae1d | 80 | |
69fbae1d | 81 | # XXX really should have shared library here |
82 | ||
83 | %install | |
84 | rm -rf $RPM_BUILD_ROOT | |
d1b0fd13 | 85 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir}/man1} \ |
748739f7 | 86 | $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d,sysconfig} \ |
d1b0fd13 | 87 | $RPM_BUILD_ROOT%{_var}/{lib,log}/mongo |
748739f7 | 88 | |
d1b0fd13 ER |
89 | %scons install \ |
90 | --prefix=$RPM_BUILD_ROOT%{_prefix} \ | |
91 | --sharedclient \ | |
92 | --full \ | |
93 | --usev8 | |
94 | ||
748739f7 ER |
95 | install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/mongod |
96 | cp -a rpm/mongod.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/mongod | |
69fbae1d | 97 | |
748739f7 | 98 | cp -a %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/mongod |
d1b0fd13 | 99 | cp -a rpm/mongod.conf $RPM_BUILD_ROOT%{_sysconfdir}/mongod.conf |
69fbae1d | 100 | |
748739f7 | 101 | cp -a debian/*.1 $RPM_BUILD_ROOT%{_mandir}/man1 |
69fbae1d | 102 | |
748739f7 | 103 | touch $RPM_BUILD_ROOT%{_var}/log/mongo/mongod.log |
69fbae1d | 104 | |
105 | %clean | |
69fbae1d | 106 | rm -rf $RPM_BUILD_ROOT |
107 | ||
108 | %pre server | |
5688efcd | 109 | %groupadd -g 258 -r mongod |
110 | %useradd -u 258 -r -g mongod -d %{_var}/lib/mongo -s /bin/false -c "MongoDB Database Server" mongod | |
69fbae1d | 111 | |
112 | %post server | |
aa21d651 ER |
113 | /sbin/chkconfig --add mongod |
114 | %service mongod restart | |
69fbae1d | 115 | |
116 | %preun server | |
aa21d651 ER |
117 | if [ "$1" = "0" ]; then |
118 | %service -q mongod stop | |
119 | /sbin/chkconfig --del mongod | |
120 | fi | |
69fbae1d | 121 | |
5688efcd | 122 | %postun server |
40ec6826 ER |
123 | if [ "$1" = "0" ]; then |
124 | %userremove mongod | |
125 | %groupremove mongod | |
126 | fi | |
127 | ||
69fbae1d | 128 | %files |
129 | %defattr(644,root,root,755) | |
130 | %doc README GNU-AGPL-3.0.txt | |
131 | %attr(755,root,root) %{_bindir}/mongo | |
132 | %attr(755,root,root) %{_bindir}/mongodump | |
133 | %attr(755,root,root) %{_bindir}/mongoexport | |
134 | %attr(755,root,root) %{_bindir}/mongofiles | |
135 | %attr(755,root,root) %{_bindir}/mongoimport | |
136 | %attr(755,root,root) %{_bindir}/mongorestore | |
137 | %attr(755,root,root) %{_bindir}/mongostat | |
138 | %attr(755,root,root) %{_bindir}/bsondump | |
139 | %{_mandir}/man1/mongo.1* | |
140 | %{_mandir}/man1/mongod.1* | |
141 | %{_mandir}/man1/mongodump.1* | |
142 | %{_mandir}/man1/mongoexport.1* | |
143 | %{_mandir}/man1/mongofiles.1* | |
144 | %{_mandir}/man1/mongoimport.1* | |
145 | %{_mandir}/man1/mongosniff.1* | |
146 | %{_mandir}/man1/mongostat.1* | |
147 | %{_mandir}/man1/mongorestore.1* | |
148 | ||
149 | %files server | |
150 | %defattr(644,root,root,755) | |
748739f7 ER |
151 | %dir %{_sysconfdir} |
152 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mongod.conf | |
153 | %attr(754,root,root) /etc/rc.d/init.d/mongod | |
154 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mongod | |
69fbae1d | 155 | %config(noreplace) /etc/logrotate.d/mongod |
69fbae1d | 156 | %attr(755,root,root) %{_bindir}/mongod |
157 | %attr(755,root,root) %{_bindir}/mongos | |
158 | %{_mandir}/man1/mongos.1* | |
159 | %attr(755,mongod,mongod) %dir %{_var}/lib/mongo | |
160 | %attr(755,mongod,mongod) %dir %{_var}/log/mongo | |
161 | %attr(640,mongod,mongod) %config(noreplace) %verify(not md5 mtime size) %{_var}/log/mongo/mongod.log | |
162 | ||
163 | %files devel | |
164 | %defattr(644,root,root,755) | |
165 | %{_includedir}/mongo | |
166 | %{_libdir}/libmongoclient.a | |
167 | %{_libdir}/libmongoclient.so | |
168 | #%{_libdir}/libmongotestfiles.a |