2024-01-06 07:13:09 +01:00
|
|
|
%global mongodb_gid 65059
|
|
|
|
%global mongodb_group mongodb
|
|
|
|
|
|
|
|
%global mongodb_uid 65059
|
|
|
|
%global mongodb_user mongodb
|
|
|
|
|
|
|
|
Name: mongodb
|
2024-01-06 07:13:11 +01:00
|
|
|
Version: 4.2.4
|
2024-01-06 07:13:09 +01:00
|
|
|
Release: 1mamba
|
2024-01-06 07:13:09 +01:00
|
|
|
Summary: A cross-platform, high-performance, schema-free document-oriented database
|
|
|
|
Group: Applications/Databases
|
|
|
|
Vendor: openmamba
|
|
|
|
Distribution: openmamba
|
|
|
|
Packager: Davide Madrisan <davide.madrisan@gmail.com>
|
|
|
|
URL: https://www.mongodb.org/
|
2024-01-06 07:13:10 +01:00
|
|
|
Source: https://github.com/mongodb/mongo.git/r%{version}/mongo-%{version}.tar.bz2
|
|
|
|
#Source: http://fastdl.mongodb.org/src/mongodb-src-r%{version}.tar.gz
|
2024-01-06 07:13:09 +01:00
|
|
|
Source1: mongod.service
|
|
|
|
Source2: mongod.conf
|
|
|
|
Source3: mongod.sysconf
|
|
|
|
Source4: mongos.service
|
|
|
|
Source5: mongos.conf
|
|
|
|
Source6: mongos.sysconf
|
|
|
|
Source7: %{name}.logrotate
|
2024-01-06 07:13:10 +01:00
|
|
|
Source8: mongodb-tmpfiles.d
|
2024-01-06 07:13:09 +01:00
|
|
|
License: Affero GNU Public License, Apache License 2.0
|
|
|
|
## AUTOBUILDREQ-BEGIN
|
|
|
|
BuildRequires: glibc-devel
|
2024-01-06 07:13:10 +01:00
|
|
|
BuildRequires: ldconfig
|
2024-01-06 07:13:09 +01:00
|
|
|
BuildRequires: libboost-devel
|
2024-01-06 07:13:10 +01:00
|
|
|
BuildRequires: libcurl-devel
|
2024-01-06 07:13:09 +01:00
|
|
|
BuildRequires: libgcc
|
2024-01-06 07:13:11 +01:00
|
|
|
BuildRequires: libgperftools-devel
|
2024-01-06 07:13:09 +01:00
|
|
|
BuildRequires: libopenssl-devel
|
2024-01-06 07:13:11 +01:00
|
|
|
BuildRequires: libsasl2-devel
|
2024-01-06 07:13:10 +01:00
|
|
|
BuildRequires: libsnappy-devel
|
2024-01-06 07:13:09 +01:00
|
|
|
BuildRequires: libstdc++6-devel
|
2024-01-06 07:13:10 +01:00
|
|
|
BuildRequires: libstemmer-devel
|
2024-01-06 07:13:09 +01:00
|
|
|
BuildRequires: libz-devel
|
|
|
|
## AUTOBUILDREQ-END
|
|
|
|
BuildRequires: scons
|
|
|
|
BuildRequires: gcc-c++
|
|
|
|
BuildRequires: gcc-go
|
2024-01-06 07:13:10 +01:00
|
|
|
BuildRequires: libyaml-cpp-devel >= 0.6.2
|
2024-01-06 07:13:09 +01:00
|
|
|
BuildRequires: valgrind-devel
|
2024-01-06 07:13:11 +01:00
|
|
|
BuildRequires: python-Cheetah3-py3
|
|
|
|
BuildRequires: python-psutil-py3
|
|
|
|
BuildRequires: libgperftools-devel
|
2024-01-06 07:13:09 +01:00
|
|
|
%{?systemd_requires}
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
|
|
|
|
|
|
|
%description
|
|
|
|
MongoDB is an open-source document database that provides high performance, high availability, and automatic scaling.
|
|
|
|
MongoDB obviates the need for an Object Relational Mapping (ORM) to facilitate development.
|
|
|
|
MongoDB stores documents in collections. Collections are analogous to tables in relational databases.
|
|
|
|
Unlike a table, however, a collection does not require its documents to have the same schema.
|
|
|
|
In MongoDB, documents stored in a collection must have a unique _id field that acts as a primary key.
|
|
|
|
|
|
|
|
%package server
|
|
|
|
Group: Applications/Databases
|
|
|
|
Summary: MongoDB server
|
|
|
|
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
|
|
|
|
|
|
|
|
%description server
|
|
|
|
This package provides the mongo server software, mongo sharding server software, default configuration files, and init scripts.
|
|
|
|
|
2024-01-06 07:13:11 +01:00
|
|
|
%debug_package
|
|
|
|
|
2024-01-06 07:13:09 +01:00
|
|
|
%prep
|
2024-01-06 07:13:10 +01:00
|
|
|
%setup -q -n mongo-%{version}
|
2024-01-06 07:13:11 +01:00
|
|
|
#-D -T
|
|
|
|
#:<< _EOF
|
|
|
|
|
|
|
|
# keep historical paths and user
|
|
|
|
sed -i 's|dbPath: /var/lib/mongo|dbPath: /var/lib/mongodb|' rpm/mongod.conf
|
|
|
|
sed -i 's/User=mongod/User=mongodb/' rpm/mongod.service
|
|
|
|
sed -i 's/Group=mongod/Group=mongodb/' rpm/mongod.service
|
|
|
|
sed -i 's|/var/run|/run|' rpm/mongod.service
|
|
|
|
sed -i 's|/usr/bin/mkdir|/bin/mkdir|' rpm/mongod.service
|
|
|
|
sed -i 's|/usr/bin/chmod|/bin/chmod|' rpm/mongod.service
|
|
|
|
sed -i 's|/usr/bin/chown|/bin/chown|' rpm/mongod.service
|
|
|
|
sed -i 's/chown mongod:mongod/chown mongodb:mongodb/' rpm/mongod.service
|
2024-01-06 07:13:09 +01:00
|
|
|
|
2024-01-06 07:13:09 +01:00
|
|
|
# GCC 6.1.0 build fix
|
|
|
|
sed -e 's|-std=c++11|-std=gnu++11|g' -i SConstruct
|
|
|
|
|
2024-01-06 07:13:11 +01:00
|
|
|
# Make systemd wait as long as it takes for MongoDB to start
|
|
|
|
# If MongoDB needs a long time to start, prevent systemd from restarting it every 90 seconds
|
|
|
|
# See: https://jira.mongodb.org/browse/SERVER-38086
|
|
|
|
sed -i 's/\[Service]/[Service]\nTimeoutStartSec=infinity/' rpm/mongod.service
|
|
|
|
|
|
|
|
# Prevent building using debug symbols, since binaries will be stripped anyway
|
|
|
|
# Reduces makepkg -- which fully runs check() -- build size from 259GB to 2.3GB, and time by at least 37%
|
|
|
|
# See: https://jira.mongodb.org/browse/SERVER-44038
|
|
|
|
sed -i '/"-ggdb" if not env.TargetOSIs/d' SConstruct
|
|
|
|
|
2024-01-06 07:13:09 +01:00
|
|
|
%build
|
2024-01-06 07:13:11 +01:00
|
|
|
#:<< _EOF
|
|
|
|
# --use-system-pcre # wait for pcre 8.44+ https://jira.mongodb.org/browse/SERVER-40836 and https://jira.mongodb.org/browse/SERVER-42990
|
|
|
|
# --use-system-yaml # https://jira.mongodb.org/browse/SERVER-43980
|
|
|
|
#--use-system-wiredtiger # https://jira.mongodb.org/browse/SERVER-42813 upstream broke this in 4.2.0, says in meantime not to use it
|
|
|
|
# --use-system-asio # https://jira.mongodb.org/browse/SERVER-21839 marked as fixed, but still doesn't compile. MongoDB uses custom patches.
|
|
|
|
# --use-system-icu # Doesn't compile
|
|
|
|
# --use-system-valgrind # Compiles, but namcap says not used
|
|
|
|
# --use-system-sqlite # "
|
|
|
|
# --use-system-mongo-c # Doesn't compile
|
2024-01-06 07:13:10 +01:00
|
|
|
|
|
|
|
scons core tools \
|
|
|
|
MONGO_VERSION=%{version} \
|
2024-01-06 07:13:09 +01:00
|
|
|
%ifnarch x86_64
|
|
|
|
--wiredtiger=off \
|
|
|
|
%endif
|
2024-01-06 07:13:11 +01:00
|
|
|
--use-system-snappy \
|
|
|
|
--use-system-zlib \
|
|
|
|
--use-system-stemmer \
|
|
|
|
--use-sasl-client \
|
|
|
|
--ssl \
|
|
|
|
--disable-warnings-as-errors \
|
|
|
|
--use-system-tcmalloc \
|
|
|
|
--use-system-boost \
|
|
|
|
%{?_smp_mflags}
|
2024-01-06 07:13:09 +01:00
|
|
|
|
|
|
|
%install
|
|
|
|
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
|
|
|
|
scons install \
|
2024-01-06 07:13:10 +01:00
|
|
|
MONGO_VERSION=%{version} \
|
2024-01-06 07:13:09 +01:00
|
|
|
%ifnarch x86_64
|
|
|
|
--wiredtiger=off \
|
|
|
|
%endif
|
2024-01-06 07:13:11 +01:00
|
|
|
--use-system-snappy \
|
|
|
|
--use-system-zlib \
|
|
|
|
--use-system-stemmer \
|
|
|
|
--use-sasl-client \
|
|
|
|
--ssl \
|
|
|
|
--disable-warnings-as-errors \
|
|
|
|
--use-system-tcmalloc \
|
|
|
|
--use-system-boost \
|
|
|
|
%{?_smp_mflags} \
|
|
|
|
--prefix=%{buildroot}%{_prefix}
|
|
|
|
|
|
|
|
install -D -m644 rpm/mongod.conf %{buildroot}%{_sysconfdir}/mongod.conf
|
|
|
|
install -D -m644 rpm/mongod.service %{buildroot}%{_unitdir}/mongod.service
|
|
|
|
|
2024-01-06 07:13:09 +01:00
|
|
|
install -p -D -m 644 "%{SOURCE3}" %{buildroot}%{_sysconfdir}/sysconfig/mongod
|
|
|
|
|
2024-01-06 07:13:11 +01:00
|
|
|
#install -p -D -m 644 "%{SOURCE4}" %{buildroot}%{_unitdir}/mongos.service
|
|
|
|
#install -p -D -m 644 "%{SOURCE5}" %{buildroot}%{_sysconfdir}/mongos.conf
|
|
|
|
#install -p -D -m 644 "%{SOURCE6}" %{buildroot}%{_sysconfdir}/sysconfig/mongos
|
2024-01-06 07:13:09 +01:00
|
|
|
|
|
|
|
install -p -D -m 644 "%{SOURCE7}" %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
|
2024-01-06 07:13:11 +01:00
|
|
|
install -p -D -m 644 "%{SOURCE8}" %{buildroot}%{_tmpfilesdir}/mongod.conf
|
2024-01-06 07:13:09 +01:00
|
|
|
|
|
|
|
install -d %{buildroot}%{_localstatedir}/lib/%{name}
|
|
|
|
install -d %{buildroot}%{_localstatedir}/log/%{name}
|
|
|
|
|
|
|
|
install -d -m 755 %{buildroot}%{_mandir}/man1
|
2024-01-06 07:13:10 +01:00
|
|
|
install -p -m 644 debian/mongo{,d,s}.1 \
|
2024-01-06 07:13:09 +01:00
|
|
|
%{buildroot}%{_mandir}/man1/
|
|
|
|
|
2024-01-06 07:13:10 +01:00
|
|
|
rm -f %{buildroot}%{_bindir}/install_compass
|
|
|
|
|
2024-01-06 07:13:09 +01:00
|
|
|
%clean
|
|
|
|
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
|
|
|
|
|
|
|
|
%pre server
|
|
|
|
getent group %{mongodb_group} >/dev/null || groupadd -g %{mongodb_gid} %{mongodb_group}
|
|
|
|
getent passwd %{mongodb_user} >/dev/null || useradd -g %{mongodb_gid} -u %{mongodb_uid} \
|
|
|
|
-d %{_localstatedir}/lib/%{name} -s /sbin/nologin \
|
|
|
|
-c "MongoDB Database Server" %{mongodb_user}
|
2024-01-06 07:13:11 +01:00
|
|
|
:
|
2024-01-06 07:13:09 +01:00
|
|
|
|
|
|
|
%post server
|
2024-01-06 07:13:11 +01:00
|
|
|
%tmpfiles_create mongod.conf
|
2024-01-06 07:13:09 +01:00
|
|
|
%systemd_post mongod.service
|
2024-01-06 07:13:11 +01:00
|
|
|
#% systemd_post mongos.service
|
|
|
|
:
|
2024-01-06 07:13:09 +01:00
|
|
|
|
|
|
|
%preun server
|
2024-01-06 07:13:11 +01:00
|
|
|
|
2024-01-06 07:13:09 +01:00
|
|
|
%systemd_preun mongod.service
|
2024-01-06 07:13:11 +01:00
|
|
|
#% systemd_preun mongos.service
|
2024-01-06 07:13:09 +01:00
|
|
|
if [ $1 -eq 0 ]; then
|
|
|
|
userdel %{mongodb_user} 2>/dev/null
|
|
|
|
groupdel %{mongodb_group} 2>/dev/null
|
|
|
|
fi
|
2024-01-06 07:13:11 +01:00
|
|
|
:
|
2024-01-06 07:13:09 +01:00
|
|
|
|
|
|
|
%postun server
|
|
|
|
%systemd_postun_with_restart mongod.service
|
2024-01-06 07:13:11 +01:00
|
|
|
#% systemd_postun_with_restart mongos.service
|
|
|
|
:
|
2024-01-06 07:13:09 +01:00
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%{_bindir}/mongo
|
|
|
|
%{_mandir}/man1/mongo.1*
|
|
|
|
|
|
|
|
%files server
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%{_bindir}/mongod
|
|
|
|
%{_bindir}/mongos
|
|
|
|
%{_unitdir}/*.service
|
2024-01-06 07:13:11 +01:00
|
|
|
%{_tmpfilesdir}/mongod.conf
|
2024-01-06 07:13:09 +01:00
|
|
|
%config(noreplace) %{_sysconfdir}/*.conf
|
|
|
|
%config(noreplace) %{_sysconfdir}/sysconfig/mongo*
|
|
|
|
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
|
|
|
|
%dir %attr(0755, %{mongodb_user}, root) %{_localstatedir}/lib/%{name}
|
|
|
|
%dir %attr(0755, %{mongodb_user}, root) %{_localstatedir}/log/%{name}
|
|
|
|
%{_mandir}/man1/mongod.1*
|
|
|
|
%{_mandir}/man1/mongos.1*
|
|
|
|
|
|
|
|
%changelog
|
2024-01-06 07:13:11 +01:00
|
|
|
* Wed Mar 18 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 4.2.4-1mamba
|
|
|
|
- update to 4.2.4
|
|
|
|
|
2024-01-06 07:13:10 +01:00
|
|
|
* Thu Jul 04 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 4.0.10-1mamba
|
|
|
|
- update to 4.0.10
|
2024-01-06 07:13:09 +01:00
|
|
|
|
2024-01-06 07:13:10 +01:00
|
|
|
* Thu Jul 04 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 3.2.22-1mamba
|
|
|
|
- update to 3.2.22
|
|
|
|
- rebuilt with libyaml-cpp 0.6.2
|
2024-01-06 07:13:09 +01:00
|
|
|
|
2024-01-06 07:13:09 +01:00
|
|
|
* Mon Oct 31 2016 Automatic Build System <autodist@mambasoft.it> 3.2.10-1mamba
|
|
|
|
- automatic version update by autodist
|
|
|
|
|
2024-01-06 07:13:09 +01:00
|
|
|
* Sat Aug 20 2016 Automatic Build System <autodist@mambasoft.it> 3.2.9-1mamba
|
|
|
|
- automatic version update by autodist
|
|
|
|
|
2024-01-06 07:13:09 +01:00
|
|
|
* Thu Jul 28 2016 Automatic Build System <autodist@mambasoft.it> 3.2.8-1mamba
|
|
|
|
- automatic version update by autodist
|
|
|
|
|
2024-01-06 07:13:09 +01:00
|
|
|
* Mon Jul 25 2016 Automatic Build System <autodist@mambasoft.it> 3.2.7-1mamba
|
|
|
|
- automatic version update by autodist
|
|
|
|
|
2024-01-06 07:13:09 +01:00
|
|
|
* Mon May 02 2016 Automatic Build System <autodist@mambasoft.it> 3.2.6-1mamba
|
|
|
|
- automatic version update by autodist
|
|
|
|
|
2024-01-06 07:13:09 +01:00
|
|
|
* Sat Apr 30 2016 Automatic Build System <autodist@mambasoft.it> 3.2.5-1mamba
|
|
|
|
- automatic version update by autodist
|
|
|
|
|
2024-01-06 07:13:10 +01:00
|
|
|
* Sat Feb 27 2016 Davide Madrisan <davide.madrisan@gmail.com> 3.2.3-2mamba
|
|
|
|
- update the installation scripts and systemd configuration files
|