自制程序和权限被拒绝问题

发布于 2024-11-18 07:41:31 字数 1483 浏览 4 评论 0原文

我尝试通过 Homebrew 包管理器编译并安装 libapreq2

brew create http://www.apache.si//httpd/libapreq/libapreq2-2.13.tar.gz

libapreq2.rb公式内容如下。

require 'formula'

class Libapreq2 < Formula
  url 'http://www.apache.si//httpd/libapreq/libapreq2-2.13.tar.gz'
  homepage ''
  md5 'c11fb0861aa84dcc6cd0f0798b045eee'

  # depends_on 'cmake'

  def install
    system "./configure", "--disable-debug", "--disable-dependency-tracking",
                          "--prefix=#{prefix}"
    # system "cmake . #{std_cmake_parameters}"
    system "make install"
  end
end

我继续,

brew install -vd libapreq2

但不幸的是编译因错误而结束。

mkdir: /usr/include/apache2/apreq2: Permission denied
make[3]: *** [install-pkgincludeHEADERS] Error 1
make[3]: *** Waiting for unfinished jobs....
/usr/bin/install -c .libs/mod_apreq2.so /usr/libexec/apache2/mod_apreq2.so
install: /usr/libexec/apache2/mod_apreq2.so: Permission denied
make[3]: *** [install-pkglibLTLIBRARIES] Error 71
make[2]: *** [install-am] Error 2
make[1]: *** [install-recursive] Error 1
make: *** [install-recursive] Error 1

Brew 尝试在 /usr/local/Cellar/libapreq2/ 目录之外安装一些文件。我想知道如何管理这些“权限被拒绝”问题。我尝试以root用户身份(即sudobrew install libapreq2),但如果以后我想删除该库,则只需删除/usr/local/Cellar/libapreq2/中的文件> 被删除。

感谢您的指点。

I try to compile and install libapreq2 via Homebrew package manager.

brew create http://www.apache.si//httpd/libapreq/libapreq2-2.13.tar.gz

The content of the libapreq2.rb formula is as follows.

require 'formula'

class Libapreq2 < Formula
  url 'http://www.apache.si//httpd/libapreq/libapreq2-2.13.tar.gz'
  homepage ''
  md5 'c11fb0861aa84dcc6cd0f0798b045eee'

  # depends_on 'cmake'

  def install
    system "./configure", "--disable-debug", "--disable-dependency-tracking",
                          "--prefix=#{prefix}"
    # system "cmake . #{std_cmake_parameters}"
    system "make install"
  end
end

I proceed with

brew install -vd libapreq2

but unfortunately the compilation ended with errors.

mkdir: /usr/include/apache2/apreq2: Permission denied
make[3]: *** [install-pkgincludeHEADERS] Error 1
make[3]: *** Waiting for unfinished jobs....
/usr/bin/install -c .libs/mod_apreq2.so /usr/libexec/apache2/mod_apreq2.so
install: /usr/libexec/apache2/mod_apreq2.so: Permission denied
make[3]: *** [install-pkglibLTLIBRARIES] Error 71
make[2]: *** [install-am] Error 2
make[1]: *** [install-recursive] Error 1
make: *** [install-recursive] Error 1

Brew try to install some files outside the /usr/local/Cellar/libapreq2/ directory. I wonder how to manage these "permission denied" issues. I tried as root user (i.e., sudo brew install libapreq2), but if I later want to remove the library, only the files in /usr/local/Cellar/libapreq2/ are removed.

Thanks for any pointers.

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

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

发布评论

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

评论(2

默嘫て 2024-11-25 07:41:31

试试这个:

sudo chown -R $(whoami) /usr/local/Cellar/libapreq2/

这对我有用!

Try this:

sudo chown -R $(whoami) /usr/local/Cellar/libapreq2/

It works for me!

追星践月 2024-11-25 07:41:31

您的软件包实际上不应该安装系统中包含在/usr/include中的任何内容。自制程序打包的位置是 /usr/local/include (作为 Cellar 的符号链接)。您只需调整 ./configure 调用即可使用 #{prefix}/include 进行包含(可能是 --incdir 或非常相似的东西)。

Your package really shouldn't install anything in the system includes in /usr/include. The place for homebrew packaged includes is /usr/local/include (as symlinks into Cellar). You'll just have to adjust your ./configure invocation to use #{prefix}/include for the includes (probably --incdir or something very similar).

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