git生成patch,应用到rpmbuild 打补丁

本文介绍了如何在CentOS环境下制作rpm包,并利用git生成patch文件。相较于传统的diff命令,git format-patch提供了更便捷的方式。文章详细讲解了从创建spec文件、解决rpmbuild错误到应用patch的步骤,确保补丁正确地应用到rpm构建过程。
摘要由CSDN通过智能技术生成

git diff > test.patch
git format-patch
不要再用diff命令 对比生成patch了,太土

原来的rpm制作,打patch方法(土):
http://blog.csdn.net/qq_26437925/article/details/73864258

centos下 rpm制作

运行环境

[root@localhost myrpm_build]# uname -a
Linux localhost 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

不同的运行环境需要调整自己的spec文件

[root@localhost myrpm_build]# tree helloworld-0.1
helloworld-0.1
├── configure
├── helloworld.c
└── readme

0 directories, 3 files
[root@localhost myrpm_build]# 

configure

#!/bin/sh
cat >Makefile  << EOF
all:helloworld
helloworld.o:helloworld.c
        gcc -c helloworld.c
helloworld:helloworld.o
        gcc helloworld.o -o helloworld
fresh:
        rm -f Makefile
clean:
        rm -f helloworld helloworld.o
install:
        cp helloworld /usr/bin
uninstall:
        rm -f /usr/bin/helloworld
EOF

helloword.c

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值