快快樂樂打造你自已的port

以我自已弄的Net-POP3-SSLWrapper為例

# mkdir /root/Net-POP3-SSLWrapper

# vim Makefile

# New ports collection makefile for:  p5-Net-POP3-SSLWrapper
# Date created:       16 December 2009
# Whom:         johnpupu <johnpupu @gmail.com>
#
# $FreeBSD$
#

PORTNAME= Net-POP3-SSLWrapper
PORTVERSION=  0.02
CATEGORIES= mail perl5
MASTER_SITES= CPAN
PKGNAMEPREFIX=  p5-

MAINTAINER= johnpupu@gmail.com
COMMENT=  Perl extension for simple POP3S wrapper for Net::POP3

BUILD_DEPENDS=  ${SITE_PERL}/IO/Socket/SSL.pm:${PORTSDIR}/security/p5-IO-Socket-SSL

PERL_CONFIGURE= yes

MAN3= Net::POP3::SSLWrapper.3

.include <bsd .port.mk>

整個Makefile 我是看相同類型的port的Makefile 來參考的

#vim pkg-descr

This is a port of Net-POP3-SSLWrapper.

WWW: http://search.cpan.org/dist/Net-POP3-SSLWrapper/

#fetch http://search.cpan.org/CPAN/authors/id/T/TO/TOKUHIROM/Net-POP3-SSLWrapper-0.02.tar.gz
#mv Net-POP3-SSLWrapper-0.02.tar.gz /usr/ports/distfiles
#cd /root/Net-POP3-SSLWrapper
#make makesum
這樣/root/Net-POP3-SSLWrapper 目錄裡應該就會有 Makefile, distinfo, pkg-descr 三個檔案
#cd /root/Net-POP3-SSLWrapper
#portlint -a ### 檢查Makefile 有沒有問題
#cp -Rp /root/Net-POP3-SSLWrapper /root/Net-POP3-SSLWrapper.new
#/root/create_pkg.sh /root/Net-POP3-SSLWrapper /root/Net-POP3-SSLWrapper.new
#cp /root/Net-POP3-SSLWrapper.new/pkg-plist /root/Net-POP3-SSLWrapper
這樣 應該就差不多了

然後 寫個測試的perl 看看有沒有問題
我原先的Makefile 是沒寫到BUILD_DEPENDS= ${SITE_PERL}/IO/Socket/SSL.pm:${PORTSDIR}/security/p5-IO-Socket-SSL
是看測試的perl 說沒有這個module 才去補上這個dependency

送pr …
#shar `find /root/Net-POP3-SSLWrapper -print` > ~/Net-POP3-SSLWrapper.shar
#send-pr -a ~/Net-POP3-SSLWrapper.shar -c 長輩的e-mail

PS:
1.
create_pkg.sh 請參考

http://blog.wu-boy.com/2009/11/18/1843/

2.

http://www.freebsd.org/doc/zh_TW/books/porters-handbook/plist-autoplist.html

這個自動產生pkg-plist的指令請在bash 底下run
csh 跑不起來..

3.我還沒驗證重作一遍…..不確定過程是完全沒少的

4.
得cls_bsd長輩指點
可以用
ports-mgmt/porttools
來檢查port 對不對
就直接在port 資料夾裡
port test 就會列出是否有錯誤了

5.
Q:
WARN: Makefile: “BUILD_DEPENDS” has to appear earlier.

A:
RUN_DEPENDS和BUILD_DEPENDS
中間不要有空行

6.
要是出現
FATAL: Makefile: duplicated manpage entry Net::POP3::SSLWrapper.3: content of MAN3 will be automatically added to pkg-plist.
表示沒把pkg-plist 中的man文件刪掉
所以請把pkg-plist 中的man 幹掉

手冊寫到
The MAN[1-9LN] variables will automatically add any manpages to pkg-plist (this means you must not list manpages in the pkg-plist——see generating PLIST for more).

ref.

http://www.freebsd.org/doc/zh_TW/books/porters-handbook/index.html

http://blog.wu-boy.com/2009/11/18/1843/

http://blog.wu-boy.com/2009/09/22/1670/

http://www.ptt.cc/man/FreeBSD/DEBD/D160/M.1135705310.A.E5B.html

http://blog.dragon2.net/2009/12/17/912.php

About johnpupu

..........
This entry was posted in FreeBSD and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word