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
相关推荐
小雪_Snow4 小时前
CentOS 7 初始化脚本
centos
confiself8 小时前
GO环境配置
linux·运维·centos
_叶小格_1 天前
cp、scp、rsync命令详解
linux·运维·服务器·ubuntu·centos·运维开发
小天源1 天前
CentOS 7介绍及其下载
linux·运维·ubuntu·centos·麒麟·windows11·windows10
nangonghen1 天前
centos 7.9安装postman v9.31.0
centos·api·postman
黑色的山岗在沉睡2 天前
CentOS 10 Stream 配置远程桌面,基于HeadLess gnome-remote-desktop。
linux·运维·centos
独自归家的兔2 天前
CentOS 8 系统下的包依赖冲突问题
linux·运维·centos
xuefuhe3 天前
RHEL9 yum install etcd Error: Unable to find a match: etcd
linux·运维·centos
顾西爵霞3 天前
远程访问centos7并连接Mariadb
数据库·centos·mariadb
码农不惑3 天前
systemd升级造成的centos-bootc系统的内核故障
linux·centos·bootc