PACKMAN
(PackMan 封装管理 命令/工具——译者注)
在已经由CD光盘安装完成MINIX3之后,使用shutdown命令关闭系统,再从登录监视器重新登陆。
然后以root身份登录并输入:
- packman
你会得到一个包的清单,选择其中你想要的若干(或者全部)并安装它们。
一个你很可能会选择的包将是“X窗口系统”。
编译一个 Packman 包
编译 MINIX 3 的包
我们积极鼓励人们编写MINIX3组成部分的软件。MINIX3包具有一种需要被简单封装管理的标准格式。这里是些简单的规则。请遵循它们,因为:对我们来说,这将使得获取你的软件的过程变得容易;对其他用户来说,这将减少第一次安装这个软件时的出错几率。
- 每一个包都有一个唯一的名称,举例来说:foo-1.2.4, 连字符前边部分是程序名称,而其后是版本号,它们组合起来构成包的名称。
- 如下这个指南包含了一个名为build.minix的可执行的shell脚本,它能够创建和安装包,例如:
#!/bin/sh make make install这个脚本将按照这样的方式命名:- binpackage,从源创建二进制的包
- easypack, 下载和创建来自源代码的包
- 不要理会在你建立的目录之外的系统中的任何文件,因为那些无关于你的包(例如:调用 chmem 是无意义的)。一个binpackage脚本只会考虑你的包和其包括的文件。
- 如果你需要调用binsizes来增加二进制容量,那么无论binpackage或easypack,在你创建的目录的主目录中建立一个名为".binpackage"的文件,并输入如下指令
binsizes=xxl
或者其他你需要的容量,默认的是'big'。
- 如果你需要调用binsizes来增加二进制容量,那么无论binpackage或easypack,在你创建的目录的主目录中建立一个名为".binpackage"的文件,并输入如下指令
- 不要在你提交的包中包含任何已经生成的文件,比如目标文件或者生成好的Makefiles文件。编译你的创建来整理已经存在的文件,并且在build.minix脚本中要包含配置或设置环境变量。这样添加新文件就完成了。
- 库应该位于 /usr/local/lib/ack 或 /usr/local/lib/gcc ,或者二者皆有,具体来说取决于使用什么编译器。
- 对于C语言编译,你可以使用cc或gcc,然而我们还是尽可能的推荐使用cc。这两个编译器涉及非常不同的两种警告模式,但是通常二者都对。对于C++语言,可以使用g++,通过网络可以找到相关资源。
- 整个的创建过程不应该依赖于有特殊模式的文件(比如可执行类型),具体来说,不要在build.minix中使用 ./configure ;而要使用 sh 配置来替代。
- 添加一个 .descr类型的文件到包的根目录下,附有一行简短描述(最多50个字符)。
- 把PREFIX添置到/usr/local/,但是清注意到关于库的其他要点。
- 编译你的build.minix脚本直至它能再次运行,它也就全部安装完成。创建的失败,不仅会是很好的帮助,而且我们这种二进制包的产生机制也依赖于这些的出现。
- 安装命令应用于安装程序:将程序复制到/usr/local/bin,它将会在用户以bin(而不是root!)登陆系统之后生效。
- 每一个程序都应有一个符合标准格式的手册页面。安装命令也应当把手册页面安装到/usr/local/man的恰当的子目录下。大多数手册页面位于 /usr/local/man/man1,但是额外的用户指南可能位于/usr/local/man/man9。
- 创建一个包,输入:
tar cf - foo-1.2.4 | bzip2 >foo-1.2.4.tar.bz2
- 在通过测试后,请将其放置于你的站点并在comp.os.minix(这是个新闻组,请读者通过google自行搜索——译者注)上发布通告。并留言反馈给作者。
- 你可以测试一下是否你的包借助运行成功的编译了一个良好的二进制包:
binpackage yourpackagedir packagesdir
译者:张帆@BLCU
版权归[minix3Q]集体所有
PACKMAN
After having installed MINIX 3 from the CD-ROM, shutdown the system using the shutdown command and then reboot from the boot monitor.
Then login as root and type:
- packman
You will get a list of packages. Select the ones you want (or all) and install them.
One package you will probably want is the X Window System.
Making a Packman Package
Making MINIX 3 Packages
We actively encourge people to write and port software to MINIX 3. MINIX 3 packages have a standard format that is required by the easypack package manager. Here are the easyrules. Please stick to them as it will make it easier for us to process your software and easier for other people to install it the first time with no glitches.
- Every package has a unique name, for example, foo-1.2.4, where the part before the hyphen in the program name and the part after it is the version number. Together they form the package name.
- This directory contains an executable shell script called build.minix that builds and installs the package. For example:
#!/bin/sh make make installThis script will be called by:- binpackage, which builds binary packages from sources.
- easypack, which downloads and builds packages from source packages.
- Don't touch any files in the system outside your build tree that don't relate to your package (e.g. calling chmem is a no-no). The binpackage script will think it's your package and include that file.
- If you need to call binsizes to increase binary sizes, have binpackage or easypack do this for you by creating a file ".binpackage" in the top-level directory of your build tree, with this line:
binsizes=xxl
or whatever size you need. By default, 'big' is used.
- If you need to call binsizes to increase binary sizes, have binpackage or easypack do this for you by creating a file ".binpackage" in the top-level directory of your build tree, with this line:
- Do not submit your package with any generated files, such as object files, or generated Makefiles. Make your build fixes to already existing files, and by including options or setting environment variables in the build.minix script. Adding new files is OK.
- Libraries should go in /usr/local/lib/ack or /usr/local/lib/gcc or both, depending on which compiler is used.
- For compiling C programs, you can use either cc or gcc, although we prefer cc where possible. The two compilers issue quite different warnings and usually both of them are right. For C++ programs, use g++, available on the Website.
- The entire build procedure should not rely on files having a particular mode (such as being executable). For example, do not use ./configure in build.minix; use sh configure instead.
- Add a .descr file to the root of the package with a short (up to 50 characters) one-line description.
- Set the PREFIX to /usr/local/, but see the other point about libraries.
- Make your build.minix script so that if it is run again, it installs everything all over. Not only will this help greatly after a failed build, but our mechanism for generating binary packages relies on this happening.
- The command make install should use the install program to copy the program to /usr/local/bin. This will work even when the user is logged in as bin (not root!).
- Every program must have a man page in the standard format. The make install command should install man pages to the appropriate subdirectories of /usr/local/man. Most man pages go in /usr/local/man/man1 but extended user guides go in /usr/local/man/man9.
- To create the package, type:
tar cf - foo-1.2.4 | bzip2 >foo-1.2.4.tar.bz2
- After thorough testing, please put it on your Website and announce it on comp.os.minix. Feedback should go to the author.
- You can test if your package successfully makes a good binary package by running
binpackage yourpackagedir packagesdir
- binpackage will run your build script, and after that scan your entire filesystem (minus some directories which are not expected to contain new package files, but are expected to have files changed) looking for updates, which are then expected to be part of the installed package. The resulting package ends up in packagesdir/yourpackagedir.tar.bz2. This is why you shouldn't touch any files outside your package files in your build script. If you need to increase your compiler binary sizes, create a file called '.binpackage' in the root of your package directory. It is sourced as a shell script. The variable 'binsizes' can be set to have binpackage execute "binsizes $binsizes".
