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
相关推荐
chanalbert5 小时前
CentOS系统新手指导手册
linux·运维·centos
小张不嚣张꒰ঌ(˚ᆺ˚)໒꒱1 天前
Centos7在yum当中遇到Could not resolve host: mirrorlist.centos.org解决方案
linux·运维·服务器·centos
Sally璐璐1 天前
CentOS企业级文件服务器终极部署指南
linux·服务器·centos
岁月玲珑1 天前
【如何判断Linux系统是Ubuntu还是CentOS】
linux·ubuntu·centos
梅孔立1 天前
yum update 报错 Cannot find a valid baseurl for repo: centos-sclo-rh/x86_64 等解决办法
linux·python·centos
Sca_杰1 天前
centos指令
linux·运维·centos
几道之旅1 天前
centos 7 安装NVIDIA Container Toolkit
linux·运维·centos
happyhappy没有句号1 天前
CentOS系统如何安装和使用docker
docker·centos
Jack_hrx1 天前
docker部署nginx
linux·nginx·docker·centos
好名字更能让你们记住我1 天前
Linux多线程(十二)之【生产者消费者模型】
linux·运维·服务器·jvm·windows·centos