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