SpringBoot RPM制作

  1. 安装依赖
shell 复制代码
[root@20240423-instance4 ~]# yum install rpmdevtools

2.初始化目录

shell 复制代码
[root@20240423-instance4 ~]# rpmdev-setuptree 
[root@20240423-instance4 ~]# tree rpmbuild/
rpmbuild/
├── BUILD
├── RPMS
├── SOURCES
├── SPECS
└── SRPMS

5 directories, 0 files

3.编写SPEC文件

shell 复制代码
%define __jar_repack 0
Name: jtlas-server
Version: 1.0.0
Release: 1
Summary: JD.Cloud jtlas service back end server.
License: Apache 2.0
Group: JD.Cloud/Applications
Prefix: /export
Source0: %{name}-%{version}-SNAPSHOT.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

%description
Jtlas Service backend acts as a service for querying metadata from a warehouse.

%prep
%setup -n %{name}

%build

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/export/App/%{name}
cp -r * $RPM_BUILD_ROOT/export/App/%{name}

mkdir -p $RPM_BUILD_ROOT%{_unitdir}

%post
%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
/export/App/%{name}

4.资源包文件打包

shell 复制代码
[root@20240423-instance4 rpmbuild]# rpmbuild -ba SPECS/jtals-server.spec
相关推荐
陆沙1 小时前
deepseek-r1-centos-本地服务器配置方法
linux·服务器·centos
网硕互联的小客服11 小时前
服务器硬件老化导致性能下降的排查与优化
linux·运维·服务器·安全·centos
ForTodayzzZ12 小时前
centos和ubuntu安装mysql教程
linux·mysql·ubuntu·centos
web1478621072313 小时前
Linux(CentOS)安装 Nginx
linux·nginx·centos
猫吃了源码14 小时前
CentOS系统安装NFS
linux·运维·centos
m0_7482453416 小时前
Linux(CentOS)安装 MySQL
linux·mysql·centos
leafseelight1 天前
在CentOS 7上安装RocketMQ 4.9.2
linux·centos·rocketmq
yzj2311282 天前
linux命令
linux·运维·centos
Dracen_Wu2 天前
VMware17.6+CentOS 8安装教程
linux·运维·centos·vmware
沐千熏3 天前
安装Liunx(CentOS-6-x86_64)系统
linux·centos