1.安装环境
复制代码
1
2
3
4
5sudo apt update sudo apt install dh-make sudo apt install devscripts sudo apt install build-essential
2.创建一个二级目录
复制代码
1
2
3mkdir ~/test/hello-1.0 -p cd ~/test/hello-1.0
3.创建文件
hello.c 文件内容
复制代码
1
2
3
4
5
6
7
8//cat hello.c #include <stdio.h> int main(void) { printf("%sn","Hello"); return 0; }
Makefile 文件内容
复制代码
1
2
3
4
5
6
7
8
9
10# 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⽬录
复制代码
1
2dh_make --createorig -e liruijian@kylinos.cn
5.在debian目录下创建install文件
复制代码
1
2vi debian/install
install 文件内容
复制代码
1
2hello /bin
6.编译出changelog
复制代码
1
2
3debuild -S -sa -Inothing
7.推到launchpad.net编译
复制代码
1
2dput ppa:liruijian/hello ../hello_1.0-1_source.changes
会推送失败,处理如下:
修改debian/control文件为:
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16Source: 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文件为:
复制代码
1
2
3
4
5
6hello (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
就可以上传成功并且编译通过。
最后
以上就是矮小夏天最近收集整理的关于launchpad(二)ubuntu使用launchpad.net线上编译的全部内容,更多相关launchpad(二)ubuntu使用launchpad内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复