xref: /openbsd-src/share/man/man5/port-modules.5 (revision aa5e9e10509ffd51558f081f01cd78bfa3c4f2a5)
1.\"	$OpenBSD: port-modules.5,v 1.160 2013/04/16 13:17:40 ajacoutot Exp $
2.\"
3.\" Copyright (c) 2008 Marc Espie
4.\"
5.\" All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
17.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
20.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26.\"
27.Dd $Mdocdate: April 16 2013 $
28.Dt PORT-MODULES 5
29.Os
30.Sh NAME
31.Nm port-modules
32.Nd documentation and conventions used in port modules
33.Sh DESCRIPTION
34The
35.Ox
36Ports framework is based on a gigantic makefile named
37.Xr bsd.port.mk 5 .
38.Pp
39In order to curb unwieldy growth, parts of the framework
40that are not always needed have been set apart in optional
41files called
42.Nm port modules ,
43which are retrieved as needed through the
44.Ev MODULES
45variable of
46.Xr bsd.port.mk 5 .
47.Pp
48Some of these modules correspond to basic mechanisms which are not
49always needed, such as GNU autoconf, or perl5.
50.Pp
51Other modules correspond to shortcuts for using some other ports as
52dependencies without needing to hardcode too much, such as libiconv or
53the qt ports.
54.Sh THE MODULES LOOK-UP MECHANISM
55The variable
56.Ev MODULES
57should contain a list of module names.
58Some core modules are a single word, all other modules should be
59${PKGPATH}.
60If the module is
61.Pa some/dir/portname ,
62the ports framework will look for a file named
63.Pa ${PORTSDIR}/some/dir/portname/portname.port.mk
64and include it.
65.Pp
66Most modules should conform to this syntax.
67The historic practice of having a redirection file directly under
68.Pa ${PORTSDIR}/infrastructure/mk
69is deprecated for new modules.
70.Pp
71Modules may refer to each other.
72The modules mechanism has specific recursion handling such that
73adding
74.Li MODULES += foo/bar
75to a module will work as expected.
76.Sh NAMING CONVENTIONS
77Since there is no actual scope in makefiles, everything defined within
78a module will be global to the ports framework, and thus may interfere
79with other ports.
80.Pp
81As far as possible, all variables and targets belonging to a module named
82.Pa some/dir/foo
83should be named
84.Ev MODFOO_*
85and
86.Ar modfoo_* .
87.Pp
88Following the same conventions as
89.Xr bsd.port.mk 5 ,
90internal variables and targets not intended for user consumption should be
91named
92.Ev _MODFOO_*
93and
94.Ar _modfoo_* .
95.Pp
96For instance, if a module wants some value to be available for the rest
97of the world, it should define
98.Ev MODFOO_VARNAME ,
99with a name matching the basic infrastructure as far as possible.
100That is, a port that defines specific dependencies will usually
101define
102.Ev MODFOO_WANTLIB ,
103.Ev MODFOO_LIB_DEPENDS ,
104and
105.Ev MODFOO_RUN_DEPENDS ,
106as appropriate.
107.Pp
108As an exception to the naming mechanism, some ports have several distinct
109versions in the ports tree, say
110.Pa x11/qt3
111and
112.Pa x11/qt4 .
113Instead of using the namespace
114.Ev MODQT3* ,
115variables will usually drop the version suffix and be simply called
116.Ev MODQT_*
117so that a port using the module can be switched from version to version
118without needing to change everything.
119.Pp
120It is highly desirable to define names in both namespaces for such ports,
121for example to define both
122.Ev MODQT3_LIB_DEPENDS
123and
124.Ev MODQT_LIB_DEPENDS .
125Normal client ports will use
126.Ev MODQT_LIB_DEPENDS ,
127but a port may exceptionally import both modules with
128.Li MODULES += x11/qt3 x11/qt4
129and differentiate between qt3 and qt4 needs with
130.Ev MODQT3_LIB_DEPENDS
131and
132.Ev MODQT4_LIB_DEPENDS .
133See
134.Pa print/poppler
135for an example.
136.Sh OVERRIDING TARGET BEHAVIOR
137The main framework contains several hooks that allow ports to override
138normal behavior.
139This evolved as an ad-hoc framework, where only hooks that turned out
140to be needed were added.
141If several modules define the same hook, hook behaviors will be
142invoked in sequence.
143.Bl -tag -width do-configure
144.It Ar patch
145There is a
146.Ar post-patch
147hook that can be activated by defining
148.Ev MODFOO_post-patch .
149It will be run right after
150.Ar post-patch
151and before
152.Ev REORDER_DEPENDENCIES
153touches things.
154.It Ar configure
155There is a
156.Ar pre-configure
157hook that can be activated by defining
158.Ev MODFOO_pre-configure .
159It will be run right after
160.Ar pre-configure .
161The normal
162.Ar do-configure
163behavior is to invoke all
164.Ev MODFOO_configure
165contents that are defined in
166.Ev CONFIGURE_STYLE .
167By default,
168.Ar configure
169will do nothing.
170.Pp
171Some
172.Ev CONFIGURE_STYLE
173values, namely perl, gnu, imake, automake, autoconf, and autoupdate
174will automatically import the correct module.
175User-defined modules must both add to
176.Ev CONFIGURE_STYLE
177and import the correct module to override behavior.
178.Pp
179Contrary to other hooks, module behavior is not invoked in
180addition to
181.Ar do-configure ,
182but as the normal configure process.
183If
184.Ar do-configure
185is overridden, normal hook processing will not happen.
186.It Ar fake
187There is a
188.Ar pre-fake
189hook that can be activated by defining
190.Ev MODFOO_pre-fake .
191This will be invoked right after
192.Xr mtree 8 ,
193and before the normal
194.Ar pre-fake
195behavior.
196.Pp
197This can occasionnally be used for ports that require some specific
198fake installation setup that will be provided by runtime dependencies.
199.It Ar install
200There is a
201.Ar post-install
202hook that can be activated by defining
203.Ev MODFOO_post-install .
204This will be invoked at the end of
205.Ar install ,
206right after the normal
207.Ar post-install
208behavior.
209.El
210.Sh OVERRIDING VARIABLE BEHAVIOR
211Some variables can be overridden by modules.
212Be very cautious, as this can make the module difficult to use,
213or interact badly with other modules.
214As a rule, always provide the override as:
215.Pp
216.Dl VARIABLE ?= value
217.Pp
218and provide a module-specific variable with the same value:
219.Pp
220.Dl MODFOO_VARIABLE = value .
221.Pp
222The following variables can be overridden in a relatively safe fashion:
223.Ev ALL_TARGET ,
224.Ev CONFIGURE_SCRIPT ,
225.Ev DESTDIRNAME ,
226.Ev DIST_SUBDIR ,
227.Ev DISTNAME ,
228.Ev DISTFILES ,
229.Ev EXTRACT_SUFX ,
230.Ev FAKE_FLAGS ,
231.Ev FETCH_MANUALLY ,
232.Ev HOMEPAGE ,
233.Ev IGNORE ,
234.Ev IS_INTERACTIVE ,
235.Ev LIBTOOL_FLAGS ,
236.Ev MAKE_FILE ,
237.Ev MASTER_SITES ,
238.Ev MULTI_PACKAGES ,
239.Ev NO_BUILD ,
240.Ev NO_TEST ,
241.Ev PATCH_LIST ,
242.Ev PKG_ARCH ,
243.Ev PKGNAME* ,
244.Ev PREFIX ,
245.Ev TEST_TARGET ,
246.Ev TEST_IS_INTERACTIVE ,
247.Ev REORDER_DEPENDENCIES ,
248.Ev SEPARATE_BUILD ,
249.Ev SHARED_ONLY ,
250.Ev USE_GMAKE ,
251.Ev USE_LIBTOOL .
252.Pp
253The following variables can be added to in a relatively safe fashion:
254.Ev BUILD_DEPENDS ,
255.Ev CATEGORIES ,
256.Ev CONFIGURE_ARGS ,
257.Ev CONFIGURE_ENV ,
258.Ev ERRORS ,
259.Ev FAKE_FLAGS ,
260.Ev FLAVOR ,
261.Ev FLAVORS ,
262.Ev INSTALL_TARGET ,
263.Ev LIB_DEPENDS ,
264.Ev MAKE_ENV ,
265.Ev MAKE_FLAGS ,
266.Ev PKG_ARGS ,
267.Ev PSEUDO_FLAVORS ,
268.Ev TEST_DEPENDS ,
269.Ev REORDER_DEPENDENCIES ,
270.Ev RUN_DEPENDS ,
271.Ev SUBST_VARS ,
272.Ev WANTLIB .
273.Sh SPECIFIC MODULE INTERACTIONS
274Some modules correspond to extra ports that will be used mostly as
275.Ev BUILD_DEPENDS
276or
277.Ev RUN_DEPENDS .
278Such modules can safely append values directly to the
279.Ev BUILD_DEPENDS ,
280.Ev RUN_DEPENDS ,
281.Ev LIB_DEPENDS ,
282and
283.Ev WANTLIB
284variables, as long as they also define module-specific variables for
285all runtime dependencies.
286.Pp
287Simple client ports will use the module directly, and thus inherit extra
288build and runtime dependencies.
289.Pp
290More sophisticated ports can use
291.Ev MULTI_PACKAGES
292to select specific behavior: build-time dependencies will always be
293needed.
294Runtime dependencies will be selected on a subpackage basis,
295since runtime dependencies such as
296.Ev LIB_DEPENDS-sub
297do not inherit the default
298.Ev LIB_DEPENDS
299value.
300The client port's author must only bear in mind that external modules
301may add values to the default
302.Ev WANTLIB ,
303.Ev LIB_DEPENDS ,
304and
305.Ev RUN_DEPENDS ,
306and thus that it is not safe to inherit from it blindly.
307.Pp
308Modules are imported during
309.Pp
310.Dl .include <bsd.port.mk>
311.Pp
312Thus they can be affected by user choices such as setting a variable
313to Yes or No.
314Modules may make decisions based on documented
315.Ev MODFOO_BEHAVIOR
316values.
317.Pp
318When modules are processed, only a few
319.Xr bsd.port.mk 5
320variables are already defined.
321Modules may depend upon the following variables already having a sane
322value:
323.Ev DISTDIR ,
324.Ev LOCALBASE ,
325.Ev NO_DEPENDS ,
326.Ev PKGPATH ,
327.Ev PORTSDIR ,
328.Ev X11BASE
329and all arch-dependent constant from
330.Xr bsd.port.arch.mk 5 ,
331such as
332.Ev PROPERTIES
333or
334.Ev NO_SHARED_ARCHS .
335Note that this is only relevant for tests.
336It is perfectly okay to define variables or targets that depend on the
337basic ports framework without having to care whether that variable is
338already defined, since
339.Xr make 1
340performs lazy evaluation.
341.Sh CORE MODULES DOCUMENTATION
342The following modules are available.
343.Bl -tag -width do-configure
344.It apache-module
345.It converters/libiconv
346.It cpan
347For perl ports coming from CPAN.
348Wrapper around the normal perl module that fetches the file from
349the correct location depending on
350.Ev DISTNAME ,
351and sets a default
352.Ev PKGNAME .
353Also affects
354.Ev TEST_DEPENDS ,
355.Ev CONFIGURE_STYLE ,
356.Ev PKG_ARCH ,
357and
358.Ev CATEGORIES .
359.Pp
360Some CPAN modules are only indexed by author, set
361.Li CPAN_AUTHOR=ID
362to locate the right directory.
363.Pp
364If no
365.Ev HOMEPAGE
366is defined, it will default to
367.Pa http://search.cpan.org/dist/${DISTNAME:C/-[^-]*$//}/
368.Pp
369User settings: set
370.Ev CPAN_REPORT
371to Yes,
372.Ev CPAN_REPORT_DB
373to a valid directory,
374and
375.Ev CPAN_REPORT_FROM
376to a valid email address to automate the reporting
377of regression tests to CPAN.
378.Pp
379If
380.Ev MODCPAN_EXAMPLES
381is set, the following variables will be set.
382.Ev MODCPAN_EXAMPLES_DIST
383will hold the default directory in the distfile with
384example scripts.
385.Ev MODCPAN_EXAMPLES_DIR
386will be set to the standard installation directory for
387examples.
388Sets the
389.Ar post-install
390target if none has been defined to install the examples,
391otherwise
392.Ev MODCPAN_POST_INSTALL
393should be used as such:
394.Bd -literal
395post-install:
396	...
397	${MODCPAN_POST_INSTALL}
398.Ed
399.It devel/cmake
400.It devel/dconf
401Sets
402.Ev CONFIGURE_ARGS ,
403.Ev BUILD_DEPENDS
404and
405.Ev RUN_DEPENDS .
406This module is used by ports installing gsettings schemas under
407.Pa ${PREFIX}/share/glib-2.0/schemas/ .
408It requires the following goo in the PLIST:
409.Bd -literal -offset indent
410@exec %D/bin/glib-compile-schemas %D/share/glib-2.0/schemas >/dev/null
411@unexec-delete %D/bin/glib-compile-schemas %D/share/glib-2.0/schemas >/dev/null
412.Ed
413.It devel/gconf2
414A link from
415.Xr gconftool-2 1
416to
417.Xr true 1
418will be put at the front of the path.
419Sets
420.Ev CONFIGURE_ARGS ,
421.Ev BUILD_DEPENDS
422and
423.Ev RUN_DEPENDS .
424According to the values of
425.Ev MODGCONF2_LIBDEP ,
426sets
427.Ev LIB_DEPENDS .
428User settings: set
429.Ev MODGCONF2_SCHEMAS_DIR
430to the directory name under
431.Pa ${LOCALBASE}/share/schemas/
432where schemas files will be installed.
433.It devel/gettext
434.It devel/pmk
435Sets
436.Ev CONFIGURE_SCRIPT ,
437.Ev CONFIGURE_ARGS
438and
439.Ev MODPMK_configure .
440It appends
441.Pa devel/pmk
442to
443.Ev BUILD_DEPENDS .
444.It devel/scons
445Adds
446.Pa devel/scons
447to
448.Ev BUILD_DEPENDS .
449Sets
450.Ev MODSCONS_BIN
451and
452.Ev MODSCONS_ENV .
453Also defines an overridable
454.Ev MODSCONS_FLAGS .
455It provides a
456.Ar do-build
457and
458.Ar do-install
459targets that can be overridden in the port Makefile.
460.It devel/waf
461Adds
462.Pa devel/waf
463to
464.Ev BUILD_DEPENDS ,
465.Pa lang/python
466to
467.Ev MODULES ,
468and provides
469.Ar do-configure ,
470.Ar do-build ,
471.Ar do-install
472and
473.Ar post-install
474targets.
475.Ar do-build ,
476.Ar do-install
477and
478.Ar post-install
479can be overridden in the port Makefile.
480.It fortran
481Sets
482.Ev MODFORTRAN_LIB_DEPENDS ,
483.Ev MODFORTRAN_WANTLIB ,
484.Ev MODFORTRAN_BUILD_DEPENDS .
485Set
486.Ev MODFORTRAN_COMPILER
487to `g77' or `gfortran', depending on what the port requires.
488The default is `g77'.
489The dependencies are chosen according to
490.Ev COMPILER_VERSION
491and
492.Ev MODFORTRAN_COMPILER .
493.It gcc4
494If
495.Ev COMPILER_VERSION
496is not gcc4 (defined by
497.Pa /usr/share/mk/bsd.own.mk ) ,
498and architecture is in
499.Ev MODGCC4_ARCHS ,
500then the gcc4 compilers will be put at the front of the path.
501By default, only C language support is included by this module.
502If other languages are needed, they must be listed in
503.Ev MODGCC4_LANGS
504(e.g. c++, fortran).
505The
506.Ev MODGCC4_VERSION
507variable can be used to change the version of gcc.
508By default gcc 4.6 is used.
509If
510.Ev MODGCC4_LANGS
511contains c++, this module provides
512.Ev MODGCC4_CPPLIBDEP
513and
514.Ev MODGCC4_CPPWANTLIB .
515.It gnu
516This module is documented in the main
517.Xr bsd.port.mk 5
518manpage.
519.It imake
520This module is documented in the main
521.Xr bsd.port.mk 5
522manpage.
523.It java
524Set
525.Li MODJAVA_VER=x.y
526to use exactly the JDK x.y,
527.Li MODJAVA_VER=x.y+
528to use any x.y or higher version.
529Set
530.Li MODJAVA_JRERUN=Yes
531if the port only needs the JRE at runtime.
532The module sets
533.Ev JAVA_HOME ,
534.Ev ONLY_FOR_ARCHS ,
535.Ev MODJAVA_RUN_DEPENDS ,
536.Ev MODJAVA_SHARE_DIR ,
537.Ev MODJAVA_JAR_DIR ,
538.Ev MODJAVA_EXAMPLE_DIR
539and
540.Ev MODJAVA_DOC_DIR .
541It appends to
542.Ev BUILD_DEPENDS ,
543.Ev RUN_DEPENDS ,
544.Ev CATEGORIES
545and
546.Ev SUBST_VARS .
547If
548.Li MODJAVA_BUILD=ant
549then this module provides
550.Ev MODJAVA_BUILD_DIR ,
551.Ev MODJAVA_BUILD_FILE
552and
553.Ev MODJAVA_BUILD_TARGET ,
554as well as a
555.Ar do-build
556target (if not already defined).
557It heeds
558.Ev NO_BUILD .
559.It lang/clang
560Similar to gcc3 and gcc4 modules.
561If architecture is in MODCLANG_ARCHS, the CLang compilers will be
562put at the front of the path.
563By default, only C language support is included by this module.
564If other languages are needed, they must be listed in
565.Ev MODCLANG_LANGS
566(e.g. c++).
567Sets
568.Ev MODCLANG_VERSION
569which is also appended to
570.Ev SUBST_VARS .
571.It lang/erlang
572.It lang/ghc
573Sets
574.Ev ONLY_FOR_ARCHS ,
575.Ev MODGHC_VER ,
576.Ev BUILD_DEPENDS ,
577and
578.Ev RUN_DEPENDS .
579Build and further actions are based on the list of values in
580.Ev MODGHC_BUILD :
581.Bl -tag -width register
582.It Ar nort
583no runtime dependency on
584.Pa lang/ghc
585and hs- prefix will not be added,
586.It Ar cabal
587get the typical Cabal targets defined,
588.It Ar haddock
589generate API documentation using
590.Pa devel/haddock ,
591.It Ar register
592create and include register/unregister scripts,
593.It Ar hackage
594the distfiles are available on Hackage.
595.El
596.Pp
597Also affects
598.Ev CATEGORIES ,
599.Ev CONFIGURE_STYLE
600and
601.Ev SUBST_VARS .
602.Ar do-build ,
603.Ar do-install
604and
605.Ar do-test
606targets are provided if the port itself didn't set them.
607If
608.Ar register
609has been set, the PLIST needs to be modified in order to
610add the relevant @exec/@unexec lines.
611This module will run the Setup script and ensure the documentation
612will be built (if
613.Ar haddock
614has been set), and that the package is
615registered as a library usable by
616.Pa lang/ghc
617(if
618.Ar register
619has been set).
620Extra arguments and environment additions for the Setup configure
621command can be specified with
622.Ev MODGHC_SETUP_CONF_ARGS
623and
624.Ev MODGHC_SETUP_CONF_ENV .
625.It lang/lua
626Sets
627.Ev MODLUA_BIN ,
628.Ev MODLUA_DATADIR ,
629.Ev MODLUA_DEP ,
630.Ev MODLUA_DEP_VERSION ,
631.Ev MODLUA_DOCDIR ,
632.Ev MODLUA_EXAMPLEDIR ,
633.Ev MODLUA_INCL_DIR ,
634.Ev MODLUA_LIB ,
635.Ev MODLUA_LIBDIR ,
636.Ev MODLUA_VERSION ,
637.Ev MODLUA_WANTLIB .
638Appends to
639.Ev CATEGORIES .
640Also appends to
641.Ev BUILD_DEPENDS ,
642unless
643.Ev NO_BUILD
644has been set to Yes.
645Also appends to
646.Ev RUN_DEPENDS ,
647unless
648.Ev MODLUA_RUNDEP
649is set to No.
650Appends
651.Ev MODLUA_VERSION ,
652.Ev MODLUA_LIB ,
653.Ev MODLUA_INCL_DIR ,
654.Ev MODLUA_EXAMPLEDIR ,
655.Ev MODLUA_DOCDIR ,
656.Ev MODLUA_LIBDIR ,
657.Ev MODLUA_DATADIR ,
658.Ev MODLUA_DEP ,
659.Ev MODLUA_DEP_VERSION ,
660.Ev MODLUA_BIN
661to
662.Ev SUBST_VARS .
663.Ev MODLUA_DEFAULT_VERSION
664is set to 5.1.
665.Ev MODLUA_VERSION is set to
666.Ev MODLUA_DEFAULT_VERSION
667by default.
668Ports can be built with two lua versions.
669If no FLAVOR is set it defaults to MODLUA_DEAFULT_VERSION.
670Otherwise the FULLPKGNAME is adjusted, if MODLUA_SA is not set.
671In order to set a build, run or test dependency on a lua port,
672use the following, which will propagate the currently used flavor:
673.Ev MODLUA_BUILD_DEPENDS ,
674.Ev MODLUA_TEST_DEPENDS ,
675.Ev MODLUA_RUN_DEPENDS .
676.It lang/mono
677Sets
678.Ev MODMONO_ONLY_FOR_ARCHS ,
679.Ev CONFIGURE_ENV ,
680.Ev MAKE_FLAGS ,
681.Ev MODMONO_BUILD_DEPENDS
682and
683.Ev MODMONO_RUN_DEPENDS .
684If
685.Ev MODMONO_DEPS
686is set to Yes,
687.Pa lang/mono
688is appended to
689.Ev BUILD_DEPENDS
690and
691.Ev RUN_DEPENDS .
692If
693.Ev MODMONO_NANT
694is set to Yes,
695.Ev NANT
696and
697.Ev NANT_FLAGS
698are set,
699.Pa devel/nant
700is appended to
701.Ev BUILD_DEPENDS
702and a
703.Ar do-build
704and
705.Ar do-install
706targets are provided to use nant for building.
707If these targets are already defined, one can use
708.Ev MODMONO_BUILD_TARGET
709and
710.Ev MODMONO_INSTALL_TARGET
711instead in the corresponding target.
712.Ev DLLMAP_FILES
713defines in which files the module will substitute hardcoded
714shared library versions using a
715.Ar post-configure
716target.
717.It lang/node
718Adds common dependencies to
719.Ev RUN_DEPENDS
720and
721.Ev BUILD_DEPENDS .
722Recognizes two additional types of
723.Ev CONFIGURE_STYLE Ns s ,
724"npm" and "npm ext".
725"npm ext" should be used for npm packages that contain C++ extensions which
726need to be compiled.
727"npm" should be used for other npm packages.
728If regression tests are included that can be run using
729.Pa devel/node-expresso ,
730append "expresso" to
731.Ev CONFIGURE_STYLE .
732.Pa devel/node-expresso
733will be appened to
734.Ev TEST_DEPENDS
735and a default
736.Ev MODNODE_TEST_TARGET
737will be defined, along with a do-test target if it has not
738already been set.
739If "expresso" isn't appended to
740.Ev CONFIGURE_STYLE ,
741.Ev TEST_TARGET
742will be set to "test".
743One of these two
744.Ev CONFIGURE_STYLE Ns s
745should be used or the module doesn't affect anything except
746.Ev RUN_DEPENDS
747and
748.Ev BUILD_DEPENDS .
749Requires
750.Ev NPM_NAME
751to be set to the name of the npm package.
752Uses
753.Ev NPM_NAME
754and
755.Ev NPM_VERSION
756to set
757.Ev DISTNAME ,
758and
759.Ev PKGNAME ,
760and
761.Ev MASTER_SITES .
762If the npm package depends on other npm packages, the npm package names it
763depends on should be listed in
764.Ev MODNODE_DEPENDS .
765Adds default do_build and do_install tasks, and you can reference the default
766implementations via
767.Ev MODNODE_BUILD_TARGET
768and
769.Ev MODNODE_INSTALL_TARGET .
770.It lang/ocaml
771Sets
772.Ev OCAML_VERSION .
773Appends to
774.Ev BUILD_DEPENDS
775and
776.Ev MAKE_ENV .
777This selects a %%native%% plist fragment and
778.Ev ocaml_native
779property depending on whether the architecture supports native
780compilation.
781If dynamic linking is supported on the native architecture,
782the %%dynlink%% plist fragment and
783.Ev ocaml_native_dynlink
784property is set.
785.It lang/php/pecl
786Used for ports for PHP PECL extensions.
787Sets default
788.Ev MASTER_SITES ,
789.Ev HOMEPAGE ,
790.Ev EXTRACT_SUFX ,
791.Ev DESTDIRNAME ,
792.Ev MODPHP_DO_SAMPLE ,
793.Ev MODPHP_DO_PHPIZE ,
794.Ev AUTOCONF_VERSION ,
795.Ev AUTOMAKE_VERSION ,
796.Ev LIBTOOL_FLAGS .
797Provides a default
798.Ev TEST_TARGET
799and
800.Ev TEST_FLAGS
801unless
802.Ev NO_TEST
803or a
804.Ar do-test
805target is defined.
806Adds common dependencies to
807.Ev RUN_DEPENDS
808and
809.Ev BUILD_DEPENDS .
810Sets a default
811.Ev PKGNAME
812and appends to
813.Ev CATEGORIES .
814.It lang/python
815Sets
816.Ev MODPY_VERSION ,
817.Ev MODPY_BIN ,
818.Ev MODPY_INCDIR ,
819.Ev MODPY_LIBDIR ,
820.Ev MODPY_SITEPKG ,
821.Ev MODPY_SETUP ,
822.Ev MODPY_WANTLIB ,
823.Ev MODPY_LIB_DEPENDS ,
824.Ev MODPY_RUN_DEPENDS ,
825.Ev MODPY_BUILD_DEPENDS
826and
827.Ev MODPY_ADJ_FILES .
828Appends to
829.Ev RUN_DEPENDS
830unless
831.Ev MODPY_RUNDEP
832is set to No.
833Appends to
834.Ev BUILD_DEPENDS
835unless
836.Ev MODPY_BUILDDEP
837is set to No or
838.Ev NO_BUILD
839is set to Yes.
840.Ev MODPY_VERSION
841is the default version used by all python modules.
842Ports which use the setuptools module should set
843.Ev MODPY_SETUPTOOLS
844to Yes.
845All ports that generate egg-info files should set
846.Ev MODPY_EGG_VERSION
847to the version string used by the port's setup.py setup() function.
848Extra arguments to the build and install commands can be passed via
849.Ev MODPY_DISTUTILS_BUILDARGS
850and
851.Ev MODPY_DISTUTILS_INSTALLARGS .
852If any files have a python shebang line which needs to be replaced
853using MODPY_BIN, list them in
854.Ev MODPY_ADJ_FILES .
855These are prefixed with WRKSRC and replaced automatically
856at the end of
857.Ar pre-configure .
858Also affects
859.Ev CATEGORIES ,
860.Ev MAKE_ENV ,
861.Ev CONFIGURE_ENV ,
862.Ev SHARED_ONLY ,
863and
864.Ev SUBST_VARS .
865May affect the
866.Ar test
867target.
868.It lang/ruby
869See
870.Xr ruby-module 5 .
871.It lang/tcl
872Sets
873.Ev MODTCL_VERSION ,
874.Ev MODTCL_BIN ,
875.Ev MODTCL_INCDIR ,
876.Ev MODTCL_LIBDIR ,
877.Ev MODTCL_BUILD_DEPENDS ,
878.Ev MODTCL_RUN_DEPENDS ,
879.Ev MODTCL_LIB ,
880.Ev MODTCL_LIB_DEPENDS ,
881and
882.Ev MODTCL_CONFIG .
883.Ev MODTCL_VERSION
884is the default version used by all Tcl ports and may be overridden.
885Provides
886.Ev MODTCL_TCLSH_ADJ
887and
888.Ev MODTCL_WISH_ADJ
889shell fragments to patch the interpreter path in executable scripts.
890Also affects
891.Ev CATEGORIES
892and
893.Ev SUBST_VARS .
894.It perl
895This module is documented in the main
896.Xr bsd.port.mk 5
897manpage.
898.It textproc/intltool
899Sets
900.Ev MODINTLTOOL_OVERRIDE .
901.Pa textproc/intltool
902is added to
903.Ev BUILD_DEPENDS .
904.Ev MODINTLTOOL_OVERRIDE
905changes the paths of
906.Ev INTLTOOL_EXTRACT ,
907.Ev INTLTOOL_MERGE
908and
909.Ev INTLTOOL_UPDATE
910to use the installed versions of intltool-extract,
911intltool-merge and intltool-update, instead of the version's packages into the
912distfile of the port using this module.
913Also affects
914.Ev CONFIGURE_ENV ,
915.Ev MAKE_ENV
916and
917.Ev MAKE_FLAGS
918by appending
919.Ev MODINTLTOOL_OVERRIDE
920to them.
921.It www/drupal6
922This module is legacy.
923drupal6 is still supported, but new work should mostly happen in drupal7 land.
924.It www/drupal7
925Can be used to install plugins (default), themes if
926.Ev MODDRUPAL_THEME
927is yes, or languages packs if
928.Ev DRUPAL_LANG
929is set to the desired language.
930.Pp
931The module will set or add to default values for
932.Ev HOMEPAGE ,
933.Ev MASTER_SITES ,
934.Ev PREFIX ,
935.Ev DIST_SUBDIR ,
936.Ev CATEGORIES ,
937.Ev PKG_ARCH ,
938.Ev WRKDIST ,
939.Ev RUN_DEPENDS .
940Drupal modules normally don't have any build part, just an installation part
941that defaults to copying the plugin/theme/language files into the right
942location through
943.Ev MODDRUPAL_INSTALL .
944.Pp
945The module sets
946.Ev DRUPAL
947to drupal7,
948.Ev DRUPAL_ROOT
949to htdocs/${DRUPAL}
950.Ev DRUPAL_MODS
951to ${DRUPAL_ROOT}/site/all/modules
952.Ev DRUPAL_THEMES
953to ${DRUPAL_ROOT}/site/all/themes
954and
955.Ev DRUPAL_TRANSLATIONS
956to ${DRUPAL_ROOT}/profiles/standard/translations.
957So, by default, modules and themes are installed for all sites,
958and translations are activated at install.
959.Pp
960.Ev DRUPAL_OWNER , DRUPAL_GROUP
961are set to root, daemon, since drupal doesn't need to write
962to any file except the files/ directory and the site settings (those
963belong to www instead).
964.Pp
965Translations are handled by setting
966.Ev DRUPAL_LANG
967to the language letter code, and by setting
968.Ev LANGFILES
969to a list of module names/version pairs.
970.Pp
971With drupal7, all translations have been put in separate .po files.
972It has been deemed simplest to pack all translations for a given language
973into a single package, since translations for non installed modules won't
974affect anything.
975.It www/horde
976.It www/mozilla
977Sets
978.Ev PKGNAME ,
979.Ev HOMEPAGE ,
980.Ev MASTER_SITES ,
981.Ev DISTNAME ,
982.Ev USE_GMAKE ,
983.Ev ONLY_FOR_ARCHS
984and
985.Ev SHARED_ONLY .
986.Ev EXTRACT_SUFX
987defaults to .tar.bz2.
988.Pp
989Adds common dependencies to
990.Ev LIB_DEPENDS ,
991.Ev WANTLIB ,
992.Ev RUN_DEPENDS
993and
994.Ev BUILD_DEPENDS .
995Sets common
996.Ev CONFIGURE_ARGS ,
997.Ev MAKE_ENV
998and
999.Ev CONFIGURE_ENV .
1000Sets
1001.Ev MOB
1002variable as source directory
1003and
1004.Ev MOZ
1005as target directory within
1006.Ar do-install .
1007.Pp
1008Individual port Makefile must set
1009.Ev MOZILLA_PROJECT ,
1010.Ev MOZILLA_CODENAME ,
1011.Ev MOZILLA_VERSION ,
1012.Ev MOZILLA_BRANCH ,
1013.Ev MOZILLA_LIBS
1014and
1015.Ev MOZILLA_DATADIRS
1016variables.
1017Port can also append values to
1018.Ev MOZILLA_SUBST_FILES
1019which contains the list of
1020files to run
1021.Ev SUBST_CMD
1022on during
1023.Ar pre-configure ,
1024and
1025.Ev MOZILLA_AUTOCONF_DIRS
1026which
1027contains the list of dirs where
1028.Ev AUTOCONF
1029will be run during
1030.Ar pre-configure .
1031.It www/pear
1032Used for PHP PEAR ports.
1033Sets default
1034.Ev MASTER_SITES ,
1035.Ev EXTRACT_SUFX ,
1036.Ev PKGNAME .
1037Sets
1038.Ev PREFIX
1039to
1040.Pa /var/www .
1041Sets
1042.Ev NO_TEST
1043unless a
1044.Ar do-test
1045target is defined.
1046Adds common dependencies to
1047.Ev RUN_DEPENDS
1048and
1049.Ev BUILD_DEPENDS ,
1050sets
1051.Ev MAKE_FILE
1052and
1053.Ev FAKE_FLAGS
1054appropriately.
1055Makes
1056.Ev PEAR_LIBDIR
1057and
1058.Ev PEAR_PHPBIN
1059available for use in the port.
1060Sets a default
1061.Ev PKGNAME
1062and appends to
1063.Ev CATEGORIES .
1064.It www/plone
1065Sets
1066.Ev MODPLONE_VERSION
1067and
1068.Ev MODZOPE_VERSION .
1069.Ev MODPLONE_VERSION
1070is the default version used by all Plone ports and may be overridden.
1071It appends
1072.Pa www/plone
1073to
1074.Ev RUN_DEPENDS
1075and also sets
1076.Ev NO_TEST
1077to Yes.
1078.It www/zope
1079.It x11/gnome
1080If both
1081.Ev GNOME_PROJECT
1082and
1083.Ev GNOME_VERSION
1084are set, this module defines
1085.Ev DISTNAME ,
1086.Ev VERSION ,
1087.Ev MASTER_SITES ,
1088adds x11/gnome to
1089.Ev CATEGORIES
1090and
1091.Ev EXTRACT_SUFX
1092will default to .tar.xz if unset.
1093Also unconditionally sets
1094.Ev USE_GMAKE .
1095If
1096.Li MODGNOME_ICON_CACHE=Yes ,
1097a dependency on
1098.Pa x11/gtk+2,-guic
1099is appended to
1100.Ev MODGNOME_RUN_DEPENDS .
1101Unless
1102.Li NO_BUILD=Yes ,
1103.Ev CONFIGURE_SHARED
1104is appended to
1105.Ev CONFIGURE_ARGS ,
1106.Li CPPFLAGS="-I${LOCALBASE}/include"
1107and
1108.Li LDFLAGS="-L${LOCALBASE}/lib"
1109are appended to
1110.Ev CONFIGURE_ENV
1111and
1112.Pa textproc/intltool
1113is appended to
1114.Ev MODULES .
1115If none of
1116.Ev AUTOCONF_VERSION
1117nor
1118.Ev AUTOMAKE_VERSION
1119are defined, then "--disable-maintainer-mode" is appended to
1120.Ev CONFIGURE_ARGS .
1121Certain build/run dependencies and configure arguments and environment
1122can be set by appending gi, gtk-doc, vala and/or yelp to
1123.Ev MODGNOME_TOOLS .
1124They are disabled otherwise.
1125If
1126.Ev MODGNOME_TOOLS
1127is set to yelp,
1128.Pa textproc/itstool
1129and
1130.Pa x11/gnome/doc-utils
1131are appended to
1132.Ev MODGNOME_BUILD_DEPENDS .
1133Also,
1134.Pa x11/gnome/yelp
1135is appended to
1136.Ev MODGNOME_RUN_DEPENDS ,
1137and
1138.Ev MODGNOME_RUN_DEPENDS_yelp
1139is
1140set for use with multi packaged ports.
1141This option is to be used when any files are installed into
1142.Pa share/gnome/help/
1143or page files are installed into
1144.Pa share/help/ .
1145.Ev MODGNOME_BUILD_DEPENDS
1146and
1147.Ev MODGNOME_BUILD_DEPENDS
1148are appended to the
1149corresponding
1150.Ev BUILD_DEPENDS
1151and
1152.Ev RUN_DEPENDS .
1153.It x11/gnustep
1154.It x11/kde
1155.It x11/qt3 and x11/qt4
1156Both qt modules share a common
1157.Ev MODQT_*
1158namespace for simple ports.
1159The qt3 module also defines the same variables under
1160.Ev MODQT3_*
1161and the qt4 module also defines the same variables under
1162.Ev MODQT4_* ,
1163to allow ports to use both modules, such as
1164.Pa print/poppler .
1165.Pp
1166Those modules define
1167.Ev MODQT*_LIBDIR
1168as the libraries location,
1169.Ev MODQT*_INCDIR
1170as the include files location ,
1171.Ev MODQT*_QTDIR
1172as the global qt directory location ,
1173.Ev MODQT*_CONFIGURE_ARGS
1174as standard GNU configure-style parameters to locate the include and libraries.
1175.Pp
1176The location of qt specific tools
1177.Nm moc
1178and
1179.Nm uic
1180is available through
1181.Ev MODQT*_MOC
1182and
1183.Ev MODQT*_UIC .
1184.Ev MODQT*_OVERRIDE_UIC
1185controls whether the default setup will force a value of
1186.Ev UIC
1187or not.
1188The value of
1189.Ev MOC
1190is always forced to ${MODQT*_MOC}.
1191qt4 includes
1192.Xr pkg-config 1
1193files under a specific location recorded in
1194.Ev MODQT_PKG_CONFIG_PATH .
1195qt3 requires the use of
1196.Ev MODQT3_PLUGINS
1197to correctly locate plugins.
1198.Pp
1199The modules add to
1200.Ev CONFIGURE_ENV , MAKE_ENV
1201and
1202.Ev MAKE_FLAGS .
1203They define appropriate
1204.Ev MODQT*_LIB_DEPENDS
1205and
1206.Ev MODQT*_WANTLIB .
1207Note that qt4 has split its code over several libraries, so the basic
1208.Ev WANTLIB
1209only refers to QtCore.
1210Other libraries should be added as needed.
1211.It x11/tk
1212Sets
1213.Ev MODTK_VERSION ,
1214.Ev MODTK_BIN ,
1215.Ev MODTK_INCDIR ,
1216.Ev MODTK_LIBDIR ,
1217.Ev MODTK_BUILD_DEPENDS ,
1218.Ev MODTK_RUN_DEPENDS ,
1219.Ev MODTK_LIB ,
1220.Ev MODTK_LIB_DEPENDS ,
1221and
1222.Ev MODTK_CONFIG .
1223.Ev MODTK_VERSION
1224is the default version used by all Tk ports and
1225may be overridden.
1226Automatically adds the
1227.Pa lang/tcl
1228module, provides a default
1229.Ev MODTCL_VERSION
1230to match
1231.Ev MODTK_VERSION ,
1232and affects
1233.Ev CATEGORIES
1234and
1235.Ev SUBST_VARS .
1236Note the
1237.Ev MODTCL_WISH_ADJ
1238shell fragment in the
1239.Pa lang/tcl
1240module.
1241.It x11/xfce4
1242Sets
1243.Ev DIST_SUBDIR ,
1244.Ev EXTRACT_SUFX ,
1245.Ev CONFIGURE_STYLE ,
1246.Ev CONFIGURE_ENV
1247and
1248.Ev USE_GMAKE .
1249If
1250.Ev MODXFCE_ICON_CACHE
1251is set to yes, it adds
1252.Pa x11/gtk+2,-guic
1253to
1254.Ev RUN_DEPENDS .
1255Unless
1256.Ev XFCE_NO_SRC
1257is set,
1258.Pa devel/gettext
1259and
1260.Pa textproc/intltool
1261are added to
1262.Ev MODULES .
1263Also affects
1264.Ev CATEGORIES .
1265.Pp
1266Xfce ports can be divided into five categories: core libraries and
1267applications, goodies, artwork, thunar plugins, and panel plugins.
1268.Ev HOMEPAGE ,
1269.Ev MASTER_SITES
1270and
1271.Ev DISTNAME
1272are built using
1273.Ev XFCE_VERSION
1274(which defaults to
1275.Ev XFCE_DESKTOP_VERSION
1276if not set) and either
1277.Ev XFCE_PROJECT ,
1278.Ev XFCE_GOODIE ,
1279.Ev XFCE_ARTWORK ,
1280.Ev THUNAR_PLUGIN
1281or
1282.Ev XFCE_PLUGIN .
1283One of the latter has to be provided by the port Makefile.
1284.El
1285.Sh SEE ALSO
1286.Xr make 1 ,
1287.Xr bsd.port.mk 5 ,
1288.Xr ports 7
1289