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
相关推荐
bjzhang7510 小时前
CentOS下安装MySQL详解
linux·mysql·centos
My is 李豆14 小时前
CentOS 7 安装 Docker 完整教程(含 docker-compose 插件)
docker·eureka·centos
上天_去_做颗惺星 EVE_BLUE18 小时前
【新 Linux 服务器上手全攻略】系统巡检、存储规划与开发环境初始化
linux·运维·服务器·ubuntu·macos·centos
2601_9611940221 小时前
考研专业课在哪里参加考试|考点|流程|资料已整理
linux·考研·ubuntu·缓存·centos·负载均衡
我叫张小白。1 天前
CentOS 7 安装 Docker并配置镜像加速(完整指南)
linux·docker·centos
paul_chen213 天前
CentOS 8 LVM 在线扩容根分区:从 home 安全割让空间(XFS 文件系统)
linux·安全·centos
流烟默4 天前
腾讯云Centos7.6使用yum安装MySQL8
mysql·centos·腾讯云
穿条秋裤到处跑4 天前
Centos7环境升级openssh7.4p1至openssh9.8p1版本
centos·openssh
阳光满路4 天前
三步搞定:Linux 安装配置 Telnet 服务
linux·运维·centos
张青贤5 天前
centos7内核kernel升级
linux·centos·内核·kernel