创建Macports端口,无需安装,无依赖,只需解压

发布于 2024-12-21 22:50:59 字数 1863 浏览 3 评论 0原文

目标

我正在尝试为基于Eclipse的开源工具创建一个端口(Macports),不需要安装,换句话说,它只是“提取并使用” “ 案件。用户可以从项目官方网站下载该工具并使用。所以没有DESTROOT变量集。

由于很多Mac用户已经习惯了Macports的便利性,因此我想将这个工具添加到那里,以便用户可以立即安装或卸载该工具。

** 重要提示:一旦用户启动该工具,它会在安装该工具的同一位置创建“/workspace”目录,以保存用户的首选项、设置和其他必要文件。因此,当用户启动该工具时,程序应该有权在其安装的同一目录中进行写入。该工具的当前版本不提供选择工作区位置的方法。

问题

我应该如何组织 Portfile?

我已经设置了以下配置,告诉 Macports 不要使用配置、构建destroot阶段。

set cm_workspace    /workspace

universal_variant   no

use_configure       no

supported_archs     noarch

post-extract {
    file mkdir ${worksrcpath}${cm_workspace}
    destroot.keepdirs-append  ${worksrcpath}${cm_workspace}
}

build {}

destroot {}

据我了解,

  • 提取阶段解压文件,
  • 安装阶段应存档这些文件,
  • 最后激活阶段应将文件移动到 <强>去根。

但我不断收到错误。

--->  Extracting cubridmanager
--->  Configuring cubridmanager
--->  Building cubridmanager
--->  Staging cubridmanager into destroot
Error: No files have been installed in the destroot directory!
Error: Please make sure that this software supports 'make install DESTDIR=${destroot}' or implement an alternative destroot mechanism in the Portfile.
Error: Files might have been installed directly into your system, check before proceeding.
Error: Target org.macports.destroot returned: Staging cubridmanager into destroot failed
Log for cubridmanager is at: /opt/local/var/macports/logs/_Users_nbp_macports_databases_cubridmanager/cubridmanager/main.log
Error: Status 1 encountered during processing.
To report a bug, see <http://guide.macports.org/#project.tickets>

我想为那个开源社区做出贡献,但这一步我过不了。

Goal

I am trying to create a port (Macports) for an open source tool based on Eclipse which doesn't need installation, in other words, it's just "extract and use" case. Users can download the tool from the official project site and use just like that. So there is no DESTROOT variable set.

Since many Mac users got used to the convenience of Macports, I would like to add the tool there, so that users could instantly install or uninstall the tool.

** Important notice: once users start the tool, it creates "/workspace" directory in the same place the tool was installed to keep users' preferences, settings, and other necessary files. So, when users starts the tool, the program should have access to write in the same directory it was installed. The current version of the tool doesn't provide a way to choose the workspace location.

Problem

How should I organize the Portfile?

I have set the following configurations where I tell Macports to not use configure, build, and destroot phases.

set cm_workspace    /workspace

universal_variant   no

use_configure       no

supported_archs     noarch

post-extract {
    file mkdir ${worksrcpath}${cm_workspace}
    destroot.keepdirs-append  ${worksrcpath}${cm_workspace}
}

build {}

destroot {}

As I understand,

  • extract phase untars the file,
  • and install phases should archive those files,
  • and finally activate phase should move the files to the destroot.

But I keep getting errors.

--->  Extracting cubridmanager
--->  Configuring cubridmanager
--->  Building cubridmanager
--->  Staging cubridmanager into destroot
Error: No files have been installed in the destroot directory!
Error: Please make sure that this software supports 'make install DESTDIR=${destroot}' or implement an alternative destroot mechanism in the Portfile.
Error: Files might have been installed directly into your system, check before proceeding.
Error: Target org.macports.destroot returned: Staging cubridmanager into destroot failed
Log for cubridmanager is at: /opt/local/var/macports/logs/_Users_nbp_macports_databases_cubridmanager/cubridmanager/main.log
Error: Status 1 encountered during processing.
To report a bug, see <http://guide.macports.org/#project.tickets>

I want to contribute to that open source community, but I can't pass this step.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

时间你老了 2024-12-28 22:50:59

您误解了这些阶段,通常的工作流程如下:

  1. 提取解压下载的文件
  2. 补丁应用任何本地补丁
  3. 配置运行
  4. ./configurebuild 运行 make
  5. destroot 运行 make install DESTDIR=${destroot}
  6. install 将 destroot 区域中的文件打包到存档中
  7. activate 动作 。

因此,在您的情况下,您不需要步骤 2、3 和 4。但您仍然需要在步骤 5(destroot 阶段)中将文件复制到 destroot 区域 否则 MacPorts 不知道它应该安装哪些文件。

supported_archs     noarch
use_configure no

build {}
destroot {
    copy ${worksrcpath} ${destroot}${prefix}/some/path
}

请注意,MacPorts 不鼓励在前缀目录之外安装文件,因为安装是独立的。路径 /workspace 听起来是一个非常糟糕的主意。相反,您应该使用用户主目录内的路径来保存任何数据,否则无法在具有多个用户帐户的计算机上使用。当然,实际的可执行文件可以驻留在 MacPorts 前缀中。

通常,UNIX 软件将 /usr(或 MacPorts 中的 /opt/local)中的二进制文件、库和共享数据与主目录中的用户特定数据分开。如果您的工具不遵循此约定,则需要开发人员首先修复。

You misunderstood the phases, the usual workflow is as follows:

  1. extract untars the downloaded file
  2. patch applies any local patches
  3. configure runs ./configure
  4. build runs make
  5. destroot runs make install DESTDIR=${destroot}
  6. install packs the file in the destroot area into an archive
  7. activate moves the files into ${prefix}

So, in your case, you don't need steps 2, 3 and 4. But you still need to copy the files to the destroot area in step 5, the destroot phase. Otherwise MacPorts does not know which files it is supposed to install.

supported_archs     noarch
use_configure no

build {}
destroot {
    copy ${worksrcpath} ${destroot}${prefix}/some/path
}

Note that MacPorts does discourage installing files outside the prefix directory, as the installation is meant to be self-contained. The path /workspace sounds like a pretty bad idea. Rather, you should use a path inside the users home directory to save any data as otherwise this cannot be used on a computer with multiple user accounts. Of course, the actual executable files can reside in the MacPorts prefix.

Normally, UNIX software separates binaries, libraries and shared data in /usr (or in the MacPorts case,/opt/local) from user-specific data in the home directory. If your tool does not follow this convention, this needs to be fixed by the developers first.

带刺的爱情 2024-12-28 22:50:59

由于相关原因,我认为该工具不适合 macports

来自 macports 的所有文件都应位于受支持的目录之一,即 destroot 并最终位于 /opt/local
该项目尝试写入子目录,这在这里不好
写入 bu macports 的目录只能由用户 macports 写入,以尽量减少对构建和运行环境的影响。
在多用户系统中,谁拥有要写入的目录?例如 macports 作为用户 macports 安装并作为其他人运行 - 另外,如果有多个普通用户写入该目录?

我认为您需要修补该工具,以便在普通用户运行该工具时传递一个目录来创建工作区,但该工具由 macports 作为 ownwd 安装在 /opt/local/bin 中

I don't think that tool fits with macports for related reasons

All files from macports should be in one of the supported directories i.e. destroot and ending up in /opt/local
The project tries to write to sub directories which is not good here
The directories written to bu macports can only be written to by the user macports so as to minimize the ability to affect the build and run environment.
In a multiuser system who owns the directory to write to? e.g. macports are installed as user macports and are run as someone else - Also if there are more than one normal user who writes to the directory?

I think you need to patch the tool so that it is passed a directory to create the workspace in when a normal user runs it but the tool is install as ownwd by macports in /opt/local/bin

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文