deb包安装的脚本有错误的前缀 [英] Scripts installed by the deb package have wrong prefix

查看:181
本文介绍了deb包安装的脚本有错误的前缀的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



特别是,

>


  • 我们正在构建 mono

  • 我们正在使用官方的tarball。

  • 最终出现错误前缀的脚本是: mcs ,xbuild,nunit-console4等



错误脚本的示例:

 #!/ bin / sh 
exec / root / 7digital-mono / mono / bin / mono \
--debug $ MONO_OPTIONS \
/root/7digital-mono/mono/lib/mono/2.0/nunit-console.exe $ @

应该是正确的最终结果:

 #!/ bin / sh 
exec / usr / bin / mono \
--debug $ MONO_OPTIONS \
/ usr / lib / mono / 2.0 / nunit-console.exe$ @

我们在 build-package 脚本:

  sed -is,`pwd` / mono,/ usr,g $ TARGET_DIR / bin / mcs 
sed -is,`pwd` / mono,/ usr,g $ TARGET_DIR / bin / xbuild
sed -is,`pwd` / mono,/ usr,g $ TARGET_DIR / bin / nunit-console
sed -is,`pwd` / mono,/ usr,g $ TARGET_DIR / bin / nunit-console2
sed -is,`pwd` / mono,/ usr,g $ TARGET_DIR / bin / nunit-console4

现在,正确的方法是解决这个问题?完整的debian包创建脚本 here



免责声明:我知道有Mono 3的预览软件包 here !但是这些不适用于Squeeze。

解决方案

正确的方法是调用 ./configure --prefix = $ TARGET_DIR



这将告诉所有的二进制文件/脚本/ ...安装的文件将最终在 $ {TARGET_DIR} 中,而他们真的应该在 / usr 中。



可以使用 DESTDIR 变量(如 make install DESTDIR = $ {TARGET_DIR} )在安装时更改(前缀)安装目标(文件将以 $ {TARGET_DIR} / $ {prefix} 结尾,但只有 $ {前缀} 内置)


Building our own deb packages we've run into the issue of having to patch manually some scripts so they get the proper prefix.

In particular,

  • We're building mono
  • We're using official tarballs.
  • The scripts that end up with wrong prefix are: mcs, xbuild, nunit-console4, etc

An example of a wrong script:

#!/bin/sh
exec /root/7digital-mono/mono/bin/mono \
      --debug $MONO_OPTIONS \
      /root/7digital-mono/mono/lib/mono/2.0/nunit-console.exe "$@"

What should be the correct end result:

#!/bin/sh
exec /usr/bin/mono \
      --debug $MONO_OPTIONS \
      /usr/lib/mono/2.0/nunit-console.exe "$@"

The workaround we're using in our build-package script before calling dpkg-buildpackage:

sed -i s,`pwd`/mono,/usr,g $TARGET_DIR/bin/mcs
sed -i s,`pwd`/mono,/usr,g $TARGET_DIR/bin/xbuild
sed -i s,`pwd`/mono,/usr,g $TARGET_DIR/bin/nunit-console
sed -i s,`pwd`/mono,/usr,g $TARGET_DIR/bin/nunit-console2
sed -i s,`pwd`/mono,/usr,g $TARGET_DIR/bin/nunit-console4

Now, what is the CORRECT way to fix this? Full debian package creation scripts here.

Disclaimer: I know there are preview packages of Mono 3 here! But those don't work for Squeeze.

解决方案

the proper way is to not call ./configure --prefix=$TARGET_DIR

this tells all the binaries/scripts/... that the installated files will end up in ${TARGET_DIR}, whereas they really should endup in /usr.

you can use the DESTDIR variable (as in make install DESTDIR=${TARGET_DIR}) to change (prefix) the installation target at install time (files will end-up in ${TARGET_DIR}/${prefix} but will only have ${prefix} "built-in")

这篇关于deb包安装的脚本有错误的前缀的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆