- 浏览: 4400559 次
- 性别:
- 来自: 湛江
博客专栏
-
SQLite源码剖析
浏览量:80078
-
WIN32汇编语言学习应用...
浏览量:70049
-
神奇的perl
浏览量:103358
-
lucene等搜索引擎解析...
浏览量:285824
-
深入lucene3.5源码...
浏览量:15014
-
VB.NET并行与分布式编...
浏览量:67568
-
silverlight 5...
浏览量:32153
-
算法下午茶系列
浏览量:45991
文章分类
最新评论
-
yoyo837:
counters15 写道目前只支持IE吗?插件的东西是跨浏览 ...
Silverlight 5 轻松开启绚丽的网页3D世界 -
shuiyunbing:
直接在前台导出方式:excel中的单元格样式怎么处理,比如某行 ...
Flex导出Excel -
di1984HIT:
写的很好~
lucene入门-索引网页 -
rjguanwen:
在win7 64位操作系统下,pygtk的Entry无法输入怎 ...
pygtk-entry -
ldl_xz:
http://www.9958.pw/post/php_exc ...
PHPExcel常用方法汇总(转载)
The two aforementioned methods both require that someone else has “created a package”, i.e. has ported and configured a program for NetBSD. Although the package collection comprises more that 3500 programs, it is possible that the one that you want is still not included. In this case you can compile it without using the package system and, once you get it working, create a package that can be added to the collection: other users will benefit from your work.
Before installing a program from source, you should download and install the package collection from the NetBSD site or from the mirror of your choice. This is described in the following steps.
-
Download the latest version of the package system sources, which include all the necessary makefiles and configuration files, from ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-current/tar_files/. The file to be downloaded is
pkgsrc.tar.gz
. -
Remove the existing collection from your hard disk (if you already have installed it) with the following command:
#
cd /usr
#
rm -rf pkgsrc
-
Install the collection that you have downloaded:
#
tar -xzvpf pkgsrc.tar.gz -C /usr
The execution of the previous command can last many minutes, because of the huge number of (small) files that are extracted. At the end, the framework required for the installation of new programs is ready and you can start installing them.
Note
by now it is probably clear that the previous commands installed the configuration files required for the automatic installation of programs on your system: you have not yet installed the programs! Basically, the system now has a list of the available packages and the instructions to fetch, compile and install them.
When you have installed the package collection you can browse it with Lynx or Netscape and read the details and the descriptions of all the available packages and package categories. For example:
$
cd /usr/pkgsrc
$
lynx README.html
Don't lose the distfiles
When you remove an existing package collection to install a newer version, don't forget to back up your /usr/pkgsrc/distfiles
subdirectory before removing /usr/pkgsrc
. This directory is used to store downloaded source tarballs, if you remove this directory your system has to download these tarballs one more time when pkgsrc needs them. If you don't want to run this risk, you can instruct the system to use another directory for the distfiles, one which is not a subdirectory of /usr/pkgsrc
. For example, create the new directory:
#
mkdir /usr/pkgsrc_distfiles
Add the following line to /etc/mk.conf
:
DISTDIR=/usr/pkgsrc_distfiles
Of course, you can use a directory of your choice instead of /usr/pkgsrc_distfiles
.
You can configure many aspects of the package system with /etc/mk.conf
. You can find a detailed description of the variables you may want to set in the /usr/pkgsrc/mk/bsd.pkg.defaults.mk
file and in mk.conf(5).
The package collection is frequently updated: you can find a new version on the ftp site almost weekly. To update the collection on your system follow the same instructions as for first time installation.
Sometimes, when updating the package collection, it will be necessary to update the “pkgtools” utilities too. You can easily spot if you need to do it: when you try to install a program the package system complains that your pkgtools are outdated.
#
make
===> Validating dependencies for gqmpeg-0.6.3 Your package tools need to be updated to 2000/02/02 versions. The installed package tools were last updated on 1999/01/01. Please make and install the pkgsrc/pkgtools/pkg_install package. *** Error code 1
The easiest way to update is:
#
cd /usr/pkgsrc/pkgtools/pkg_install
#
make install
After this you can resume the installation of the package which issued the original error message.
Note
You can determine the required version examing the pkgsrc/mk/bsd.pkg.mk
file: look for the line with:
PKGTOOLS_REQD = 20000202
(the 20000202 date is only an example.) This means that the version of the programs that you need is in the pkg_install-20000202.tar.gz
file, that you can find on the NetBSD ftp site under packages/distfiles/LOCAL_PORTS
. pkg_install
can be installed like any other package.
This section describes the installation of an example program: the cdrecord application. First, cd to the /usr/pkgsrc/sysutils/cdrecord
directory.
If you are connected to the Internet, the Makefile
will automatically fetch the required sources and you don't need to read this section.
Downloading from another machine
A very common scenario is that you download the package sources on another machine with a fast Internet connection (for example at work) and then install them on your NetBSD system (for example at home.)
Otherwise you should take care of getting the tarballs yourself. In this case you need to know the name(s) of the tarball(s); look in the Makefile
for the line
DISTNAME = cdrtools-2.0
The full name of the package is cdrtools-2.0.tar.gz
.
You can achieve the same result in an easier way with the following commands:
#
cd /usr/pkgsrc/sysutils/cdrecord
#
make fetch-list
which also show a list of sites from where the package can be downloaded.
To compile the package write
#
cd /usr/pkgsrc/sysutils/cdrecord
#
make
The previous command fetches the source archive (if it is not already present in the distfiles directory), extracts the sources, applies the patches necessary to compile it on NetBSD and then builds the package.
To install it
#
make install
The installation of the new program is recorded on your system: you can check with the pkg_info -a command.
Then cdrecord package is ready for use; you can make some room removing the intermediate files created by the compiler:
#
make clean
#
make clean-depends
The second command is needed if some dependent packages have been installed. The same result can be achieved with one command:
#
make clean CLEANDEPENDS=1
I have already explained in the first part of this chapter that the package system can install program from source but can also install binary packages, prepared by someone else for NetBSD. This second form of installation is faster because the compilation of the package is not needed and the tarballs for the binary package are usually smaller and faster to fetch. To install a binary package the package collection is not needed: only the “pkgtools” utilities are needed.
The tarballs for the binary programs usually have the extension .tgz
while the source tarballs usually end with .tar.gz
.
Note
not all the source tarballs end with .tar.gz
. The package system can handle other types of packages, for example .zip
, .bz2
, etc.
It is not strictly necessary to download binary packages prior to installation: you can also use ftp://-URLs. For example:
ftp://ftp.NetBSD.org/pub/NetBSD/packages/1.4.2/i386/All/tcsh-6.09.00.tgz
If you don't know what version of the package is available on the FTP site you can even leave out the version inormation and pkg_add will pick the latest version on the FTP server. For example:
#
pkg_add ftp://ftp.NetBSD.org/pub/NetBSD/packages/1.4.2/i386/All/tcsh
It is also possible to set PKG_PATH to a ;-separated list of path and URLs and then omit that part for pkg_add:
#
PKG_PATH="/cdrom;/usr/pkgsrc/packages/All;ftp://ftp.NetBSD.org/pub/NetBSD/packages/1.4.2/i386/All"
export PKG_PATH#
pkg_add tcsh
The previous command installs the first tcsh binary package that it finds.
As an example, let's install the texinfo program in precompiled form.
-
Copy
gtexinfo-3.12.tgz
in a temporary directory. -
Give the following command
#
pkg_add -v gtexinfo-3.12.tgz
-
Check that the package has been installed with the command
#
pkg_info
-
Remove the file
gtexinfo-3.12.tgz
from the temporary directory.
Precompiled packages are very practical to use because they require a minimal effort and time for installation, but source packages give more control because their compilation options can be customized. The installation is somewhat longer, because of the compilation, and this could be critical on some (older) platforms.
Before installing a precompiled package with pkg_add, it is better to examine it with the pkg_info command. For example:
#
pkg_info -f jpeg-6b.tgz
It is worth examining the first CWD command, to check where the package is installed (base directory.) The most common base directories are /usr/pkg
and /usr/X11R6
. If the base directory is not what you want, you can change it with the -p
of the pkg_add command. For example, the jpeg-6b.tgz
package is installed in /usr/pkg
by default, but you can install it in /usr/X11R6
if you extract it with the following command:
#
pkg_add -p /usr/X11R6 -v jpeg-6b.tgz
The most important commands for package management are:
adds precompiled packages.
removes installed packages. Package names can be given with or without version; if no version is given, pkg_delete will find out which version is installed. Wildcards can be used (but must be escaped for the shell); for example:
#
pkg_delete "*emacs*"
The -r
option is very powerful: it removes all the packages that require the package in question and then removes the package itself. For example:
#
pkg_delete -r jpeg
will remove jpeg and all the packages that used it; this allows upgrading the jpeg package.
shows information on packages, installed and not installed.
creates new packages for the package collection. This program is used to create new precompiled packages. It's called automatically by the build system and there's no need to call it by hand.
executes various administrative functions on the package system.
This section details a quick start method for building relatively small Packages for the NetBSD packaging system. For more details on some of the intricacies on the NetBSD packaging system see pkgsrc documentation.
There are three primary tools for rapidly building a small package addition to NetBSD:
url2pkg |
a template package |
pkglint |
The url2pkg utility can be installed from the pkgsrc tree. This tool helps the package builder quickly fill in and test rudimentry aspects of package building.
A template package example, bison, is provided in the appendices of the pkgsrc documentation.
Starting the process is fairly simple. It is important that the builder (e.g. you) have already tested building the package from the sources on a NetBSD system. Otherwise setting up a new package could be problematic if if fails to build. It should be noted that most often, a patch can be written for the sources and included in the package to fix any build problems. That is beyond the scope of this quick start guide (see the pkgsrc documentation for details).
The next step is to use url2pkg.
Following are the steps for using url2pkg to create some of the initial files needed for a new package:
-
Make the directory under the appropiate pkgsrc directory for the new package. Do not put anything in it yet.
-
cd into the new directory.
-
type
$
url2pkg
-
You will be prompted to enter a url at this point, enter the url and hit <Return>.
-
A vi session will begin
Note
this uses the default location of vi on NetBSD, by default it is nvi. If you normally use another vi clone such as vim you may get
.exrc
errors.The vi session is for the
Makefile
of the new package. You must enter the package name, package maintainer email and the category that the package will fall under. -
Save the file and exit.
-
url2pkg will automatically fetch the package and put it in the work subdirectory.
-
Next, url2pkg will generate md5 files.
That ends a url2pkg session, please note url2pkg does not fill in any other files except the Makefile
. It will generate an empty PLIST
file.
Now that the Makefile
has been generated, the remaining files must be created. Using your template package, copy over the following files from the template package's pkg subdirectory:
A multi-line description of the piece of software. This should include credits as well.
A one-line description of the piece of software. There is no need to mention the package's name - this will automatically be added by the pkg_* tools when they are invoked.
This file contains the location of files to be installed on the system. For a small package (e.g. one binary and one or two man pages) peeking at the distribution's Makefile
, install script etc. should easily illustrate where to install what files.
With all of the files ready, it is time to check the package with the pkglint tool. Often the Makefile needs a section moved, changed or added, however, for the first time around it is helpful just to run pkglint before hand so you know exactly what you may need to change, following is some sample output taken from the pkgsrc documentation pkglint session:
$
pkglint
OK: checking pkg/COMMENT. OK: checking pkg/DESCR. OK: checking Makefile. OK: checking files/md5. OK: checking patches/patch-aa. looks fine.
If an error occured, it is normally pretty straightforward, here is a sample error I got while building a package:
extract suffix not required
I did not need to define an extract suffix in the Makefile
.
At this point if pkglint has passed, I normally run a complete check of the fetch, build and installation. To do this properly I must delete the work subdirectory and the distfile(s) from /usr/pkgsrc/distfiles
. This way I can ensure I will be doing a full and complete test.
First make an archive of the package tree itself (including the pkg/work
subdirectory) like so:
$
tar -czf packagename.tgz package_dir
Next, upload the archive to a location that NetBSD package maintainers can access it from, if you cannot upload the archive, contact NetBSD to see if there is some other method you might try to make your archive available to package maintainers.
The preferred method of notifying NetBSD package maintainers is to use the send-pr utility with a category of “pkg”, a synopsis which includes the package name and version number, a short description of the package and the URL of the tar file.
You can use either the send-pr utility on your NetBSD system or the online form at http://www.NetBSD.org/cgi-bin/sendpr.cgi?gndb=netbsd if for some reason you cannot get send-pr to work locally.
发表评论
-
R语言与数据分析
2015-05-15 20:58 2153当今计算机系统要处理的数据类型变得多种多样,并且为了深入理 ... -
prezi-中文输入
2013-01-31 15:33 6842首先,先下载中文字体,用的是Pez_GBC_Fonts中文补 ... -
prezi desktop
2013-01-29 22:36 3102prezi试用版的破解方法 (2012-05-02 ... -
netbsd桌面笔记
2012-12-14 11:55 8203前言:之前完成了FreeBSD和OpenBSD的桌面笔记,今天 ... -
ubuntu12.04-安装 jdk6
2012-11-29 16:44 2035sun-java6不在软件源中。1.首先添加软件源:$sudo ... -
ubuntu-jdk7
2012-11-29 16:22 2169一步:下载jdkhttp://www.oracle.com/t ... -
Forth简介
2012-08-11 16:29 2274FORTH以可延伸的词典 ... -
骨的四大构造
2012-06-28 08:26 2009骨以骨质为基础, ... -
Ubuntu 12.04安装QQ2012
2012-06-27 10:33 3737Ubuntu 12.04安装QQ2012,下载后请根据自己 ... -
ubuntu 安装matlab 2010b 全记录
2012-06-27 10:31 5117更新:今天安装了matla ... -
netbsd5.1.2文档pdf
2012-02-28 17:23 1725netbsd5.1.2文档pdf -
NetBSD的网络配置
2012-02-28 16:47 2599由于NetBSD的安装方式是比较保守的,必能没有在安装的过程中 ... -
NetBSD基础知识
2012-02-26 20:03 1626NetBSD基础知识 第一章. 何谓NetBSDNetBSD是 ... -
4.4bsd介绍及下载
2012-02-25 18:09 51484.4BSD及其后裔这桩诉讼 ... -
NetBSD 从pkgsrc安装软件
2012-02-22 15:30 4666netbsd安装软件是靠pkgsrc 这个框架是从freebs ... -
解决 does not build with PTH enabled错误
2012-02-22 15:13 1995Code: 2F7# cd /usr/ports/www ... -
美国人写的从程序员的视角阐述计算机系统原理的经典之作
2012-02-18 10:24 2475美国人写的从程序员的视角详细阐述计算机系统的本质概念,并展示这 ... -
Photonvps优惠码
2011-10-22 20:59 2380之前在国庆发布了一组Photonvps优惠码,有网友留言说已经 ... -
免费动态域名
2011-10-19 09:41 1544https://www.dnsexit.com/ -
如何创建自己的域名解析服务器?
2011-10-19 09:38 5964如何创建自己的域名解析服务器? 1. 登录到您的nam ...
相关推荐
HPKGSRC 项目的目标是将 ... NetBSD Packages Collection (pkgsrc) 是一个用于在 NetBSD 和其他类 UNIX 系统上构建第三方软件的框架,目前包含 8000 多个包。 它用于在支持的平台上轻松配置和构建免费可用的软件。
你可以通过pkgsrc或编译源码来安装JDK。 2. **获取源码**:从Jetspeed官方网站或者Git仓库下载2.2.1的源码包。解压缩文件,进入源码目录。 3. **构建和安装**:使用Apache Maven作为构建工具。首先,确保Maven已...
手册会讲解如何使用pkgsrc,这是一个跨平台的软件构建和安装框架,用户可以通过它获取并安装各种软件。 5. **编程和开发**:NetBSD支持多种编程语言和开发环境,手册会提供关于编译器、调试器和其他开发工具的信息...
5. **软件包管理系统**:NetBSD使用pkgsrc,这是一个强大的跨平台软件包管理系统,可以方便地安装、升级和管理软件。 6. **网络兼容性**:NetBSD支持广泛的网络协议和硬件,包括对IPv6的全面支持,以及对各种网络...
"NetBSD的便携式软件包系统"表明了pkgsrc的核心特性,即它的跨平台兼容性,使得在不同操作系统上构建和管理软件变得简单。 "Makefile"标签指的是pkgsrc使用Makefile作为构建工具。在pkgsrc中,每个软件包都有一个...
pkgsrc提供了一个统一的框架,允许用户方便地安装、升级和管理各种开源软件。这个系统的核心是一系列的Makefile,这些文件描述了如何从源代码构建特定的软件包。pkgsrc的包源代码来自广泛的合作社区,确保了软件的...
3. **软件包的广泛性**:得益于pkgsrc庞大的软件库,用户可以访问到众多已编译好并准备安装的开源软件。 4. **版本控制**:可以轻松管理软件包的版本,确保系统中的软件保持最新状态。 5. **自动化**:自动处理依赖...
作为pkgsrc开发人员,此存储库应为您提供帮助,以在不同的操作系统上测试您的软件或软件包。 这是为使用MacOS作为本地操作系统的用户创建的。 我在本地计算机上使用它,因此也许某些脚本和环境对您不起作用。 随时...
要在非NetBSD的操作系统上使用pkgsrc,首先需要引导: cd pkgsrc/bootstrap ./bootstrap 请注意,这仅适用于最简单的情况,即使用pkgsrc的默认值。 请参阅bootstrap/README和bootstrap/README.OS以获取有关引导的...
通过pkgsrc,用户可以方便地安装和管理各种开源软件。 pkgsrc存储库是由一系列的Makefile构成的,每个Makefile对应一个软件包。这些Makefile包含了构建、安装和卸载软件的所有指令。pkgsrc-myrepos的出现解决了多...
而 `pkgsrc` 是一个跨平台的软件构建系统,源于NetBSD项目,它提供了大量的开源软件包,使得用户可以方便地在不同操作系统上安装和管理软件。 标题"alpine-pbulk:为 pbulk 构建配置的 Alpine pkgsrc"指出,这是一个...
pkgsrc是NetBSD项目的一部分,它提供了一套跨平台的软件构建系统。除了NetBSD,pkgsrc也支持多种操作系统,包括MacOS。通过pkgsrc,用户可以获取到各种开源软件的源代码,并按照其配置进行编译安装。 回到Guigna,...
安装一个包 $ pkgbrew install editors/emacs-nox11 卸载软件包 $ pkgbrew deinstall editors/emacs-nox11 升级包 $ pkgbrew replace editors/emacs-nox11 显示构建参数 $ pkgbrew show-options editors/emacs24...
“pkgsrc”是NetBSD项目的一个软件包管理系统,允许用户在各种Unix-like系统上方便地安装和管理软件包。 “plist”是Mac OS X系统中的一种配置文件格式,用于存储应用程序的偏好设置和元数据。 “字体”部分可能...
NetBSD sysprep ---如果您想从一开始就访问GIT存储库,则无论如何都需要使用pkgsrc vi ~/.profile #enable PKG_PATH . ./.profile pkg_add -v git pkg_add -v mozilla-rootcerts pkg_add -v mozilla-rootcerts-...
9. **Pkgsrc**:在提供的压缩文件中出现的`pkgsrc`是一个软件包管理系统,主要用在NetBSD操作系统上,但也可用于其他类Unix系统。它包含了一套构建工具和预配置的软件源代码,使得用户可以方便地安装和管理OpenEV...