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