奥尔
🌐 Publishing To The Arch User Repository
🌐 Setup
首先访问 https://aur.archlinux.org 并创建一个账户。务必添加正确的 ssh 密钥。接下来,使用此命令克隆一个空的 git 仓库。
🌐 First go to https://aur.archlinux.org and make an account. Be sure to add the proper ssh keys. Next, clone an empty git repository using this command.
git clone https://aur.archlinux.org/your-repo-name完成上述步骤后,创建一个名为 PKGBUILD 的文件。文件创建完成后,你可以进行下一步。
🌐 After completing the steps above, create a file with the name PKGBUILD. Once the file is created you can move onto the next step.
🌐 Writing a PKGBUILD file
pkgname=<pkgname>pkgver=1.0.0pkgrel=1pkgdesc="Description of your app"arch=('x86_64' 'aarch64')url="https://github.com/<user>/<project>"license=('MIT')depends=('cairo' 'desktop-file-utils' 'gdk-pixbuf2' 'glib2' 'gtk3' 'hicolor-icon-theme' 'libsoup' 'pango' 'webkit2gtk-4.1')options=('!strip' '!emptydirs')install=${pkgname}.installsource_x86_64=("${url}/releases/download/v${pkgver}/appname_${pkgver}_amd64.deb")source_aarch64=("${url}/releases/download/v${pkgver}/appname_"${pkgver}_arm64.deb")- 在文件顶部,定义你的包名并将其赋值给变量
pkgname。 - 设置你的
pkgver变量。通常最好在源变量中使用此变量以提高可维护性。 - 你 aur 仓库页面上的
pkgdesc变量会告诉访客你的应用的功能。 arch变量控制哪些架构可以安装你的软件包。url变量虽然不是必需的,但有助于让你的包看起来更专业。install变量指定将在安装、移除或升级软件包时运行的 .install 脚本的名称。depends变量包含运行你的应用所需的项目列表。对于任何 Tauri 应用,你必须包含上述显示的所有依赖。source变量是必须的,用于定义上游包的位置。你可以通过在变量名末尾添加架构,使source特定于某种架构。
🌐 Generating .SRCINFO
为了将你的仓库推送到AUR,你必须生成一个 .SRCINFO 文件。这可以通过以下命令完成。
🌐 In order to push your repo to the aur you must generate an .SRCINFO file. This can be done with this command.
makepkg --printsrcinfo > .SRCINFO🌐 Testing
测试该应用非常简单。你所要做的就是在与 PKGBUILD 文件相同的目录中运行 makepkg,然后查看它是否能工作
🌐 Testing the app is extremely simple. All you have to do is run makepkg within the same directory as the PKGBUILD file and see if it works
🌐 Publishing
最后,测试阶段结束后,你可以使用这些命令将应用发布到 AUR(Arch 用户仓库)。
🌐 Finally, after the testing phase is over, you can publish the application to AUR (Arch User Repository) with these commands.
git add .
git commit -m "Initial Commit"
git push如果一切顺利,你的仓库现在应该会出现在 AUR 网站上。
🌐 If all goes well, your repository should now appear on the AUR website.
🌐 Examples
🌐 Extracting From A Debian Package
# Maintainer:# Contributor:pkgname=<pkgname>pkgver=1.0.0pkgrel=1pkgdesc="Description of your app"arch=('x86_64' 'aarch64')url="https://github.com/<user>/<project>"license=('MIT')depends=('cairo' 'desktop-file-utils' 'gdk-pixbuf2' 'glib2' 'gtk3' 'hicolor-icon-theme' 'libsoup' 'pango' 'webkit2gtk-4.1')options=('!strip' '!debug')install=${pkgname}.installsource_x86_64=("${url}/releases/download/v${pkgver}/appname_${pkgver}_amd64.deb")source_aarch64=("${url}/releases/download/v${pkgver}/appname_${pkgver}_arm64.deb")sha256sums_x86_64=('ca85f11732765bed78f93f55397b4b4cbb76685088553dad612c5062e3ec651f')sha256sums_aarch64=('ed2dc3169d34d91188fb55d39867713856dd02a2360ffe0661cb2e19bd701c3c')package() { # Extract package data tar -xvf data.tar.gz -C "${pkgdir}"
}post_install() { gtk-update-icon-cache -q -t -f usr/share/icons/hicolor update-desktop-database -q}
post_upgrade() { post_install}
post_remove() { gtk-update-icon-cache -q -t -f usr/share/icons/hicolor update-desktop-database -q}🌐 Building from source
# Maintainer:pkgname=<pkgname>-gitpkgver=<pkgver>pkgrel=1pkgdesc="Description of your app"arch=('x86_64' 'aarch64')url="https://github.com/<user>/<project>"license=('MIT')depends=('cairo' 'desktop-file-utils' 'gdk-pixbuf2' 'glib2' 'gtk3' 'hicolor-icon-theme' 'libsoup' 'pango' 'webkit2gtk-4.1')makedepends=('git' 'openssl' 'appmenu-gtk-module' 'libappindicator-gtk3' 'librsvg' 'cargo' 'pnpm' 'nodejs')provides=('<pkgname>')conflicts=('<binname>' '<pkgname>')source=("git+${url}.git")sha256sums=('SKIP')
pkgver() { cd <project> ( set -o pipefail git describe --long --abbrev=7 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' || printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)" )}
prepare() { cd <project> pnpm install}
build() { cd <project> pnpm tauri build -b deb}
package() { cp -a <project>/src-tauri/target/release/bundle/deb/<project>_${pkgver}_*/data/* "${pkgdir}"}Tauri 中文网 - 粤ICP备13048890号
Nodejs.cn 旗下网站