Friday, February 17, 2017

FreeBSD Ports

FreeBSD Ports


1?????? tarball? 

??????? tarball ???????? make fetch ??? 
????????? port?? editors/joe ??????? 

??:
cd /usr/ports/editors/joe/ 
make fetch


???? joe ? tarball ??? /usr/ports/distfiles/ ???? 
?????????? ports ??????? ports ? tarball?? 

systuils/portupgrade ??????? 

??:
cd /usr/ports/systuils/portupgrade/ 
make fetch-recursive


????? ports ? tarball ???????? ports ? tarball???? /usr/ports/distfiles/ ???? 

??????????? ports ? tarball ??? 

??:
cd /usr/ports/ 
make fetch


???????? ports ? tarball ??? /usr/ports/distfiles/ ???? 
????????? ftp ??? ports ? tarball ??? 

??:
cd /usr/ports/ftp/ 
make fetch


?????? ftp ??? ports ? tarball ??? /usr/ports/distfiles/ 
???? 

2???????? tarball???? 

??????? patch/?? ???????????????? 
? editors/joe ??????? 

??:
cd /usr/ports/editors/joe/ 
make extract


?? tarball??? /usr/ports/editors/joe/work/ ???? 


3???????? tarball ???????? patch? 

???? 2 ?????????????????? patch ??? patch ?? 
????? editors/joe ??????? 

??:
cd /usr/ports/editors/joe/ 
make patch


?? tarball??? /usr/ports/editors/joe/work/ ??????? patch ? 
????? patch? 

4????????? port? 

??????????????????????? port? 
? editors/joe ??????? 

??:
cd /usr/ports/editors/joe/ 
make install


????????????? joe ???????????????????? 
???????????????? FAQ 8 ??????????? 

??:
cd /usr/ports/editors/joe/ 
#make clean


?????????? ports ????????????? ports ????? 
???? 

??:
cd /usr/ports/ 
#make clean


5????????? port?????(package)??? 

??????????????????????????????????? 
??????????????????? package ??????? 
? editors/joe ??????? 

??:
cd /usr/ports/editors/joe/ 
#make package


????????????? joe ??????????(package)??? 

package ???? /usr/ports/editors/joe/ ??????????????? 
????????? 

??:
mkdir -p /usr/ports/packages/All/


????? packages ????????????????????????? 
??????????????????? ??????????????? 
? FAQ 8 ??????????? 

??:
cd /usr/ports/editors/joe/ 
make package clean



6??????? port????????? ports ?????? 

?? FAQ 5 ?????? port ??????????? ports ?????? 
??????????? ???????????? port ??????? 
ports???????? ports ?????????? packages ??? ??? 
? ports ? packages ???? 
? sysutils/portupgrade ??????? 

??:
cd /usr/ports/sysutils/portupgrade/ 
make DEPENDS_TARGET=package package


??????? portupgrade ????? ports ????????????? 

7??????????? port ??? 

??????????????????????????? 
? editors/joe ???? 

??:
cd /var/db/pkg/ 
pkg_create -b joe-{???}


?????? port ??????? /var/db/pkg/ ???? 

8????? ports ????????????? 

??? port ??????????????????(work)???????? 
??????????????????? ?????? 
? editors/joe ??????? 

??:
cd /usr/ports/editors/joe/ 
make clean


????????? ports ???????? 

??:
cd /usr/ports/ 
make clean


????????? ftp ??????????? 

??:
cd /usr/ports/ftp/ 
make clean



9????? ports ???????????????????? tarball? 

? FAQ 8 ???????????????????(work)??????? 
ports ?????? tarball ??(???? tarball ????? 
? /usr/ports/distfiles/)????? tarball ????? 
? editors/joe ??????? 

??:
cd /usr/ports/editors/joe/ 
make distclean


make distclean ?????? make clean ????????????? 
tarball ??????M?????????????? 

????????? ports ??????? tarball ??? 

??:
cd /usr/ports/ 
make distclean


????????? ftp ?????????? tarball??? 

??:
cd /usr/ports/ftp/ 
make distclean



10?????? ports ???????/?????? 

??? ports ??????????/?????? 
? mail/p5-Mail-SpamAssassin ??????? 

??:
cd /usr/ports/mail/p5-Mail-SpamAssassin/ 
make all-depends-list #????????? 
make pretty-print-build-depends-list #???????????? 
make pretty-print-run-depends-list #???????????????



11????????? ports? 

? editors/joe ??????? 

??:
cd /usr/ports/editors/joe/ 
make deinstall


???? pkg_delete 

??:
cd /var/db/pkg/ 
pkg_delete joe-{version}


????????????????????????????????? 

??:
cd /var/db/pkg/ 
pkg_delete -f joe-{version}


?????????????????????? 

???????????FAQ 43 

12??????????? ports? 

? sysutils/portupgrade ??????? 

??:
cd /usr/ports/sysutils/portupgrade/ 
make deinstall-depends


???????????????????????????? FAQ 10 ??? 
???? 

???? pkg_delete 

??:
cd /var/db/pkg/ 
pkg_delete -r portupgrade-{version}


???????????FAQ 43 


??:
13???????????? ports?


??????????????????????? editors/joe ????? 
?? 

??:
cd /usr/ports/editors/joe/ 
make deinstall 
make clean 
make install ? make reinstall



14????????? ports? 

??????? ports collection ??????? "ldap" ??? ports? 
?? 

??:
cd /usr/ports/ 
make search key=ldap


?????? ftp ??? ports ??????? "ldap" ??? ports??? 

??:
cd /usr/ports/ftp/ 
make search key=ldap


????????????? key ?? name ?????????? ports ? 
??????????????? "ldap"? ?? 

??:
cd /usr/ports/ 
make search name=ldap


????? ftp ??? ports ????????? "ldap" ??? ports? 
?? 

??:
cd /usr/ports/ftp/ 
make search name=ldap



15????????? ports? 

??????????????????????????? port?????? 
???FAQ 11?FAQ 12?FAQ 13?????? port?????????FAQ 4? 
FAQ 5? 

? editors/joe ????? FAQ 11 ? FAQ 4 ?????? 

??:
cd /var/db/pkg/ 
pkg_delete joe-{version} 
cd /usr/ports/editors/joe/ 
make install


?? 

??:
cd /usr/ports/editors/joe/ 
make clean 
make reinstall



16????????????????? 

??????????????? 

??:
pkg_info


17??????????????????????? 
????? FAQ 16 ? 

??:
pkg_info | grep



18????????????????? 

????? /usr/local/bin/joe ???????????? 

??:
pkg_info -W /usr/local/bin/joe


?????????????????????? FreeBSD ???? 


19????????????????? 

????????????? joe ?????????? 

??:
pkg_info -L /var/db/pkg/joe-{version}



20???????? ports? 

????????????????????????????? 
???????? CVS ????????????????????????? 
???????????????????????????? FreeBSD ports 
CVS repository??????? Freshports ??? FreeBSD ? Mailing 
FreeBSD cvs ?? FreeBSD ports cvsweb? 

?????????????????? CVS tag????? ports ? CVS 
tag ??? /usr/share/examples/cvsup/ports-supfile ?????? 
2002/10/05 ?????? 

??:
# vi /usr/share/examples/cvsup/ports-supfile 
****************************************** 
default date=2002.10.05.00.00.00 #? date ????


?????? CVSup ???????? CVSup (make update)???? ports 
collections ??????????????? ???????? ports 
collections ????????? 

?????????? ports ??????????????????? 
lang/perl5.8 ????????? lang ??????? 

??:
# vi /usr/share/examples/cvsup/ports-supfile 
****************************************** 
#ports-all #? ports-all ???? 
ports-lang #????


????? CVSup??????????????????? ports? 
?????? 


21????? ports Mk? 

Mk (/usr/ports/Mk/) ??? ports ????????????? ports 
collections ?????? Mk ???????? ?????? Mk ????? 


??:
cd /usr/src/ 
make update 
cd /usr/src/share/mk 
make install



22??????? ports ??? sed -i ???? 

?? BSD style ? sed ???? BSD ????? sed ???? ports ??? 
????? sed ???????????? ????????? sed_inplace 
(textproc/sed_inplace)????????????? ports? 


??:
cd /usr/ports/???/???/ 
make -DUSE_REINPLACE install



23???????????? ports? 

ports collection ????????????? ports collections ???? 
???????????????????? ??????????????? 
????? 

??:
pkg_version -c



24????? ports system ??? ports ????????? 

??? ports collections ??????????????? Makefile ??? 
???? sysutils/portupgrade ??? 
???? /usr/ports/sysutils/portupgrade/Makefile ???? 
??????????????????????? 
?? sysutils/portupgrade ??? NOPORTDOCS??? 

??:
cd /usr/ports/sysutils/portupgrade/ 
make -DNOPORTDOCS install # make NOPORTDOCS=yes install ??


????? ports ???? NOPORTDOCS ????????????? 
?????????? ports ????????????????????? 
ports ????????????????? ?????????????? 
?? 

??:
cd /usr/ports/sysutils/portupgrade/ 
grep defined Makefile


??????????????????????????????????? 
?????????????????? 


25????????? ports ???? 

? FAQ 24 ?????? ports collections ??????????????? 
??????????? ????? ports collections ????????? 
???????????? ftp/pure-ftpd ??????? inetd ????? 
???????? ports collections ?????????????? ??? 
????? 

??:
cd /usr/ports/ftp/pure-ftpd/ 
make CONFIGURE_ARGS+="--without-inetd" install



26????? ports ?????? 

?? ports collecions ???????? (/usr/local/)????????? 
???????????????????? ? editors/joe ????? 

??:
cd /usr/ports/editors/joe/ 
make PREFIX=/usr install


?? joe ???????? /usr ?????????? /usr/local ???? 


29????? packages? 

?? FreeBSD ? packages ?? .tgz ??????????? packages ?? 
?? pkg_add?????? joe ? tgz? 

??:
pkg_add joe-{version}.tgz



30??????? packages? 

???? packages ????? packages ???????????????? 
? packages ??????? ???????? packages ????????? 
???? packages ?????????????????????????? 
??????? packages ????????????? joe ? tgz? 


??:
pkg_add -f joe-{version}.tgz



31????? packages ??? packages ??????? 

???? packages ????? packages ???????????????? 
? packages ??????? ?? packages ??? packages ??????? 
????????? portupgrade ????? packages? 


??:
pkg_info -r portupgrade-{version}.tgz



32??????? packages? 

??????????? PACKAGEROOT??? 

setenv PACKAGEROOT ftp://ftp.cn.freebsd.org #?? PACKAGEROOT ? ftp.cn.freebsd.org ?? 

???????? PACKAGESITE????????? packages ??????? 
????????????????? 
? ftp.cn.freebsd.org i386 ? current pakcages ??? 

setenv PACKAGESITE ftp://ftp.cn.freebsd.org/pub/FreeBSD/ports/i386/packages-current/Latest/ 

??????????????????????? 
????? packages ????? portupgrade ????? 

??:
pkg_add -r portupgrade


??????? ftp.cn.freebsd.org ????? portupgrade ??? packages ???? 


33????? INDEX ???? 

4.x ? INDEX ?? /usr/ports/INDEX?5.x ?? /usr/ports/INDEX-5? 
INDEX ??? ports ???????????????????????? 
ports ???????????? INDEX??? ?????????? 

??:
cd /usr/ports/ 
make index



34????? INDEX HTML? 

FreeBSD ???????????? ports collection????? lynx, w3m, 
links ??????????????????? ports collection ???? 
?? 

??:
cd /usr/ports/ 
make readmes


??????????????????????????????? /usr/ports/ftp/ ????? 

??:
cd /usr/ports/ftp/ 
make readme


????? /usr/ports/ftp/ ????????????????????? 
?? ????????????????? README.html ???? 


35??????? ports ?? CVSup? 

? ports ????????????????? CVSup ?????????? 
???????? 

??:
# vi /usr/sup/refuse 
****************************************** 
ports/french 
ports/german 
ports/hebrew 
ports/hungarian 
ports/japanese



????????????????? 

?????????? ports ?????????????????????? 
???? 

??:
# vi /usr/sup/refuse 
****************************************** 
ports/lang/perl5.8


?? ports/lang/perl5.8 ?? ports ??? CVSup ??? 

????????????? 

??:
# vi /usr/sup/refuse 
****************************************** 
ports/lang/perl* 
ports/po*



36????? CVSup ?? ports collections? 

??? gslin ? ? CVSup ????? source tree ?? ports tree? 

Available link for download