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