launchpad(二)ubuntu使用launchpad.net线上编译

1.安装环境

sudo apt update
sudo apt install dh-make
sudo apt install devscripts
sudo apt install build-essential

2.创建一个二级目录

mkdir ~/test/hello-1.0 -p
cd ~/test/hello-1.0

3.创建文件
hello.c 文件内容

//cat hello.c
#include <stdio.h>

int main(void)
{
        printf("%s\n","Hello");
        return 0;
}

Makefile 文件内容

# cat Makefile
hello:hello.o
	gcc -o hello hello.o
hello.o:hello.c
	gcc -o hello.o -c hello.c
.PHONY:rebuild clean
rebuild:clean hello
clean:
	rm -f hello hello.o

4.⽣成debian⽬录

dh_make --createorig -e liruijian@kylinos.cn

5.在debian目录下创建install文件

vi debian/install

install 文件内容

hello /bin

6.编译出changelog

debuild -S  -sa -Inothing

7.推到launchpad.net编译

dput ppa:liruijian/hello ../hello_1.0-1_source.changes

会推送失败,处理如下:
修改debian/control文件为:

Source: hello
Section: libs
Priority: optional
Maintainer: jian <liruijian@kylinos.cn>
Build-Depends: debhelper (>=9)
Standards-Version: 3.9.6
Homepage: <insert the upstream URL, if relevant>
#Vcs-Git: git://anonscm.debian.org/collab-maint/hello.git
#Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/hello.git

Package: hello
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: <insert up to 60 chars description>
 <insert long description, indented with spaces>
jian@ubuntu:~/share/src/hello-1.0$ 

修改debian/changelog文件为:

hello (1.0-1) xenial; urgency=medium

  * Initial release (Closes: #nnnn)  <nnnn is the bug number of your ITP>

 -- liruijian <liruijian@kylinos.cn>  Thu, 13 May 2021 16:32:31 +0800

就可以上传成功并且编译通过。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小坚学Linux

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值