English 中文(简体)
rpmbuild:使用包裹中的文字文档,占书写字数的百分比
原标题:rpmbuild: using script files contained in the package in %pre script
  • 时间:2011-10-18 20:40:59
  •  标签:
  • rpm
  • rpmbuild

我必须在安装/升级的成套设备之前对目标系统进行多方面的“健康”检查。 我想在文字(bash/python/php或以其他方式)和其他附属档案(例如SQL scripts)中载入程序,这些档案将安装在其他档案中,但只是在(在Suprequ)之前使用。

%pre节和主稿内,我将这些档案放在了什么地方,以及我是如何打电话/参考的? 我如何参考当时的待处理数据文档(见SQL scripts)?

感谢任何帮助。

最佳回答

如果你把文字放在自封的档案中,并使之成为纸面,这是不可能的。 可查阅Make Self(,与下载直接链接。

footest为榜样:

makeself.sh --base64 /path/to/footest 
    /path/to/rpm/sources/footest.sh "My foo test" ./run.sh

<代码>/path/to/footest是一份附有您文字的名录,.run.sh为脚本目录内的文字,该格式在抽取时进行。

在您的<代码>.spec文档中,添加footest.sh作为来源,并将此列为文字:

%pre -f footest.sh

When you query your rpm for scripts, it ll show the contents of footest.sh, which is a makeself followed by the base64 encoding of your test suite to run.

<>strong>NOTE: for this to work, You have to apply a pad to make their use the base64 encoding (the present release does not have this summary), and rpm don t such as binary data in itsscript:

<>strong>自我-2.1.5-base64:。

diff -ruNp makeself-2.1.5/makeself.sh makeself-2.1.5-base64/makeself.sh
--- makeself-2.1.5/makeself.sh  2008-01-04 16:53:49.000000000 -0700
+++ makeself-2.1.5-base64/makeself.sh   2012-01-17 06:01:42.000000000 -0700
@@ -91,6 +91,7 @@ MS_Usage()
     echo "    --gzip          : Compress using gzip (default if detected)"
     echo "    --bzip2         : Compress using bzip2 instead of gzip"
     echo "    --compress      : Compress using the UNIX  compress  command"
+    echo "    --base64        : Instead of compressing, encode the data using base64"
     echo "    --nocomp        : Do not compress the data"
     echo "    --notemp        : The archive will create archive_dir in the"
     echo "                      current directory and uncompress in ./archive_dir"
@@ -150,6 +151,10 @@ do
    COMPRESS=Unix
    shift
    ;;
+    --base64)
+   COMPRESS=base64
+   shift
+   ;;
     --encrypt)
    COMPRESS=gpg
    shift
@@ -278,6 +283,10 @@ bzip2)
     GZIP_CMD="bzip2 -9"
     GUNZIP_CMD="bzip2 -d"
     ;;
+base64)
+    GZIP_CMD="base64"
+    GUNZIP_CMD="base64 -d -i"
+    ;;
 gpg)
     GZIP_CMD="gpg -ac -z9"
     GUNZIP_CMD="gpg -d"
问题回答

RPM没有这种功能。 如我所知,你有两个选择:

  1. 保存档案,将其编码为文本格式(例如uencode)和编码格式,并按百分比排列。 尽可能高。

  2. 拥有单独的输油管,即提供这些档案。 之后,在您现有的总价中,添加如下内容:

    要求: ql-dependencies。





相关问题
How can I make an RPM depend on package a OR package b?

This seems like a simple question, but the docs don t seem to have anything to say on the subject. I would like to do something like Requires: vim or emacs but when I do that, I in fact depend on vim,...

rpm build error

I tried to build a rpm package which is giving me the following error /usr/lib/rpm/find-debuginfo.sh /usr/src/redhat/BUILD/RPMS find: invalid predicate ` error: Bad exit status from /var/tmp/rpm-tmp....

find latest version of rpms from a mirror

I want to write a script to find the latest version of rpm of a given package available from a mirror for eg: http://mirror.centos.org/centos/5/updates/x86_64/RPMS/ The script should be able to run ...

How to put license agreement in spec file, RPM

I am using Fedora 10 linux. I want to put license agreement for my spec file. Actually I have created rpm for my application. So my application gets installed perfectly without asking for license ...

How to write .spec file to check JRE version in Fedora 10

I am using fedora 10 linux. I have created an RPM for my software it works fine. But I want the follwing feature "If I install RPM it will check whether JRE 1.5 or greater is availble in that system ...

How to create Customized group in RPM, Fedora

Hi I am using Fedora 10 linux. I have created an rpm for my application. I can run my going to manubar and then application under Applications----> Others--> MyApplication. But I want my ...

How to delete some extra folder using rpm

I am using Fedora 10, I have created an rpm file for my software. It removes all the files from the installed directory. If i use yum remove command or rpm -e command. but after installation my ...

热门标签