<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE book PUBLIC "-//FreeBSD//DTD DocBook XML V5.0-Based Extension//EN" "http://www.FreeBSD.org/XML/share/xml/freebsd50.dtd" [
<!--
The FreeBSD Documentation Project
$FreeBSD$
--><!ENTITY % chapters SYSTEM "chapters.ent">
<!--
Creates entities for each chapter in the Porters Handbook. Each entity
is named chap.foo, where foo is the value of the id attribute on that
chapter, and corresponds to the name of the directory in which that
chapter's .xml file is stored.
Chapters should be listed in the order in which they are referenced.
$FreeBSD$
--><!ENTITY chap.porting-why SYSTEM "porting-why/chapter.xml">
<!ENTITY chap.new-port SYSTEM "new-port/chapter.xml">
<!ENTITY chap.quick-porting SYSTEM "quick-porting/chapter.xml">
<!ENTITY chap.slow-porting SYSTEM "slow-porting/chapter.xml">
<!ENTITY chap.makefiles SYSTEM "makefiles/chapter.xml">
<!ENTITY chap.special SYSTEM "special/chapter.xml">
<!ENTITY chap.flavors SYSTEM "flavors/chapter.xml">
<!ENTITY chap.plist SYSTEM "plist/chapter.xml">
<!ENTITY chap.pkg-files SYSTEM "pkg-files/chapter.xml">
<!ENTITY chap.testing SYSTEM "testing/chapter.xml">
<!ENTITY chap.upgrading SYSTEM "upgrading/chapter.xml">
<!ENTITY chap.security SYSTEM "security/chapter.xml">
<!ENTITY chap.porting-dads SYSTEM "porting-dads/chapter.xml">
<!ENTITY chap.porting-samplem SYSTEM "porting-samplem/chapter.xml">
<!ENTITY chap.order SYSTEM "order/chapter.xml">
<!ENTITY chap.keeping-up SYSTEM "keeping-up/chapter.xml">
<!ENTITY chap.uses SYSTEM "uses/chapter.xml">
<!ENTITY chap.versions SYSTEM "versions/chapter.xml">
]>
<book xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:its="http://www.w3.org/2005/11/its" version="5.0" xml:lang="pt_BR">
<info>
<title>FreeBSD Porter's Handbook</title>
<authorgroup>
<author><orgname>Projeto de Documentação do FreeBSD</orgname></author>
</authorgroup>
<pubdate>$FreeBSD$</pubdate>
<copyright><year>2000</year> <year>2001</year> <year>2002</year> <year>2003</year> <year>2004</year> <year>2005</year> <year>2006</year> <year>2007</year> <year>2008</year> <year>2009</year> <year>2010</year> <year>2011</year> <year>2012</year> <year>2013</year> <year>2014</year> <year>2015</year> <year>2016</year> <year>2017</year> <year>2018</year> <year>2019</year> <year>2020</year> <holder role="mailto:doc@FreeBSD.org">Projeto de Documentação do FreeBSD</holder></copyright>
<legalnotice xml:id="legalnotice">
<title>Copyright</title>
<para>Redistribution and use in source (XML DocBook) and 'compiled' forms (XML, HTML, PDF, PostScript, RTF and so forth) with or without modification, are permitted provided that the following conditions are met:</para>
<orderedlist>
<listitem>
<para>Redistributions of source code (XML DocBook) must retain the above copyright notice, this list of conditions and the following disclaimer as the first lines of this file unmodified.</para>
</listitem>
<listitem>
<para>Redistributions in compiled form (transformed to other DTDs, converted to PDF, PostScript, RTF and other formats) must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.</para>
</listitem>
</orderedlist>
<important>
<para>THIS DOCUMENTATION IS PROVIDED BY THE FREEBSD DOCUMENTATION PROJECT "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FREEBSD DOCUMENTATION PROJECT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</para>
</important>
</legalnotice>
<legalnotice xml:id="trademarks" role="trademarks">
<para>FreeBSD is a registered trademark of the FreeBSD Foundation.</para>
<para>UNIX is a registered trademark of The Open Group in the United States and other countries.</para>
<para>Sun, Sun Microsystems, Java, Java Virtual Machine, JDK, JRE, JSP, JVM, Netra, OpenJDK, Solaris, StarOffice, SunOS and VirtualBox are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.</para>
<para>Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this document, and the FreeBSD Project was aware of the trademark claim, the designations have been followed by the <quote>™</quote> or the <quote>®</quote> symbol.</para>
</legalnotice>
<releaseinfo>$FreeBSD$</releaseinfo>
</info>
<!--
The FreeBSD Documentation Project
$FreeBSD$
-->
<chapter version="5.0" xml:id="why-port">
<title>Introdução</title>
<para>A Coleção de Ports do FreeBSD é a maneira como quase todo mundo instala aplicativos ("ports") no FreeBSD. Como tudo no FreeBSD, é principalmente um esforço voluntário. É importante ter isso em mente ao ler este documento.</para>
<para>No FreeBSD, qualquer um pode enviar um novo port ou ser voluntário para manter um port que esteja sem mantenedor. Nenhum privilégio de commit é necessário.</para>
</chapter>
<!--
The FreeBSD Documentation Project
$FreeBSD$
-->
<chapter version="5.0" xml:id="own-port">
<title>Criando um Novo Port</title>
<para>Interessado em fazer um novo port ou atualizar os ports existentes? Ótimo!</para>
<para>O que segue são algumas instruções para criar um novo port para o FreeBSD. Para atualizar um port existente, leia este documento e depois leia o <xref linkend="port-upgrading"/>.</para>
<para>Quando este documento não for suficientemente detalhado, consulte <filename>/usr/ports/Mk/bsd.port.mk</filename>, que é incluído por todos os <filename>Makefile</filename>s dos ports. Mesmo aqueles que não estão hackeando os <filename>Makefile</filename>s diariamente podem ganhar muito conhecimento com isso. Além disso, perguntas específicas podem ser enviadas à <link xlink:href="http://lists.FreeBSD.org/mailman/listinfo/freebsd-ports"> Lista de discussão do ports do FreeBSD</link>.</para>
<note>
<para>Apenas uma fração das variáveis (<varname><replaceable>VAR</replaceable></varname>) que podem ser sobrepostas são mencionados neste documento. A maioria (se não todas) estão documentadas no início do <filename>/usr/ports/Mk/bsd.port.mk</filename>; as outras provavelmente deveriam estar também. Observe que esse arquivo usa uma configuração de tabulação não padrão: O <application>Emacs</application> e o <application>Vim</application> irão reconhecer a configuração ao carregar o arquivo. Ambos <citerefentry><refentrytitle>vi</refentrytitle><manvolnum>1</manvolnum></citerefentry> e <citerefentry><refentrytitle>ex</refentrytitle><manvolnum>1</manvolnum></citerefentry> podem ser configurados para usar o valor correto digitando <command>:set tabstop=4</command> uma vez que o arquivo foi carregado.</para>
</note>
<para>Procurando algo fácil para começar? Dê uma olhada na <link xlink:href="https://wiki.freebsd.org/WantedPorts">lista de ports desejados</link> e veja se você pode trabalhar em um (ou mais de um).</para>
</chapter>
<!--
The FreeBSD Documentation Project
$FreeBSD$
-->
<chapter version="5.0" xml:id="quick-porting">
<title>Port Rápido</title>
<para>Esta seção descreve como criar rapidamente um novo port. Para aplicativos em que esse método rápido não for adequado, o processo <quote>Slow Porting</quote> está descrito no <xref linkend="slow-porting"/>.</para>
<para>Primeiro, obtenha o tarball original e coloque-o em <varname>DISTDIR</varname>, que por padrão é o diretório <filename>/usr/ports/distfiles</filename>.</para>
<note>
<para>Estas etapas assumem que o software foi compilado de forma simples (out-of-the-box). Em outras palavras, não foi necessária absolutamente nenhuma mudança para o aplicativo funcionar em um sistema FreeBSD. Se alguma coisa teve que ser alterada, por favor consulte o <xref linkend="slow-porting"/>.</para>
</note>
<note>
<para>Recomenda-se definir a variável <varname>DEVELOPER</varname> do <citerefentry><refentrytitle>make</refentrytitle><manvolnum>1</manvolnum></citerefentry> em <filename>/etc/make.conf</filename> antes de começar o trabalho com os ports.</para>
<screen><prompt>#</prompt> <userinput>echo DEVELOPER=yes >> /etc/make.conf</userinput></screen>
<para>Esta configuração habilita o <quote>modo de desenvolvedor</quote> que exibe avisos sobre a descontinuidade de comandos e ativa algumas verificações de qualidade adicionais nas execuções do comando <command>make</command>.</para>
</note>
<sect1 xml:id="porting-makefile">
<title>Escrevendo o <filename>Makefile</filename></title>
<para>O <filename>Makefile</filename> mínimo seria algo assim:</para>
<programlisting># $FreeBSD$
PORTNAME= oneko
DISTVERSION= 1.1b
CATEGORIES= games
MASTER_SITES= ftp://ftp.cs.columbia.edu/archives/X11R5/contrib/
MAINTAINER= youremail@example.com
COMMENT= Cat chasing a mouse all over the screen
.include <bsd.port.mk><
|