1 Star 0 Fork 16

programmer12/mongodb

forked from src-openEuler/mongodb
关闭
 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
mongodb.spec 5.16 KB
一键复制 编辑 原始数据 按行查看 历史
谢志鹏 提交于 2020-07-17 03:42 . update license in spec
%global __python %{__python3}
Name: mongodb
Version: 4.5.0
Release: 2
Summary: The global cloud database service for modern applications
License: SSPL
URL: http://www.mongodb.org
Source0: https://github.com/mongodb/mongo/archive/r%{version}.tar.gz
Source1: mongod.conf
Source2: mongod.service
BuildRequires: gcc-c++ >= 5.3.0 boost-devel >= 1.56 gperftools-devel libpcap-devel libstemmer-devel
BuildRequires: openssl-devel pcre-devel python3-scons snappy-devel yaml-cpp-devel zlib-devel systemd
BuildRequires: valgrind-devel libcurl-devel python3-devel python3-yaml python3-requests python3-cheetah
BuildRequires: python3-psutil xz-devel
ExclusiveArch: x86_64 aarch64
%description
MongoDB is a general purpose, document-based, distributed database built for
modern application developers and for the cloud era. No database makes you
more productive.
%package server
Summary: MongoDB database server
Requires(pre): shadow-utils
Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units
Provides: bundled(wiredtiger) = %{version} bundled(asio) = 1.11.0 bundled(icu) = 57.1
Provides: bundled(IntelRDFPMathLib) = 20U1 bundled(timelib) = 2017.05beta10 bundled(mozjs45) = 45.8.0
%description server
Contains the MongoDB server software, default configuration files and systemd service files.
%package test
Summary: MongoDB test suite
Requires: mongodb = %{version}-%{release} mongodb-server = %{version}-%{release}
Requires: python3-pymongo python3-yaml python3-requests
%description test
Contains the regression test suite.
%package help
Summary: Documentation for mongodb
Requires: mongodb = %{version}-%{release} mongodb-server = %{version}-%{release}
BuildArch: noarch
%description help
Documentation for mongodb.
%prep
%autosetup -n mongo-r%{version} -p1
%build
export LANG="en_US.UTF-8"
cat > variables.list << EOF
CCFLAGS="$(echo %{?optflags} | sed -e "s/-O. //" -e "s/-g //")"
MONGO_VERSION="%{version}"
VARIANT_DIR="openeuler"
%ifarch aarch64
CCFLAGS+=" -march=armv8-a+crc"
%endif
EOF
cat > build-options << EOF
%{?_smp_mflags} --disable-warnings-as-errors --variables-files=variables.list
EOF
scons-3 core tools $(cat build-options)
%install
for file in mongod mongos mongo mongobridge; do
install -p -D -m 755 $file %{buildroot}%{_bindir}/$file
done
install -d %{buildroot}%{_sharedstatedir}/mongodb
install -d %{buildroot}%{_localstatedir}/log/mongodb
install -d %{buildroot}%{_localstatedir}/run/mongodb
install -p -D -m 644 "%{SOURCE1}" %{buildroot}%{_sysconfdir}/mongod.conf
install -p -D -m 644 "%{SOURCE2}" %{buildroot}%{_unitdir}/mongod.service
for file in mongo.1 mongod.1 mongos.1; do
install -p -D -m 644 debian/$file %{buildroot}%{_mandir}/man1/$file
done
install -d -D %{buildroot}%{_datadir}/mongodb-test/{var,buildscripts}
install -p -D -m 755 buildscripts/resmoke.py %{buildroot}%{_datadir}/mongodb-test/
install -p -D -m 444 buildscripts/__init__.py %{buildroot}%{_datadir}/mongodb-test/buildscripts/
cp -R buildscripts/resmokeconfig %{buildroot}%{_datadir}/mongodb-test/buildscripts/
cp -R buildscripts/resmokelib %{buildroot}%{_datadir}/mongodb-test/buildscripts/
cp -R jstests %{buildroot}%{_datadir}/mongodb-test/
for file in `find %{buildroot}%{_datadir}/mongodb-test/jstests -type f`; do
chmod a-x $file
done
%pre server
if ! /usr/bin/id -g mongodb &>/dev/null; then
/usr/sbin/groupadd -r mongodb
fi
if ! /usr/bin/id mongodb &>/dev/null; then
/usr/sbin/useradd -M -r -g mongodb -d /var/lib/mongo -s /bin/false -c mongodb mongodb > /dev/null 2>&1
fi
%post server
if test $1 = 1; then
/usr/bin/systemctl enable mongod
fi
if test $1 = 2; then
/usr/bin/systemctl daemon-reload
fi
%preun server
if test $1 = 0; then
/usr/bin/systemctl disable mongod
fi
%postun server
if test $1 -ge 1; then
/usr/bin/systemctl restart mongod >/dev/null 2>&1 || :
fi
%files
%doc APACHE-2.0.txt
%{_bindir}/{mongo,mongobridge}
%files server
%{_bindir}/{mongod,mongos}
%dir %attr(0755, mongodb, root) %{_sharedstatedir}/mongodb
%dir %attr(0750, mongodb, root) %{_localstatedir}/log/mongodb
%dir %attr(0755, mongodb, root) %{_localstatedir}/run/mongodb
%config(noreplace) %{_sysconfdir}/mongod.conf
%{_unitdir}/*.service
%files test
%defattr(-,mongodb,root)
%dir %attr(0755, mongodb, root) %{_datadir}/mongodb-test
%dir %attr(0755, mongodb, root) %{_datadir}/mongodb-test/var
%{_datadir}/mongodb-test/{jstests,buildscripts,resmoke.*,__pycache__}
%files help
%{_mandir}/man1/{mongo.1*,mongod.1*,mongos.1*}
%changelog
* Fri Jun 23 2020 Captain Wei <captain.a.wei@gmail.com> - 4.5.0-2
- add dependency package
* Fri Jun 5 2020 Captain Wei <captain.a.wei@gmail.com> - 4.5.0-1
- update package version
* Fri May 29 2020 panchenbo <panchenbo@uniontech.com> - 4.0.1-5
- Type:bugfix
- ID: NA
- SUG: restart
- DESC: fix service start error
* Thu May 21 2020 yaokai13 <yaokai13@huawei.com> - 4.0.1-4
- Type: cves
- ID: CVE-2020-7921
- SUG: restart
- DESC: fix CVE-2020-7921
* Mon Feb 13 2020 Ling Yang <lingyang2@huawei.com> - 4.0.1-3
- Fixed mongodb-test package build errors
* Wed Feb 8 2020 Ling Yang <lingyang2@huawei.com> - 4.0.1-2
- Package init
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/programmer12/mongodb.git
git@gitee.com:programmer12/mongodb.git
programmer12
mongodb
mongodb
master

搜索帮助