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
相关推荐
播播资源9 小时前
CentOS系统 + 宝塔面板 部署 OpenClaw源码开发版完整教程
linux·运维·centos
HABuo16 小时前
【linux线程(一)】线程概念、线程控制详细剖析
linux·运维·服务器·c语言·c++·ubuntu·centos
jarreyer1 天前
CentOS 7 无法使用 yum 安装软件
linux·运维·centos
架构指南3 天前
Centos上安装Claude Code报GLIBC_2.27 not found
linux·运维·centos
REDcker3 天前
CentOS 与主流 Linux 发行版:版本与时间表(年表)
linux·运维·centos
wd5205213 天前
常用环境部署(二十九)——Centos升级OpenSSH 10.2p1
linux·运维·centos·ssh
REDcker3 天前
CentOS 与主流 Linux 发行版历史与版本综述
linux·centos·numpy
kabu_Charlie3 天前
找不到CentOS 7 64 位-00000.vmdk
centos
Willliam_william3 天前
CentOS 7系统中进行时间/时区设置
linux·运维·centos
sdm0704273 天前
yum和开发工具vim/gcc
linux·服务器·centos