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
相关推荐
Harvy_没救了1 小时前
【网络运维】CentOS 7 部署 LAMP 与 LNMP 实战指南
运维·网络·centos
努力的搬砖人.1 小时前
CentOS 7 系统(内核版本 3.10.0-229.el7.x86_64)无法使用 yum 更新
linux·运维·centos
蜡台1 天前
Centos 安装Mysql
linux·mysql·centos·yum·mysql8
tobias.b1 天前
Centos Linux 维护
linux·python·centos
小夏子_riotous2 天前
Docker学习路径——3、常用命令
linux·运维·服务器·学习·docker·容器·centos
uesowys3 天前
CentOS Linux安装部署OpenClaw
linux·centos·安装部署openclaw
aq55356003 天前
CentOS vs Debian:如何选择最适合的Linux发行版
linux·centos·debian
huanmieyaoseng10033 天前
centos 配置国内yum源2026新
linux·运维·centos
杨云龙UP4 天前
CentOS7.9及以上环境部署TDengine TSDB-OSS实战指南:安装、配置、建库、建超级表与验证_20250418
大数据·linux·运维·数据库·centos·时序数据库·tdengine
青城山下————5 天前
CentOS 7 安装 PostgreSQL 13(国内镜像 + 远程访问)完整实践教程
linux·postgresql·centos