diff options
author | Ryan Egesdahl <ryan.egesdahl@mongodb.com> | 2020-11-11 23:04:58 -0800 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-03-05 08:14:04 +0000 |
commit | 2495a8fa87c215da70c3361beef11d52ce5be1c0 (patch) | |
tree | 1e162d2a9a4bb49b2c35a2ae61590d0f62b1f6d0 /rpm | |
parent | a92f7c91d5cca7eee12108de705291ef564894a8 (diff) | |
download | mongo-2495a8fa87c215da70c3361beef11d52ce5be1c0.tar.gz |
SERVER-52610 Ensure RPM install roots can be relocated
We were not using directory macros in the RPMs, which meant that the
installation root could not be changed. When we tried, we got an
incomplete install, with some of it going to the new prefix and some
going to the host system. Here, we follow RPM packaging guidelines a bit
better and use named directory macros instead of explicit paths.
(cherry picked from commit 9aba0cac770d87d36cf0f0d19a1be06e73312221)
(cherry picked from commit 6670cb159540b07b8a39fe4c072c24ff7a0130f0)
Diffstat (limited to 'rpm')
-rw-r--r-- | rpm/mongodb-enterprise-init.spec | 60 | ||||
-rw-r--r-- | rpm/mongodb-enterprise-unstable-init.spec | 60 | ||||
-rw-r--r-- | rpm/mongodb-enterprise-unstable.spec | 58 | ||||
-rw-r--r-- | rpm/mongodb-enterprise.spec | 60 | ||||
-rw-r--r-- | rpm/mongodb-org-init.spec | 60 | ||||
-rw-r--r-- | rpm/mongodb-org-unstable-init.spec | 60 | ||||
-rw-r--r-- | rpm/mongodb-org-unstable.spec | 61 | ||||
-rw-r--r-- | rpm/mongodb-org.spec | 52 |
8 files changed, 308 insertions, 163 deletions
diff --git a/rpm/mongodb-enterprise-init.spec b/rpm/mongodb-enterprise-init.spec index 47caf3fb2e6..a0affbe980a 100644 --- a/rpm/mongodb-enterprise-init.spec +++ b/rpm/mongodb-enterprise-init.spec @@ -1,5 +1,11 @@ +%if ! %{defined _rundir} +%define _rundir %{_localstatedir}/run +%endif + Name: mongodb-enterprise Prefix: /usr +Prefix: /var +Prefix: /etc Conflicts: mongo-10gen, mongo-10gen-server, mongo-10gen-unstable, mongo-10gen-unstable-enterprise, mongo-10gen-unstable-enterprise-mongos, mongo-10gen-unstable-enterprise-server, mongo-10gen-unstable-enterprise-shell, mongo-10gen-unstable-enterprise-tools, mongo-10gen-unstable-mongos, mongo-10gen-unstable-server, mongo-10gen-unstable-shell, mongo-10gen-unstable-tools, mongo18-10gen, mongo18-10gen-server, mongo20-10gen, mongo20-10gen-server, mongodb, mongodb-server, mongodb-dev, mongodb-clients, mongodb-10gen, mongodb-10gen-enterprise, mongodb-10gen-unstable, mongodb-10gen-unstable-enterprise, mongodb-10gen-unstable-enterprise-mongos, mongodb-10gen-unstable-enterprise-server, mongodb-10gen-unstable-enterprise-shell, mongodb-10gen-unstable-enterprise-tools, mongodb-10gen-unstable-mongos, mongodb-10gen-unstable-server, mongodb-10gen-unstable-shell, mongodb-10gen-unstable-tools, mongodb-enterprise-unstable, mongodb-enterprise-unstable-mongos, mongodb-enterprise-unstable-server, mongodb-enterprise-unstable-shell, mongodb-enterprise-unstable-tools, mongodb-enterprise-unstable-cryptd, mongodb-nightly, mongodb-org, mongodb-org-mongos, mongodb-org-server, mongodb-org-shell, mongodb-org-tools, mongodb-stable, mongodb18-10gen, mongodb20-10gen, mongodb-org-unstable, mongodb-org-unstable-mongos, mongodb-org-unstable-server, mongodb-org-unstable-shell, mongodb-org-unstable-tools Obsoletes: mongodb-enterprise-unstable, mongo-enterprise-unstable, mongo-10gen-enterprise Provides: mongo-10gen-enterprise @@ -11,6 +17,10 @@ URL: http://www.mongodb.org Group: Applications/Databases Requires: mongodb-enterprise-server = %{version}, mongodb-enterprise-shell = %{version}, mongodb-enterprise-mongos = %{version}, mongodb-enterprise-tools = %{version}, mongodb-enterprise-cryptd = %{version} +%if 0%{?rhel} >= 8 || 0%{?fedora} >= 30 +BuildRequires: /usr/bin/pathfix.py, python3-devel +%endif + Source0: %{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root @@ -191,27 +201,33 @@ MongoDB features: This package provides the MongoDB static library and header files needed to develop MongoDB client software. +#Release builds have no debug symbols, and this prevents packaging errors on RHEL 8.0 +%global debug_package %{nil} + %prep %setup +%if 0%{?rhel} >= 8 || 0%{?fedora} >= 30 +pathfix.py -pni "%{__python3} %{py3_shbang_opts}" bin/install_compass +%endif %build %install -mkdir -p $RPM_BUILD_ROOT/usr -cp -rv bin $RPM_BUILD_ROOT/usr -mkdir -p $RPM_BUILD_ROOT/usr/share/man/man1 -cp debian/*.1 $RPM_BUILD_ROOT/usr/share/man/man1/ -mkdir -p $RPM_BUILD_ROOT/etc/init.d -cp -v rpm/init.d-mongod $RPM_BUILD_ROOT/etc/init.d/mongod -chmod a+x $RPM_BUILD_ROOT/etc/init.d/mongod -mkdir -p $RPM_BUILD_ROOT/etc -cp -v rpm/mongod.conf $RPM_BUILD_ROOT/etc/mongod.conf -mkdir -p $RPM_BUILD_ROOT/etc/sysconfig -cp -v rpm/mongod.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/mongod -mkdir -p $RPM_BUILD_ROOT/var/lib/mongo -mkdir -p $RPM_BUILD_ROOT/var/log/mongodb -mkdir -p $RPM_BUILD_ROOT/var/run/mongodb -touch $RPM_BUILD_ROOT/var/log/mongodb/mongod.log +mkdir -p $RPM_BUILD_ROOT%{_prefix} +cp -rv bin $RPM_BUILD_ROOT%{_prefix} +mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1 +cp debian/*.1 $RPM_BUILD_ROOT%{_mandir}/man1/ +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/init.d +cp -v rpm/init.d-mongod $RPM_BUILD_ROOT%{_sysconfdir}/init.d/mongod +chmod a+x $RPM_BUILD_ROOT%{_sysconfdir}/init.d/mongod +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir} +cp -v rpm/mongod.conf $RPM_BUILD_ROOT%{_sysconfdir}/mongod.conf +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig +cp -v rpm/mongod.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/mongod +mkdir -p $RPM_BUILD_ROOT%{_sharedstatedir}/mongo +mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/mongodb +mkdir -p $RPM_BUILD_ROOT%{_rundir}/mongodb +touch $RPM_BUILD_ROOT%{_localstatedir}/log/mongodb/mongod.log %clean rm -rf $RPM_BUILD_ROOT @@ -246,15 +262,15 @@ fi %files server %defattr(-,root,root,-) -%config(noreplace) /etc/mongod.conf +%config(noreplace) %{_sysconfdir}/mongod.conf %{_bindir}/mongod %{_mandir}/man1/mongod.1* -/etc/init.d/mongod -%config(noreplace) /etc/sysconfig/mongod -%attr(0755,mongod,mongod) %dir /var/lib/mongo -%attr(0755,mongod,mongod) %dir /var/log/mongodb -%attr(0755,mongod,mongod) %dir /var/run/mongodb -%attr(0640,mongod,mongod) %config(noreplace) %verify(not md5 size mtime) /var/log/mongodb/mongod.log +%{_sysconfdir}/init.d/mongod +%config(noreplace) %{_sysconfdir}/sysconfig/mongod +%attr(0755,mongod,mongod) %dir %{_sharedstatedir}/mongo +%attr(0755,mongod,mongod) %dir %{_localstatedir}/log/mongodb +%attr(0755,mongod,mongod) %dir %{_rundir}/mongodb +%attr(0640,mongod,mongod) %config(noreplace) %verify(not md5 size mtime) %{_localstatedir}/log/mongodb/mongod.log %doc snmp/MONGOD-MIB.txt %doc snmp/MONGODBINC-MIB.txt %doc snmp/mongod.conf.master diff --git a/rpm/mongodb-enterprise-unstable-init.spec b/rpm/mongodb-enterprise-unstable-init.spec index 6f7daaf9c39..6be459a7a83 100644 --- a/rpm/mongodb-enterprise-unstable-init.spec +++ b/rpm/mongodb-enterprise-unstable-init.spec @@ -1,5 +1,11 @@ +%if ! %{defined _rundir} +%define _rundir %{_localstatedir}/run +%endif + Name: mongodb-enterprise-unstable Prefix: /usr +Prefix: /var +Prefix: /etc Conflicts: mongo-10gen, mongo-10gen-enterprise, mongo-10gen-enterprise-server, mongo-10gen-server, mongo-10gen-unstable, mongo-10gen-unstable-enterprise, mongo-10gen-unstable-enterprise-mongos, mongo-10gen-unstable-enterprise-server, mongo-10gen-unstable-enterprise-shell, mongo-10gen-unstable-enterprise-tools, mongo-10gen-unstable-mongos, mongo-10gen-unstable-server, mongo-10gen-unstable-shell, mongo-10gen-unstable-tools, mongo18-10gen, mongo18-10gen-server, mongo20-10gen, mongo20-10gen-server, mongodb, mongodb-server, mongodb-dev, mongodb-clients, mongodb-10gen, mongodb-10gen-enterprise, mongodb-10gen-unstable, mongodb-10gen-unstable-enterprise, mongodb-10gen-unstable-enterprise-mongos, mongodb-10gen-unstable-enterprise-server, mongodb-10gen-unstable-enterprise-shell, mongodb-10gen-unstable-enterprise-tools, mongodb-10gen-unstable-mongos, mongodb-10gen-unstable-server, mongodb-10gen-unstable-shell, mongodb-10gen-unstable-tools, mongodb-enterprise, mongodb-enterprise-mongos, mongodb-enterprise-server, mongodb-enterprise-shell, mongodb-enterprise-tools, mongodb-enterprise-cryptd, mongodb-nightly, mongodb-org, mongodb-org-mongos, mongodb-org-server, mongodb-org-shell, mongodb-org-tools, mongodb-stable, mongodb18-10gen, mongodb20-10gen, mongodb-org-unstable, mongodb-org-unstable-mongos, mongodb-org-unstable-server, mongodb-org-unstable-shell, mongodb-org-unstable-tools Obsoletes: mongodb-enterprise-unstable,mongo-enterprise-unstable Version: %{dynamic_version} @@ -10,6 +16,10 @@ URL: http://www.mongodb.org Group: Applications/Databases Requires: mongodb-enterprise-unstable-server = %{version}, mongodb-enterprise-unstable-shell = %{version}, mongodb-enterprise-unstable-mongos = %{version}, mongodb-enterprise-unstable-tools = %{version}, mongodb-enterprise-unstable-cryptd = %{version} +%if 0%{?rhel} >= 8 || 0%{?fedora} >= 30 +BuildRequires: /usr/bin/pathfix.py, python3-devel +%endif + Source0: %{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root @@ -180,27 +190,33 @@ MongoDB features: This package provides the MongoDB static library and header files needed to develop MongoDB client software. +#Release builds have no debug symbols, and this prevents packaging errors on RHEL 8.0 +%global debug_package %{nil} + %prep %setup +%if 0%{?rhel} >= 8 || 0%{?fedora} >= 30 +pathfix.py -pni "%{__python3} %{py3_shbang_opts}" bin/install_compass +%endif %build %install -mkdir -p $RPM_BUILD_ROOT/usr -cp -rv bin $RPM_BUILD_ROOT/usr -mkdir -p $RPM_BUILD_ROOT/usr/share/man/man1 -cp debian/*.1 $RPM_BUILD_ROOT/usr/share/man/man1/ -mkdir -p $RPM_BUILD_ROOT/etc/init.d -cp -v rpm/init.d-mongod $RPM_BUILD_ROOT/etc/init.d/mongod -chmod a+x $RPM_BUILD_ROOT/etc/init.d/mongod -mkdir -p $RPM_BUILD_ROOT/etc -cp -v rpm/mongod.conf $RPM_BUILD_ROOT/etc/mongod.conf -mkdir -p $RPM_BUILD_ROOT/etc/sysconfig -cp -v rpm/mongod.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/mongod -mkdir -p $RPM_BUILD_ROOT/var/lib/mongo -mkdir -p $RPM_BUILD_ROOT/var/log/mongodb -mkdir -p $RPM_BUILD_ROOT/var/run/mongodb -touch $RPM_BUILD_ROOT/var/log/mongodb/mongod.log +mkdir -p $RPM_BUILD_ROOT%{_prefix} +cp -rv bin $RPM_BUILD_ROOT%{_prefix} +mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1 +cp debian/*.1 $RPM_BUILD_ROOT%{_mandir}/man1/ +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/init.d +cp -v rpm/init.d-mongod $RPM_BUILD_ROOT%{_sysconfdir}/init.d/mongod +chmod a+x $RPM_BUILD_ROOT%{_sysconfdir}/init.d/mongod +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir} +cp -v rpm/mongod.conf $RPM_BUILD_ROOT%{_sysconfdir}/mongod.conf +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig +cp -v rpm/mongod.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/mongod +mkdir -p $RPM_BUILD_ROOT%{_sharedstatedir}/mongo +mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/mongodb +mkdir -p $RPM_BUILD_ROOT%{_rundir}/mongodb +touch $RPM_BUILD_ROOT%{_localstatedir}/log/mongodb/mongod.log @@ -237,15 +253,15 @@ fi %files server %defattr(-,root,root,-) -%config(noreplace) /etc/mongod.conf +%config(noreplace) %{_sysconfdir}/mongod.conf %{_bindir}/mongod %{_mandir}/man1/mongod.1* -/etc/init.d/mongod -%config(noreplace) /etc/sysconfig/mongod -%attr(0755,mongod,mongod) %dir /var/lib/mongo -%attr(0755,mongod,mongod) %dir /var/log/mongodb -%attr(0755,mongod,mongod) %dir /var/run/mongodb -%attr(0640,mongod,mongod) %config(noreplace) %verify(not md5 size mtime) /var/log/mongodb/mongod.log +%{_sysconfdir}/init.d/mongod +%config(noreplace) %{_sysconfdir}/sysconfig/mongod +%attr(0755,mongod,mongod) %dir %{_sharedstatedir}/mongo +%attr(0755,mongod,mongod) %dir %{_localstatedir}/log/mongodb +%attr(0755,mongod,mongod) %dir %{_rundir}/mongodb +%attr(0640,mongod,mongod) %config(noreplace) %verify(not md5 size mtime) %{_localstatedir}/log/mongodb/mongod.log %doc snmp/MONGOD-MIB.txt %doc snmp/MONGODBINC-MIB.txt %doc snmp/mongod.conf.master diff --git a/rpm/mongodb-enterprise-unstable.spec b/rpm/mongodb-enterprise-unstable.spec index db7d77fa7b3..041d7cf7ddd 100644 --- a/rpm/mongodb-enterprise-unstable.spec +++ b/rpm/mongodb-enterprise-unstable.spec @@ -1,5 +1,11 @@ +%if ! %{defined _rundir} +%define _rundir %{_localstatedir}/run +%endif + Name: mongodb-enterprise-unstable Prefix: /usr +Prefix: /var +Prefix: /etc Conflicts: mongo-10gen, mongo-10gen-enterprise, mongo-10gen-enterprise-server, mongo-10gen-server, mongo-10gen-unstable, mongo-10gen-unstable-enterprise, mongo-10gen-unstable-enterprise-mongos, mongo-10gen-unstable-enterprise-server, mongo-10gen-unstable-enterprise-shell, mongo-10gen-unstable-enterprise-tools, mongo-10gen-unstable-mongos, mongo-10gen-unstable-server, mongo-10gen-unstable-shell, mongo-10gen-unstable-tools, mongo18-10gen, mongo18-10gen-server, mongo20-10gen, mongo20-10gen-server, mongodb, mongodb-server, mongodb-dev, mongodb-clients, mongodb-10gen, mongodb-10gen-enterprise, mongodb-10gen-unstable, mongodb-10gen-unstable-enterprise, mongodb-10gen-unstable-enterprise-mongos, mongodb-10gen-unstable-enterprise-server, mongodb-10gen-unstable-enterprise-shell, mongodb-10gen-unstable-enterprise-tools, mongodb-10gen-unstable-mongos, mongodb-10gen-unstable-server, mongodb-10gen-unstable-shell, mongodb-10gen-unstable-tools, mongodb-enterprise, mongodb-enterprise-mongos, mongodb-enterprise-server, mongodb-enterprise-shell, mongodb-enterprise-tools, mongodb-enterprise-cryptd, mongodb-nightly, mongodb-org, mongodb-org-mongos, mongodb-org-server, mongodb-org-shell, mongodb-org-tools, mongodb-stable, mongodb18-10gen, mongodb20-10gen, mongodb-org-unstable, mongodb-org-unstable-mongos, mongodb-org-unstable-server, mongodb-org-unstable-shell, mongodb-org-unstable-tools Obsoletes: mongodb-enterprise-unstable,mongo-enterprise-unstable Version: %{dynamic_version} @@ -10,6 +16,10 @@ URL: http://www.mongodb.org Group: Applications/Databases Requires: mongodb-enterprise-unstable-server = %{version}, mongodb-enterprise-unstable-shell = %{version}, mongodb-enterprise-unstable-mongos = %{version}, mongodb-enterprise-unstable-tools = %{version}, mongodb-enterprise-unstable-cryptd = %{version} +%if 0%{?rhel} >= 8 || 0%{?fedora} >= 30 +BuildRequires: /usr/bin/pathfix.py, python3-devel +%endif + Source0: %{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root @@ -44,7 +54,13 @@ Summary: MongoDB database server (enterprise) Group: Applications/Databases Requires: openssl, net-snmp, cyrus-sasl, cyrus-sasl-plain, cyrus-sasl-gssapi, %{timezone_pkg}, %{python_pkg} Conflicts: mongo-10gen, mongo-10gen-enterprise, mongo-10gen-enterprise-server, mongo-10gen-server, mongo-10gen-unstable, mongo-10gen-unstable-enterprise, mongo-10gen-unstable-enterprise-mongos, mongo-10gen-unstable-enterprise-server, mongo-10gen-unstable-enterprise-shell, mongo-10gen-unstable-enterprise-tools, mongo-10gen-unstable-mongos, mongo-10gen-unstable-server, mongo-10gen-unstable-shell, mongo-10gen-unstable-tools, mongo18-10gen, mongo18-10gen-server, mongo20-10gen, mongo20-10gen-server, mongodb, mongodb-server, mongodb-dev, mongodb-clients, mongodb-10gen, mongodb-10gen-enterprise, mongodb-10gen-unstable, mongodb-10gen-unstable-enterprise, mongodb-10gen-unstable-enterprise-mongos, mongodb-10gen-unstable-enterprise-server, mongodb-10gen-unstable-enterprise-shell, mongodb-10gen-unstable-enterprise-tools, mongodb-10gen-unstable-mongos, mongodb-10gen-unstable-server, mongodb-10gen-unstable-shell, mongodb-10gen-unstable-tools, mongodb-enterprise, mongodb-enterprise-mongos, mongodb-enterprise-server, mongodb-enterprise-shell, mongodb-enterprise-tools, mongodb-nightly, mongodb-org, mongodb-org-mongos, mongodb-org-server, mongodb-org-shell, mongodb-org-tools, mongodb-stable, mongodb18-10gen, mongodb20-10gen, mongodb-org-unstable, mongodb-org-unstable-mongos, mongodb-org-unstable-server, mongodb-org-unstable-shell, mongodb-org-unstable-tools + +%if 0%{?suse_version} >= 1210 || 0%{?rhel} >= 700 || 0%{?fedora} >= 15 +BuildRequires: systemd-rpm-macros +%else BuildRequires: systemd +%{?systemd_requires} +%endif %description server MongoDB is built for scalability, performance and high availability, scaling from single server deployments to large, complex multi-site architectures. By leveraging in-memory computing, MongoDB provides high performance for both reads and writes. MongoDB’s native replication and automated failover enable enterprise-grade reliability and operational flexibility. @@ -183,24 +199,30 @@ MongoDB features: This package provides the MongoDB static library and header files needed to develop MongoDB client software. +#Release builds have no debug symbols, and this prevents packaging errors on RHEL 8.0 +%global debug_package %{nil} + %prep %setup +%if 0%{?rhel} >= 8 || 0%{?fedora} >= 30 +pathfix.py -pni "%{__python3} %{py3_shbang_opts}" bin/install_compass +%endif %build %install -mkdir -p $RPM_BUILD_ROOT/usr -cp -rv bin $RPM_BUILD_ROOT/usr -mkdir -p $RPM_BUILD_ROOT/usr/share/man/man1 -cp debian/*.1 $RPM_BUILD_ROOT/usr/share/man/man1/ -mkdir -p $RPM_BUILD_ROOT/etc -cp -v rpm/mongod.conf $RPM_BUILD_ROOT/etc/mongod.conf -mkdir -p $RPM_BUILD_ROOT/lib/systemd/system -cp -v rpm/mongod.service $RPM_BUILD_ROOT/lib/systemd/system -mkdir -p $RPM_BUILD_ROOT/var/lib/mongo -mkdir -p $RPM_BUILD_ROOT/var/log/mongodb -mkdir -p $RPM_BUILD_ROOT/var/run/mongodb -touch $RPM_BUILD_ROOT/var/log/mongodb/mongod.log +mkdir -p $RPM_BUILD_ROOT%{_prefix} +cp -rv bin $RPM_BUILD_ROOT%{_prefix} +mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1 +cp debian/*.1 $RPM_BUILD_ROOT%{_mandir}/man1/ +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir} +cp -v rpm/mongod.conf $RPM_BUILD_ROOT%{_sysconfdir}/mongod.conf +mkdir -p $RPM_BUILD_ROOT%{_unitdir} +cp -v rpm/mongod.service $RPM_BUILD_ROOT%{_unitdir} +mkdir -p $RPM_BUILD_ROOT%{_sharedstatedir}/mongo +mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/mongodb +mkdir -p $RPM_BUILD_ROOT%{_rundir}/mongodb +touch $RPM_BUILD_ROOT%{_localstatedir}/log/mongodb/mongod.log @@ -242,14 +264,14 @@ fi %files server %defattr(-,root,root,-) -%config(noreplace) /etc/mongod.conf +%config(noreplace) %{_sysconfdir}/mongod.conf %{_bindir}/mongod %{_mandir}/man1/mongod.1* -/lib/systemd/system/mongod.service -%attr(0755,mongod,mongod) %dir /var/lib/mongo -%attr(0755,mongod,mongod) %dir /var/log/mongodb -%attr(0755,mongod,mongod) %dir /var/run/mongodb -%attr(0640,mongod,mongod) %config(noreplace) %verify(not md5 size mtime) /var/log/mongodb/mongod.log +%{_unitdir}/mongod.service +%attr(0755,mongod,mongod) %dir %{_sharedstatedir}/mongo +%attr(0755,mongod,mongod) %dir %{_localstatedir}/log/mongodb +%attr(0755,mongod,mongod) %dir %{_rundir}/mongodb +%attr(0640,mongod,mongod) %config(noreplace) %verify(not md5 size mtime) %{_localstatedir}/log/mongodb/mongod.log %doc snmp/MONGOD-MIB.txt %doc snmp/MONGODBINC-MIB.txt %doc snmp/mongod.conf.master diff --git a/rpm/mongodb-enterprise.spec b/rpm/mongodb-enterprise.spec index 7bebe78353b..42a7ecbd8be 100644 --- a/rpm/mongodb-enterprise.spec +++ b/rpm/mongodb-enterprise.spec @@ -1,5 +1,11 @@ +%if ! %{defined _rundir} +%define _rundir %{_localstatedir}/run +%endif + Name: mongodb-enterprise Prefix: /usr +Prefix: /var +Prefix: /etc Conflicts: mongo-10gen, mongo-10gen-server, mongo-10gen-unstable, mongo-10gen-unstable-enterprise, mongo-10gen-unstable-enterprise-mongos, mongo-10gen-unstable-enterprise-server, mongo-10gen-unstable-enterprise-shell, mongo-10gen-unstable-enterprise-tools, mongo-10gen-unstable-mongos, mongo-10gen-unstable-server, mongo-10gen-unstable-shell, mongo-10gen-unstable-tools, mongo18-10gen, mongo18-10gen-server, mongo20-10gen, mongo20-10gen-server, mongodb, mongodb-server, mongodb-dev, mongodb-clients, mongodb-10gen, mongodb-10gen-enterprise, mongodb-10gen-unstable, mongodb-10gen-unstable-enterprise, mongodb-10gen-unstable-enterprise-mongos, mongodb-10gen-unstable-enterprise-server, mongodb-10gen-unstable-enterprise-shell, mongodb-10gen-unstable-enterprise-tools, mongodb-10gen-unstable-mongos, mongodb-10gen-unstable-server, mongodb-10gen-unstable-shell, mongodb-10gen-unstable-tools, mongodb-enterprise-unstable, mongodb-enterprise-unstable-mongos, mongodb-enterprise-unstable-server, mongodb-enterprise-unstable-shell, mongodb-enterprise-unstable-tools, mongodb-enterprise-unstable-cryptd, mongodb-nightly, mongodb-org, mongodb-org-mongos, mongodb-org-server, mongodb-org-shell, mongodb-org-tools, mongodb-stable, mongodb18-10gen, mongodb20-10gen, mongodb-org-unstable, mongodb-org-unstable-mongos, mongodb-org-unstable-server, mongodb-org-unstable-shell, mongodb-org-unstable-tools Obsoletes: mongodb-enterprise-unstable, mongo-enterprise-unstable, mongo-10gen-enterprise Provides: mongo-10gen-enterprise @@ -11,6 +17,10 @@ URL: http://www.mongodb.org Group: Applications/Databases Requires: mongodb-enterprise-server = %{version}, mongodb-enterprise-shell = %{version}, mongodb-enterprise-mongos = %{version}, mongodb-enterprise-tools = %{version}, mongodb-enterprise-cryptd = %{version} +%if 0%{?rhel} >= 8 || 0%{?fedora} >= 30 +BuildRequires: /usr/bin/pathfix.py, python3-devel +%endif + Source0: %{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root @@ -48,6 +58,13 @@ Conflicts: mongo-10gen, mongo-10gen-server, mongo-10gen-unstable, mongo-10gen-un Obsoletes: mongo-10gen-enterprise-server Provides: mongo-10gen-enterprise-server +%if 0%{?suse_version} >= 1210 || 0%{?rhel} >= 700 || 0%{?fedora} >= 15 +BuildRequires: systemd-rpm-macros +%else +BuildRequires: systemd +%{?systemd_requires} +%endif + %description server MongoDB is built for scalability, performance and high availability, scaling from single server deployments to large, complex multi-site architectures. By leveraging in-memory computing, MongoDB provides high performance for both reads and writes. MongoDB’s native replication and automated failover enable enterprise-grade reliability and operational flexibility. @@ -193,25 +210,30 @@ MongoDB features: This package provides the MongoDB static library and header files needed to develop MongoDB client software. +#Release builds have no debug symbols, and this prevents packaging errors on RHEL 8.0 +%global debug_package %{nil} + %prep %setup +%if 0%{?rhel} >= 8 || 0%{?fedora} >= 30 +pathfix.py -pni "%{__python3} %{py3_shbang_opts}" bin/install_compass +%endif %build %install -mkdir -p $RPM_BUILD_ROOT/usr -cp -rv bin $RPM_BUILD_ROOT/usr -mkdir -p $RPM_BUILD_ROOT/usr/share/man/man1 -cp debian/*.1 $RPM_BUILD_ROOT/usr/share/man/man1/ -mkdir -p $RPM_BUILD_ROOT/etc -cp -v rpm/mongod.conf $RPM_BUILD_ROOT/etc/mongod.conf -mkdir -p $RPM_BUILD_ROOT/lib/systemd/system -cp -v rpm/mongod.service $RPM_BUILD_ROOT/lib/systemd/system -mkdir -p $RPM_BUILD_ROOT/var/lib/mongo -mkdir -p $RPM_BUILD_ROOT/var/log/mongodb -mkdir -p $RPM_BUILD_ROOT/var/run/mongodb -touch $RPM_BUILD_ROOT/var/log/mongodb/mongod.log - +mkdir -p $RPM_BUILD_ROOT%{_prefix} +cp -rv bin $RPM_BUILD_ROOT%{_prefix} +mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1 +cp debian/*.1 $RPM_BUILD_ROOT%{_mandir}/man1/ +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir} +cp -v rpm/mongod.conf $RPM_BUILD_ROOT%{_sysconfdir}/mongod.conf +mkdir -p $RPM_BUILD_ROOT%{_unitdir} +cp -v rpm/mongod.service $RPM_BUILD_ROOT%{_unitdir} +mkdir -p $RPM_BUILD_ROOT%{_sharedstatedir}/mongo +mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/mongodb +mkdir -p $RPM_BUILD_ROOT%{_rundir}/mongodb +touch $RPM_BUILD_ROOT%{_localstatedir}/log/mongodb/mongod.log %clean rm -rf $RPM_BUILD_ROOT @@ -249,14 +271,14 @@ fi %files server %defattr(-,root,root,-) -%config(noreplace) /etc/mongod.conf +%config(noreplace) %{_sysconfdir}/mongod.conf %{_bindir}/mongod %{_mandir}/man1/mongod.1* -/lib/systemd/system/mongod.service -%attr(0755,mongod,mongod) %dir /var/lib/mongo -%attr(0755,mongod,mongod) %dir /var/log/mongodb -%attr(0755,mongod,mongod) %dir /var/run/mongodb -%attr(0640,mongod,mongod) %config(noreplace) %verify(not md5 size mtime) /var/log/mongodb/mongod.log +%{_unitdir}/mongod.service +%attr(0755,mongod,mongod) %dir %{_sharedstatedir}/mongo +%attr(0755,mongod,mongod) %dir %{_localstatedir}/log/mongodb +%attr(0755,mongod,mongod) %dir %{_rundir}/mongodb +%attr(0640,mongod,mongod) %config(noreplace) %verify(not md5 size mtime) %{_localstatedir}/log/mongodb/mongod.log %doc snmp/MONGOD-MIB.txt %doc snmp/MONGODBINC-MIB.txt %doc snmp/mongod.conf.master diff --git a/rpm/mongodb-org-init.spec b/rpm/mongodb-org-init.spec index 792123388c1..47ddaab1ca3 100644 --- a/rpm/mongodb-org-init.spec +++ b/rpm/mongodb-org-init.spec @@ -1,5 +1,11 @@ +%if ! %{defined _rundir} +%define _rundir %{_localstatedir}/run +%endif + Name: mongodb-org Prefix: /usr +Prefix: /var +Prefix: /etc Conflicts: mongo-10gen-enterprise, mongo-10gen-enterprise-server, mongo-10gen-unstable, mongo-10gen-unstable-enterprise, mongo-10gen-unstable-enterprise-mongos, mongo-10gen-unstable-enterprise-server, mongo-10gen-unstable-enterprise-shell, mongo-10gen-unstable-enterprise-tools, mongo-10gen-unstable-mongos, mongo-10gen-unstable-server, mongo-10gen-unstable-shell, mongo-10gen-unstable-tools, mongo18-10gen, mongo18-10gen-server, mongo20-10gen, mongo20-10gen-server, mongodb, mongodb-server, mongodb-dev, mongodb-clients, mongodb-10gen, mongodb-10gen-enterprise, mongodb-10gen-unstable, mongodb-10gen-unstable-enterprise, mongodb-10gen-unstable-enterprise-mongos, mongodb-10gen-unstable-enterprise-server, mongodb-10gen-unstable-enterprise-shell, mongodb-10gen-unstable-enterprise-tools, mongodb-10gen-unstable-mongos, mongodb-10gen-unstable-server, mongodb-10gen-unstable-shell, mongodb-10gen-unstable-tools, mongodb-enterprise, mongodb-enterprise-mongos, mongodb-enterprise-server, mongodb-enterprise-shell, mongodb-enterprise-tools, mongodb-nightly, mongodb-org-unstable, mongodb-org-unstable-mongos, mongodb-org-unstable-server, mongodb-org-unstable-shell, mongodb-org-unstable-tools, mongodb-stable, mongodb18-10gen, mongodb20-10gen, mongodb-enterprise-unstable, mongodb-enterprise-unstable-mongos, mongodb-enterprise-unstable-server, mongodb-enterprise-unstable-shell, mongodb-enterprise-unstable-tools Version: %{dynamic_version} Release: %{dynamic_release}%{?dist} @@ -11,6 +17,10 @@ URL: http://www.mongodb.org Group: Applications/Databases Requires: mongodb-org-server = %{version}, mongodb-org-shell = %{version}, mongodb-org-mongos = %{version}, mongodb-org-tools = %{version} +%if 0%{?rhel} >= 8 || 0%{?fedora} >= 30 +BuildRequires: /usr/bin/pathfix.py, python3-devel +%endif + Source0: %{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root @@ -167,27 +177,33 @@ MongoDB features: This package provides the MongoDB static library and header files needed to develop MongoDB client software. +#Release builds have no debug symbols, and this prevents packaging errors on RHEL 8.0 +%global debug_package %{nil} + %prep %setup +%if 0%{?rhel} >= 8 || 0%{?fedora} >= 30 +pathfix.py -pni "%{__python3} %{py3_shbang_opts}" bin/install_compass +%endif %build %install -mkdir -p $RPM_BUILD_ROOT/usr -cp -rv bin $RPM_BUILD_ROOT/usr -mkdir -p $RPM_BUILD_ROOT/usr/share/man/man1 -cp debian/*.1 $RPM_BUILD_ROOT/usr/share/man/man1/ -mkdir -p $RPM_BUILD_ROOT/etc/init.d -cp -v rpm/init.d-mongod $RPM_BUILD_ROOT/etc/init.d/mongod -chmod a+x $RPM_BUILD_ROOT/etc/init.d/mongod -mkdir -p $RPM_BUILD_ROOT/etc -cp -v rpm/mongod.conf $RPM_BUILD_ROOT/etc/mongod.conf -mkdir -p $RPM_BUILD_ROOT/etc/sysconfig -cp -v rpm/mongod.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/mongod -mkdir -p $RPM_BUILD_ROOT/var/lib/mongo -mkdir -p $RPM_BUILD_ROOT/var/log/mongodb -mkdir -p $RPM_BUILD_ROOT/var/run/mongodb -touch $RPM_BUILD_ROOT/var/log/mongodb/mongod.log +mkdir -p $RPM_BUILD_ROOT%{_prefix} +cp -rv bin $RPM_BUILD_ROOT%{_prefix} +mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1 +cp debian/*.1 $RPM_BUILD_ROOT%{_mandir}/man1/ +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/init.d +cp -v rpm/init.d-mongod $RPM_BUILD_ROOT%{_sysconfdir}/init.d/mongod +chmod a+x $RPM_BUILD_ROOT%{_sysconfdir}/init.d/mongod +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir} +cp -v rpm/mongod.conf $RPM_BUILD_ROOT%{_sysconfdir}/mongod.conf +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig +cp -v rpm/mongod.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/mongod +mkdir -p $RPM_BUILD_ROOT%{_sharedstatedir}/mongo +mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/mongodb +mkdir -p $RPM_BUILD_ROOT%{_rundir}/mongodb +touch $RPM_BUILD_ROOT%{_localstatedir}/log/mongodb/mongod.log %clean rm -rf $RPM_BUILD_ROOT @@ -222,15 +238,15 @@ fi %files server %defattr(-,root,root,-) -%config(noreplace) /etc/mongod.conf +%config(noreplace) %{_sysconfdir}/mongod.conf %{_bindir}/mongod %{_mandir}/man1/mongod.1* -/etc/init.d/mongod -%config(noreplace) /etc/sysconfig/mongod -%attr(0755,mongod,mongod) %dir /var/lib/mongo -%attr(0755,mongod,mongod) %dir /var/log/mongodb -%attr(0755,mongod,mongod) %dir /var/run/mongodb -%attr(0640,mongod,mongod) %config(noreplace) %verify(not md5 size mtime) /var/log/mongodb/mongod.log +%{_sysconfdir}/init.d/mongod +%config(noreplace) %{_sysconfdir}/sysconfig/mongod +%attr(0755,mongod,mongod) %dir %{_sharedstatedir}/mongo +%attr(0755,mongod,mongod) %dir %{_localstatedir}/log/mongodb +%attr(0755,mongod,mongod) %dir %{_rundir}/mongodb +%attr(0640,mongod,mongod) %config(noreplace) %verify(not md5 size mtime) %{_localstatedir}/log/mongodb/mongod.log %doc LICENSE-Community.txt %doc README %doc THIRD-PARTY-NOTICES diff --git a/rpm/mongodb-org-unstable-init.spec b/rpm/mongodb-org-unstable-init.spec index 445ddb27108..b2c29a88c9e 100644 --- a/rpm/mongodb-org-unstable-init.spec +++ b/rpm/mongodb-org-unstable-init.spec @@ -1,5 +1,11 @@ +%if ! %{defined _rundir} +%define _rundir %{_localstatedir}/run +%endif + Name: mongodb-org-unstable Prefix: /usr +Prefix: /var +Prefix: /etc Conflicts: mongo-10gen, mongo-10gen-enterprise, mongo-10gen-enterprise-server, mongo-10gen-server, mongo-10gen-unstable, mongo-10gen-unstable-enterprise, mongo-10gen-unstable-enterprise-mongos, mongo-10gen-unstable-enterprise-server, mongo-10gen-unstable-enterprise-shell, mongo-10gen-unstable-enterprise-tools, mongo-10gen-unstable-mongos, mongo-10gen-unstable-server, mongo-10gen-unstable-shell, mongo-10gen-unstable-tools, mongo18-10gen, mongo18-10gen-server, mongo20-10gen, mongo20-10gen-server, mongodb, mongodb-server, mongodb-dev, mongodb-clients, mongodb-10gen, mongodb-10gen-enterprise, mongodb-10gen-unstable, mongodb-10gen-unstable-enterprise, mongodb-10gen-unstable-enterprise-mongos, mongodb-10gen-unstable-enterprise-server, mongodb-10gen-unstable-enterprise-shell, mongodb-10gen-unstable-enterprise-tools, mongodb-10gen-unstable-mongos, mongodb-10gen-unstable-server, mongodb-10gen-unstable-shell, mongodb-10gen-unstable-tools, mongodb-enterprise, mongodb-enterprise-mongos, mongodb-enterprise-server, mongodb-enterprise-shell, mongodb-enterprise-tools, mongodb-nightly, mongodb-org, mongodb-org-mongos, mongodb-org-server, mongodb-org-shell, mongodb-org-tools, mongodb-stable, mongodb18-10gen, mongodb20-10gen, mongodb-enterprise-unstable, mongodb-enterprise-unstable-mongos, mongodb-enterprise-unstable-server, mongodb-enterprise-unstable-shell, mongodb-enterprise-unstable-tools Version: %{dynamic_version} Release: %{dynamic_release}%{?dist} @@ -9,6 +15,10 @@ URL: http://www.mongodb.org Group: Applications/Databases Requires: mongodb-org-unstable-server = %{version}, mongodb-org-unstable-shell = %{version}, mongodb-org-unstable-mongos = %{version}, mongodb-org-unstable-tools = %{version} +%if 0%{?rhel} >= 8 || 0%{?fedora} >= 30 +BuildRequires: /usr/bin/pathfix.py, python3-devel +%endif + Source0: %{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root @@ -155,27 +165,33 @@ MongoDB features: This package provides the MongoDB static library and header files needed to develop MongoDB client software. +#Release builds have no debug symbols, and this prevents packaging errors on RHEL 8.0 +%global debug_package %{nil} + %prep %setup +%if 0%{?rhel} >= 8 || 0%{?fedora} >= 30 +pathfix.py -pni "%{__python3} %{py3_shbang_opts}" bin/install_compass +%endif %build %install -mkdir -p $RPM_BUILD_ROOT/usr -cp -rv bin $RPM_BUILD_ROOT/usr -mkdir -p $RPM_BUILD_ROOT/usr/share/man/man1 -cp debian/*.1 $RPM_BUILD_ROOT/usr/share/man/man1/ -mkdir -p $RPM_BUILD_ROOT/etc/init.d -cp -v rpm/init.d-mongod $RPM_BUILD_ROOT/etc/init.d/mongod -chmod a+x $RPM_BUILD_ROOT/etc/init.d/mongod -mkdir -p $RPM_BUILD_ROOT/etc -cp -v rpm/mongod.conf $RPM_BUILD_ROOT/etc/mongod.conf -mkdir -p $RPM_BUILD_ROOT/etc/sysconfig -cp -v rpm/mongod.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/mongod -mkdir -p $RPM_BUILD_ROOT/var/lib/mongo -mkdir -p $RPM_BUILD_ROOT/var/log/mongodb -mkdir -p $RPM_BUILD_ROOT/var/run/mongodb -touch $RPM_BUILD_ROOT/var/log/mongodb/mongod.log +mkdir -p $RPM_BUILD_ROOT%{_prefix} +cp -rv bin $RPM_BUILD_ROOT%{_prefix} +mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1 +cp debian/*.1 $RPM_BUILD_ROOT%{_mandir}/man1/ +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/init.d +cp -v rpm/init.d-mongod $RPM_BUILD_ROOT%{_sysconfdir}/init.d/mongod +chmod a+x $RPM_BUILD_ROOT%{_sysconfdir}/init.d/mongod +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir} +cp -v rpm/mongod.conf $RPM_BUILD_ROOT%{_sysconfdir}/mongod.conf +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig +cp -v rpm/mongod.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/mongod +mkdir -p $RPM_BUILD_ROOT%{_sharedstatedir}/mongo +mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/mongodb +mkdir -p $RPM_BUILD_ROOT%{_rundir}/mongodb +touch $RPM_BUILD_ROOT%{_localstatedir}/log/mongodb/mongod.log @@ -212,15 +228,15 @@ fi %files server %defattr(-,root,root,-) -%config(noreplace) /etc/mongod.conf +%config(noreplace) %{_sysconfdir}/mongod.conf %{_bindir}/mongod %{_mandir}/man1/mongod.1* -/etc/init.d/mongod -%config(noreplace) /etc/sysconfig/mongod -%attr(0755,mongod,mongod) %dir /var/lib/mongo -%attr(0755,mongod,mongod) %dir /var/log/mongodb -%attr(0755,mongod,mongod) %dir /var/run/mongodb -%attr(0640,mongod,mongod) %config(noreplace) %verify(not md5 size mtime) /var/log/mongodb/mongod.log +%{_sysconfdir}/init.d/mongod +%config(noreplace) %{_sysconfdir}/sysconfig/mongod +%attr(0755,mongod,mongod) %dir %{_sharedstatedir}/mongo +%attr(0755,mongod,mongod) %dir %{_localstatedir}/log/mongodb +%attr(0755,mongod,mongod) %dir %{_rundir}/mongodb +%attr(0640,mongod,mongod) %config(noreplace) %verify(not md5 size mtime) %{_localstatedir}/log/mongodb/mongod.log %doc LICENSE-Community.txt %doc README %doc THIRD-PARTY-NOTICES diff --git a/rpm/mongodb-org-unstable.spec b/rpm/mongodb-org-unstable.spec index b9b6b13b5fc..f22b2738ddd 100644 --- a/rpm/mongodb-org-unstable.spec +++ b/rpm/mongodb-org-unstable.spec @@ -1,5 +1,11 @@ +%if ! %{defined _rundir} +%define _rundir %{_localstatedir}/run +%endif + Name: mongodb-org-unstable Prefix: /usr +Prefix: /var +Prefix: /etc Conflicts: mongo-10gen, mongo-10gen-enterprise, mongo-10gen-enterprise-server, mongo-10gen-server, mongo-10gen-unstable, mongo-10gen-unstable-enterprise, mongo-10gen-unstable-enterprise-mongos, mongo-10gen-unstable-enterprise-server, mongo-10gen-unstable-enterprise-shell, mongo-10gen-unstable-enterprise-tools, mongo-10gen-unstable-mongos, mongo-10gen-unstable-server, mongo-10gen-unstable-shell, mongo-10gen-unstable-tools, mongo18-10gen, mongo18-10gen-server, mongo20-10gen, mongo20-10gen-server, mongodb, mongodb-server, mongodb-dev, mongodb-clients, mongodb-10gen, mongodb-10gen-enterprise, mongodb-10gen-unstable, mongodb-10gen-unstable-enterprise, mongodb-10gen-unstable-enterprise-mongos, mongodb-10gen-unstable-enterprise-server, mongodb-10gen-unstable-enterprise-shell, mongodb-10gen-unstable-enterprise-tools, mongodb-10gen-unstable-mongos, mongodb-10gen-unstable-server, mongodb-10gen-unstable-shell, mongodb-10gen-unstable-tools, mongodb-enterprise, mongodb-enterprise-mongos, mongodb-enterprise-server, mongodb-enterprise-shell, mongodb-enterprise-tools, mongodb-nightly, mongodb-org, mongodb-org-mongos, mongodb-org-server, mongodb-org-shell, mongodb-org-tools, mongodb-stable, mongodb18-10gen, mongodb20-10gen, mongodb-enterprise-unstable, mongodb-enterprise-unstable-mongos, mongodb-enterprise-unstable-server, mongodb-enterprise-unstable-shell, mongodb-enterprise-unstable-tools Version: %{dynamic_version} Release: %{dynamic_release}%{?dist} @@ -9,6 +15,10 @@ URL: http://www.mongodb.org Group: Applications/Databases Requires: mongodb-org-unstable-server = %{version}, mongodb-org-unstable-shell = %{version}, mongodb-org-unstable-mongos = %{version}, mongodb-org-unstable-tools = %{version} +%if 0%{?rhel} >= 8 || 0%{?fedora} >= 30 +BuildRequires: /usr/bin/pathfix.py, python3-devel +%endif + Source0: %{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root @@ -44,6 +54,13 @@ Group: Applications/Databases Requires: openssl, %{timezone_pkg}, %{python_pkg} Conflicts: mongo-10gen, mongo-10gen-enterprise, mongo-10gen-enterprise-server, mongo-10gen-server, mongo-10gen-unstable, mongo-10gen-unstable-enterprise, mongo-10gen-unstable-enterprise-mongos, mongo-10gen-unstable-enterprise-server, mongo-10gen-unstable-enterprise-shell, mongo-10gen-unstable-enterprise-tools, mongo-10gen-unstable-mongos, mongo-10gen-unstable-server, mongo-10gen-unstable-shell, mongo-10gen-unstable-tools, mongo18-10gen, mongo18-10gen-server, mongo20-10gen, mongo20-10gen-server, mongodb, mongodb-server, mongodb-dev, mongodb-clients, mongodb-10gen, mongodb-10gen-enterprise, mongodb-10gen-unstable, mongodb-10gen-unstable-enterprise, mongodb-10gen-unstable-enterprise-mongos, mongodb-10gen-unstable-enterprise-server, mongodb-10gen-unstable-enterprise-shell, mongodb-10gen-unstable-enterprise-tools, mongodb-10gen-unstable-mongos, mongodb-10gen-unstable-server, mongodb-10gen-unstable-shell, mongodb-10gen-unstable-tools, mongodb-enterprise, mongodb-enterprise-mongos, mongodb-enterprise-server, mongodb-enterprise-shell, mongodb-enterprise-tools, mongodb-nightly, mongodb-org, mongodb-org-mongos, mongodb-org-server, mongodb-org-shell, mongodb-org-tools, mongodb-stable, mongodb18-10gen, mongodb20-10gen, mongodb-enterprise-unstable, mongodb-enterprise-unstable-mongos, mongodb-enterprise-unstable-server, mongodb-enterprise-unstable-shell, mongodb-enterprise-unstable-tools +%if 0%{?suse_version} >= 1210 || 0%{?rhel} >= 700 || 0%{?fedora} >= 15 +BuildRequires: systemd-rpm-macros +%else +BuildRequires: systemd +%{?systemd_requires} +%endif + %description server MongoDB is built for scalability, performance and high availability, scaling from single server deployments to large, complex multi-site architectures. By leveraging in-memory computing, MongoDB provides high performance for both reads and writes. MongoDB’s native replication and automated failover enable enterprise-grade reliability and operational flexibility. @@ -157,26 +174,30 @@ MongoDB features: This package provides the MongoDB static library and header files needed to develop MongoDB client software. +#Release builds have no debug symbols, and this prevents packaging errors on RHEL 8.0 +%global debug_package %{nil} + %prep %setup +%if 0%{?rhel} >= 8 || 0%{?fedora} >= 30 +pathfix.py -pni "%{__python3} %{py3_shbang_opts}" bin/install_compass +%endif %build %install -mkdir -p $RPM_BUILD_ROOT/usr -cp -rv bin $RPM_BUILD_ROOT/usr -mkdir -p $RPM_BUILD_ROOT/usr/share/man/man1 -cp debian/*.1 $RPM_BUILD_ROOT/usr/share/man/man1/ -mkdir -p $RPM_BUILD_ROOT/etc -cp -v rpm/mongod.conf $RPM_BUILD_ROOT/etc/mongod.conf -mkdir -p $RPM_BUILD_ROOT/lib/systemd/system -cp -v rpm/mongod.service $RPM_BUILD_ROOT/lib/systemd/system -mkdir -p $RPM_BUILD_ROOT/var/lib/mongo -mkdir -p $RPM_BUILD_ROOT/var/log/mongodb -mkdir -p $RPM_BUILD_ROOT/var/run/mongodb -touch $RPM_BUILD_ROOT/var/log/mongodb/mongod.log - - +mkdir -p $RPM_BUILD_ROOT%{_prefix} +cp -rv bin $RPM_BUILD_ROOT%{_prefix} +mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1 +cp debian/*.1 $RPM_BUILD_ROOT%{_mandir}/man1/ +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir} +cp -v rpm/mongod.conf $RPM_BUILD_ROOT%{_sysconfdir}/mongod.conf +mkdir -p $RPM_BUILD_ROOT%{_unitdir} +cp -v rpm/mongod.service $RPM_BUILD_ROOT%{_unitdir} +mkdir -p $RPM_BUILD_ROOT%{_sharedstatedir}/mongo +mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/mongodb +mkdir -p $RPM_BUILD_ROOT%{_rundir}/mongodb +touch $RPM_BUILD_ROOT%{_localstatedir}/log/mongodb/mongod.log %clean rm -rf $RPM_BUILD_ROOT @@ -215,14 +236,14 @@ fi %files server %defattr(-,root,root,-) -%config(noreplace) /etc/mongod.conf +%config(noreplace) %{_sysconfdir}/mongod.conf %{_bindir}/mongod %{_mandir}/man1/mongod.1* -/lib/systemd/system/mongod.service -%attr(0755,mongod,mongod) %dir /var/lib/mongo -%attr(0755,mongod,mongod) %dir /var/log/mongodb -%attr(0755,mongod,mongod) %dir /var/run/mongodb -%attr(0640,mongod,mongod) %config(noreplace) %verify(not md5 size mtime) /var/log/mongodb/mongod.log +%{_unitdir}/mongod.service +%attr(0755,mongod,mongod) %dir %{_sharedstatedir}/mongo +%attr(0755,mongod,mongod) %dir %{_localstatedir}/log/mongodb +%attr(0755,mongod,mongod) %dir %{_rundir}/mongodb +%attr(0640,mongod,mongod) %config(noreplace) %verify(not md5 size mtime) %{_localstatedir}/log/mongodb/mongod.log %doc LICENSE-Community.txt %doc README %doc THIRD-PARTY-NOTICES diff --git a/rpm/mongodb-org.spec b/rpm/mongodb-org.spec index 9a94cd6086b..d0ac98bf123 100644 --- a/rpm/mongodb-org.spec +++ b/rpm/mongodb-org.spec @@ -1,5 +1,11 @@ +%if ! %{defined _rundir} +%define _rundir %{_localstatedir}/run +%endif + Name: mongodb-org Prefix: /usr +Prefix: /var +Prefix: /etc Conflicts: mongo-10gen-enterprise, mongo-10gen-enterprise-server, mongo-10gen-unstable, mongo-10gen-unstable-enterprise, mongo-10gen-unstable-enterprise-mongos, mongo-10gen-unstable-enterprise-server, mongo-10gen-unstable-enterprise-shell, mongo-10gen-unstable-enterprise-tools, mongo-10gen-unstable-mongos, mongo-10gen-unstable-server, mongo-10gen-unstable-shell, mongo-10gen-unstable-tools, mongo18-10gen, mongo18-10gen-server, mongo20-10gen, mongo20-10gen-server, mongodb, mongodb-server, mongodb-dev, mongodb-clients, mongodb-10gen, mongodb-10gen-enterprise, mongodb-10gen-unstable, mongodb-10gen-unstable-enterprise, mongodb-10gen-unstable-enterprise-mongos, mongodb-10gen-unstable-enterprise-server, mongodb-10gen-unstable-enterprise-shell, mongodb-10gen-unstable-enterprise-tools, mongodb-10gen-unstable-mongos, mongodb-10gen-unstable-server, mongodb-10gen-unstable-shell, mongodb-10gen-unstable-tools, mongodb-enterprise, mongodb-enterprise-mongos, mongodb-enterprise-server, mongodb-enterprise-shell, mongodb-enterprise-tools, mongodb-nightly, mongodb-org-unstable, mongodb-org-unstable-mongos, mongodb-org-unstable-server, mongodb-org-unstable-shell, mongodb-org-unstable-tools, mongodb-stable, mongodb18-10gen, mongodb20-10gen, mongodb-enterprise-unstable, mongodb-enterprise-unstable-mongos, mongodb-enterprise-unstable-server, mongodb-enterprise-unstable-shell, mongodb-enterprise-unstable-tools Version: %{dynamic_version} Release: %{dynamic_release}%{?dist} @@ -11,6 +17,10 @@ URL: http://www.mongodb.org Group: Applications/Databases Requires: mongodb-org-server = %{version}, mongodb-org-shell = %{version}, mongodb-org-mongos = %{version}, mongodb-org-tools = %{version} +%if 0%{?rhel} >= 8 || 0%{?fedora} >= 30 +BuildRequires: /usr/bin/pathfix.py, python3-devel +%endif + Source0: %{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root @@ -169,24 +179,30 @@ MongoDB features: This package provides the MongoDB static library and header files needed to develop MongoDB client software. +#Release builds have no debug symbols, and this prevents packaging errors on RHEL 8.0 +%global debug_package %{nil} + %prep %setup +%if 0%{?rhel} >= 8 || 0%{?fedora} >= 30 +pathfix.py -pni "%{__python3} %{py3_shbang_opts}" bin/install_compass +%endif %build %install -mkdir -p $RPM_BUILD_ROOT/usr -cp -rv bin $RPM_BUILD_ROOT/usr -mkdir -p $RPM_BUILD_ROOT/usr/share/man/man1 -cp debian/*.1 $RPM_BUILD_ROOT/usr/share/man/man1/ -mkdir -p $RPM_BUILD_ROOT/etc -cp -v rpm/mongod.conf $RPM_BUILD_ROOT/etc/mongod.conf -mkdir -p $RPM_BUILD_ROOT/lib/systemd/system -cp -v rpm/mongod.service $RPM_BUILD_ROOT/lib/systemd/system -mkdir -p $RPM_BUILD_ROOT/var/lib/mongo -mkdir -p $RPM_BUILD_ROOT/var/log/mongodb -mkdir -p $RPM_BUILD_ROOT/var/run/mongodb -touch $RPM_BUILD_ROOT/var/log/mongodb/mongod.log +mkdir -p $RPM_BUILD_ROOT%{_prefix} +cp -rv bin $RPM_BUILD_ROOT%{_prefix} +mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1 +cp debian/*.1 $RPM_BUILD_ROOT%{_mandir}/man1/ +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir} +cp -v rpm/mongod.conf $RPM_BUILD_ROOT%{_sysconfdir}/mongod.conf +mkdir -p $RPM_BUILD_ROOT%{_unitdir} +cp -v rpm/mongod.service $RPM_BUILD_ROOT%{_unitdir} +mkdir -p $RPM_BUILD_ROOT%{_sharedstatedir}/mongo +mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/mongodb +mkdir -p $RPM_BUILD_ROOT%{_rundir}/mongodb +touch $RPM_BUILD_ROOT%{_localstatedir}/log/mongodb/mongod.log %clean rm -rf $RPM_BUILD_ROOT @@ -225,14 +241,14 @@ fi %files server %defattr(-,root,root,-) -%config(noreplace) /etc/mongod.conf +%config(noreplace) %{_sysconfdir}/mongod.conf %{_bindir}/mongod %{_mandir}/man1/mongod.1* -/lib/systemd/system/mongod.service -%attr(0755,mongod,mongod) %dir /var/lib/mongo -%attr(0755,mongod,mongod) %dir /var/log/mongodb -%attr(0755,mongod,mongod) %dir /var/run/mongodb -%attr(0640,mongod,mongod) %config(noreplace) %verify(not md5 size mtime) /var/log/mongodb/mongod.log +%{_unitdir}/mongod.service +%attr(0755,mongod,mongod) %dir %{_sharedstatedir}/mongo +%attr(0755,mongod,mongod) %dir %{_localstatedir}/log/mongodb +%attr(0755,mongod,mongod) %dir %{_rundir}/mongodb +%attr(0640,mongod,mongod) %config(noreplace) %verify(not md5 size mtime) %{_localstatedir}/log/mongodb/mongod.log %doc LICENSE-Community.txt %doc README %doc THIRD-PARTY-NOTICES |