From b7694d5817fb1a6c9554ac109dec6a0f16d4a7b6 Mon Sep 17 00:00:00 2001 From: Yao Date: Thu, 9 Mar 2023 08:14:29 +0000 Subject: [PATCH 1/8] =?UTF-8?q?=E6=96=87=E6=A1=A3=E7=A7=BB=E6=A4=8DHello?= =?UTF-8?q?=E8=BD=AF=E4=BB=B6=E5=88=B0openKylin=20=E7=BF=BB=E8=AF=91=20?= =?UTF-8?q?=E7=BF=BB=E8=AF=91=20docs/=20=E7=A4=BE=E5=8C=BA=E5=BC=80?= =?UTF-8?q?=E5=8F=91=E6=8C=87=E5=8D=97/=E7=A7=BB=E6=A4=8DHello=E8=BD=AF?= =?UTF-8?q?=E4=BB=B6=E5=88=B0openKylin.md=20=E6=96=87=E4=BB=B6=EF=BC=8C?= =?UTF-8?q?=E4=B8=BA=E8=8B=B1=E8=AF=AD=E7=94=A8=E6=88=B7=E6=8F=90=E4=BE=9B?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E4=BE=BF=E5=88=A9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yao --- ...(\350\213\261\346\226\207\347\211\210).md" | 392 ++++++++++++++++++ 1 file changed, 392 insertions(+) create mode 100644 "\347\244\276\345\214\272\345\274\200\345\217\221\346\214\207\345\215\227/\347\247\273\346\244\215Hello\350\275\257\344\273\266\345\210\260openKylin(\350\213\261\346\226\207\347\211\210).md" diff --git "a/\347\244\276\345\214\272\345\274\200\345\217\221\346\214\207\345\215\227/\347\247\273\346\244\215Hello\350\275\257\344\273\266\345\210\260openKylin(\350\213\261\346\226\207\347\211\210).md" "b/\347\244\276\345\214\272\345\274\200\345\217\221\346\214\207\345\215\227/\347\247\273\346\244\215Hello\350\275\257\344\273\266\345\210\260openKylin(\350\213\261\346\226\207\347\211\210).md" new file mode 100644 index 0000000..325bb13 --- /dev/null +++ "b/\347\244\276\345\214\272\345\274\200\345\217\221\346\214\207\345\215\227/\347\247\273\346\244\215Hello\350\275\257\344\273\266\345\210\260openKylin(\350\213\261\346\226\207\347\211\210).md" @@ -0,0 +1,392 @@ +# # Porting software "Hello" to openKylin + + + +> This document is a demo about migration and packaging for the package of openKylin. + + +## I. Introduction of GNU Hello +The GNU Hello is a sample program of  GNU .This project implements the introductory program hello world in the formal  GNU  specification, which is the reference for GNU coding standards and GNU maintainer practices. Although the GNU Hello only is a small program about 'hello world', it contains several technologies described as follows: + +- Automake and Autoconf: generate compiled configuration scripts +- Gnulib: the basic function library +- Gettext: Internationalization support +- getopt: command line parameter support +- help2man: Generate manpage with the --help option of the program +- Texinfo: write program documentation + + +The more complex software systems in the GNU project, with higher complexity of specific business logic, are organized in a way that is consistent with the specifications demonstrated in the "Hello". + +## II. Packaging upstream source code +> openKylin uses apt as a package manager. When employing upstream software into openKylin, the upstream source code needs to be packaged as a Debian-compliant source package. + + +### 1. Obtain upstream source code + +The official website of "GNU Hello“ is [https://www.gnu.org/software/hello/](https://www.gnu.org/software/hello/) + +Download the latest version (2.12.1) from [https://ftp.gnu.org/gnu/hello/hello-2.12.1.tar.gz](https://ftp.gnu.org/gnu/hello/hello-2.12.1.tar.gz) + +Subsequently, decompress the source package. + +```shell +$ wget https://ftp.gnu.org/gnu/hello/hello-2.12.1.tar.gz +$ tar -xaf hello-2.12.1.tar.gz +``` + +### 2. generate template files with debmake + +Access the directory of source code and execute `debmake` + +```shell +$ cd hello-2.12.1 +$ debmake +I: set parameters +I: sanity check of parameters +I: pkg="hello", ver="2.12.1", rev="1" +I: *** start packaging in "hello-2.12.1". *** +I: provide hello_2.12.1.orig.tar.gz for non-native Debian package +I: pwd = "/data2/test/hello" +I: $ ln -sf hello-2.12.1.tar.gz hello_2.12.1.orig.tar.gz +I: pwd = "/data2/test/hello/hello-2.12.1" +I: parse binary package settings: +I: binary package=hello Type=bin / Arch=any M-A=foreign +I: analyze the source tree +I: build_type = Autotools with autoreconf +I: scan source for copyright+license text and file extensions +I: 43 %, ext = c +I: 27 %, ext = m4 +I: 11 %, ext = gmo +I: 11 %, ext = po +I: 1 %, ext = gperf +I: 1 %, ext = mk +I: 1 %, ext = in +I: 1 %, ext = texi +I: 0 %, ext = sin +I: 0 %, ext = sed +I: 0 %, ext = header +I: 0 %, ext = text +I: 0 %, ext = O +I: 0 %, ext = ac +I: 0 %, ext = am +I: 0 %, ext = 1 +I: 0 %, ext = pot +I: 0 %, ext = x +I: 0 %, ext = valgrind +I: 0 %, ext = info +I: 0 %, ext = tex +I: 0 %, ext = sub +I: 0 %, ext = rpath +I: 0 %, ext = sh +I: 0 %, ext = guess +I: check_all_licenses +...... +I: check_all_licenses completed for 447 files. +I: bunch_all_licenses +I: format_all_licenses +I: make debian/* template files +I: single binary package +I: debmake -x "1" ... +I: creating => debian/control +I: creating => debian/copyright +I: substituting => /usr/share/debmake/extra0/changelog +I: creating => debian/changelog +I: substituting => /usr/share/debmake/extra0/rules +I: creating => debian/rules +I: substituting => /usr/share/debmake/extra1/compat +I: creating => debian/compat +I: substituting => /usr/share/debmake/extra1/watch +I: creating => debian/watch +I: substituting => /usr/share/debmake/extra1/README.Debian +I: creating => debian/README.Debian +I: substituting => /usr/share/debmake/extra1source/local-options +I: creating => debian/source/local-options +I: substituting => /usr/share/debmake/extra1source/format +I: creating => debian/source/format +I: substituting => /usr/share/debmake/extra1patches/series +I: creating => debian/patches/series +I: run "debmake -x2" to get more template files +I: $ wrap-and-sort +``` + +After running `debmake`, a new debian directory and template files are created. + +View the source tree. + +```shell +$ cd .. +$ tree +├── hello-2.12.1 +│...... +│   ├── debian +│   │   ├── changelog +│   │   ├── compat +│   │   ├── control +│   │   ├── copyright +│   │   ├── patches +│   │   │   └── series +│   │   ├── README.Debian +│   │   ├── rules +│   │   ├── source +│   │   │   ├── format +│   │   │   └── local-options +│   │   └── watch +│...... +├── hello_2.12.1.orig.tar.gz -> hello-2.12.1.tar.gz +└── hello-2.12.1.tar.gz +``` + +### 3. Edit the directory template file of debian + +#### (1) Check debian/source + +##### [1] Make sure the format of packages is quilt + +`debian/source/format` defines the format of source package,which is `3.0 (native)` or `3.0 (quilt)`. According to the requirement of building openKylin package workflow, the format of source package must be `3.0 (quilt)`. + +```shell +$ cat debian/source/format +3.0 (quilt) +``` + +##### [2] local-options is generally unneeded and can be removed + +```shell +rm debian/source/local-options +``` + +#### (2) Edit debian/changelog + +`debian/changelog`is the update log of package, which includes package name, version number, version description, etc. +The default initialization content `debian/changlog` is: + +```text +hello (2.12.1-1) UNRELEASED; urgency=low + + * Initial release. Closes: #nnnn + + + -- your name Wed, 16 Nov 2022 09:40:47 +0800 +``` +The package name is on the left of the first line, and the package version is on its right. The format of package version is `-`, where `upstream_version` is the upstream version. +The upstream version number has been automatically identified as 2.12.1 during the execution of `debmake`. `revisions` is the revised version, default 1. + +For the package of openKylin, use `ok1` as the first `revisions`. +`UNRELEASED`, on the right side, needs to be modified to `yangtze`. The description in the middle is usually written as: `Build for openKylin`. + +In the last line, `your name` is the personal signature (English recommended). `your email address` is the personal email address. Both parameters need to be filled in and are indispensable. + + +The contents of the `debian/changlog` file after the modification is demonstrated as follows: + +```text +hello (2.12.1-ok1) yangtze; urgency=medium + + * Build for openKylin. + + -- zhangsan Tue, 15 Nov 2022 10:13:02 +0800 +``` + +#### (3) Edit debian/control + +`debian/control` defines the information of source and binary packages, including compilation dependencies, installation dependencies, etc. It is an essential file, which can be written according to the information exhibited by the upstream software. After the modification, it is shown below. + +```text +Source: hello +Section: devel +Priority: optional +Maintainer: openKylin Developers +Standards-Version: 4.3.0 +Build-Depends: debhelper-compat (= 9) +Homepage: http://www.gnu.org/software/hello/ +Rules-Requires-Root: no + +Package: hello +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Conflicts: hello-traditional +Replaces: hello-traditional, hello-debhelper (<< 2.9) +Breaks: hello-debhelper (<< 2.9) +Description: example package based on GNU hello + The GNU hello program produces a familiar, friendly greeting. It + allows non-programmers to use a classic computer science tool which + would otherwise be unavailable to them. + . + Seriously, though: this is an example of how to do a Debian package. + It is the Debian version of the GNU Project's `hello world' program + (which is itself an example for the GNU Project). +``` + +#### (4) Edit debian/rules + + +The `debian/rules` is a build script provided by the package maintainer. In fact, this file is Makefile that needs to be written according to the compilation method of the upstream software. This file is also indispensable. By default, the contents of `debian/rules` is read as the compilation rules. + +"Hello" is a standard package built with `Autotools`. It is compiled and installed as follows + +```shell +$ ./configure +$ make +$ sudo make install +``` + + +Based on the above compilation method, the `debian/rules` ia written as follows. + +```Makefile +#!/usr/bin/make -f +%: + dh $@ + +override_dh_auto_clean: + [ ! -f Makefile ] || $(MAKE) distclean + +override_dh_installdocs: + dh_installdocs NEWS +``` + +#### (5) Handle non-essential documents + +debian/compat and debian/README.Debian are not essential documents, which can be deleted. + +```shell +$ rm debian/compat +$ rm debian/README.Debian +``` + +### 4. Package and test compile +Execute `dpkg-source -b . ` to package the upstream source code into a Debian-formatted source package. Two new files ending in `.debian.tar.xz` and `.dsc` will be generated after successful packaging. + + + +```shell +$ dpkg-source -b . +dpkg-source: info: using source format '3.0 (quilt)' +dpkg-source: info: building hello using existing ./hello_2.12.1.orig.tar.gz +dpkg-source: info: building hello in hello_2.12.1-ok1.debian.tar.xz +dpkg-source: info: building hello in hello_2.12.1-ok1.dsc + +$ tree -L 1 ../ +../ +├── hello-2.12.1 +├── hello_2.12.1-ok1.debian.tar.xz +├── hello_2.12.1-ok1.dsc +├── hello_2.12.1.orig.tar.gz -> hello-2.12.1.tar.gz +└── hello-2.12.1.tar.gz + +1 directory, 4 files +``` + +Before uploading the source package to Git, we can also do a local test to make sure that the debian/rules files are written correctly. It is always recommended to do a local build test before uploading to the Git repository. debian-formatted source packages are compiled using the `dpkg-buildpackage` tool. When the compilation is successful, it looks like the following. + +```shell +$ dpkg-buildpackage -b -uc +dpkg-buildpackage: info: source package hello +dpkg-buildpackage: info: source package version 2.12.1-ok1 +dpkg-buildpackage: info: source distribution yangtze +...... + Renaming hello-dbgsym_2.12.1-ok1_amd64.deb to hello-dbgsym_2.12.1-ok1_amd64.ddeb + dpkg-genbuildinfo --build=binary + dpkg-genchanges --build=binary >../hello_2.12.1-ok1_amd64.changes +dpkg-genchanges: info: binary-only upload (no source code included) + dpkg-source --after-build . +dpkg-buildpackage: info: binary-only upload (no source included) + +$ tree -L 1 ../ +../ +├── hello-2.12.1 +├── hello_2.12.1-ok1_amd64.buildinfo +├── hello_2.12.1-ok1_amd64.changes +├── hello_2.12.1-ok1_amd64.deb +├── hello_2.12.1-ok1.debian.tar.xz +├── hello_2.12.1-ok1.dsc +├── hello_2.12.1.orig.tar.gz -> hello-2.12.1.tar.gz +├── hello-2.12.1.tar.gz +└── hello-dbgsym_2.12.1-ok1_amd64.ddeb + +1 directory, 8 files +``` + +## III. Upload the source package to the Gitee + +### 1. Create the corresponding Git repository + +#### (1) fork openkylin/community repository to personal repository + +To create a new code repository in the openKylin, the openkylin/community repository is required. [https://gitee.com/openkylin/community](https://gitee.com/openkylin/community) + +Fork the openkylin/community repository to your personal account on the browser. Clone thw generated new repository address `https://gitee.com//community` to local. + + +```shell +$ git clone git@gitee.com:/community.git +``` +The follow-up process is divided into two types in terms of maintainer roles, **Separate Package Maintainer** and **SIG Group Maintainer**. + +#### (2)As a separate package maintainer +##### [1] Create package and maintenance information +Go to the first-level directory of packages, create `hello.yaml` and add the following content. +(more examples is in:[https://gitee.com/openkylin/community/tree/master/packages](https://gitee.com/openkylin/community/tree/master/packages)) + +```yaml +name: hello +path: hello +maintainers: +- name: your Gitee ID + openkylinid: your username of openkylinid + displayname: your name or nickname + email: your email +``` + +##### [2] Upload changes to a personal remote repository and commit pr to the openkylin/community repository + +```shell +$ git add packages +$ git commit -m "Add maintenance information of hello" +$ git push origin master +``` + +After pushing to the personal repository, `Pull Requests` will be launched on the web page. After the corresponding community manager has reviewed and accepted the pr, the corresponding community manager will automatically create the corresponding openkylin repository based on the maintenance information described in the package. + +For example, after the pr request for the `hello` above is merged, an openkylin repository named `hello` will be created, which can be accessed in the browser. The corresponding repository address for the `hello` package is [https://gitee.com/openkylin/hello](https://gitee.com/openkylin/hello) + +#### (3) As a SIG group maintainer + +##### [1] Create package and maintenance information + +This step requires adding the source package name to the `sig.yaml` in the corresponding sig group. Taking `Packaging SIG` group as an example, the operation is described as follows. + +```shell +$ echo "- hello" >> sig/packaging/sig.yaml +``` + +##### [2] Upload changes to a personal remote repository and commit pr to the openkylin/community repository + +```shell +$ git add sig/packaging/sig.yaml +$ git commit -m "Add hello package" +$ git push origin master +``` + +After pushing to the personal repository, `Pull Requests` request will be launched . +After the corresponding SIG group maintainer has reviewed and accepted the pr, the corresponding SIG group maintainer will automatically create the corresponding openkylin repository according to the maintenance information described in the package. + +For example, after the pr request for the `hello` package above is merged, an openkylin repository named `hello` will be created, which can be accessed in the browser. The corresponding repository address for the `hello` package is [https://gitee.com/openkylin/hello](https://gitee.com/openkylin/hello) + +### 2. Build a local Git repository + +Obtain the tool:[https://gitee.com/openkylin/packaging-tools](https://gitee.com/openkylin/packaging-tools) + +```shell +$ path/to/source-packing.py import-to-git --dsc-file hello_2.12.1-ok1.dsc --packaging-branch openkylin/yangtze +``` + +### 3. Push to a remote Git repository + +```shell +$ cd hello +$ git remote add origin git@gitee.com:openkylin/hello.git +$ git push --all && git push --tags +``` +At this point you can open the Gitee Platform repository link ([https://gitee.com/openkylin/hello](https://gitee.com/openkylin/hello)) in your browser to check if the source code is pushed successfully. -- Gitee From 7f819fdf14eb3d06bbe590d5774507889c56299c Mon Sep 17 00:00:00 2001 From: Yao Date: Fri, 10 Mar 2023 06:51:45 +0000 Subject: [PATCH 2/8] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20?= =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E5=BC=80=E5=8F=91=E6=8C=87=E5=8D=97/?= =?UTF-8?q?=E7=A7=BB=E6=A4=8DHello=E8=BD=AF=E4=BB=B6=E5=88=B0openKylin(?= =?UTF-8?q?=E8=8B=B1=E6=96=87=E7=89=88).md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...(\350\213\261\346\226\207\347\211\210).md" | 392 ------------------ 1 file changed, 392 deletions(-) delete mode 100644 "\347\244\276\345\214\272\345\274\200\345\217\221\346\214\207\345\215\227/\347\247\273\346\244\215Hello\350\275\257\344\273\266\345\210\260openKylin(\350\213\261\346\226\207\347\211\210).md" diff --git "a/\347\244\276\345\214\272\345\274\200\345\217\221\346\214\207\345\215\227/\347\247\273\346\244\215Hello\350\275\257\344\273\266\345\210\260openKylin(\350\213\261\346\226\207\347\211\210).md" "b/\347\244\276\345\214\272\345\274\200\345\217\221\346\214\207\345\215\227/\347\247\273\346\244\215Hello\350\275\257\344\273\266\345\210\260openKylin(\350\213\261\346\226\207\347\211\210).md" deleted file mode 100644 index 325bb13..0000000 --- "a/\347\244\276\345\214\272\345\274\200\345\217\221\346\214\207\345\215\227/\347\247\273\346\244\215Hello\350\275\257\344\273\266\345\210\260openKylin(\350\213\261\346\226\207\347\211\210).md" +++ /dev/null @@ -1,392 +0,0 @@ -# # Porting software "Hello" to openKylin - - - -> This document is a demo about migration and packaging for the package of openKylin. - - -## I. Introduction of GNU Hello -The GNU Hello is a sample program of  GNU .This project implements the introductory program hello world in the formal  GNU  specification, which is the reference for GNU coding standards and GNU maintainer practices. Although the GNU Hello only is a small program about 'hello world', it contains several technologies described as follows: - -- Automake and Autoconf: generate compiled configuration scripts -- Gnulib: the basic function library -- Gettext: Internationalization support -- getopt: command line parameter support -- help2man: Generate manpage with the --help option of the program -- Texinfo: write program documentation - - -The more complex software systems in the GNU project, with higher complexity of specific business logic, are organized in a way that is consistent with the specifications demonstrated in the "Hello". - -## II. Packaging upstream source code -> openKylin uses apt as a package manager. When employing upstream software into openKylin, the upstream source code needs to be packaged as a Debian-compliant source package. - - -### 1. Obtain upstream source code - -The official website of "GNU Hello“ is [https://www.gnu.org/software/hello/](https://www.gnu.org/software/hello/) - -Download the latest version (2.12.1) from [https://ftp.gnu.org/gnu/hello/hello-2.12.1.tar.gz](https://ftp.gnu.org/gnu/hello/hello-2.12.1.tar.gz) - -Subsequently, decompress the source package. - -```shell -$ wget https://ftp.gnu.org/gnu/hello/hello-2.12.1.tar.gz -$ tar -xaf hello-2.12.1.tar.gz -``` - -### 2. generate template files with debmake - -Access the directory of source code and execute `debmake` - -```shell -$ cd hello-2.12.1 -$ debmake -I: set parameters -I: sanity check of parameters -I: pkg="hello", ver="2.12.1", rev="1" -I: *** start packaging in "hello-2.12.1". *** -I: provide hello_2.12.1.orig.tar.gz for non-native Debian package -I: pwd = "/data2/test/hello" -I: $ ln -sf hello-2.12.1.tar.gz hello_2.12.1.orig.tar.gz -I: pwd = "/data2/test/hello/hello-2.12.1" -I: parse binary package settings: -I: binary package=hello Type=bin / Arch=any M-A=foreign -I: analyze the source tree -I: build_type = Autotools with autoreconf -I: scan source for copyright+license text and file extensions -I: 43 %, ext = c -I: 27 %, ext = m4 -I: 11 %, ext = gmo -I: 11 %, ext = po -I: 1 %, ext = gperf -I: 1 %, ext = mk -I: 1 %, ext = in -I: 1 %, ext = texi -I: 0 %, ext = sin -I: 0 %, ext = sed -I: 0 %, ext = header -I: 0 %, ext = text -I: 0 %, ext = O -I: 0 %, ext = ac -I: 0 %, ext = am -I: 0 %, ext = 1 -I: 0 %, ext = pot -I: 0 %, ext = x -I: 0 %, ext = valgrind -I: 0 %, ext = info -I: 0 %, ext = tex -I: 0 %, ext = sub -I: 0 %, ext = rpath -I: 0 %, ext = sh -I: 0 %, ext = guess -I: check_all_licenses -...... -I: check_all_licenses completed for 447 files. -I: bunch_all_licenses -I: format_all_licenses -I: make debian/* template files -I: single binary package -I: debmake -x "1" ... -I: creating => debian/control -I: creating => debian/copyright -I: substituting => /usr/share/debmake/extra0/changelog -I: creating => debian/changelog -I: substituting => /usr/share/debmake/extra0/rules -I: creating => debian/rules -I: substituting => /usr/share/debmake/extra1/compat -I: creating => debian/compat -I: substituting => /usr/share/debmake/extra1/watch -I: creating => debian/watch -I: substituting => /usr/share/debmake/extra1/README.Debian -I: creating => debian/README.Debian -I: substituting => /usr/share/debmake/extra1source/local-options -I: creating => debian/source/local-options -I: substituting => /usr/share/debmake/extra1source/format -I: creating => debian/source/format -I: substituting => /usr/share/debmake/extra1patches/series -I: creating => debian/patches/series -I: run "debmake -x2" to get more template files -I: $ wrap-and-sort -``` - -After running `debmake`, a new debian directory and template files are created. - -View the source tree. - -```shell -$ cd .. -$ tree -├── hello-2.12.1 -│...... -│   ├── debian -│   │   ├── changelog -│   │   ├── compat -│   │   ├── control -│   │   ├── copyright -│   │   ├── patches -│   │   │   └── series -│   │   ├── README.Debian -│   │   ├── rules -│   │   ├── source -│   │   │   ├── format -│   │   │   └── local-options -│   │   └── watch -│...... -├── hello_2.12.1.orig.tar.gz -> hello-2.12.1.tar.gz -└── hello-2.12.1.tar.gz -``` - -### 3. Edit the directory template file of debian - -#### (1) Check debian/source - -##### [1] Make sure the format of packages is quilt - -`debian/source/format` defines the format of source package,which is `3.0 (native)` or `3.0 (quilt)`. According to the requirement of building openKylin package workflow, the format of source package must be `3.0 (quilt)`. - -```shell -$ cat debian/source/format -3.0 (quilt) -``` - -##### [2] local-options is generally unneeded and can be removed - -```shell -rm debian/source/local-options -``` - -#### (2) Edit debian/changelog - -`debian/changelog`is the update log of package, which includes package name, version number, version description, etc. -The default initialization content `debian/changlog` is: - -```text -hello (2.12.1-1) UNRELEASED; urgency=low - - * Initial release. Closes: #nnnn - - - -- your name Wed, 16 Nov 2022 09:40:47 +0800 -``` -The package name is on the left of the first line, and the package version is on its right. The format of package version is `-`, where `upstream_version` is the upstream version. -The upstream version number has been automatically identified as 2.12.1 during the execution of `debmake`. `revisions` is the revised version, default 1. - -For the package of openKylin, use `ok1` as the first `revisions`. -`UNRELEASED`, on the right side, needs to be modified to `yangtze`. The description in the middle is usually written as: `Build for openKylin`. - -In the last line, `your name` is the personal signature (English recommended). `your email address` is the personal email address. Both parameters need to be filled in and are indispensable. - - -The contents of the `debian/changlog` file after the modification is demonstrated as follows: - -```text -hello (2.12.1-ok1) yangtze; urgency=medium - - * Build for openKylin. - - -- zhangsan Tue, 15 Nov 2022 10:13:02 +0800 -``` - -#### (3) Edit debian/control - -`debian/control` defines the information of source and binary packages, including compilation dependencies, installation dependencies, etc. It is an essential file, which can be written according to the information exhibited by the upstream software. After the modification, it is shown below. - -```text -Source: hello -Section: devel -Priority: optional -Maintainer: openKylin Developers -Standards-Version: 4.3.0 -Build-Depends: debhelper-compat (= 9) -Homepage: http://www.gnu.org/software/hello/ -Rules-Requires-Root: no - -Package: hello -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Conflicts: hello-traditional -Replaces: hello-traditional, hello-debhelper (<< 2.9) -Breaks: hello-debhelper (<< 2.9) -Description: example package based on GNU hello - The GNU hello program produces a familiar, friendly greeting. It - allows non-programmers to use a classic computer science tool which - would otherwise be unavailable to them. - . - Seriously, though: this is an example of how to do a Debian package. - It is the Debian version of the GNU Project's `hello world' program - (which is itself an example for the GNU Project). -``` - -#### (4) Edit debian/rules - - -The `debian/rules` is a build script provided by the package maintainer. In fact, this file is Makefile that needs to be written according to the compilation method of the upstream software. This file is also indispensable. By default, the contents of `debian/rules` is read as the compilation rules. - -"Hello" is a standard package built with `Autotools`. It is compiled and installed as follows - -```shell -$ ./configure -$ make -$ sudo make install -``` - - -Based on the above compilation method, the `debian/rules` ia written as follows. - -```Makefile -#!/usr/bin/make -f -%: - dh $@ - -override_dh_auto_clean: - [ ! -f Makefile ] || $(MAKE) distclean - -override_dh_installdocs: - dh_installdocs NEWS -``` - -#### (5) Handle non-essential documents - -debian/compat and debian/README.Debian are not essential documents, which can be deleted. - -```shell -$ rm debian/compat -$ rm debian/README.Debian -``` - -### 4. Package and test compile -Execute `dpkg-source -b . ` to package the upstream source code into a Debian-formatted source package. Two new files ending in `.debian.tar.xz` and `.dsc` will be generated after successful packaging. - - - -```shell -$ dpkg-source -b . -dpkg-source: info: using source format '3.0 (quilt)' -dpkg-source: info: building hello using existing ./hello_2.12.1.orig.tar.gz -dpkg-source: info: building hello in hello_2.12.1-ok1.debian.tar.xz -dpkg-source: info: building hello in hello_2.12.1-ok1.dsc - -$ tree -L 1 ../ -../ -├── hello-2.12.1 -├── hello_2.12.1-ok1.debian.tar.xz -├── hello_2.12.1-ok1.dsc -├── hello_2.12.1.orig.tar.gz -> hello-2.12.1.tar.gz -└── hello-2.12.1.tar.gz - -1 directory, 4 files -``` - -Before uploading the source package to Git, we can also do a local test to make sure that the debian/rules files are written correctly. It is always recommended to do a local build test before uploading to the Git repository. debian-formatted source packages are compiled using the `dpkg-buildpackage` tool. When the compilation is successful, it looks like the following. - -```shell -$ dpkg-buildpackage -b -uc -dpkg-buildpackage: info: source package hello -dpkg-buildpackage: info: source package version 2.12.1-ok1 -dpkg-buildpackage: info: source distribution yangtze -...... - Renaming hello-dbgsym_2.12.1-ok1_amd64.deb to hello-dbgsym_2.12.1-ok1_amd64.ddeb - dpkg-genbuildinfo --build=binary - dpkg-genchanges --build=binary >../hello_2.12.1-ok1_amd64.changes -dpkg-genchanges: info: binary-only upload (no source code included) - dpkg-source --after-build . -dpkg-buildpackage: info: binary-only upload (no source included) - -$ tree -L 1 ../ -../ -├── hello-2.12.1 -├── hello_2.12.1-ok1_amd64.buildinfo -├── hello_2.12.1-ok1_amd64.changes -├── hello_2.12.1-ok1_amd64.deb -├── hello_2.12.1-ok1.debian.tar.xz -├── hello_2.12.1-ok1.dsc -├── hello_2.12.1.orig.tar.gz -> hello-2.12.1.tar.gz -├── hello-2.12.1.tar.gz -└── hello-dbgsym_2.12.1-ok1_amd64.ddeb - -1 directory, 8 files -``` - -## III. Upload the source package to the Gitee - -### 1. Create the corresponding Git repository - -#### (1) fork openkylin/community repository to personal repository - -To create a new code repository in the openKylin, the openkylin/community repository is required. [https://gitee.com/openkylin/community](https://gitee.com/openkylin/community) - -Fork the openkylin/community repository to your personal account on the browser. Clone thw generated new repository address `https://gitee.com//community` to local. - - -```shell -$ git clone git@gitee.com:/community.git -``` -The follow-up process is divided into two types in terms of maintainer roles, **Separate Package Maintainer** and **SIG Group Maintainer**. - -#### (2)As a separate package maintainer -##### [1] Create package and maintenance information -Go to the first-level directory of packages, create `hello.yaml` and add the following content. -(more examples is in:[https://gitee.com/openkylin/community/tree/master/packages](https://gitee.com/openkylin/community/tree/master/packages)) - -```yaml -name: hello -path: hello -maintainers: -- name: your Gitee ID - openkylinid: your username of openkylinid - displayname: your name or nickname - email: your email -``` - -##### [2] Upload changes to a personal remote repository and commit pr to the openkylin/community repository - -```shell -$ git add packages -$ git commit -m "Add maintenance information of hello" -$ git push origin master -``` - -After pushing to the personal repository, `Pull Requests` will be launched on the web page. After the corresponding community manager has reviewed and accepted the pr, the corresponding community manager will automatically create the corresponding openkylin repository based on the maintenance information described in the package. - -For example, after the pr request for the `hello` above is merged, an openkylin repository named `hello` will be created, which can be accessed in the browser. The corresponding repository address for the `hello` package is [https://gitee.com/openkylin/hello](https://gitee.com/openkylin/hello) - -#### (3) As a SIG group maintainer - -##### [1] Create package and maintenance information - -This step requires adding the source package name to the `sig.yaml` in the corresponding sig group. Taking `Packaging SIG` group as an example, the operation is described as follows. - -```shell -$ echo "- hello" >> sig/packaging/sig.yaml -``` - -##### [2] Upload changes to a personal remote repository and commit pr to the openkylin/community repository - -```shell -$ git add sig/packaging/sig.yaml -$ git commit -m "Add hello package" -$ git push origin master -``` - -After pushing to the personal repository, `Pull Requests` request will be launched . -After the corresponding SIG group maintainer has reviewed and accepted the pr, the corresponding SIG group maintainer will automatically create the corresponding openkylin repository according to the maintenance information described in the package. - -For example, after the pr request for the `hello` package above is merged, an openkylin repository named `hello` will be created, which can be accessed in the browser. The corresponding repository address for the `hello` package is [https://gitee.com/openkylin/hello](https://gitee.com/openkylin/hello) - -### 2. Build a local Git repository - -Obtain the tool:[https://gitee.com/openkylin/packaging-tools](https://gitee.com/openkylin/packaging-tools) - -```shell -$ path/to/source-packing.py import-to-git --dsc-file hello_2.12.1-ok1.dsc --packaging-branch openkylin/yangtze -``` - -### 3. Push to a remote Git repository - -```shell -$ cd hello -$ git remote add origin git@gitee.com:openkylin/hello.git -$ git push --all && git push --tags -``` -At this point you can open the Gitee Platform repository link ([https://gitee.com/openkylin/hello](https://gitee.com/openkylin/hello)) in your browser to check if the source code is pushed successfully. -- Gitee From dc64cf5cfc55ee0bc70c7d9712379d41dd9b2440 Mon Sep 17 00:00:00 2001 From: Yao Date: Fri, 10 Mar 2023 06:52:01 +0000 Subject: [PATCH 3/8] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=20=E7=A4=BE?= =?UTF-8?q?=E5=8C=BA=E5=BC=80=E5=8F=91=E6=8C=87=E5=8D=97/=E7=A7=BB?= =?UTF-8?q?=E6=A4=8DHello=E8=BD=AF=E4=BB=B6=E5=88=B0openKylin.md=20?= =?UTF-8?q?=E4=B8=BA=20=E7=A4=BE=E5=8C=BA=E5=BC=80=E5=8F=91=E6=8C=87?= =?UTF-8?q?=E5=8D=97/=E7=A7=BB=E6=A4=8DGun=20Hello=E8=BD=AF=E4=BB=B6?= =?UTF-8?q?=E5=88=B0openKylin.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\215Gun Hello\350\275\257\344\273\266\345\210\260openKylin.md" | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename "\347\244\276\345\214\272\345\274\200\345\217\221\346\214\207\345\215\227/\347\247\273\346\244\215Hello\350\275\257\344\273\266\345\210\260openKylin.md" => "\347\244\276\345\214\272\345\274\200\345\217\221\346\214\207\345\215\227/\347\247\273\346\244\215Gun Hello\350\275\257\344\273\266\345\210\260openKylin.md" (100%) diff --git "a/\347\244\276\345\214\272\345\274\200\345\217\221\346\214\207\345\215\227/\347\247\273\346\244\215Hello\350\275\257\344\273\266\345\210\260openKylin.md" "b/\347\244\276\345\214\272\345\274\200\345\217\221\346\214\207\345\215\227/\347\247\273\346\244\215Gun Hello\350\275\257\344\273\266\345\210\260openKylin.md" similarity index 100% rename from "\347\244\276\345\214\272\345\274\200\345\217\221\346\214\207\345\215\227/\347\247\273\346\244\215Hello\350\275\257\344\273\266\345\210\260openKylin.md" rename to "\347\244\276\345\214\272\345\274\200\345\217\221\346\214\207\345\215\227/\347\247\273\346\244\215Gun Hello\350\275\257\344\273\266\345\210\260openKylin.md" -- Gitee From 2963d6219f501d32ed2173e0572c8cde6e4ae4d0 Mon Sep 17 00:00:00 2001 From: Yao Date: Fri, 10 Mar 2023 06:53:27 +0000 Subject: [PATCH 4/8] =?UTF-8?q?update=20=E7=A4=BE=E5=8C=BA=E5=BC=80?= =?UTF-8?q?=E5=8F=91=E6=8C=87=E5=8D=97/=E7=A7=BB=E6=A4=8DGun=20Hello?= =?UTF-8?q?=E8=BD=AF=E4=BB=B6=E5=88=B0openKylin.md.=20=E2=80=9CGNU=20Hello?= =?UTF-8?q?=E2=80=9D=E6=98=AF=E5=9B=BA=E5=AE=9A=E7=94=A8=E6=B3=95=EF=BC=8C?= =?UTF-8?q?=E5=86=99=E4=B8=BAhello=E8=BD=AF=E4=BB=B6=E4=B8=8D=E5=A6=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yao --- ...15Gun Hello\350\275\257\344\273\266\345\210\260openKylin.md" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/\347\244\276\345\214\272\345\274\200\345\217\221\346\214\207\345\215\227/\347\247\273\346\244\215Gun Hello\350\275\257\344\273\266\345\210\260openKylin.md" "b/\347\244\276\345\214\272\345\274\200\345\217\221\346\214\207\345\215\227/\347\247\273\346\244\215Gun Hello\350\275\257\344\273\266\345\210\260openKylin.md" index 89dd02f..6f9ed83 100644 --- "a/\347\244\276\345\214\272\345\274\200\345\217\221\346\214\207\345\215\227/\347\247\273\346\244\215Gun Hello\350\275\257\344\273\266\345\210\260openKylin.md" +++ "b/\347\244\276\345\214\272\345\274\200\345\217\221\346\214\207\345\215\227/\347\247\273\346\244\215Gun Hello\350\275\257\344\273\266\345\210\260openKylin.md" @@ -1,4 +1,4 @@ -# 移植Hello软件到openKylin +# 移植Gun Hello到openKylin > 本文是openKylin软件包打包移植的示例文档 -- Gitee From fa951576db5fa9bc6a649d173c890480b380bb6d Mon Sep 17 00:00:00 2001 From: Yao Date: Fri, 10 Mar 2023 07:02:40 +0000 Subject: [PATCH 5/8] =?UTF-8?q?=E6=96=87=E6=A1=A3=E7=A7=BB=E6=A4=8DHello?= =?UTF-8?q?=E8=BD=AF=E4=BB=B6=E5=88=B0openKylin=20=E7=BF=BB=E8=AF=91=20?= =?UTF-8?q?=E5=AF=B9=E5=BC=80=E5=8F=91=E6=8C=87=E5=8D=97=E4=B8=AD=20?= =?UTF-8?q?=E7=A7=BB=E6=A4=8DHello=E8=BD=AF=E4=BB=B6=E5=88=B0openKylin=20?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E8=8B=B1=E6=96=87=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yao --- en/Porting_Gun_Hello_to_openKylin.md | 391 +++++++++++++++++++++++++++ 1 file changed, 391 insertions(+) create mode 100644 en/Porting_Gun_Hello_to_openKylin.md diff --git a/en/Porting_Gun_Hello_to_openKylin.md b/en/Porting_Gun_Hello_to_openKylin.md new file mode 100644 index 0000000..cf2f5bf --- /dev/null +++ b/en/Porting_Gun_Hello_to_openKylin.md @@ -0,0 +1,391 @@ +# # Porting "Gun Hello" to openKylin + + + +This document is an example of packaging and porting software to openKylin. + +## I. Introduction of GNU Hello +The GNU Hello is an example software released by GNU. This project implements the introductory program "hello world" in the formal  GNU  specification, which is the reference for GNU coding standards and GNU maintainer practices. Although the GNU Hello only is a small program about 'hello world', it contains several technologies described as follows: + +- Automake and Autoconf: generate compiled configuration scripts +- Gnulib: the basic function library +- Gettext: Internationalization support +- getopt: command-line parameter support +- help2man: Generate manpage with the --help option of the program +- Texinfo: write program documentation + + +The more complex software systems in the GNU project, with higher complexity of specific business logic, are organized in a way that is consistent with the specifications demonstrated in the Gun Hello. + +## II. Packaging upstream source code +> openKylin uses apt as a package manager. When employing upstream software into openKylin, the upstream source code needs to be packaged as a Debian-compliant source package. + + +### 1. Obtain upstream source code + +The official website of "GNU Hello“ is [https://www.gnu.org/software/hello/](https://www.gnu.org/software/hello/) + +Download the latest version (2.12.1) from [https://ftp.gnu.org/gnu/hello/hello-2.12.1.tar.gz](https://ftp.gnu.org/gnu/hello/hello-2.12.1.tar.gz) + +Subsequently, decompress the source package. + +```shell +$ wget https://ftp.gnu.org/gnu/hello/hello-2.12.1.tar.gz +$ tar -xaf hello-2.12.1.tar.gz +``` + +### 2. generate template files with debmake + +Access the directory of source code and execute `debmake` + +```shell +$ cd hello-2.12.1 +$ debmake +I: set parameters +I: sanity check of parameters +I: pkg="hello", ver="2.12.1", rev="1" +I: *** start packaging in "hello-2.12.1". *** +I: provide hello_2.12.1.orig.tar.gz for non-native Debian package +I: pwd = "/data2/test/hello" +I: $ ln -sf hello-2.12.1.tar.gz hello_2.12.1.orig.tar.gz +I: pwd = "/data2/test/hello/hello-2.12.1" +I: parse binary package settings: +I: binary package=hello Type=bin / Arch=any M-A=foreign +I: analyze the source tree +I: build_type = Autotools with autoreconf +I: scan source for copyright+license text and file extensions +I: 43 %, ext = c +I: 27 %, ext = m4 +I: 11 %, ext = gmo +I: 11 %, ext = po +I: 1 %, ext = gperf +I: 1 %, ext = mk +I: 1 %, ext = in +I: 1 %, ext = texi +I: 0 %, ext = sin +I: 0 %, ext = sed +I: 0 %, ext = header +I: 0 %, ext = text +I: 0 %, ext = O +I: 0 %, ext = ac +I: 0 %, ext = am +I: 0 %, ext = 1 +I: 0 %, ext = pot +I: 0 %, ext = x +I: 0 %, ext = valgrind +I: 0 %, ext = info +I: 0 %, ext = tex +I: 0 %, ext = sub +I: 0 %, ext = rpath +I: 0 %, ext = sh +I: 0 %, ext = guess +I: check_all_licenses +...... +I: check_all_licenses completed for 447 files. +I: bunch_all_licenses +I: format_all_licenses +I: make debian/* template files +I: single binary package +I: debmake -x "1" ... +I: creating => debian/control +I: creating => debian/copyright +I: substituting => /usr/share/debmake/extra0/changelog +I: creating => debian/changelog +I: substituting => /usr/share/debmake/extra0/rules +I: creating => debian/rules +I: substituting => /usr/share/debmake/extra1/compat +I: creating => debian/compat +I: substituting => /usr/share/debmake/extra1/watch +I: creating => debian/watch +I: substituting => /usr/share/debmake/extra1/README.Debian +I: creating => debian/README.Debian +I: substituting => /usr/share/debmake/extra1source/local-options +I: creating => debian/source/local-options +I: substituting => /usr/share/debmake/extra1source/format +I: creating => debian/source/format +I: substituting => /usr/share/debmake/extra1patches/series +I: creating => debian/patches/series +I: run "debmake -x2" to get more template files +I: $ wrap-and-sort +``` + +After running `debmake`, a new debian directory and template files are created. + +View the source tree. + +```shell +$ cd .. +$ tree +├── hello-2.12.1 +│...... +│   ├── debian +│   │   ├── changelog +│   │   ├── compat +│   │   ├── control +│   │   ├── copyright +│   │   ├── patches +│   │   │   └── series +│   │   ├── README.Debian +│   │   ├── rules +│   │   ├── source +│   │   │   ├── format +│   │   │   └── local-options +│   │   └── watch +│...... +├── hello_2.12.1.orig.tar.gz -> hello-2.12.1.tar.gz +└── hello-2.12.1.tar.gz +``` + +### 3. Edit the directory template file of debian + +#### (1) Check debian/source + +##### [1] Make sure the format of packages is quilt + +`debian/source/format` defines the format of source package,which is `3.0 (native)` or `3.0 (quilt)`. According to the requirement of building openKylin package workflow, the format of source package must be `3.0 (quilt)`. + +```shell +$ cat debian/source/format +3.0 (quilt) +``` + +##### [2] local-options is generally unneeded and can be removed + +```shell +rm debian/source/local-options +``` + +#### (2) Edit debian/changelog + +`debian/changelog`is the update log of package, which includes package name, version number, version description, etc. +The default initialization content `debian/changlog` is: + +```text +hello (2.12.1-1) UNRELEASED; urgency=low + + * Initial release. Closes: #nnnn + + + -- your name Wed, 16 Nov 2022 09:40:47 +0800 +``` +The package name is on the left of the first line, and the package version is on its right. The format of package version is `-`, where `upstream_version` is the upstream version. +The upstream version number has been automatically identified as 2.12.1 during the execution of `debmake`. `revisions` is the revised version, default 1. + +For the package of openKylin, use `ok1` as the first `revisions`. +`UNRELEASED`, on the right side, needs to be modified to `yangtze`. The description in the middle is usually written as: `Build for openKylin`. + +In the last line, `your name` is the personal signature (English recommended). `your email address` is the personal email address. Both parameters need to be filled in and are indispensable. + + +The contents of the `debian/changlog` file after the modification is demonstrated as follows: + +```text +hello (2.12.1-ok1) yangtze; urgency=medium + + * Build for openKylin. + + -- zhangsan Tue, 15 Nov 2022 10:13:02 +0800 +``` + +#### (3) Edit debian/control + +`debian/control` defines the information of source and binary packages, including compilation dependencies, installation dependencies, etc. It is an essential file, which can be written according to the information exhibited by the upstream software. After the modification, it is shown below. + +```text +Source: hello +Section: devel +Priority: optional +Maintainer: openKylin Developers +Standards-Version: 4.3.0 +Build-Depends: debhelper-compat (= 9) +Homepage: http://www.gnu.org/software/hello/ +Rules-Requires-Root: no + +Package: hello +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Conflicts: hello-traditional +Replaces: hello-traditional, hello-debhelper (<< 2.9) +Breaks: hello-debhelper (<< 2.9) +Description: example package based on GNU hello + The GNU hello program produces a familiar, friendly greeting. It + allows non-programmers to use a classic computer science tool which + would otherwise be unavailable to them. + . + Seriously, though: this is an example of how to do a Debian package. + It is the Debian version of the GNU Project's `hello world' program + (which is itself an example for the GNU Project). +``` + +#### (4) Edit debian/rules + + +The `debian/rules` is a build script provided by the package maintainer. In fact, this file is Makefile that needs to be written according to the compilation method of the upstream software. This file is also indispensable. By default, the contents of `debian/rules` is read as the compilation rules. + +"Hello" is a standard package built with `Autotools`. It is compiled and installed as follows + +```shell +$ ./configure +$ make +$ sudo make install +``` + + +Based on the above compilation method, the `debian/rules` ia written as follows. + +```Makefile +#!/usr/bin/make -f +%: + dh $@ + +override_dh_auto_clean: + [ ! -f Makefile ] || $(MAKE) distclean + +override_dh_installdocs: + dh_installdocs NEWS +``` + +#### (5) Handle non-essential documents + +debian/compat and debian/README.Debian are not essential documents, which can be deleted. + +```shell +$ rm debian/compat +$ rm debian/README.Debian +``` + +### 4. Package and test compile +Execute `dpkg-source -b . ` to package the upstream source code into a Debian-formatted source package. Two new files ending in `.debian.tar.xz` and `.dsc` will be generated after successful packaging. + + + +```shell +$ dpkg-source -b . +dpkg-source: info: using source format '3.0 (quilt)' +dpkg-source: info: building hello using existing ./hello_2.12.1.orig.tar.gz +dpkg-source: info: building hello in hello_2.12.1-ok1.debian.tar.xz +dpkg-source: info: building hello in hello_2.12.1-ok1.dsc + +$ tree -L 1 ../ +../ +├── hello-2.12.1 +├── hello_2.12.1-ok1.debian.tar.xz +├── hello_2.12.1-ok1.dsc +├── hello_2.12.1.orig.tar.gz -> hello-2.12.1.tar.gz +└── hello-2.12.1.tar.gz + +1 directory, 4 files +``` + +Before uploading the source package to Git, we can also do a local test to make sure that the debian/rules files are written correctly. It is always recommended to do a local build test before uploading to the Git repository. debian-formatted source packages are compiled using the `dpkg-buildpackage` tool. When the compilation is successful, it looks like the following. + +```shell +$ dpkg-buildpackage -b -uc +dpkg-buildpackage: info: source package hello +dpkg-buildpackage: info: source package version 2.12.1-ok1 +dpkg-buildpackage: info: source distribution yangtze +...... + Renaming hello-dbgsym_2.12.1-ok1_amd64.deb to hello-dbgsym_2.12.1-ok1_amd64.ddeb + dpkg-genbuildinfo --build=binary + dpkg-genchanges --build=binary >../hello_2.12.1-ok1_amd64.changes +dpkg-genchanges: info: binary-only upload (no source code included) + dpkg-source --after-build . +dpkg-buildpackage: info: binary-only upload (no source included) + +$ tree -L 1 ../ +../ +├── hello-2.12.1 +├── hello_2.12.1-ok1_amd64.buildinfo +├── hello_2.12.1-ok1_amd64.changes +├── hello_2.12.1-ok1_amd64.deb +├── hello_2.12.1-ok1.debian.tar.xz +├── hello_2.12.1-ok1.dsc +├── hello_2.12.1.orig.tar.gz -> hello-2.12.1.tar.gz +├── hello-2.12.1.tar.gz +└── hello-dbgsym_2.12.1-ok1_amd64.ddeb + +1 directory, 8 files +``` + +## III. Upload the source package to the Gitee + +### 1. Create the corresponding Git repository + +#### (1) fork openkylin/community repository to personal repository + +To create a new code repository in the openKylin, the openkylin/community repository is required. [https://gitee.com/openkylin/community](https://gitee.com/openkylin/community) + +Fork the openkylin/community repository to your personal account on the browser. Clone thw generated new repository address `https://gitee.com//community` to local. + + +```shell +$ git clone git@gitee.com:/community.git +``` +The follow-up process is divided into two types in terms of maintainer roles, **Separate Package Maintainer** and **SIG Group Maintainer**. + +#### (2)As a separate package maintainer +##### [1] Create package and maintenance information +Go to the first-level directory of packages, create `hello.yaml` and add the following content. +(more examples is in:[https://gitee.com/openkylin/community/tree/master/packages](https://gitee.com/openkylin/community/tree/master/packages)) + +```yaml +name: hello +path: hello +maintainers: +- name: your Gitee ID + openkylinid: your username of openkylinid + displayname: your name or nickname + email: your email +``` + +##### [2] Upload changes to a personal remote repository and commit pr to the openkylin/community repository + +```shell +$ git add packages +$ git commit -m "Add maintenance information of hello" +$ git push origin master +``` + +After pushing to the personal repository, `Pull Requests` will be launched on the web page. After the corresponding community manager has reviewed and accepted the pr, the corresponding community manager will automatically create the corresponding openkylin repository based on the maintenance information described in the package. + +For example, after the pr request for the `hello` above is merged, an openkylin repository named `hello` will be created, which can be accessed in the browser. The corresponding repository address for the `hello` package is [https://gitee.com/openkylin/hello](https://gitee.com/openkylin/hello) + +#### (3) As a SIG group maintainer + +##### [1] Create package and maintenance information + +This step requires adding the source package name to the `sig.yaml` in the corresponding sig group. Taking `Packaging SIG` group as an example, the operation is described as follows. + +```shell +$ echo "- hello" >> sig/packaging/sig.yaml +``` + +##### [2] Upload changes to a personal remote repository and commit pr to the openkylin/community repository + +```shell +$ git add sig/packaging/sig.yaml +$ git commit -m "Add hello package" +$ git push origin master +``` + +After pushing to the personal repository, `Pull Requests` request will be launched . +After the corresponding SIG group maintainer has reviewed and accepted the pr, the corresponding SIG group maintainer will automatically create the corresponding openkylin repository according to the maintenance information described in the package. + +For example, after the pr request for the `hello` package above is merged, an openkylin repository named `hello` will be created, which can be accessed in the browser. The corresponding repository address for the `hello` package is [https://gitee.com/openkylin/hello](https://gitee.com/openkylin/hello) + +### 2. Build a local Git repository + +Obtain the tool:[https://gitee.com/openkylin/packaging-tools](https://gitee.com/openkylin/packaging-tools) + +```shell +$ path/to/source-packing.py import-to-git --dsc-file hello_2.12.1-ok1.dsc --packaging-branch openkylin/yangtze +``` + +### 3. Push to a remote Git repository + +```shell +$ cd hello +$ git remote add origin git@gitee.com:openkylin/hello.git +$ git push --all && git push --tags +``` +At this point you can open the Gitee Platform repository link ([https://gitee.com/openkylin/hello](https://gitee.com/openkylin/hello)) in your browser to check if the source code is pushed successfully. -- Gitee From 5a8c5d91e5f6b36b09ce85dbb9028a961d40e962 Mon Sep 17 00:00:00 2001 From: Yao Date: Fri, 10 Mar 2023 07:09:16 +0000 Subject: [PATCH 6/8] =?UTF-8?q?update=20=E7=A4=BE=E5=8C=BA=E5=BC=80?= =?UTF-8?q?=E5=8F=91=E6=8C=87=E5=8D=97/=E7=A7=BB=E6=A4=8DGun=20Hello?= =?UTF-8?q?=E8=BD=AF=E4=BB=B6=E5=88=B0openKylin.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yao --- ...15Gun Hello\350\275\257\344\273\266\345\210\260openKylin.md" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/\347\244\276\345\214\272\345\274\200\345\217\221\346\214\207\345\215\227/\347\247\273\346\244\215Gun Hello\350\275\257\344\273\266\345\210\260openKylin.md" "b/\347\244\276\345\214\272\345\274\200\345\217\221\346\214\207\345\215\227/\347\247\273\346\244\215Gun Hello\350\275\257\344\273\266\345\210\260openKylin.md" index 6f9ed83..c96e70a 100644 --- "a/\347\244\276\345\214\272\345\274\200\345\217\221\346\214\207\345\215\227/\347\247\273\346\244\215Gun Hello\350\275\257\344\273\266\345\210\260openKylin.md" +++ "b/\347\244\276\345\214\272\345\274\200\345\217\221\346\214\207\345\215\227/\347\247\273\346\244\215Gun Hello\350\275\257\344\273\266\345\210\260openKylin.md" @@ -13,7 +13,7 @@ GNU Hello项目是 GNU 推出的示例软件,此项目将入门的 hello w - help2man:用程序的--help选项输出生成manpage - Texinfo:编写程序文档 -GNU项目中其他更复杂的软件系统,只是具体的业务逻辑复杂度更高,其组织结构与hello项目展示的规范保持一致。 +GNU项目中其他更复杂的软件系统,只是具体的业务逻辑复杂度更高,其组织结构与GUN Hello项目展示的规范保持一致。 ## 二、对上游源码进行打包 -- Gitee From 693dcf6645b690ea47553d9bcadc47c7a4543702 Mon Sep 17 00:00:00 2001 From: Yao Date: Mon, 13 Mar 2023 01:17:46 +0000 Subject: [PATCH 7/8] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=20=E7=A4=BE?= =?UTF-8?q?=E5=8C=BA=E5=BC=80=E5=8F=91=E6=8C=87=E5=8D=97/=E7=A7=BB?= =?UTF-8?q?=E6=A4=8DGun=20Hello=E8=BD=AF=E4=BB=B6=E5=88=B0openKylin.md=20?= =?UTF-8?q?=E4=B8=BA=20=E7=A4=BE=E5=8C=BA=E5=BC=80=E5=8F=91=E6=8C=87?= =?UTF-8?q?=E5=8D=97/=E7=A7=BB=E6=A4=8DGUN=20Hello=E8=BD=AF=E4=BB=B6?= =?UTF-8?q?=E5=88=B0openKylin.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\215GUN Hello\350\275\257\344\273\266\345\210\260openKylin.md" | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename "\347\244\276\345\214\272\345\274\200\345\217\221\346\214\207\345\215\227/\347\247\273\346\244\215Gun Hello\350\275\257\344\273\266\345\210\260openKylin.md" => "\347\244\276\345\214\272\345\274\200\345\217\221\346\214\207\345\215\227/\347\247\273\346\244\215GUN Hello\350\275\257\344\273\266\345\210\260openKylin.md" (100%) diff --git "a/\347\244\276\345\214\272\345\274\200\345\217\221\346\214\207\345\215\227/\347\247\273\346\244\215Gun Hello\350\275\257\344\273\266\345\210\260openKylin.md" "b/\347\244\276\345\214\272\345\274\200\345\217\221\346\214\207\345\215\227/\347\247\273\346\244\215GUN Hello\350\275\257\344\273\266\345\210\260openKylin.md" similarity index 100% rename from "\347\244\276\345\214\272\345\274\200\345\217\221\346\214\207\345\215\227/\347\247\273\346\244\215Gun Hello\350\275\257\344\273\266\345\210\260openKylin.md" rename to "\347\244\276\345\214\272\345\274\200\345\217\221\346\214\207\345\215\227/\347\247\273\346\244\215GUN Hello\350\275\257\344\273\266\345\210\260openKylin.md" -- Gitee From 3bc63c7a0c5d3abdaebb8b5daf4ebb54a11bbf72 Mon Sep 17 00:00:00 2001 From: Yao Date: Mon, 13 Mar 2023 01:19:37 +0000 Subject: [PATCH 8/8] =?UTF-8?q?update=20=E7=A4=BE=E5=8C=BA=E5=BC=80?= =?UTF-8?q?=E5=8F=91=E6=8C=87=E5=8D=97/=E7=A7=BB=E6=A4=8DGUN=20Hello?= =?UTF-8?q?=E8=BD=AF=E4=BB=B6=E5=88=B0openKylin.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yao --- ...15GUN Hello\350\275\257\344\273\266\345\210\260openKylin.md" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/\347\244\276\345\214\272\345\274\200\345\217\221\346\214\207\345\215\227/\347\247\273\346\244\215GUN Hello\350\275\257\344\273\266\345\210\260openKylin.md" "b/\347\244\276\345\214\272\345\274\200\345\217\221\346\214\207\345\215\227/\347\247\273\346\244\215GUN Hello\350\275\257\344\273\266\345\210\260openKylin.md" index c96e70a..94ca02b 100644 --- "a/\347\244\276\345\214\272\345\274\200\345\217\221\346\214\207\345\215\227/\347\247\273\346\244\215GUN Hello\350\275\257\344\273\266\345\210\260openKylin.md" +++ "b/\347\244\276\345\214\272\345\274\200\345\217\221\346\214\207\345\215\227/\347\247\273\346\244\215GUN Hello\350\275\257\344\273\266\345\210\260openKylin.md" @@ -1,4 +1,4 @@ -# 移植Gun Hello到openKylin +# 移植GUN Hello到openKylin > 本文是openKylin软件包打包移植的示例文档 -- Gitee