GNU Octave:从目录而不是 tarball 构建包
GNU Octave: Build a package from a directory instead of a tarball
我目前正在为一个库开发一个接口作为 GNU Octave 包。通常 GNU Octave 中的软件包是通过
安装的
pkg install tarball_of_the_package.tar.gz
但是每次测试都要压缩包,或多或少比较耗时。现在我的问题是,是否可以从具有有效包结构的目录(如 tarball 中)以某种方式调用 pkg install
机制? 运行
pkg install .
从这个目录中产生一个错误:
unpack: FILETYPE must be "gunzip" for a directory
甚至将整个路径指定为
pkg install /path/to/the/package/source
导致同样的问题。
目前我正在使用 GNU Octave 4.0.0 进行开发。
大多数软件包的根目录中都有一个 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 个文件。如果你的包也有需要编译的代码,image包有一个更复杂的,但不是很多,Makefile。
我目前正在为一个库开发一个接口作为 GNU Octave 包。通常 GNU Octave 中的软件包是通过
安装的pkg install tarball_of_the_package.tar.gz
但是每次测试都要压缩包,或多或少比较耗时。现在我的问题是,是否可以从具有有效包结构的目录(如 tarball 中)以某种方式调用 pkg install
机制? 运行
pkg install .
从这个目录中产生一个错误:
unpack: FILETYPE must be "gunzip" for a directory
甚至将整个路径指定为
pkg install /path/to/the/package/source
导致同样的问题。
目前我正在使用 GNU Octave 4.0.0 进行开发。
大多数软件包的根目录中都有一个 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 个文件。如果你的包也有需要编译的代码,image包有一个更复杂的,但不是很多,Makefile。