自制程序和权限被拒绝问题
我尝试通过 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
试试这个:
这对我有用!
Try this:
It works for me!
您的软件包实际上不应该安装系统中包含在/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).