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
相关推荐
深夜情感老师3 分钟前
centos离线安装ssh
linux·centos·ssh
啊吧怪不啊吧8 小时前
Linux常见指令介绍下(入门级)
linux·开发语言·centos
李菠菜8 小时前
CentOS系统指定版本Docker与Docker-Compose在线安装教程
docker·容器·centos
柳如烟@9 小时前
CentOS 7上Memcached的安装、配置及高可用架构搭建
架构·centos·memcached
小鑫仔_x15 小时前
使用 VMware 安装一台 Linux 系统之Centos
linux·运维·centos
hnlucky15 小时前
CentOS 7 系统中,防火墙要怎么使用?
linux·运维·网络·网络安全·centos
Waitccy15 小时前
CentOS 7 磁盘分区详细教程
linux·运维·centos
davysiao15 小时前
基于 CentOS 的 Docker Swarm 集群管理实战指南
linux·docker·centos
Python私教15 小时前
CentOS 7 基于 Nginx 的 HTML 部署全流程指南
nginx·centos·html
企鹅侠客16 小时前
centos停服 迁移centos7.3系统到新搭建的openEuler
linux·运维·centos·openeuler·迁移