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
相关推荐
千百元8 小时前
centos如何删除恶心定时任务
linux·运维·centos
XMYX-014 小时前
CentOS 7 搭建 PostgreSQL 14 实战指南
linux·postgresql·centos
丁丁丁梦涛14 小时前
TencentOS Server 4.4(兼容centos 9 stream)部署KKFileView
linux·运维·centos·kkfileview
白驹过隙不负青春15 小时前
Docker-compose部署java服务及前端服务
java·运维·前端·docker·容器·centos
源图客17 小时前
CentOS系统安装Python3.12.10
linux·运维·centos
MyCollege199917 小时前
以UEFI模式从U盘安装centos遇到空间不足
linux·运维·centos
BIBI204920 小时前
通过 HeidiSQL 连接 CentOS 7 中的 MySQL 5.7
linux·windows·mysql·centos·数据库管理·环境搭建·服务器运维
两千连弹21 小时前
VMware安装CentOS Stream 9及Redis安装
linux·运维·centos
yueguangni1 天前
sysstat 版本 10.1.5 是 CentOS 7 的默认版本,默认情况下确实不显示 %wait 字段。需要升级到新版sysstat
linux·运维·centos
豆是浪个1 天前
Linux(Centos 7.6)命令详解:ps
linux·windows·centos