View | Details | Raw Unified | Return to bug 53420
Collapse All | Expand All

(-)book.sgml (-66 / +66 lines)
Lines 67-74 Link Here
67
	  This file uses a non-standard tab setting.
67
	  This file uses a non-standard tab setting.
68
	  <application>Emacs</application> and
68
	  <application>Emacs</application> and
69
	  <application>Vim</application> should recognize the setting on
69
	  <application>Vim</application> should recognize the setting on
70
	  loading the file.  Both <command>vi</command> and
70
	  loading the file.  Both &man.vi.1; and
71
	  <command>ex</command> can be set to use the correct value by
71
	  &man.ex.1; can be set to use the correct value by
72
	  typing <command>:set tabstop=4</command> once the file has been
72
	  typing <command>:set tabstop=4</command> once the file has been
73
	  loaded.</para>
73
	  loaded.</para>
74
      </note>
74
      </note>
Lines 470-476 Link Here
470
          actions are done.</para>
470
          actions are done.</para>
471
471
472
        <para>For example, if you have a <maketarget>post-extract</maketarget>
472
        <para>For example, if you have a <maketarget>post-extract</maketarget>
473
          target defined in your Makefile, and a file
473
          target defined in your <filename>Makefile</filename>, and a file
474
          <filename>pre-build</filename> in the <filename>scripts</filename>
474
          <filename>pre-build</filename> in the <filename>scripts</filename>
475
          subdirectory, the <maketarget>post-extract</maketarget> target will
475
          subdirectory, the <maketarget>post-extract</maketarget> target will
476
          be called after the regular extraction actions, and the
476
          be called after the regular extraction actions, and the
Lines 581-588 Link Here
581
        <title>Patching</title>
581
        <title>Patching</title>
582
582
583
        <para>In the preparation of the port, files that have been added or
583
        <para>In the preparation of the port, files that have been added or
584
          changed can be picked up with a recursive diff for later feeding to
584
          changed can be picked up with a recursive &man.diff.1; for later feeding to
585
          patch.  Each set of patches you wish to apply should be collected
585
          &man.patch.1;.  Each set of patches you wish to apply should be collected
586
          into a file named
586
          into a file named
587
          <filename>patch-<replaceable>*</replaceable></filename> where
587
          <filename>patch-<replaceable>*</replaceable></filename> where
588
          <replaceable>*</replaceable> denotes the sequence in which the
588
          <replaceable>*</replaceable> denotes the sequence in which the
Lines 609-618 Link Here
609
          <literal>&dollar;RCS</literal>.</para>
609
          <literal>&dollar;RCS</literal>.</para>
610
610
611
        <para>Using the recurse (<option>-r</option>) option to
611
        <para>Using the recurse (<option>-r</option>) option to
612
          <command>diff</command> to generate patches is fine, but please take
612
          &man.diff.1; to generate patches is fine, but please take
613
          a look at the resulting patches to make sure you do not have any
613
          a look at the resulting patches to make sure you do not have any
614
          unnecessary junk in there.  In particular, diffs between two backup
614
          unnecessary junk in there.  In particular, diffs between two backup
615
          files, <filename>Makefiles</filename> when the port uses
615
          files, <filename>Makefile</filename>s when the port uses
616
          <command>Imake</command> or GNU <command>configure</command>, etc.,
616
          <command>Imake</command> or GNU <command>configure</command>, etc.,
617
          are unnecessary and should be deleted.  If you had to edit
617
          are unnecessary and should be deleted.  If you had to edit
618
          <filename>configure.in</filename> and run
618
          <filename>configure.in</filename> and run
Lines 643-649 Link Here
643
        <title>Handling user input</title>
643
        <title>Handling user input</title>
644
644
645
        <para>If your port requires user input to build, configure, or install,
645
        <para>If your port requires user input to build, configure, or install,
646
          then set <makevar>IS_INTERACTIVE</makevar> in your Makefile.  This
646
          then set <makevar>IS_INTERACTIVE</makevar> in your <filename>Makefile</filename>.  This
647
          will allow <quote>overnight builds</quote> to skip your port if the
647
          will allow <quote>overnight builds</quote> to skip your port if the
648
          user sets the variable <envar>BATCH</envar> in his environment (and
648
          user sets the variable <envar>BATCH</envar> in his environment (and
649
          if the user sets the variable <envar>INTERACTIVE</envar>, then
649
          if the user sets the variable <envar>INTERACTIVE</envar>, then
Lines 661-667 Link Here
661
    <chapter id="makefile">
661
    <chapter id="makefile">
662
      <title>Configuring the Makefile</title>
662
      <title>Configuring the Makefile</title>
663
663
664
      <para>Configuring the Makefile is pretty simple, and again we suggest
664
      <para>Configuring the <filename>Makefile</filename> is pretty simple, and again we suggest
665
        that you look at existing examples before starting. Also, there is a
665
        that you look at existing examples before starting. Also, there is a
666
        <link linkend="porting-samplem">sample Makefile</link> in this
666
        <link linkend="porting-samplem">sample Makefile</link> in this
667
        handbook, so take a look and please follow the ordering of variables
667
        handbook, so take a look and please follow the ordering of variables
Lines 669-675 Link Here
669
        read.</para>
669
        read.</para>
670
670
671
      <para>Now, consider the following problems in sequence as you design
671
      <para>Now, consider the following problems in sequence as you design
672
        your new Makefile:</para>
672
        your new <filename>Makefile</filename>:</para>
673
673
674
      <sect1 id="makefile-source">
674
      <sect1 id="makefile-source">
675
        <title>The original source</title>
675
        <title>The original source</title>
Lines 726-732 Link Here
726
	    affects the content or structure of the derived
726
	    affects the content or structure of the derived
727
	    package.</para>
727
	    package.</para>
728
728
729
	  <para>Examples of when PORTREVISION should be bumped:</para>
729
	  <para>Examples of when <makevar>PORTREVISION</makevar> should be bumped:</para>
730
730
731
	  <itemizedlist>
731
	  <itemizedlist>
732
	    <listitem>
732
	    <listitem>
Lines 736-742 Link Here
736
	    </listitem>
736
	    </listitem>
737
737
738
	    <listitem>
738
	    <listitem>
739
	      <para>Changes to the port makefile to enable or disable
739
	      <para>Changes to the port <filename>Makefile</filename> to enable or disable
740
		compile-time options in the package.</para>
740
		compile-time options in the package.</para>
741
	    </listitem>
741
	    </listitem>
742
742
Lines 808-814 Link Here
808
	    enhancement, fix, or by virtue that the new package will
808
	    enhancement, fix, or by virtue that the new package will
809
	    actually work for them). If yes, the
809
	    actually work for them). If yes, the
810
	    <makevar>PORTREVISION</makevar> should be bumped so that
810
	    <makevar>PORTREVISION</makevar> should be bumped so that
811
	    automated tools (e.g.  <command>pkg_version</command>)
811
	    automated tools (e.g.  &man.pkg.version.1;)
812
	    will highlight the fact that a new package is
812
	    will highlight the fact that a new package is
813
	    available.</para>
813
	    available.</para>
814
	</sect3>
814
	</sect3>
Lines 862-869 Link Here
862
	  <title>Example of <makevar>PORTREVISION</makevar> and
862
	  <title>Example of <makevar>PORTREVISION</makevar> and
863
	    <makevar>PORTEPOCH</makevar> usage</title>
863
	    <makevar>PORTEPOCH</makevar> usage</title>
864
864
865
	  <para>The gtkmumble port, version 0.10, is committed to the
865
	  <para>The <literal>gtkmumble</literal> port, version <literal>0.10</literal>, is committed to the
866
	    ports collection.</para>
866
	    ports collection:</para>
867
867
868
	  <programlisting>PORTNAME=	gtkmumble
868
	  <programlisting>PORTNAME=	gtkmumble
869
PORTVERSION=	0.10</programlisting>
869
PORTVERSION=	0.10</programlisting>
Lines 893-899 Link Here
893
	    force the new package to be detected as <quote>newer</quote>. Since it
893
	    force the new package to be detected as <quote>newer</quote>. Since it
894
	    is a new vendor release of the code,
894
	    is a new vendor release of the code,
895
	    <makevar>PORTREVISION</makevar> is reset to 0 (or removed
895
	    <makevar>PORTREVISION</makevar> is reset to 0 (or removed
896
	    from the makefile).</para>
896
	    from the <filename>Makefile</filename>).</para>
897
897
898
	  <programlisting>PORTNAME=	gtkmumble
898
	  <programlisting>PORTNAME=	gtkmumble
899
PORTVERSION=	0.2
899
PORTVERSION=	0.2
Lines 916-923 Link Here
916
          <note>
916
          <note>
917
            <para>If <makevar>PORTEPOCH</makevar> were reset
917
            <para>If <makevar>PORTEPOCH</makevar> were reset
918
              to <literal>0</literal> with this upgrade, someone who had
918
              to <literal>0</literal> with this upgrade, someone who had
919
              installed the gtkmumble-0.10_1 package would not detect
919
              installed the <literal>gtkmumble-0.10_1</literal> package would not detect
920
              the gtkmumble-0.3 package as newer, since
920
              the <literal>gtkmumble-0.3</literal> package as newer, since
921
              <literal>3</literal> is still numerically less than
921
              <literal>3</literal> is still numerically less than
922
              <literal>10</literal>.</para>
922
              <literal>10</literal>.</para>
923
	  </note>
923
	  </note>
Lines 939-945 Link Here
939
          hyphen (<literal>-</literal>) in
939
          hyphen (<literal>-</literal>) in
940
          <makevar>PORTVERSION</makevar>.  Also, if the package name
940
          <makevar>PORTVERSION</makevar>.  Also, if the package name
941
          has the <replaceable>language-</replaceable> or the
941
          has the <replaceable>language-</replaceable> or the
942
          <replaceable>compiled.specifics</replaceable> part, use
942
          <replaceable>-compiled.specifics</replaceable> part, use
943
          <makevar>PKGNAMEPREFIX</makevar> and
943
          <makevar>PKGNAMEPREFIX</makevar> and
944
          <makevar>PKGNAMESUFFIX</makevar>, respectively.  Do not make
944
          <makevar>PKGNAMESUFFIX</makevar>, respectively.  Do not make
945
          them part of <makevar>PORTNAME</makevar>.</para>
945
          them part of <makevar>PORTNAME</makevar>.</para>
Lines 985-991 Link Here
985
            should be lowercase.  (The rest of the name can contain
985
            should be lowercase.  (The rest of the name can contain
986
            capital letters, so use your own discretion when you are
986
            capital letters, so use your own discretion when you are
987
            converting a software name that has some capital letters in it.)
987
            converting a software name that has some capital letters in it.)
988
            There is a tradition of naming Perl 5 modules by
988
            There is a tradition of naming <literal>perl 5</literal> modules by
989
            prepending <literal>p5-</literal> and converting the double-colon
989
            prepending <literal>p5-</literal> and converting the double-colon
990
            separator to a hyphen; for example, the
990
            separator to a hyphen; for example, the
991
            <literal>Data::Dumper</literal> module becomes
991
            <literal>Data::Dumper</literal> module becomes
Lines 1002-1008 Link Here
1002
            the compiled-in defaults (the hyphen is optional).  Examples are
1002
            the compiled-in defaults (the hyphen is optional).  Examples are
1003
            papersize and font units.</para>
1003
            papersize and font units.</para>
1004
1004
1005
          <para>The <replaceable>compiled.specifics</replaceable> part
1005
          <para>The <replaceable>-compiled.specifics</replaceable> part
1006
            should be set in the <makevar>PKGNAMESUFFIX</makevar>
1006
            should be set in the <makevar>PKGNAMESUFFIX</makevar>
1007
            variable.</para>
1007
            variable.</para>
1008
        </listitem>
1008
        </listitem>
Lines 1180-1186 Link Here
1180
      <para>If there is absolutely no trace of version information in the
1180
      <para>If there is absolutely no trace of version information in the
1181
        original source and it is unlikely that the original author will ever
1181
        original source and it is unlikely that the original author will ever
1182
        release another version, just set the version string to
1182
        release another version, just set the version string to
1183
        <literal>1.0</literal> (like the piewm example above).  Otherwise, ask
1183
        <literal>1.0</literal> (like the <literal>piewm</literal> example above).  Otherwise, ask
1184
        the original author or use the date string
1184
        the original author or use the date string
1185
        (<literal><replaceable>yyyy</replaceable>.<replaceable>mm</replaceable>.<replaceable>dd</replaceable></literal>)
1185
        (<literal><replaceable>yyyy</replaceable>.<replaceable>mm</replaceable>.<replaceable>dd</replaceable></literal>)
1186
	as the version.</para>
1186
	as the version.</para>
Lines 1493-1499 Link Here
1493
1493
1494
              <row>
1494
              <row>
1495
                <entry><filename>perl5*</filename></entry>
1495
                <entry><filename>perl5*</filename></entry>
1496
                <entry>Ports that require perl version 5 to run.</entry>
1496
                <entry>Ports that require <literal>perl</literal> version 5 to run.</entry>
1497
              </row>
1497
              </row>
1498
1498
1499
              <row>
1499
              <row>
Lines 1629-1635 Link Here
1629
              <row>
1629
              <row>
1630
                <entry><filename>windowmaker*</filename></entry>
1630
                <entry><filename>windowmaker*</filename></entry>
1631
                <entry>Ports to support the WindowMaker window
1631
                <entry>Ports to support the WindowMaker window
1632
                  manager</entry>
1632
                  manager.</entry>
1633
              </row>
1633
              </row>
1634
1634
1635
              <row>
1635
              <row>
Lines 2596-2602 Link Here
2596
2596
2597
        <note>
2597
        <note>
2598
          <para>This does not affect the <makevar>MASTER_SITES</makevar> you
2598
          <para>This does not affect the <makevar>MASTER_SITES</makevar> you
2599
            define in your Makefile.</para>
2599
            define in your <filename>Makefile</filename>.</para>
2600
        </note>
2600
        </note>
2601
      </sect2>
2601
      </sect2>
2602
    </sect1>
2602
    </sect1>
Lines 2665-2671 Link Here
2665
            <maketarget>extract</maketarget> target and then from within the
2665
            <maketarget>extract</maketarget> target and then from within the
2666
            <maketarget>install</maketarget> target.  Also, the name of the
2666
            <maketarget>install</maketarget> target.  Also, the name of the
2667
            dependency is put into the package so that
2667
            dependency is put into the package so that
2668
            <command>pkg_add</command> will automatically install it if it is
2668
            &man.pkg.add.1; will automatically install it if it is
2669
            not on the user's system.</para>
2669
            not on the user's system.</para>
2670
        </sect2>
2670
        </sect2>
2671
2671
Lines 2710-2716 Link Here
2710
          <para>The dependency is checked from within the
2710
          <para>The dependency is checked from within the
2711
            <maketarget>install</maketarget> target.  Also, the name of the
2711
            <maketarget>install</maketarget> target.  Also, the name of the
2712
            dependency is put into the  package so that
2712
            dependency is put into the  package so that
2713
            <command>pkg_add</command> will automatically install it if it is
2713
            &man.pkg.add.1; will automatically install it if it is
2714
            not on the user's system.  The <replaceable>target</replaceable>
2714
            not on the user's system.  The <replaceable>target</replaceable>
2715
            part can be omitted if it is the same as
2715
            part can be omitted if it is the same as
2716
            <makevar>DEPENDS_TARGET</makevar>.</para>
2716
            <makevar>DEPENDS_TARGET</makevar>.</para>
Lines 2814-2822 Link Here
2814
	      <row>
2814
	      <row>
2815
		<entry><makevar>USE_PERL5</makevar></entry>
2815
		<entry><makevar>USE_PERL5</makevar></entry>
2816
2816
2817
		<entry>The port requires Perl 5 to build and install.  See
2817
		<entry>The port requires <literal>perl 5</literal> to build and install.  See
2818
		  <xref linkend="using-perl"> for additional variables that
2818
		  <xref linkend="using-perl"> for additional variables that
2819
		  can be set relating to Perl.</entry>
2819
		  can be set relating to <literal>perl</literal>.</entry>
2820
	      </row>
2820
	      </row>
2821
2821
2822
	      <row>
2822
	      <row>
Lines 2888-2895 Link Here
2888
            GNU autoconf to be run.  Define <literal>USE_QT=yes</literal> if
2888
            GNU autoconf to be run.  Define <literal>USE_QT=yes</literal> if
2889
            your port uses the latest qt toolkit.  Use
2889
            your port uses the latest qt toolkit.  Use
2890
            <literal>USE_PERL5=yes</literal> if your port requires version 5
2890
            <literal>USE_PERL5=yes</literal> if your port requires version 5
2891
            of the perl language.  (The last is especially important since
2891
            of the <literal>perl</literal> language.  (The last is especially important since
2892
            some versions of FreeBSD have perl5 as part of the base system
2892
            some versions of FreeBSD have <literal>perl5</literal> as part of the base system
2893
            while others do not.)</para>
2893
            while others do not.)</para>
2894
        </sect2>
2894
        </sect2>
2895
2895
Lines 2920-2926 Link Here
2920
2920
2921
            <programlisting>BUILD_DEPENDS=   ${NONEXISTENT}:${PORTSDIR}/graphics/jpeg:extract</programlisting>
2921
            <programlisting>BUILD_DEPENDS=   ${NONEXISTENT}:${PORTSDIR}/graphics/jpeg:extract</programlisting>
2922
2922
2923
            will always descend to the JPEG port and extract it.</para>
2923
            will always descend to the <literal>jpeg</literal> port and extract it.</para>
2924
2924
2925
          <para>Do not use <makevar>DEPENDS</makevar> unless there is no other
2925
          <para>Do not use <makevar>DEPENDS</makevar> unless there is no other
2926
            way the behavior you want can be accomplished.  It will cause the
2926
            way the behavior you want can be accomplished.  It will cause the
Lines 3191-3200 Link Here
3191
    </sect1>
3191
    </sect1>
3192
3192
3193
    <sect1 id="using-perl">
3193
    <sect1 id="using-perl">
3194
      <title>Using Perl</title>
3194
      <title>Using <literal>perl</literal></title>
3195
3195
3196
      <table frame="none">
3196
      <table frame="none">
3197
	<title>Variables for ports that use Perl</title>
3197
	<title>Variables for ports that use <literal>perl</literal></title>
3198
3198
3199
	<tgroup cols="2">
3199
	<tgroup cols="2">
3200
	  <thead>
3200
	  <thead>
Lines 3209-3215 Link Here
3209
	    <row>
3209
	    <row>
3210
	      <entry><makevar>USE_PERL5</makevar></entry>
3210
	      <entry><makevar>USE_PERL5</makevar></entry>
3211
3211
3212
	      <entry>Says that the port uses Perl 5 to build and run.</entry>
3212
	      <entry>Says that the port uses <literal>perl 5</literal> to build and run.</entry>
3213
	    </row>
3213
	    </row>
3214
	    
3214
	    
3215
	    <row>
3215
	    <row>
Lines 3219-3246 Link Here
3219
	    <row>
3219
	    <row>
3220
	      <entry><makevar>PERL_VERSION</makevar></entry>
3220
	      <entry><makevar>PERL_VERSION</makevar></entry>
3221
	      
3221
	      
3222
	      <entry>The full version of Perl installed (e.g.,
3222
	      <entry>The full version of <literal>perl</literal> installed (e.g.,
3223
		<literal>5.00503</literal>).</entry>
3223
		<literal>5.00503</literal>).</entry>
3224
	    </row>
3224
	    </row>
3225
	    
3225
	    
3226
	    <row>
3226
	    <row>
3227
	      <entry><makevar>PERL_VER</makevar></entry>
3227
	      <entry><makevar>PERL_VER</makevar></entry>
3228
	      
3228
	      
3229
	      <entry>The short version of Perl installed (e.g.,
3229
	      <entry>The short version of <literal>perl</literal> installed (e.g.,
3230
		<literal>5.005</literal>).</entry>
3230
		<literal>5.005</literal>).</entry>
3231
	    </row>
3231
	    </row>
3232
3232
3233
            <row>
3233
            <row>
3234
              <entry><makevar>PERL_LEVEL</makevar></entry>
3234
              <entry><makevar>PERL_LEVEL</makevar></entry>
3235
3235
3236
              <entry>The installed Perl version as an integer of the form MNNNPP
3236
              <entry>The installed <literal>perl</literal> version as an integer of the form <literal>MNNNPP</literal>
3237
                (e.g., <literal>500503</literal>).</entry>
3237
                (e.g., <literal>500503</literal>).</entry>
3238
	    </row>
3238
	    </row>
3239
	    
3239
	    
3240
	    <row>
3240
	    <row>
3241
	      <entry><makevar>PERL_ARCH</makevar></entry>
3241
	      <entry><makevar>PERL_ARCH</makevar></entry>
3242
	      
3242
	      
3243
	      <entry>Where Perl stores architecture dependent libraries.
3243
	      <entry>Where <literal>perl</literal> stores architecture dependent libraries.
3244
		Defaults to <literal>${ARCH}-freebsd</literal>.</entry>
3244
		Defaults to <literal>${ARCH}-freebsd</literal>.</entry>
3245
	    </row>
3245
	    </row>
3246
	  </tbody>
3246
	  </tbody>
Lines 3710-3716 Link Here
3710
      <sect1>
3710
      <sect1>
3711
        <title><makevar>LIB_DEPENDS</makevar></title>
3711
        <title><makevar>LIB_DEPENDS</makevar></title>
3712
3712
3713
        <para>All port Makefiles are edited to remove minor numbers from
3713
        <para>All port <filename>Makefile</filename>s are edited to remove minor numbers from
3714
          <makevar>LIB_DEPENDS</makevar>, and also to have the regexp support
3714
          <makevar>LIB_DEPENDS</makevar>, and also to have the regexp support
3715
          removed.  (E.g., <literal>foo\\.1\\.\\(33|40\\)</literal> becomes
3715
          removed.  (E.g., <literal>foo\\.1\\.\\(33|40\\)</literal> becomes
3716
          <literal>foo.2</literal>.)  They will be matched using <command>grep
3716
          <literal>foo.2</literal>.)  They will be matched using <command>grep
Lines 3741-3747 Link Here
3741
      <sect1>
3741
      <sect1>
3742
        <title><literal>ldconfig</literal></title>
3742
        <title><literal>ldconfig</literal></title>
3743
3743
3744
        <para>The <literal>ldconfig</literal> line in Makefiles should
3744
        <para>The <literal>ldconfig</literal> line in <filename>Makefile</filename>s should
3745
          read:</para>
3745
          read:</para>
3746
3746
3747
        <programlisting>${SETENV} OBJFORMAT=${PORTOBJFORMAT} ${LDCONFIG} -m ....</programlisting>
3747
        <programlisting>${SETENV} OBJFORMAT=${PORTOBJFORMAT} ${LDCONFIG} -m ....</programlisting>
Lines 3768-3774 Link Here
3768
        make it easier for users to see what to do, but try to share as many
3768
        make it easier for users to see what to do, but try to share as many
3769
        files as possible between ports.  Typically you only need a very short
3769
        files as possible between ports.  Typically you only need a very short
3770
        <filename>Makefile</filename> in all but one of the directories if you
3770
        <filename>Makefile</filename> in all but one of the directories if you
3771
        use variables cleverly.  In the sole <filename>Makefiles</filename>,
3771
        use variables cleverly.  In the sole <filename>Makefile</filename>,
3772
        you can use <makevar>MASTERDIR</makevar> to specify the directory
3772
        you can use <makevar>MASTERDIR</makevar> to specify the directory
3773
        where the rest of the files are.  Also, use a variable as part of
3773
        where the rest of the files are.  Also, use a variable as part of
3774
        <link linkend="porting-pkgname"><makevar>PKGNAMESUFFIX</makevar></link> so
3774
        <link linkend="porting-pkgname"><makevar>PKGNAMESUFFIX</makevar></link> so
Lines 3891-3897 Link Here
3891
      <para>If your port anchors its man tree somewhere other than
3891
      <para>If your port anchors its man tree somewhere other than
3892
        <makevar>PREFIX</makevar>, you can use the
3892
        <makevar>PREFIX</makevar>, you can use the
3893
        <makevar>MANPREFIX</makevar> to set it.  Also, if only manpages in
3893
        <makevar>MANPREFIX</makevar> to set it.  Also, if only manpages in
3894
        certain sections go in a non-standard place, such as some Perl modules
3894
        certain sections go in a non-standard place, such as some <literal>perl</literal> modules
3895
        ports, you can set individual man paths using
3895
        ports, you can set individual man paths using
3896
        <makevar>MAN<replaceable>sect</replaceable>PREFIX</makevar> (where
3896
        <makevar>MAN<replaceable>sect</replaceable>PREFIX</makevar> (where
3897
        <replaceable>sect</replaceable> is one of <literal>1-9</literal>,
3897
        <replaceable>sect</replaceable> is one of <literal>1-9</literal>,
Lines 3945-3951 Link Here
3945
        <title><makevar>USE_MOTIF</makevar></title>
3945
        <title><makevar>USE_MOTIF</makevar></title>
3946
3946
3947
        <para>If your port requires Motif, define this variable in the
3947
        <para>If your port requires Motif, define this variable in the
3948
          Makefile.  This will prevent people who do not own a copy of Motif
3948
          <filename>Makefile</filename>.  This will prevent people who do not own a copy of Motif
3949
          from even attempting to build it.</para>
3949
          from even attempting to build it.</para>
3950
      </sect1>
3950
      </sect1>
3951
3951
Lines 4217-4223 Link Here
4217
          <para>Edit <filename>pkg-plist</filename> and add equivalent
4217
          <para>Edit <filename>pkg-plist</filename> and add equivalent
4218
            <literal>@exec</literal> statements and also
4218
            <literal>@exec</literal> statements and also
4219
            <literal>@unexec</literal> for
4219
            <literal>@unexec</literal> for
4220
            <command>pkg_delete</command>.</para>
4220
            &man.pkg.delete.1;.</para>
4221
4221
4222
          <programlisting>Index: pkg-plist
4222
          <programlisting>Index: pkg-plist
4223
===================================================================
4223
===================================================================
Lines 4274-4280 Link Here
4274
        <para>If you need to display a message to the installer, you may place
4274
        <para>If you need to display a message to the installer, you may place
4275
          the message in <filename>pkg-message</filename>.  This capability is
4275
          the message in <filename>pkg-message</filename>.  This capability is
4276
          often useful to display additional installation steps to be taken
4276
          often useful to display additional installation steps to be taken
4277
          after a <command>pkg_add</command> or to display licensing
4277
          after a &man.pkg.add.1; or to display licensing
4278
          information.</para>
4278
          information.</para>
4279
4279
4280
        <note>
4280
        <note>
Lines 4290-4299 Link Here
4290
        <title><filename>pkg-install</filename></title>
4290
        <title><filename>pkg-install</filename></title>
4291
4291
4292
        <para>If your port needs to execute commands when the binary package
4292
        <para>If your port needs to execute commands when the binary package
4293
          is installed with <command>pkg_add</command> you can do this via the
4293
          is installed with &man.pkg.add.1; you can do this via the
4294
          <filename>pkg-install</filename> script.  This script will
4294
          <filename>pkg-install</filename> script.  This script will
4295
          automatically be added to the package, and will be run twice by
4295
          automatically be added to the package, and will be run twice by
4296
          <command>pkg_add</command>.  The first time as
4296
          &man.pkg.add.1;.  The first time as
4297
          <literal>&dollar;{SH} pkg-install &dollar;{PKGNAME}
4297
          <literal>&dollar;{SH} pkg-install &dollar;{PKGNAME}
4298
          PRE-INSTALL</literal> and the second time as
4298
          PRE-INSTALL</literal> and the second time as
4299
          <literal>&dollar;{SH} pkg-install &dollar;{PKGNAME} POST-INSTALL</literal>. 
4299
          <literal>&dollar;{SH} pkg-install &dollar;{PKGNAME} POST-INSTALL</literal>. 
Lines 4321-4330 Link Here
4321
          installation/deinstallation should proceed.</para>
4321
          installation/deinstallation should proceed.</para>
4322
4322
4323
        <para>The script will be run at installation time by
4323
        <para>The script will be run at installation time by
4324
          <command>pkg_add</command> as
4324
          &man.pkg.add.1; as
4325
          <literal>pkg-req &dollar;{PKGNAME} INSTALL</literal>.
4325
          <literal>pkg-req &dollar;{PKGNAME} INSTALL</literal>.
4326
          At deinstallation time it will be run by
4326
          At deinstallation time it will be run by
4327
          <command>pkg_delete</command> as
4327
          &man.pkg.delete.1; as
4328
          <literal>pkg-req &dollar;{PKGNAME} DEINSTALL</literal>.</para>
4328
          <literal>pkg-req &dollar;{PKGNAME} DEINSTALL</literal>.</para>
4329
      </sect1>
4329
      </sect1>
4330
4330
Lines 4332-4348 Link Here
4332
        <title>Changing <filename>pkg-plist</filename> based on make
4332
        <title>Changing <filename>pkg-plist</filename> based on make
4333
          variables</title>
4333
          variables</title>
4334
4334
4335
        <para>Some ports, particularly the p5- ports, need to change their
4335
        <para>Some ports, particularly the <literal>p5-</literal> ports, need to change their
4336
          <filename>pkg-plist</filename> depending on what options they are
4336
          <filename>pkg-plist</filename> depending on what options they are
4337
          configured with (or version of perl, in the case of p5- ports).  To
4337
          configured with (or version of <literal>perl</literal>, in the case of <literal>p5-</literal> ports).  To
4338
          make this easy, any instances in the <filename>pkg-plist</filename> of
4338
          make this easy, any instances in the <filename>pkg-plist</filename> of
4339
          <literal>%%OSREL%%</literal>, <literal>%%PERL_VER%%</literal>, and
4339
          <literal>%%OSREL%%</literal>, <literal>%%PERL_VER%%</literal>, and
4340
          <literal>%%PERL_VERSION%%</literal> will be substituted for
4340
          <literal>%%PERL_VERSION%%</literal> will be substituted for
4341
          appropriately.  The value of <literal>%%OSREL%%</literal> is the
4341
          appropriately.  The value of <literal>%%OSREL%%</literal> is the
4342
          numeric revision of the operating system (e.g.,
4342
          numeric revision of the operating system (e.g.,
4343
          <literal>2.2.7</literal>).  <literal>%%PERL_VERSION%%</literal> is
4343
          <literal>2.2.7</literal>).  <literal>%%PERL_VERSION%%</literal> is
4344
          the full version number of perl (e.g., <literal>5.00502</literal>)
4344
          the full version number of <literal>perl</literal> (e.g., <literal>5.00502</literal>)
4345
          and <literal>%%PERL_VER%%</literal> is the perl version number minus
4345
          and <literal>%%PERL_VER%%</literal> is the <literal>perl</literal> version number minus
4346
          the patchlevel (e.g., <literal>5.005</literal>).</para>
4346
          the patchlevel (e.g., <literal>5.005</literal>).</para>
4347
4347
4348
        <para>If you need to make other substitutions, you can set the
4348
        <para>If you need to make other substitutions, you can set the
Lines 4477-4483 Link Here
4477
          automatic; otherwise, this can often be done by simply replacing the
4477
          automatic; otherwise, this can often be done by simply replacing the
4478
          occurrences of <filename>/usr/local</filename> (or
4478
          occurrences of <filename>/usr/local</filename> (or
4479
          <filename>/usr/X11R6</filename> for X ports that do not use imake)
4479
          <filename>/usr/X11R6</filename> for X ports that do not use imake)
4480
          in the various scripts/Makefiles in the port to read
4480
          in the various <filename>scripts/Makefile</filename>s in the port to read
4481
          <makevar>PREFIX</makevar>, as this variable is automatically passed
4481
          <makevar>PREFIX</makevar>, as this variable is automatically passed
4482
          down to every stage of the build and install processes.</para>
4482
          down to every stage of the build and install processes.</para>
4483
4483
Lines 4505-4511 Link Here
4505
        <para>The variable <makevar>PREFIX</makevar> can be reassigned in your
4505
        <para>The variable <makevar>PREFIX</makevar> can be reassigned in your
4506
          <filename>Makefile</filename> or in the user's environment.
4506
          <filename>Makefile</filename> or in the user's environment.
4507
          However, it is strongly discouraged for individual ports to set this
4507
          However, it is strongly discouraged for individual ports to set this
4508
          variable explicitly in the <filename>Makefiles</filename>.</para>
4508
          variable explicitly in the <filename>Makefile</filename>s.</para>
4509
4509
4510
        <para>Also, refer to programs/files from other ports with the
4510
        <para>Also, refer to programs/files from other ports with the
4511
          variables mentioned above, not explicit pathnames.  For instance, if
4511
          variables mentioned above, not explicit pathnames.  For instance, if
Lines 4521-4527 Link Here
4521
          if this is an X port, instead of
4521
          if this is an X port, instead of
4522
          <literal>-DPAGER=\"/usr/local/bin/less\"</literal>. This way it will
4522
          <literal>-DPAGER=\"/usr/local/bin/less\"</literal>. This way it will
4523
          have a better chance of working if the system administrator has
4523
          have a better chance of working if the system administrator has
4524
          moved the whole `/usr/local' tree somewhere else.</para>
4524
          moved the whole <filename>/usr/local</filename> tree somewhere else.</para>
4525
      </sect1>
4525
      </sect1>
4526
4526
4527
      <sect1 id="testing-freshports">
4527
      <sect1 id="testing-freshports">
Lines 4534-4544 Link Here
4534
	  testing of your commits.</para>
4534
	  testing of your commits.</para>
4535
4535
4536
	<para>If you wish to use this service, all you need is a FreshPorts
4536
	<para>If you wish to use this service, all you need is a FreshPorts
4537
	  account.  If your registered email address is @FreeBSD.org,
4537
	  account.  If your registered email address is <literal>@FreeBSD.org</literal>,
4538
	  you'll see the opt-in link on the right hand side of the webpages.
4538
	  you'll see the opt-in link on the right hand side of the webpages.
4539
	  For those of you who already have a FreshPorts account, but are not
4539
	  For those of you who already have a FreshPorts account, but are not
4540
	  using your @FreeBSD.org email address, just change your email to
4540
	  using your <literal>@FreeBSD.org</literal> email address, just change your email to
4541
	  @FreeBSD.org, subscribe, then change it back again.</para>
4541
	  <literal>@FreeBSD.org</literal>, subscribe, then change it back again.</para>
4542
      </sect1>
4542
      </sect1>
4543
  </chapter>
4543
  </chapter>
4544
4544
Lines 5699-5706 Link Here
5699
5699
5700
        <note>
5700
        <note>
5701
          <para>You need to include either the
5701
          <para>You need to include either the
5702
            <filename>pre.mk</filename>/<filename>post.mk</filename> pair or
5702
            <filename>bsd.port.pre.mk</filename>/<filename>bsd.port.post.mk</filename> pair or
5703
            <filename>bsd.port.mk</filename> only; do not mix these two.</para>
5703
            <filename>bsd.port.mk</filename> only; do not mix these two usages.</para>
5704
        </note>
5704
        </note>
5705
5705
5706
        <para><filename>bsd.port.pre.mk</filename> only defines a few
5706
        <para><filename>bsd.port.pre.mk</filename> only defines a few
Lines 5867-5873 Link Here
5867
          (executables started internally), <filename>sbin</filename>
5867
          (executables started internally), <filename>sbin</filename>
5868
          (executables for superusers/managers), <filename>info</filename>
5868
          (executables for superusers/managers), <filename>info</filename>
5869
          (documentation for info browser) or  <filename>share</filename>
5869
          (documentation for info browser) or  <filename>share</filename>
5870
          (architecture independent files).  See man &man.hier.7; for details,
5870
          (architecture independent files).  See &man.hier.7; for details;
5871
          the rules governing
5871
          the rules governing
5872
          <filename>/usr</filename> pretty much apply to
5872
          <filename>/usr</filename> pretty much apply to
5873
          <filename>/usr/local</filename> too.  The exception are ports
5873
          <filename>/usr/local</filename> too.  The exception are ports
Lines 5901-5907 Link Here
5901
        <programlisting>@unexec rmdir %D/share/doc/gimp 2>/dev/null || true</programlisting>
5901
        <programlisting>@unexec rmdir %D/share/doc/gimp 2>/dev/null || true</programlisting>
5902
5902
5903
        <para>This will neither print any error messages nor cause
5903
        <para>This will neither print any error messages nor cause
5904
          <command>pkg_delete</command> to exit abnormally even if
5904
          &man.pkg.delete.1; to exit abnormally even if
5905
          <filename><makevar>PREFIX</makevar>/share/doc/gimp</filename> is not
5905
          <filename><makevar>PREFIX</makevar>/share/doc/gimp</filename> is not
5906
          empty due to other ports installing some files in there.</para>
5906
          empty due to other ports installing some files in there.</para>
5907
      </sect1>
5907
      </sect1>
Lines 6037-6043 Link Here
6037
          <filename><makevar>PREFIX</makevar>/etc</filename>, do
6037
          <filename><makevar>PREFIX</makevar>/etc</filename>, do
6038
          <emphasis>not</emphasis> just install them and list them in
6038
          <emphasis>not</emphasis> just install them and list them in
6039
          <filename>pkg-plist</filename>.  That will cause
6039
          <filename>pkg-plist</filename>.  That will cause
6040
          <command>pkg_delete</command> to delete files carefully edited by
6040
          &man.pkg.delete.1; to delete files carefully edited by
6041
          the user and a new installation to wipe them out.</para>
6041
          the user and a new installation to wipe them out.</para>
6042
6042
6043
        <para>Instead, install sample files with a suffix
6043
        <para>Instead, install sample files with a suffix
Lines 6082-6088 Link Here
6082
	Please use the correct <command>make</command> variable as
6082
	Please use the correct <command>make</command> variable as
6083
	each make variable conveys radically different meanings to
6083
	each make variable conveys radically different meanings to
6084
	both users, and to automated systems that parse
6084
	both users, and to automated systems that parse
6085
	<filename>Makefiles</filename>.</para>
6085
	<filename>Makefile</filename>s.</para>
6086
6086
6087
	<itemizedlist>
6087
	<itemizedlist>
6088
	  <listitem>
6088
	  <listitem>

Return to bug 53420