diff --git a/documentation/content/en/books/porters-handbook/order/_index.adoc b/documentation/content/en/books/porters-handbook/order/_index.adoc index 4c362669cf..057119bed6 100644 --- a/documentation/content/en/books/porters-handbook/order/_index.adoc +++ b/documentation/content/en/books/porters-handbook/order/_index.adoc @@ -1,282 +1,282 @@ --- title: Chapter 15. Order of Variables in Port Makefiles prev: books/porters-handbook/porting-samplem next: books/porters-handbook/keeping-up description: Order of Variables in FreeBSD Port Makefiles tags: ["order", "PORTNAME", "PATCHFILES", "MAINTAINER", "LICENSE", "dependencies", "USES"] showBookMenu: true weight: 15 path: "/books/porters-handbook/" --- [[porting-order]] = Order of Variables in Port Makefiles :doctype: book :toc: macro :toclevels: 1 :icons: font :sectnums: :sectnumlevels: 6 :sectnumoffset: 15 :partnums: :source-highlighter: rouge :experimental: :images-path: books/porters-handbook/ ifdef::env-beastie[] ifdef::backend-html5[] :imagesdir: ../../../../images/{images-path} endif::[] ifndef::book[] include::shared/authors.adoc[] include::shared/mirrors.adoc[] include::shared/releases.adoc[] include::shared/attributes/attributes-{{% lang %}}.adoc[] include::shared/{{% lang %}}/teams.adoc[] include::shared/{{% lang %}}/mailing-lists.adoc[] include::shared/{{% lang %}}/urls.adoc[] toc::[] endif::[] ifdef::backend-pdf,backend-epub3[] include::../../../../../shared/asciidoctor.adoc[] endif::[] endif::[] ifndef::env-beastie[] toc::[] include::../../../../../shared/asciidoctor.adoc[] endif::[] The first sections of the [.filename]#Makefile# must always come in the same order. This standard makes it so everyone can easily read any port without having to search for variables in a random order. [NOTE] ==== The sections and variables described here are mandatory in a ordinary port. In a slave port, many sections and variables can be skipped. ==== [IMPORTANT] ==== Each following block must be separated from the previous block by a single blank line. In the following blocks, only set the variables that are required by the port. Define these variables in the order they are shown here. ==== [[porting-order-portname]] == `PORTNAME` Block This block is the most important. It defines the port name, version, distribution file location, and category. The variables must be in this order: * crossref:makefiles[makefile-portname,`PORTNAME`] * crossref:makefiles[makefile-versions,`PORTVERSION`][<>] * crossref:makefiles[makefile-versions,`DISTVERSIONPREFIX`] * crossref:makefiles[makefile-versions,`DISTVERSION`][<>] * crossref:makefiles[makefile-versions,`DISTVERSIONSUFFIX`] * crossref:makefiles[makefile-portrevision,`PORTREVISION`] * crossref:makefiles[makefile-portepoch,`PORTEPOCH`] * crossref:makefiles[makefile-categories,`CATEGORIES`] * crossref:makefiles[makefile-master_sites,`MASTER_SITES`] * crossref:makefiles[makefile-master_sites-shorthand,`MASTER_SITE_SUBDIR`] (deprecated) * crossref:makefiles[porting-pkgnameprefix-suffix,`PKGNAMEPREFIX`] * crossref:makefiles[porting-pkgnameprefix-suffix,`PKGNAMESUFFIX`] * crossref:makefiles[makefile-distname,`DISTNAME`] * crossref:makefiles[makefile-extract_sufx,`EXTRACT_SUFX`] * crossref:makefiles[makefile-distfiles-definition,`DISTFILES`] * crossref:makefiles[makefile-dist_subdir,`DIST_SUBDIR`] * crossref:makefiles[makefile-extract_only,`EXTRACT_ONLY`] [[portversion-footnote]] [IMPORTANT] ==== Only one of PORTVERSION and DISTVERSION can be used. ==== [[porting-order-patch]] == `PATCHFILES` Block This block is optional. The variables are: * crossref:makefiles[porting-patchfiles,`PATCH_SITES`] * crossref:makefiles[porting-patchfiles,`PATCHFILES`] * crossref:makefiles[porting-patchfiles,`PATCH_DIST_STRIP`] [[porting-order-maintainer]] == `MAINTAINER` Block This block is mandatory. The variables are: * crossref:makefiles[makefile-maintainer,`MAINTAINER`] * crossref:makefiles[makefile-comment,`COMMENT`] [[porting-order-license]] == `LICENSE` Block This block is optional, although it is highly recommended. The variables are: * crossref:makefiles[licenses-license,`LICENSE`] * crossref:makefiles[licenses-license_comb,`LICENSE_COMB`] * crossref:makefiles[licenses-license_groups,`LICENSE_GROUPS`] or `LICENSE_GROUPS_NAME` * crossref:makefiles[licenses-license_name,`LICENSE_NAME`] or `LICENSE_NAME_NAME` * crossref:makefiles[licenses-license_text,`LICENSE_TEXT`] or `LICENSE_TEXT_NAME` * crossref:makefiles[licenses-license_file,`LICENSE_FILE`] or `LICENSE_FILE_NAME` * crossref:makefiles[licenses-license_perms,`LICENSE_PERMS`] or `LICENSE_PERMS_NAME_` * crossref:makefiles[licenses-license_distfiles,`LICENSE_DISTFILES`] or `LICENSE_DISTFILES_NAME` If there are multiple licenses, sort the different LICENSE_VAR_NAME variables by license name. [[porting-order-broken]] == Generic `BROKEN`/`IGNORE`/`DEPRECATED` Messages This block is optional. The variables are: * crossref:porting-dads[dads-deprecated,`DEPRECATED`] * crossref:porting-dads[dads-deprecated,`EXPIRATION_DATE`] * crossref:porting-dads[dads-noinstall,`FORBIDDEN`] * crossref:porting-dads[dads-noinstall,`BROKEN`] * crossref:porting-dads[dads-noinstall,`BROKEN_*`] * crossref:porting-dads[dads-noinstall,`IGNORE`] * crossref:porting-dads[dads-noinstall,`IGNORE_*`] * crossref:porting-dads[dads-noinstall,`ONLY_FOR_ARCHS`] * crossref:porting-dads[dads-noinstall,`ONLY_FOR_ARCHS_REASON*`] * crossref:porting-dads[dads-noinstall,`NOT_FOR_ARCHS`] * crossref:porting-dads[dads-noinstall,`NOT_FOR_ARCHS_REASON*`] [NOTE] ==== `BROKEN_*` and `IGNORE_*` can be any generic variables, for example, `IGNORE_amd64`, `BROKEN_FreeBSD_10`, etc. With the exception of variables that depend on a crossref:uses[uses,`USES`], place those in <>. For instance, `IGNORE_WITH_PHP` only works if crossref:uses[xuses-php,`php`] is set, and `BROKEN_SSL` only if crossref:uses[uses-ssl,`ssl`] is set. If the port is marked BROKEN when some conditions are met, and such conditions can only be tested after including [.filename]#bsd.port.options.mk# or [.filename]#bsd.port.pre.mk#, then those variables should be set later, in <>. ==== [[porting-order-depends]] == The Dependencies Block This block is optional. The variables are: -* crossref:makefiles:[makefile-fetch_depends,`FETCH_DEPENDS`] -* crossref:makefiles:[makefile-extract_depends,`EXTRACT_DEPENDS`] -* crossref:makefiles:[makefile-patch_depends,`PATCH_DEPENDS`] -* crossref:makefiles:[makefile-build_depends,`BUILD_DEPENDS`] -* crossref:makefiles:[makefile-lib_depends,`LIB_DEPENDS`] -* crossref:makefiles:[makefile-run_depends,`RUN_DEPENDS`] +* crossref:makefiles[makefile-fetch_depends,`FETCH_DEPENDS`] +* crossref:makefiles[makefile-extract_depends,`EXTRACT_DEPENDS`] +* crossref:makefiles[makefile-patch_depends,`PATCH_DEPENDS`] +* crossref:makefiles[makefile-build_depends,`BUILD_DEPENDS`] +* crossref:makefiles[makefile-lib_depends,`LIB_DEPENDS`] +* crossref:makefiles[makefile-run_depends,`RUN_DEPENDS`] * `TEST_DEPENDS` [[porting-order-flavors]] == Flavors This block is optional. Start this section with defining `FLAVORS`. Continue with the possible Flavors helpers. See crossref:flavors[flavors-using,Using FLAVORS] for more Information. Constructs setting variables not available as helpers using `.if ${FLAVOR:U} == foo` should go in their respective sections below. [[porting-order-uses]] == `USES` and `USE_x` Start this section with defining `USES`, and then possible `USE_x`. Keep related variables close together. For example, if using crossref:makefiles[makefile-master_sites-github,`USE_GITHUB`], always put the `GH_*` variables right after it. [[porting-order-variables]] == Standard bsd.port.mk Variables This section block is for variables that can be defined in [.filename]#bsd.port.mk# that do not belong in any of the previous section blocks. Order is not important, however try to keep similar variables together. For example uid and gid variables `USERS` and `GROUPS`. Configuration variables `CONFIGURE_*` and `*_CONFIGURE`. List of files, and directories `PORTDOCS` and `PORTEXAMPLES`. [[porting-order-options]] == Options and Helpers If the port uses the crossref:makefiles[makefile-options,options framework], define `OPTIONS_DEFINE` and `OPTIONS_DEFAULT` first, then the other `OPTIONS_*` variables first, then the `*_DESC` descriptions, then the options helpers. Try and sort all of those alphabetically. [[porting-order-options-ex1]] .Options Variables Order Example [example] ==== The `FOO` and `BAR` options do not have a standard description, so one need to be written. The other options already have one in [.filename]#Mk/bsd.options.desc.mk# so writing one is not needed. The `DOCS` and `EXAMPLES` use target helpers to install their files, they are shown here for completeness, though they belong in <>, so other variables and targets could be inserted before them. [.programlisting] .... OPTIONS_DEFINE= DOCS EXAMPLES FOO BAR OPTIONS_DEFAULT= FOO OPTIONS_RADIO= SSL OPTIONS_RADIO_SSL= OPENSSL GNUTLS OPTIONS_SUB= yes BAR_DESC= Enable bar support FOO_DESC= Enable foo support BAR_CONFIGURE_WITH= bar=${LOCALBASE} FOO_CONFIGURE_ENABLE= foo GNUTLS_CONFIGURE_ON= --with-ssl=gnutls OPENSSL_CONFIGURE_ON= --with-ssl=openssl post-install-DOCS-on: ${MKDIR} ${STAGEDIR}${DOCSDIR} cd ${WRKSRC}/doc && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR} post-install-EXAMPLES-on: ${MKDIR} ${STAGEDIR}${EXAMPLESDIR} cd ${WRKSRC}/ex && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR} .... ==== [[porting-order-rest]] == The Rest of the Variables And then, the rest of the variables that are not mentioned in the previous blocks. [[porting-order-targets]] == The Targets After all the variables are defined, the optional man:make[1] targets can be defined. Keep `pre-*` before `post-*` and in the same order as the different stages run: * `fetch` * `extract` * `patch` * `configure` * `build` * `install` * `test` [TIP] ==== When using options helpers target keep them alphabetically sorted, but keep the `*-on` before the `*-off`. When also using the main target, keep the main target before the optional ones: [.programlisting] .... post-install: # install generic bits post-install-DOCS-on: # Install documentation post-install-X11-on: # Install X11 related bits post-install-X11-off: # Install bits that should be there if X11 is disabled .... ==== diff --git a/documentation/content/pt-br/books/porters-handbook/order/_index.adoc b/documentation/content/pt-br/books/porters-handbook/order/_index.adoc index c46f445ab3..0c5ed7b3b8 100644 --- a/documentation/content/pt-br/books/porters-handbook/order/_index.adoc +++ b/documentation/content/pt-br/books/porters-handbook/order/_index.adoc @@ -1,268 +1,268 @@ --- title: Chapter 15. Ordem das Variáveis ​​nos Makefiles de Port prev: books/porters-handbook/porting-samplem next: books/porters-handbook/keeping-up showBookMenu: true weight: 15 path: "/books/porters-handbook/" --- [[porting-order]] = Ordem das Variáveis ​​nos Makefiles de Port :doctype: book :toc: macro :toclevels: 1 :icons: font :sectnums: :sectnumlevels: 6 :sectnumoffset: 15 :partnums: :source-highlighter: rouge :experimental: :images-path: books/porters-handbook/ ifdef::env-beastie[] ifdef::backend-html5[] :imagesdir: ../../../../images/{images-path} endif::[] ifndef::book[] include::shared/authors.adoc[] include::shared/mirrors.adoc[] include::shared/releases.adoc[] include::shared/attributes/attributes-{{% lang %}}.adoc[] include::shared/{{% lang %}}/teams.adoc[] include::shared/{{% lang %}}/mailing-lists.adoc[] include::shared/{{% lang %}}/urls.adoc[] toc::[] endif::[] ifdef::backend-pdf,backend-epub3[] include::../../../../../shared/asciidoctor.adoc[] endif::[] endif::[] ifndef::env-beastie[] toc::[] include::../../../../../shared/asciidoctor.adoc[] endif::[] As primeiras seções do [.filename]#Makefile# devem sempre vir na mesma ordem. Este padrão faz com que todos possam ler facilmente qualquer port sem ter que procurar variáveis em uma ordem aleatória. A primeira linha de um [.filename]#Makefile# é sempre um comentário contendo o ID de controle de versão do Subversion, seguido por uma linha vazia. Em novos ports, parece assim: [.programlisting] .... # $FreeBSD: head/pt_BR.ISO8859-1/books/porters-handbook/book.xml 54410 2020-08-05 22:13:01Z dbaio $ .... Nos ports existentes, o Subversion expandiu essa entrada ficando assim: [.programlisting] .... # $FreeBSD: head/pt_BR.ISO8859-1/books/porters-handbook/book.xml 54410 2020-08-05 22:13:01Z dbaio $ .... [NOTE] ==== As seções e variáveis descritas aqui são obrigatórias em um port comum. Em um port slave, muitas seções e variáveis podem ser ignoradas. ==== [IMPORTANT] ==== Cada bloco seguinte deve ser separado do bloco anterior por uma única linha em branco. Nos blocos a seguir, apenas defina as variáveis ​​que são requeridas pelo port. Defina essas variáveis ​​na ordem em que são mostradas aqui. ==== [[porting-order-portname]] == Bloco `PORTNAME` Este bloco é o mais importante. Ele define o nome do port, a versão, o local do arquivo de distribuição e a categoria. As variáveis ​​devem estar nesta ordem: * crossref:makefiles[makefile-portname,`PORTNAME`] * crossref:makefiles[makefile-versions,`PORTVERSION`][<>] * crossref:makefiles[makefile-versions,`DISTVERSIONPREFIX`] * crossref:makefiles[makefile-versions,`DISTVERSION`][<>] * crossref:makefiles[makefile-versions,`DISTVERSIONSUFFIX`] * crossref:makefiles[makefile-portrevision,`PORTREVISION`] * crossref:makefiles[makefile-portepoch,`PORTEPOCH`] * crossref:makefiles[makefile-categories,`CATEGORIES`] * crossref:makefiles[makefile-master_sites,`MASTER_SITES`] * crossref:makefiles[makefile-master_sites-shorthand,`MASTER_SITE_SUBDIR`] (descontinuado) * crossref:makefiles[porting-pkgnameprefix-suffix,`PKGNAMEPREFIX`] * crossref:makefiles[porting-pkgnameprefix-suffix,`PKGNAMESUFFIX`] * crossref:makefiles[makefile-distname,`DISTNAME`] * crossref:makefiles[makefile-extract_sufx,`EXTRACT_SUFX`] * crossref:makefiles[makefile-distfiles-definition,`DISTFILES`] * crossref:makefiles[makefile-dist_subdir,`DIST_SUBDIR`] * crossref:makefiles[makefile-extract_only,`EXTRACT_ONLY`] [[porting-order-patch]] == Bloco `PATCHFILES` Este bloco é opcional. As variáveis ​​são: * crossref:makefiles[porting-patchfiles,`PATCH_SITES`] * crossref:makefiles[porting-patchfiles,`PATCHFILES`] * crossref:makefiles[porting-patchfiles,`PATCH_DIST_STRIP`] [[porting-order-maintainer]] == Bloco `MAINTAINER` Este bloco é obrigatório. As variáveis ​​são: * crossref:makefiles[makefile-maintainer,`MAINTAINER`] * crossref:makefiles[makefile-comment,`COMMENT`] [[porting-order-license]] == Bloco `LICENSE` Este bloco é opcional, embora seja altamente recomendado. As variáveis ​​são: * crossref:makefiles[licenses-license,`LICENSE`] * crossref:makefiles[licenses-license_comb,`LICENSE_COMB`] * crossref:makefiles[licenses-license_groups,`LICENSE_GROUPS`] ou `LICENSE_GROUPS_NAME` * crossref:makefiles[licenses-license_name,`LICENSE_NAME`] ou `LICENSE_NAME_NAME` * crossref:makefiles[licenses-license_text,`LICENSE_TEXT`] ou `LICENSE_TEXT_NAME` * crossref:makefiles[licenses-license_file,`LICENSE_FILE`] ou `LICENSE_FILE_NAME` * crossref:makefiles[licenses-license_perms,`LICENSE_PERMS`] ou `LICENSE_PERMS_NAME_` * crossref:makefiles[licenses-license_distfiles,`LICENSE_DISTFILES`] ou `LICENSE_DISTFILES_NAME` Se houver várias licenças, ordene as variáveis LICENSE_VAR_NOME pelo nome de licença. [[porting-order-broken]] == Mensagens Genéricas `BROKEN`/`IGNORE`/`DEPRECATED` Este bloco é opcional. As variáveis ​​são: * crossref:porting-dads[dads-deprecated,`DEPRECATED`] * crossref:porting-dads[dads-deprecated,`EXPIRATION_DATE`] * crossref:porting-dads[dads-noinstall,`FORBIDDEN`] * crossref:porting-dads[dads-noinstall,`BROKEN`] * crossref:porting-dads[dads-noinstall,`BROKEN_*`] * crossref:porting-dads[dads-noinstall,`IGNORE`] * crossref:porting-dads[dads-noinstall,`IGNORE_*`] * crossref:porting-dads[dads-noinstall,`ONLY_FOR_ARCHS`] * crossref:porting-dads[dads-noinstall,`ONLY_FOR_ARCHS_REASON*`] * crossref:porting-dads[dads-noinstall,`NOT_FOR_ARCHS`] * crossref:porting-dads[dads-noinstall,`NOT_FOR_ARCHS_REASON*`] [NOTE] ==== `BROKEN_*` e `IGNORE_*` podem ser qualquer variável genérica, por exemplo, `IGNORE_amd64`, `BROKEN_FreeBSD_10`, etc. Com exceção das variáveis ​​que dependem de uma variável crossref:uses[uses,`USES`], coloque essas em <>. Por exemplo, `IGNORE_WITH_PHP` só funciona se crossref:uses[xuses-php,`php`] estiver definido e a variável `BROKEN_SSL` somente se crossref:uses[uses-ssl,`ssl`] estiver definido. Se o port estiver marcado como BROKEN quando algumas condições forem atendidas, e tais condições puderem ser testadas somente após incluir o [.filename]#bsd.port.options.mk# ou [.filename]#bsd.port.pre.mk#, então essas variáveis ​​devem ser definidas mais tarde, em <>. ==== [[porting-order-depends]] == O Bloco de Dependências Este bloco é opcional. As variáveis ​​são: -* crossref:makefiles:[makefile-fetch_depends,`FETCH_DEPENDS`] -* crossref:makefiles:[makefile-extract_depends,`EXTRACT_DEPENDS`] -* crossref:makefiles:[makefile-patch_depends,`PATCH_DEPENDS`] -* crossref:makefiles:[makefile-build_depends,`BUILD_DEPENDS`] -* crossref:makefiles:[makefile-lib_depends,`LIB_DEPENDS`] -* crossref:makefiles:[makefile-run_depends,`RUN_DEPENDS`] +* crossref:makefiles[makefile-fetch_depends,`FETCH_DEPENDS`] +* crossref:makefiles[makefile-extract_depends,`EXTRACT_DEPENDS`] +* crossref:makefiles[makefile-patch_depends,`PATCH_DEPENDS`] +* crossref:makefiles[makefile-build_depends,`BUILD_DEPENDS`] +* crossref:makefiles[makefile-lib_depends,`LIB_DEPENDS`] +* crossref:makefiles[makefile-run_depends,`RUN_DEPENDS`] * `TEST_DEPENDS` [[porting-order-flavors]] == Flavors Este bloco é opcional. Comece esta seção com as definições de `FLAVORS`. Continue com as possíveis variáveis assistentes de Flavors. Veja crossref:flavors[flavors-using,Usando FLAVORS] para maiores informações. Variáveis ​​de definição de construção não disponíveis como assistentes, usando `.if ${FLAVOR:U} == foo` devem ir em abaixo de suas respectivas seções. [[porting-order-uses]] == `USES` e `USE_x` Comece esta seção com a definição da variável `USES` e, em seguida, possíveis variáveis `USE_x`. Mantenha as variáveis ​​relacionadas juntas. Por exemplo, se estiver usando a variável crossref:makefiles[makefile-master_sites-github,`USE_GITHUB`], coloque sempre as variáveis `GH_*` ​​logo após ela. [[porting-order-variables]] == Variáveis ​​Padrão [.filename]#bsd.port.mk# Este bloco de seção é para variáveis ​​que podem ser definidas em [.filename]#bsd.port.mk# que não pertencem a nenhum dos blocos de seção anteriores. A ordem não é importante, no entanto, tente manter variáveis ​​semelhantes juntas. Por exemplo, variáveis ​​`USERS` e `GROUPS`. Variáveis ​​de configuração `CONFIGURE__*_` e `_*__CONFIGURE`. Lista de arquivos e diretórios `PORTDOCS` e `PORTEXAMPLES`. [[porting-order-options]] == Opções e Assistentes Se o port usa o crossref:makefiles[makefile-options,framework de opções], defina `OPTIONS_DEFINE` e `OPTIONS_DEFAULT`, então as outras variáveis `OPTIONS__*_`, depois as de descrições `_*__DESC`, e então os assistentes de opções. Tente e ordene todas essas variáveis alfabeticamente. [[porting-order-options-ex1]] .Exemplo de Ordenamento das Variáveis ​​de Opções [example] ==== As opções `FOO` e `BAR` não possuem uma descrição padrão, portanto, é necessário escrever uma. As outras opções já possuem em [.filename]#Mk/bsd.options.desc.mk# então escrever uma não é necessário. Opções `DOCS` e `EXAMPLES` usam os assistentes de destino para instalar seus arquivos, eles são mostrados aqui por completo, apesar de pertencerem a <>, então outras variáveis ​​e destinos podem ser inseridos antes deles. [.programlisting] .... OPTIONS_DEFINE= DOCS EXAMPLES FOO BAR OPTIONS_DEFAULT= FOO OPTIONS_RADIO= SSL OPTIONS_RADIO_SSL= OPENSSL GNUTLS OPTIONS_SUB= yes BAR_DESC= Enable bar support FOO_DESC= Enable foo support BAR_CONFIGURE_WITH= bar=${LOCALBASE} FOO_CONFIGURE_ENABLE= foo GNUTLS_CONFIGURE_ON= --with-ssl=gnutls OPENSSL_CONFIGURE_ON= --with-ssl=openssl post-install-DOCS-on: ${MKDIR} ${STAGEDIR}${DOCSDIR} cd ${WRKSRC}/doc && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR} post-install-EXAMPLES-on: ${MKDIR} ${STAGEDIR}${EXAMPLESDIR} cd ${WRKSRC}/ex && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR} .... ==== [[porting-order-rest]] == O Restante das Variáveis E então, o restante das variáveis ​​que não são mencionadas nos blocos anteriores. [[porting-order-targets]] == Os Targets Depois que todas as variáveis ​​são definidas, targets opcionais man:make[1] podem ser definidos. Mantenha `pre-_*_` antes de `post-_*_` e na mesma ordem em que as diferentes etapas são executadas: * `fetch` * `extract` * `patch` * `configure` * `build` * `install` * `test` [TIP] ==== Ao usar os assistentes de opções, os targets são classificados alfabeticamente, mas mantenha `_*_-on` antes do `_*_-off`. Quando também estiver usando o target principal, mantenha o target principal antes dos opcionais: [.programlisting] .... post-install: # install generic bits post-install-DOCS-on: # Install documentation post-install-X11-on: # Install X11 related bits post-install-X11-off: # Install bits that should be there if X11 is disabled .... ==== diff --git a/documentation/content/zh-tw/books/porters-handbook/order/_index.adoc b/documentation/content/zh-tw/books/porters-handbook/order/_index.adoc index 4c362669cf..057119bed6 100644 --- a/documentation/content/zh-tw/books/porters-handbook/order/_index.adoc +++ b/documentation/content/zh-tw/books/porters-handbook/order/_index.adoc @@ -1,282 +1,282 @@ --- title: Chapter 15. Order of Variables in Port Makefiles prev: books/porters-handbook/porting-samplem next: books/porters-handbook/keeping-up description: Order of Variables in FreeBSD Port Makefiles tags: ["order", "PORTNAME", "PATCHFILES", "MAINTAINER", "LICENSE", "dependencies", "USES"] showBookMenu: true weight: 15 path: "/books/porters-handbook/" --- [[porting-order]] = Order of Variables in Port Makefiles :doctype: book :toc: macro :toclevels: 1 :icons: font :sectnums: :sectnumlevels: 6 :sectnumoffset: 15 :partnums: :source-highlighter: rouge :experimental: :images-path: books/porters-handbook/ ifdef::env-beastie[] ifdef::backend-html5[] :imagesdir: ../../../../images/{images-path} endif::[] ifndef::book[] include::shared/authors.adoc[] include::shared/mirrors.adoc[] include::shared/releases.adoc[] include::shared/attributes/attributes-{{% lang %}}.adoc[] include::shared/{{% lang %}}/teams.adoc[] include::shared/{{% lang %}}/mailing-lists.adoc[] include::shared/{{% lang %}}/urls.adoc[] toc::[] endif::[] ifdef::backend-pdf,backend-epub3[] include::../../../../../shared/asciidoctor.adoc[] endif::[] endif::[] ifndef::env-beastie[] toc::[] include::../../../../../shared/asciidoctor.adoc[] endif::[] The first sections of the [.filename]#Makefile# must always come in the same order. This standard makes it so everyone can easily read any port without having to search for variables in a random order. [NOTE] ==== The sections and variables described here are mandatory in a ordinary port. In a slave port, many sections and variables can be skipped. ==== [IMPORTANT] ==== Each following block must be separated from the previous block by a single blank line. In the following blocks, only set the variables that are required by the port. Define these variables in the order they are shown here. ==== [[porting-order-portname]] == `PORTNAME` Block This block is the most important. It defines the port name, version, distribution file location, and category. The variables must be in this order: * crossref:makefiles[makefile-portname,`PORTNAME`] * crossref:makefiles[makefile-versions,`PORTVERSION`][<>] * crossref:makefiles[makefile-versions,`DISTVERSIONPREFIX`] * crossref:makefiles[makefile-versions,`DISTVERSION`][<>] * crossref:makefiles[makefile-versions,`DISTVERSIONSUFFIX`] * crossref:makefiles[makefile-portrevision,`PORTREVISION`] * crossref:makefiles[makefile-portepoch,`PORTEPOCH`] * crossref:makefiles[makefile-categories,`CATEGORIES`] * crossref:makefiles[makefile-master_sites,`MASTER_SITES`] * crossref:makefiles[makefile-master_sites-shorthand,`MASTER_SITE_SUBDIR`] (deprecated) * crossref:makefiles[porting-pkgnameprefix-suffix,`PKGNAMEPREFIX`] * crossref:makefiles[porting-pkgnameprefix-suffix,`PKGNAMESUFFIX`] * crossref:makefiles[makefile-distname,`DISTNAME`] * crossref:makefiles[makefile-extract_sufx,`EXTRACT_SUFX`] * crossref:makefiles[makefile-distfiles-definition,`DISTFILES`] * crossref:makefiles[makefile-dist_subdir,`DIST_SUBDIR`] * crossref:makefiles[makefile-extract_only,`EXTRACT_ONLY`] [[portversion-footnote]] [IMPORTANT] ==== Only one of PORTVERSION and DISTVERSION can be used. ==== [[porting-order-patch]] == `PATCHFILES` Block This block is optional. The variables are: * crossref:makefiles[porting-patchfiles,`PATCH_SITES`] * crossref:makefiles[porting-patchfiles,`PATCHFILES`] * crossref:makefiles[porting-patchfiles,`PATCH_DIST_STRIP`] [[porting-order-maintainer]] == `MAINTAINER` Block This block is mandatory. The variables are: * crossref:makefiles[makefile-maintainer,`MAINTAINER`] * crossref:makefiles[makefile-comment,`COMMENT`] [[porting-order-license]] == `LICENSE` Block This block is optional, although it is highly recommended. The variables are: * crossref:makefiles[licenses-license,`LICENSE`] * crossref:makefiles[licenses-license_comb,`LICENSE_COMB`] * crossref:makefiles[licenses-license_groups,`LICENSE_GROUPS`] or `LICENSE_GROUPS_NAME` * crossref:makefiles[licenses-license_name,`LICENSE_NAME`] or `LICENSE_NAME_NAME` * crossref:makefiles[licenses-license_text,`LICENSE_TEXT`] or `LICENSE_TEXT_NAME` * crossref:makefiles[licenses-license_file,`LICENSE_FILE`] or `LICENSE_FILE_NAME` * crossref:makefiles[licenses-license_perms,`LICENSE_PERMS`] or `LICENSE_PERMS_NAME_` * crossref:makefiles[licenses-license_distfiles,`LICENSE_DISTFILES`] or `LICENSE_DISTFILES_NAME` If there are multiple licenses, sort the different LICENSE_VAR_NAME variables by license name. [[porting-order-broken]] == Generic `BROKEN`/`IGNORE`/`DEPRECATED` Messages This block is optional. The variables are: * crossref:porting-dads[dads-deprecated,`DEPRECATED`] * crossref:porting-dads[dads-deprecated,`EXPIRATION_DATE`] * crossref:porting-dads[dads-noinstall,`FORBIDDEN`] * crossref:porting-dads[dads-noinstall,`BROKEN`] * crossref:porting-dads[dads-noinstall,`BROKEN_*`] * crossref:porting-dads[dads-noinstall,`IGNORE`] * crossref:porting-dads[dads-noinstall,`IGNORE_*`] * crossref:porting-dads[dads-noinstall,`ONLY_FOR_ARCHS`] * crossref:porting-dads[dads-noinstall,`ONLY_FOR_ARCHS_REASON*`] * crossref:porting-dads[dads-noinstall,`NOT_FOR_ARCHS`] * crossref:porting-dads[dads-noinstall,`NOT_FOR_ARCHS_REASON*`] [NOTE] ==== `BROKEN_*` and `IGNORE_*` can be any generic variables, for example, `IGNORE_amd64`, `BROKEN_FreeBSD_10`, etc. With the exception of variables that depend on a crossref:uses[uses,`USES`], place those in <>. For instance, `IGNORE_WITH_PHP` only works if crossref:uses[xuses-php,`php`] is set, and `BROKEN_SSL` only if crossref:uses[uses-ssl,`ssl`] is set. If the port is marked BROKEN when some conditions are met, and such conditions can only be tested after including [.filename]#bsd.port.options.mk# or [.filename]#bsd.port.pre.mk#, then those variables should be set later, in <>. ==== [[porting-order-depends]] == The Dependencies Block This block is optional. The variables are: -* crossref:makefiles:[makefile-fetch_depends,`FETCH_DEPENDS`] -* crossref:makefiles:[makefile-extract_depends,`EXTRACT_DEPENDS`] -* crossref:makefiles:[makefile-patch_depends,`PATCH_DEPENDS`] -* crossref:makefiles:[makefile-build_depends,`BUILD_DEPENDS`] -* crossref:makefiles:[makefile-lib_depends,`LIB_DEPENDS`] -* crossref:makefiles:[makefile-run_depends,`RUN_DEPENDS`] +* crossref:makefiles[makefile-fetch_depends,`FETCH_DEPENDS`] +* crossref:makefiles[makefile-extract_depends,`EXTRACT_DEPENDS`] +* crossref:makefiles[makefile-patch_depends,`PATCH_DEPENDS`] +* crossref:makefiles[makefile-build_depends,`BUILD_DEPENDS`] +* crossref:makefiles[makefile-lib_depends,`LIB_DEPENDS`] +* crossref:makefiles[makefile-run_depends,`RUN_DEPENDS`] * `TEST_DEPENDS` [[porting-order-flavors]] == Flavors This block is optional. Start this section with defining `FLAVORS`. Continue with the possible Flavors helpers. See crossref:flavors[flavors-using,Using FLAVORS] for more Information. Constructs setting variables not available as helpers using `.if ${FLAVOR:U} == foo` should go in their respective sections below. [[porting-order-uses]] == `USES` and `USE_x` Start this section with defining `USES`, and then possible `USE_x`. Keep related variables close together. For example, if using crossref:makefiles[makefile-master_sites-github,`USE_GITHUB`], always put the `GH_*` variables right after it. [[porting-order-variables]] == Standard bsd.port.mk Variables This section block is for variables that can be defined in [.filename]#bsd.port.mk# that do not belong in any of the previous section blocks. Order is not important, however try to keep similar variables together. For example uid and gid variables `USERS` and `GROUPS`. Configuration variables `CONFIGURE_*` and `*_CONFIGURE`. List of files, and directories `PORTDOCS` and `PORTEXAMPLES`. [[porting-order-options]] == Options and Helpers If the port uses the crossref:makefiles[makefile-options,options framework], define `OPTIONS_DEFINE` and `OPTIONS_DEFAULT` first, then the other `OPTIONS_*` variables first, then the `*_DESC` descriptions, then the options helpers. Try and sort all of those alphabetically. [[porting-order-options-ex1]] .Options Variables Order Example [example] ==== The `FOO` and `BAR` options do not have a standard description, so one need to be written. The other options already have one in [.filename]#Mk/bsd.options.desc.mk# so writing one is not needed. The `DOCS` and `EXAMPLES` use target helpers to install their files, they are shown here for completeness, though they belong in <>, so other variables and targets could be inserted before them. [.programlisting] .... OPTIONS_DEFINE= DOCS EXAMPLES FOO BAR OPTIONS_DEFAULT= FOO OPTIONS_RADIO= SSL OPTIONS_RADIO_SSL= OPENSSL GNUTLS OPTIONS_SUB= yes BAR_DESC= Enable bar support FOO_DESC= Enable foo support BAR_CONFIGURE_WITH= bar=${LOCALBASE} FOO_CONFIGURE_ENABLE= foo GNUTLS_CONFIGURE_ON= --with-ssl=gnutls OPENSSL_CONFIGURE_ON= --with-ssl=openssl post-install-DOCS-on: ${MKDIR} ${STAGEDIR}${DOCSDIR} cd ${WRKSRC}/doc && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR} post-install-EXAMPLES-on: ${MKDIR} ${STAGEDIR}${EXAMPLESDIR} cd ${WRKSRC}/ex && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR} .... ==== [[porting-order-rest]] == The Rest of the Variables And then, the rest of the variables that are not mentioned in the previous blocks. [[porting-order-targets]] == The Targets After all the variables are defined, the optional man:make[1] targets can be defined. Keep `pre-*` before `post-*` and in the same order as the different stages run: * `fetch` * `extract` * `patch` * `configure` * `build` * `install` * `test` [TIP] ==== When using options helpers target keep them alphabetically sorted, but keep the `*-on` before the `*-off`. When also using the main target, keep the main target before the optional ones: [.programlisting] .... post-install: # install generic bits post-install-DOCS-on: # Install documentation post-install-X11-on: # Install X11 related bits post-install-X11-off: # Install bits that should be there if X11 is disabled .... ====