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
相关推荐
oMcLin3 小时前
如何在 CentOS Stream 9 上配置并优化 PostgreSQL 15,支持高并发的数据插入与快速查询?
linux·postgresql·centos
whlqjn_121118 小时前
linux下使用SHC对Shell脚本进行封装和源码隐藏
linux·centos
芝麻馅汤圆儿1 天前
cpu 大小核
linux·运维·centos
学习3人组1 天前
CentOS 系统下 ModelScope 模型下载的默认目录
linux·python·centos
TimerShaft1 天前
CentOS7安装PostgresSQL和PGVector
postgresql·centos·pgvector
千百元2 天前
centos如何删除恶心定时任务
linux·运维·centos
XMYX-02 天前
CentOS 7 搭建 PostgreSQL 14 实战指南
linux·postgresql·centos
丁丁丁梦涛2 天前
TencentOS Server 4.4(兼容centos 9 stream)部署KKFileView
linux·运维·centos·kkfileview
白驹过隙不负青春2 天前
Docker-compose部署java服务及前端服务
java·运维·前端·docker·容器·centos
源图客2 天前
CentOS系统安装Python3.12.10
linux·运维·centos