Changeset View
Changeset View
Standalone View
Standalone View
head/en_US.ISO8859-1/books/porters-handbook/slow-porting/chapter.xml
Show First 20 Lines • Show All 409 Lines • ▼ Show 20 Lines | <sect2 xml:id="slow-patch-automatic-replacements"> | ||||
<title>Simple Automatic Replacements</title> | <title>Simple Automatic Replacements</title> | ||||
<para>Simple replacements can be performed directly from the | <para>Simple replacements can be performed directly from the | ||||
port <filename>Makefile</filename> using the in-place mode of | port <filename>Makefile</filename> using the in-place mode of | ||||
&man.sed.1;. This is useful when changes use the value of a | &man.sed.1;. This is useful when changes use the value of a | ||||
variable:</para> | variable:</para> | ||||
<programlisting>post-patch: | <programlisting>post-patch: | ||||
@${REINPLACE_CMD} -e 's|for Linux|for FreeBSD|g' ${WRKSRC}/README</programlisting> | @${REINPLACE_CMD} -e 's|/usr/local|${PREFIX}|g' ${WRKSRC}/Makefile</programlisting> | ||||
<important> | |||||
<para>Only use &man.sed.1; to replace variable content. You | |||||
must use patch files instead of &man.sed.1; to replace | |||||
static content.</para> | |||||
</important> | |||||
<para>Quite often, software being ported uses the CR/LF | <para>Quite often, software being ported uses the CR/LF | ||||
convention in source files. This may cause problems with | convention in source files. This may cause problems with | ||||
further patching, compiler warnings, or script execution (like | further patching, compiler warnings, or script execution (like | ||||
<literal>/bin/sh^M not found</literal>.) To quickly convert | <literal>/bin/sh^M not found</literal>.) To quickly convert | ||||
all files from CR/LF to just LF, add this entry to the port | all files from CR/LF to just LF, add this entry to the port | ||||
<filename>Makefile</filename>:</para> | <filename>Makefile</filename>:</para> | ||||
▲ Show 20 Lines • Show All 138 Lines • Show Last 20 Lines |