init rocketmq spec

This commit is contained in:
shizhili 2023-08-29 09:14:30 +08:00
parent 4004abfc36
commit 96a4e5b08a
3 changed files with 67 additions and 0 deletions

14
.gitignore vendored Normal file
View File

@ -0,0 +1,14 @@
.classpath
.project
.settings/
target/
devenv
*.log.*
*.iml
.idea/
*.versionsBackup
!NOTICE-BIN
!LICENSE-BIN
.DS_Store
nohup.out
.vscode

Binary file not shown.

53
rocketmq.spec Normal file
View File

@ -0,0 +1,53 @@
%define debug_package %{nil}
%define rocketmq_ver 5.1.3
%define rkg_ver 1
%define _prefix /opt/rocketmq
%define path_name %{name}-all-%{version}-source-release
Summary: Cloud-Native, Distributed Messaging and Streaming
Name: rocketmq
Version: %{rocketmq_ver}
Release: %{rkg_ver}
License: Apache-2.0
Group: Applications/Message
URL: https://rocketmq.apache.org/
Source0: https://archive.apache.org/dist/%{name}/%{version}/%{name}-all-%{version}-source-release.zip
BuildRoot: /root/rpmbuild/BUILDROOT/
BuildRequires: java-1.8.0-openjdk-devel,systemd, maven, maven-local
Requires: java-1.8.0-openjdk
%description
Apache RocketMQ is a cloud native messaging and streaming platform, making it simple to build event-driven applications.
%prep
%setup -q -n %{name}-all-%{version}-source-release
%build
cd %{_builddir}/%{name}-all-%{version}-source-release/distribution
mvn -Prelease-all -DskipTests clean install -U
%install
cd %{_builddir}/%{path_name}/distribution/target
tar -zxvf %{name}-%{version}.tar.gz
mkdir -p $RPM_BUILD_ROOT%{_prefix}
cp -pr %{_builddir}/%{path_name}/distribution/target/%{name}-%{version}/%{name}-%{version}/* $RPM_BUILD_ROOT%{_prefix}
%clean
rm -rf $RPM_BUILD_ROOT
rm -rf $RPM_BUILD
%files
%defattr(-,root,root)
%attr(-,rocketmq,rocketmq) %{_prefix}
%dir %attr(755, rocketmq, rocketmq) %{_prefix}
%pre
getent group rocketmq >/dev/null || groupadd -r rocketmq
getent passwd rocketmq >/dev/null || useradd -r -g rocketmq -d / -s /sbin/nologin rocketmq
exit 0
%changelog
* Thu Aug 17 2023 ShiZhili <shizhili_yewu@cmss.chinamobile.com> - 5.1.3-1
- init rocketmq spec