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
相关推荐
2601_9618752417 天前
决战申论100题2026|最新|范文
linux·容器·centos·debian·ssh·fabric·vagrant
wcy1008618 天前
为 CentOS 7.6 (7.6.1810) 配置阿里云 Vault 源
linux·阿里云·centos
狮子再回头19 天前
relhat9.1 yum无法安装问题
linux·运维·centos
IT199519 天前
踩坑实录:CentOS 默认 Fail2Ban 挡不住高频并发攻击,漏洞修复一步到位
linux·运维·centos
摇滚侠19 天前
VMvare 安装 Linux CentOS 7
linux·运维·centos
java知路19 天前
centos euler离线下载docker镜像
linux·docker·centos
Lang-121021 天前
CentOS Linux服务器完整迁移方案
linux·服务器·centos
2601_9618454221 天前
法考真题及答案解析|历年真题|资料已整理
linux·windows·ubuntu·macos·centos·gnu
拦路雨g23 天前
VMware centos磁盘容量扩容
linux·运维·centos
keyipatience23 天前
27,28,29进程通信和匿名管道详解
linux·ubuntu·centos