From 4190a5c54a1d4e6e9bdec8d83dff237b54bec460 Mon Sep 17 00:00:00 2001 From: Max Wash Date: Wed, 6 Aug 2025 22:15:32 +0100 Subject: [PATCH] doc: add lots of sample files --- doc/package-manifest.json | 31 +++++ doc/package-readme.txt | 25 ++++ doc/package-versions.txt | 124 ++++++++++++++++++ doc/release.json | 9 ++ doc/sample-package/control/post-install.sh | 3 + doc/sample-package/control/post-uninstall.sh | 3 + doc/sample-package/control/pre-install.sh | 3 + doc/sample-package/control/pre-uninstall.sh | 3 + doc/sample-package/make-package.sh | 22 ++++ doc/sample-package/manifest | 17 +++ doc/sample-package/news/20250707.01.news | 110 ++++++++++++++++ doc/sample-package/payload/usr/bin/hello | 0 .../sample-package_0.1.amd64.ropkg | Bin 0 -> 6656 bytes doc/sample.recipe | 46 +++++++ 14 files changed, 396 insertions(+) create mode 100644 doc/package-manifest.json create mode 100644 doc/package-readme.txt create mode 100644 doc/package-versions.txt create mode 100644 doc/release.json create mode 100755 doc/sample-package/control/post-install.sh create mode 100755 doc/sample-package/control/post-uninstall.sh create mode 100755 doc/sample-package/control/pre-install.sh create mode 100755 doc/sample-package/control/pre-uninstall.sh create mode 100755 doc/sample-package/make-package.sh create mode 100644 doc/sample-package/manifest create mode 100644 doc/sample-package/news/20250707.01.news create mode 100755 doc/sample-package/payload/usr/bin/hello create mode 100644 doc/sample-package/sample-package_0.1.amd64.ropkg create mode 100644 doc/sample.recipe diff --git a/doc/package-manifest.json b/doc/package-manifest.json new file mode 100644 index 0000000..cbb1d2a --- /dev/null +++ b/doc/package-manifest.json @@ -0,0 +1,31 @@ +{ + "Name": "sample-package", + "Architecture": "amd64", + "Version": "1.2.5-2", + "Priority": "optional", + "Category": "misc", + "Maintainer": "John Doe ", + "Provides": [ + { "Name": "sample-api", "Version": "1.2.5" } + ], + "Depends": [ + { "Name": "libc", "Version": "2.0", "Predicate": ">=" }, + { "Name": "libstdc++", "Version": "2.3", "Predicate": ">=" }, + { "Name": "libc", "Version": "2.0", "Predicate": ">=" }, + { + "One-Of": [ + { "Name": "libs1", "Version": "1.0", "Predicate": ">=" }, + { "Name": "libs2", "Version": "1.2", "Predicate": ">=" } + ] + } + ], + "Recommends": [ "sample-cli" ], + "Suggests": [ + { "One-Of": [ "sample-gtk", "sample-qt" ] }, + { "Name": "libc", "Version": "2.0", "Predicate": ">=" } + ], + "Conflicts": [ "example-package" ], + "Enhances": [ "basic-package" ], + "Description": "A sample package", + "Installed-Size": 3245 +} diff --git a/doc/package-readme.txt b/doc/package-readme.txt new file mode 100644 index 0000000..b77dda1 --- /dev/null +++ b/doc/package-readme.txt @@ -0,0 +1,25 @@ ++------------------------------------------------------------------------------+ +| A Sample Package | ++------------------------------------------------------------------------------+ + + This is a sample package to demonstrate the layout and features of a Rosetta + package. + + +1 Main Package Layout +===================== + + +2 The Payload Package +===================== + + +3 The Control Package +===================== + + +4 The Meta Package +================== + + +vim: shiftwidth=3 expandtab diff --git a/doc/package-versions.txt b/doc/package-versions.txt new file mode 100644 index 0000000..1d14816 --- /dev/null +++ b/doc/package-versions.txt @@ -0,0 +1,124 @@ ++------------------------------------------------------------------------------+ +| Rosetta Package Manager Documentation | +| ..................................... | +| Package Version Format and Comparison | ++------------------------------------------------------------------------------+ + + This document describes the format of Rosetta package version indicators, and + the way in which they are compared. + + +1 Permitted Characters +====================== + + The following characters can be used in a package version identifier: + - lowercase letters [a-z] + - digits [0-9] + - the following punctuation: - . ~ + + +2 Version String Format +======================= + + The package version identifier should have the following layout: + + [release-phase][~version-version-phase[version-release-phase-revision]][-package-revision] + + Components surrounded by [square brackets] is optional, while components + surrounded by are required. If a component name + is preceded by a punctuation mark, the value of that component in a package + version identifier must also be preceded by that punctuation mark. + + The different version identifier components are defined as follows: + - release-phase (optional) indicates the release stage of the upstream + software. allowable values are: alpha, beta + + - upstream-version (required) indicates the version number of the upstream + release. this is made up of one to five integers >= 0 separated by full + stops. + + - version-release-phase (optional) indicates the release stage of this + particular version of the upstream software. allowable values are: + alpha, beta, rc. + + - version-release-phase-revision (optional) indicates the revision of the + upstream package version within a given pre-release-version. must be + a positive non-zero integer. + + - package-revision (optional) indicates different versions of a particular + package that contain the same version of the upstream software. + + Some examples of package versions include: + - 1.0.0 + First revision of package for upstream release 1.0.0 + + - beta1.7 + First revision of package for upstream beta pre-release 1.7 + + - 0.6-2 + Second revision of package for upstream release 0.6 + + - 1.2~beta2 + First revision of package for the second beta pre-release of upstream + version 1.2 + + - 5.15~rc1-2 + Second revision of package for the first release-candidate pre-release of + upstream version 5.15 + + +3 Version Comparison +==================== + + There are a number of rules that govern how package version identifiers are + compared. + + + 3.1 Comparison Procedure + ------------------------ + + When comparing two version numbers, the five components are compared left to + right using the following procedure: + 1. release-phase is compared according to Release Phase Precedence. If the + two packages have different release-phase values, the one with higher + precedence is considered the newer package. If one package does not have + a release-phase, a release-phase of 'release' is assumed, which has the + highest precedence. + + 2. Each digit in upstream-version is compared left-to-right. If one package + version has fewer digits than the other, the missing digits are assumed to + be zero. If one package has a version digit greater than the other when + read left-to-right, it is considered the newer package. + + 3. version-release-phase is compared according to Release Phase Precedence. + If the two packages have different version-release-phase values, the + one with higher precedence is considered the newer package. If a package + does not have a version-release-phase, a value of 'release' (with the + highest precedence) is assumed, and step 4 is skipped. + + 4. The package with the greater version-release-phase-revision is considered + the newer package. If a package does not have a + version-release-phase-revision, a value of one is assumed. + + 5. The package with the greater package-revision is considered the newer + package. If a package does not have a package-revision, a value of one is + assumed. + + If each of the five components of two package versions is determined to be + equal according to the above procedure, the two packages are considered to + be equal in version. + + + 3.2 Release Phase Precedence + -------------------------- + + Release phases have a defined order of precedence which is used during + comparisons. This order, in decending level of precedence, is: + 1. release (cannot be specified directly, but is used implicitly if no + release phase is specified). + 2. rc + 3. beta + 4. alpha + + +vim: shiftwidth=3 expandtab diff --git a/doc/release.json b/doc/release.json new file mode 100644 index 0000000..caf7f41 --- /dev/null +++ b/doc/release.json @@ -0,0 +1,9 @@ +{ + "mango-kernel": { + "0.1": { + } + }, + "rosetta-system": { + "0.1": { + } +} diff --git a/doc/sample-package/control/post-install.sh b/doc/sample-package/control/post-install.sh new file mode 100755 index 0000000..9f3f770 --- /dev/null +++ b/doc/sample-package/control/post-install.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +echo "Hello, world!" diff --git a/doc/sample-package/control/post-uninstall.sh b/doc/sample-package/control/post-uninstall.sh new file mode 100755 index 0000000..9f3f770 --- /dev/null +++ b/doc/sample-package/control/post-uninstall.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +echo "Hello, world!" diff --git a/doc/sample-package/control/pre-install.sh b/doc/sample-package/control/pre-install.sh new file mode 100755 index 0000000..9f3f770 --- /dev/null +++ b/doc/sample-package/control/pre-install.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +echo "Hello, world!" diff --git a/doc/sample-package/control/pre-uninstall.sh b/doc/sample-package/control/pre-uninstall.sh new file mode 100755 index 0000000..9f3f770 --- /dev/null +++ b/doc/sample-package/control/pre-uninstall.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +echo "Hello, world!" diff --git a/doc/sample-package/make-package.sh b/doc/sample-package/make-package.sh new file mode 100755 index 0000000..e7d4ac2 --- /dev/null +++ b/doc/sample-package/make-package.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +payload_name=payload.tar.zst +control_name=control.tar.zst +news_name=news.tar.zst +manifest_name=manifest.json.zst + +payload_dest=$TMPDIR/$payload_name +control_dest=$TMPDIR/$control_name +news_dest=$TMPDIR/$news_name +manifest_dest=$TMPDIR/$manifest_name + +pkg_dest=sample-package_0.1_amd64.ropkg + +rm -rf $manifest_dest + +tar cf $payload_dest --zstd -C payload . +tar cf $control_dest --zstd -C control . +tar cf $news_dest --zstd -C news . +zstd manifest.json -o $manifest_dest + +tar cf $pkg_dest -C $TMPDIR $payload_name $control_name $news_name $manifest_name diff --git a/doc/sample-package/manifest b/doc/sample-package/manifest new file mode 100644 index 0000000..58904ef --- /dev/null +++ b/doc/sample-package/manifest @@ -0,0 +1,17 @@ +Name: sample-package +Architecture: amd64 +Version: 1.2.5-2 +Priority: optional +Category: misc +Maintainer: John Doe +Provides: sample-api (= 1.2.5) +Depends: libc (>= 2.0), libstdc++ (>= 2.3), libs1 (>= 1.0) | libs2 (>= 1.2) +Recommends: sample-cli +Suggests: sample-gtk | sample-qt, sample-server +Conflicts: example-package +Enhances: basic-package +Description: A sample package +Installed-Size: 3245 + +This is a sample package that demonstrates the structure of a Rosetta package, +as well as the layout of the associated manifest and news files. diff --git a/doc/sample-package/news/20250707.01.news b/doc/sample-package/news/20250707.01.news new file mode 100644 index 0000000..0bea577 --- /dev/null +++ b/doc/sample-package/news/20250707.01.news @@ -0,0 +1,110 @@ +PublishDate: 2025-07-07 09:00:00 +Importance: Normal +Title: Welcome to the Rosetta Package Manager +Category: General + ++------------------------------------------------------------------------------+ +| Welcome to the Rosetta Package Manager! | ++------------------------------------------------------------------------------+ + + This is a sample news item to introduce you to the Rosetta package manager. + These news items can be used to provide information and updates to those who + use your repository. + + +1 News File Location +==================== + + News items come from four different sources: + - Repository-wide news items, located in /news + + - Channel-related news items, located in /channel//news + + - Component-related news items, located in + /channel//component//news + + - Package-related news items, included in individual package files. + + Specific news items can be published in different locations depending on who + the news is relevant for. For example, if there is some critical issue that + affects all users of a repository, /news would be the perfect place to use. + If, instead, the issue only affects users of a particular channel (maybe + you have a channel for each release of your operating system), + /channel//news would be more appropriate. It's important that + news is targeted to the appropriate audience so that users don't have to sift + through news that isn't relevant to them. + + +2 News File Format +================== + + News items have a specific plain-text format, which can be seen in this file. + The file begins with a set of headers that describe certain attributes of the + news, followed by the news content and an optional footer. + + + 2.1 Header And Footer + --------------------- + + These headers include: + - PublishDate: The date and time on which the news item was published. This + is used by clients to determine which news items have been released since + the user last checked the news. This is always in UTC. + + - Title: The title of the news item. + + - Category: The particular category that the news item is relevant to. + Possible values include: + * General + * Security + + - Importance: How important it is that the user reads this news. + Possible values include: + * Low + * Normal + * High + * Critical + The user has to go out of their way to read Low and Normal news items, while + High and Critical news items will be shown automatically when the user next + interacts with the relevant part of the repo. + + Immediately following these headers are two line-feed characters. This + denotes the end of the header and the start of the content of the news files. + With two line feeds, there should be exactly one blank line visible between + the last header line and the first content line. + + At the end of the file is a line with 5 asterisk (*) characters. This denotes + the end of the of the news file's content and the start of the footer. Beyond + this point, you can put extra data, such as the vim formatting commands + visible in this file, that you don't want shown to the user. If no footer is + required, the 5-asterisk marker can be omitted, and the news content will + simply end where the file ends. + + + 2.2 Content + ----------- + + Between the header and footer is the actual news content that is shown to the + user. This section can be formatted in any way you prefer; any plaintext is + acceptable. This news file has been formated in a particular way to provide + example formatting that you may wish to use. It features a page header, + section and sub-section headings, and list formatting. All paragraphs + are indented with three spaces. The gap between a list item marker + and list item text is two spaces, with any following lines in that particular + list item indented with three spaces. There is one blank line between each + paragraph, and two blank lines between the last line in one section and + the heading of the next. + + The only formatting rule that should be adhered to is that, like code, lines + should be kept to no longer than 80 characters. This is due to the fact that + the vast majority of users will be viewing news items within their terminal + as they are using the ropkg commands, and 80 cells is the standard width for + terminal displays. + + Don't forget that, if your text editor supports in-line formatting directives + like vim, you can store these directives in the page footer so that they + aren't shown to the user. + +***** + +vim: shiftwidth=3 expandtab diff --git a/doc/sample-package/payload/usr/bin/hello b/doc/sample-package/payload/usr/bin/hello new file mode 100755 index 0000000..e69de29 diff --git a/doc/sample-package/sample-package_0.1.amd64.ropkg b/doc/sample-package/sample-package_0.1.amd64.ropkg new file mode 100644 index 0000000000000000000000000000000000000000..283656cd672f54ee5afe0521f981781dc7f0b823 GIT binary patch literal 6656 zcmeHLc{r478=o;_%OH#;#59)dy|dXBLdm`l6~>-shK!{VWegfyWJ{5lBE=L!C5mh* z9T7uXD9e#8Ta*^xoO8ZE&gr|Z@B6F1>wI7LKlgh-&wV}5egEF)cRlxWhZ3m75Q3jp zI3Y|cni3BB9s&S>HWrHjakP#$?spBK|FAhj0D#s85GWjg!2%dqMawC#WS2jN?B&`D`a%&$$RPS*`P`u(@AxOZV33(r zcU-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_zRgr zoq`^QVBIt54M5nXcg)sd%&?wts!oD&q7i~M44QAldpgr3a|%mN6Bkkv zdSKV_a+Gx8;7LJ<9gn|6Pus=t*uHv&Ty@%)Po3L0q{CK2kONf)ZAZN8)94_S^ZYY} z$}ioLLqJD`=0|}M^L_p}ff}JE&*Wgu*IUo2;FI^^E*yC;^NRQDv5N+?N89(GH9QtR zWV)UQf)N5mx|lemK{`rh?fvR|I^7QBGCp}At@X2^OdUbyOa_r4=A( zLA71^Pxk34chyd82VMv`gf8q{d7`ZNqPS>GCS47FRiT$K z!0THYoW3xxB`T18Cg^~=K1)uT%U>nY|Eh`_Ux(;pkuI)bu$_ANCSA~gs#>t}lCGA_ z!J|Z3A(1+^Y!$UHV+D|tiao5cq6FW|~wk>bkk{?;i?{?6#3Kn%>HS%f$Fei2HgGDjg zsb*cg+dh0C4LjQ$-f)560Q|Y2_b){4$yz7{{R$P=lAy?2B(e2a^8ZR{tpho z{jC4~`lr5+^;`X?Xy?KO>W3WL#E&EsNd8ED1d>7^g%bTWLkYfz34#7d4bBuH%r}TY z^3%pf`iD^tg^&R)6onWP&hZ8|#cqObhAKl^``_Mv4~-PG`5~RV?*qusRevJz6M>%y I{GTB354#5Gu>b%7 literal 0 HcmV?d00001 diff --git a/doc/sample.recipe b/doc/sample.recipe new file mode 100644 index 0000000..6b16e30 --- /dev/null +++ b/doc/sample.recipe @@ -0,0 +1,46 @@ +import ropkg + + +package_manifest = { + 'Name': 'rosequartz', + 'Version': '1.0', + 'Maintainers': [ 'Max Wash ' ], + 'Arch': ropkg.system.arch(), + 'Platform': ropkg.system.platform_name(), + 'Description': 'Cross platform C and C++ runtime', + 'Depends': [ 'libc:1.0', 'libm:1.0'], + 'License': '3-Clause BSD', + 'Website': 'http://doorstuck.net', + 'SourceWebsite': 'https://gitlab.com/doorstuck/rosequartz' +} + + +def get_sources(): + ropkg.git.clone_repo('rosequartz', 'https://gitlab.com/doorstuck/rosequartz.git') + + +def configure(): + ropkg.cmake.configure_project('rosequartz') + + +def build(): + ropkg.build.build_project('rosequartz') + + +def package(): + ropkg.pkg.build_package('rosequartz', package_manifest) + + +recipe = { + 'name': 'rosequartz', + 'steps': { + 'get-src': get_sources, + 'configure': configure, + 'build': build, + 'package': package, + } +} + +ropkg.run_recipe(recipe) + +# vim: ft=python