update to 4.2.4 [release 4.2.4-1mamba;Wed Mar 18 2020]

This commit is contained in:
Silvan Calarco 2024-01-06 07:13:11 +01:00
parent c99746c816
commit b03dd31bf4

View File

@ -5,7 +5,7 @@
%global mongodb_user mongodb
Name: mongodb
Version: 4.0.10
Version: 4.2.4
Release: 1mamba
Summary: A cross-platform, high-performance, schema-free document-oriented database
Group: Applications/Databases
@ -30,12 +30,12 @@ BuildRequires: ldconfig
BuildRequires: libboost-devel
BuildRequires: libcurl-devel
BuildRequires: libgcc
BuildRequires: libgperftools-devel
BuildRequires: libopenssl-devel
BuildRequires: libpcre-devel
BuildRequires: libsasl2-devel
BuildRequires: libsnappy-devel
BuildRequires: libstdc++6-devel
BuildRequires: libstemmer-devel
BuildRequires: libyaml-cpp-devel
BuildRequires: libz-devel
## AUTOBUILDREQ-END
BuildRequires: scons
@ -43,7 +43,9 @@ BuildRequires: gcc-c++
BuildRequires: gcc-go
BuildRequires: libyaml-cpp-devel >= 0.6.2
BuildRequires: valgrind-devel
BuildRequires: python-cheetah
BuildRequires: python-Cheetah3-py3
BuildRequires: python-psutil-py3
BuildRequires: libgperftools-devel
%{?systemd_requires}
BuildRoot: %{_tmppath}/%{name}-%{version}-root
@ -62,38 +64,61 @@ 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.
%debug_package
%prep
%setup -q -n mongo-%{version}
#-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
# GCC 6.1.0 build fix
sed -e 's|-std=c++11|-std=gnu++11|g' -i SConstruct
# 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
%build
# see: https://github.com/mongodb/mongo/wiki/Build-Mongodb-From-Source
# note: MongoDB uses a customized built-in version of tcmalloc to achieve
# significant performance gains. Building with --use-system-tcmalloc
# produces binaries that lack these performance gains.
# note: WiredTiger is not supported on 32-bit platforms
# Re-run scons with --wiredtiger=off to build on 32-bit platforms
#:<< _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
scons core tools \
MONGO_VERSION=%{version} \
%ifnarch x86_64
--wiredtiger=off \
%endif
%{?_smp_mflags} \
--use-system-pcre \
--use-system-snappy \
--use-system-stemmer \
--use-system-boost \
--use-system-valgrind \
--use-system-zlib \
--use-system-yaml \
--ssl \
--disable-warnings-as-errors
# --use-system-snappy
# --use-system-stemmer
--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}
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
@ -102,29 +127,28 @@ scons install \
%ifnarch x86_64
--wiredtiger=off \
%endif
%{?_smp_mflags} \
--use-system-pcre \
--use-system-snappy \
--use-system-stemmer \
--use-system-boost \
--use-system-valgrind \
--use-system-zlib \
--use-system-yaml \
--ssl \
--disable-warnings-as-errors \
--prefix=%{buildroot}%{_prefix}
--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 -p -D -m 644 "%{SOURCE8}" %{buildroot}%{_tmpfilesdir}/mongodb.conf
install -D -m644 rpm/mongod.conf %{buildroot}%{_sysconfdir}/mongod.conf
install -D -m644 rpm/mongod.service %{buildroot}%{_unitdir}/mongod.service
install -p -D -m 644 "%{SOURCE1}" %{buildroot}%{_unitdir}/mongod.service
install -p -D -m 644 "%{SOURCE2}" %{buildroot}%{_sysconfdir}/mongod.conf
install -p -D -m 644 "%{SOURCE3}" %{buildroot}%{_sysconfdir}/sysconfig/mongod
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
#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
install -p -D -m 644 "%{SOURCE7}" %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
install -p -D -m 644 "%{SOURCE8}" %{buildroot}%{_tmpfilesdir}/mongod.conf
install -d %{buildroot}%{_localstatedir}/lib/%{name}
install -d %{buildroot}%{_localstatedir}/log/%{name}
@ -143,42 +167,40 @@ getent group %{mongodb_group} >/dev/null || groupadd -g %{mongodb_gid} %{mongodb
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}
exit 0
:
%post server
%tmpfiles_create mongod.conf
%systemd_post mongod.service
%systemd_post mongos.service
exit 0
#% systemd_post mongos.service
:
%preun server
%systemd_preun mongod.service
%systemd_preun mongos.service
#% systemd_preun mongos.service
if [ $1 -eq 0 ]; then
userdel %{mongodb_user} 2>/dev/null
groupdel %{mongodb_group} 2>/dev/null
fi
exit 0
:
%postun server
%systemd_postun_with_restart mongod.service
%systemd_postun_with_restart mongos.service
exit 0
#% systemd_postun_with_restart mongos.service
:
%files
%defattr(-,root,root)
%{_bindir}/mongo
#%{_bindir}/mongoperf
#%{_bindir}/mongosniff
%{_mandir}/man1/mongo.1*
#%{_mandir}/man1/mongoperf.1*
#%{_mandir}/man1/mongosniff.1*
%files server
%defattr(-,root,root)
%{_bindir}/mongod
%{_bindir}/mongos
%{_unitdir}/*.service
%{_tmpfilesdir}/mongodb.conf
%{_tmpfilesdir}/mongod.conf
%config(noreplace) %{_sysconfdir}/*.conf
%config(noreplace) %{_sysconfdir}/sysconfig/mongo*
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
@ -188,6 +210,9 @@ exit 0
%{_mandir}/man1/mongos.1*
%changelog
* Wed Mar 18 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 4.2.4-1mamba
- update to 4.2.4
* Thu Jul 04 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 4.0.10-1mamba
- update to 4.0.10