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