netbsd pkgsrc安装软件说明
The two aforementioned methods both require that someone else has “
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.
COMMENTSA 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.
PLISTThis 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.
Again this little guide is for small packages that contain only a few files to be installed on a NetBSD system. It makes the assumption that the package does not require any patches and can build with no dependancies.