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