【问题标题】:GNU Octave: Build a package from a directory instead of a tarballGNU Octave:从目录而不是 tarball 构建包
【发布时间】:2015-11-29 09:29:58
【问题描述】:

我目前正在开发一个库接口作为 GNU Octave 包。通常 GNU Octave 中的软件包是通过

安装的
pkg install tarball_of_the_package.tar.gz 

但是为每个测试压缩包或多或少会耗费时间。现在我的问题是,是否可以从具有有效包结构的目录中以某种方式调用pkg install 机制,例如在 tarball 中?运行

pkg install . 

从这个目录中产生一个错误:

unpack: FILETYPE must be "gunzip" for a directory

甚至将整个路径指定为

pkg install /path/to/the/package/source 

导致同样的问题。

目前我正在使用 GNU Octave 4.0.0 进行开发。

【问题讨论】:

    标签: installation octave packages


    【解决方案1】:

    大多数包都有一个Makefile,位于包的根目录,目标为install,将为您处理。参见例如Makefile for the statistics package,它允许您这样做:

    $ hg clone http://hg.code.sf.net/p/octave/statistics
    destination directory: statistics
    requesting all changes
    adding changesets
    adding manifests
    adding file changes
    added 401 changesets with 996 changes to 172 files
    updating to branch default
    133 files updated, 0 files merged, 0 files removed, 0 files unresolved
    $ cd statistics/
    $ make install
    Creating package version 1.2.4 release ...
    rm -rf "statistics-1.2.4"
    hg archive --exclude ".hg*" --exclude "Makefile" --type files "statistics-1.2.4"
    chmod -R a+rX,u+w,go-w "statistics-1.2.4"
    tar cf - --posix "statistics-1.2.4" | gzip -9n > "statistics-1.2.4.tar.gz"
    Installing package locally ...
    octave --silent --eval 'pkg ("install", "statistics-1.2.4.tar.gz")'
    For information about changes from previous versions of the statistics package, run 'news statistics'.
    

    当然,没有什么能阻止您从 Octave 会话本身调用 make install。统计包示例更好,因为它只有 m 个文件。如果您的包也有要编译的代码,则图像包有一个更复杂但不是很多的Makefile

    【讨论】:

    • 有趣的是,Debian 人员使用pkg install . 的方式将 octave-forge 软件打包到 deb 包中,我在 octave 内找不到任何差异或补丁可以实现这一点。
    猜你喜欢
    • 2012-09-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-02-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多