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