Sync Mk with ports
[dports.git] / Mk / bsd.sanity.mk
1 # $FreeBSD$
2 #
3 # MAINTAINER: portmgr@FreeBSD.org
4 #
5
6 .if defined(WITHOUT_NLS)
7 WARNING+=       "WITHOUT_NLS is deprecated use OPTIONS_UNSET=NLS instead"
8 .endif
9
10 .if defined(WITH_NEW_XORG) || defined(WITHOUT_NEW_XORG)
11 WARNING+=       "WITH_NEW_XORG and WITHOUT_NEW_XORG knobs were removed and have no effect"
12 .endif
13
14 .if defined(WITH_KMS) || defined(WITHOUT_KMS)
15 WARNING+=       "WITH_KMS was removed and has no effect"
16 .endif
17
18 .if exists(${.CURDIR}/../../Mk/bsd.port.mk)
19 .if ${.CURDIR:H:T} != ${PKGCATEGORY}
20 DEV_ERROR+=     "The first entry in CATEGORIES should be the directory where the port lives"
21 .endif
22 .else
23 DEV_WARNING+=   "Not validating first entry in CATEGORIES due to being outside of PORTSDIR. Please ensure this is proper when committing."
24 .endif
25
26 #.if defined(WITHOUT_X11)
27 #WARNING+=      "WITHOUT_X11 is deprecated use X11 option instead"
28 #.endif
29
30 #.if !defined(LICENSE)
31 #DEV_WARNING+=  "No license is defined consider adding one"
32 #.endif
33
34 .if defined(USE_PERL5) && ${USE_PERL5} == yes
35 DEV_ERROR+=     "USE_PERL5=yes is unsupported, please use USES=perl5 instead"
36 .endif
37
38 .if defined(USE_KDEBASE_VER)
39 DEV_ERROR+=     "USE_KDEBASE_VER is unsupported"
40 .endif
41
42 .if defined(USE_KDELIBS_VER)
43 DEV_ERROR+=     "USE_KDELIBS_VER is unsupported"
44 .endif
45
46 .if defined(USE_QT_VER)
47 DEV_ERROR+=     "USE_QT_VER is unsupported"
48 .endif
49
50 .if defined(USE_GHOSTSCRIPT) || defined(USE_GHOSTSCRIPT_BUILD) || defined(USE_GHOSTSCRIPT_RUN)
51 DEV_ERROR+=     "USE_GHOSTSCRIPT is unsupported, please use USES=ghostscript instead"
52 .endif
53
54 .if !empty(LIB_DEPENDS:M*/../*)
55 DEV_ERROR+=     "LIB_DEPENDS contains unsupported relative path to dependency"
56 .endif
57
58 .if !empty(RUN_DEPENDS:M*/../*)
59 DEV_ERROR+=     "RUN_DEPENDS contains unsupported relative path to dependency"
60 .endif
61
62 .if defined(USE_GNOME) && ${USE_GNOME:Mpkgconfig}
63 DEV_ERROR+=     "USE_GNOME=pkgconfig is unsupported, please use USES=pkgconfig"
64 .endif
65
66 .if defined(USE_ZOPE) && ${USE_ZOPE} == yes
67 DEV_ERROR+=     "USE_ZOPE=yes is unsupported, please use USES=zope instead"
68 .endif
69
70 .if defined(USE_GITHUB) && defined(GH_COMMIT)
71 DEV_ERROR+=     "GH_COMMIT is unsupported, please convert GHL-\>GH in MASTER_SITES and set GH_TAGNAME to tag or commit hash and remove GH_COMMIT"
72 .endif
73
74 .if defined(USE_GNOME) && ${USE_GNOME:Mgnomehack}
75 DEV_WARNING+=   "USE_GNOME=gnomehack is deprecated, please use USES=pathfix"
76 .endif
77
78 .if defined(USE_GNOME) && ${USE_GNOME:Mdesktopfileutils}
79 DEV_WARNING+=   "USE_GNOME=desktopfileutils is deprecated, please use USES=desktop-file-utils"
80 .endif
81
82 .if defined(LIB_DEPENDS) && ${LIB_DEPENDS:Nlib*}
83 DEV_ERROR+=     "All LIB_DEPENDS should use the new format and start out with lib.  \(libfoo.so vs foo.so\)"
84 .endif
85
86 .if defined(USE_TCL) || defined(USE_TCL_BUILD) || defined(USE_TCL_RUN) || defined(USE_TCL_WRAPPER) || \
87    defined(USE_TK)  || defined(USE_TK_BUILD)  || defined(USE_TK_RUN)  || defined(USE_TK_WRAPPER)
88 DEV_ERROR+=     "USE_TCL and USE_TK are no longer supported, please use USES=tcl or USES=tk"
89 .endif
90
91 # print warning if no reason given for NO_STAGE
92 .if defined(NO_STAGE)
93 DEV_ERROR+=     "NO_STAGE is unsupported, convert port to stage directory:"
94 DEV_ERROR+=     "https://wiki.freebsd.org/ports/StageDir"
95 .endif
96
97 .for a in 1 2 3 4 5 6 7 8 9 L N
98 .if defined(MAN${a})
99 DEV_WARNING+=   "MAN${a} macros are deprecated when using stage directory"
100 .endif
101 .endfor
102
103 .if defined(MLINKS)
104 DEV_WARNING+=   "MLINKS macros are deprecated when using stage directory"
105 .endif
106
107 .if defined(_PREMKINCLUDED)
108 DEV_ERROR+=     "you cannot include bsd.port[.pre].mk twice"
109 .endif
110
111 .if defined(USE_DOS2UNIX)
112 DEV_ERROR+=     "USE_DOS2UNIX is no longer supported, please use USES=dos2unix"
113 .endif
114
115 .if defined(LICENSE)
116 .if ${LICENSE:MBSD}
117 DEV_WARNING+=   "LICENSE must not contain BSD, instead use BSD[234]CLAUSE"
118 .endif
119 .endif
120
121 .if defined(USE_PYDISTUTILS) && ${USE_PYDISTUTILS} == "easy_install"
122 DEV_ERROR+=     "USE_PYDISTUTILS=easy_install is no longer supported, please use USE_PYDISTUTILS=yes"
123 .endif
124
125 .if defined(USE_PYTHON) && (${USE_PYTHON} == "yes" || ${USE_PYTHON:C/[-0-9.+]*//} == "")
126 _PYTHON_VAL := ${USE_PYTHON}
127 .if ${_PYTHON_VAL} != "yes"
128 DEV_ERROR+=     "USE_PYTHON=${_PYTHON_VAL} is no longer supported, please use USES=python:${_PYTHON_VAL}"
129 .else
130 DEV_ERROR+=     "USE_PYTHON=yes is no longer supported, please use USES=python"
131 .endif
132 .endif
133 .if defined(USE_PYTHON_RUN)
134 .if ${USE_PYTHON_RUN} != "yes"
135 DEV_ERROR+=     "USE_PYTHON_RUN is no longer supported, please use USES=python:${USE_PYTHON_RUN},run"
136 .else
137 DEV_ERROR+=     "USE_PYTHON_RUN is no longer supported, please use USES=python:run"
138 .endif
139 .endif
140 .if defined(USE_PYTHON_BUILD)
141 .if ${USE_PYTHON_BUILD} != "yes"
142 DEV_ERROR+=     "USE_PYTHON_BUILD is no longer supported, please use USES=python:${USE_PYTHON_BUILD},build"
143 .else
144 DEV_ERROR+=     "USE_PYTHON_BUILD is no longer supported, please use USES=python:build"
145 .endif
146 .endif
147
148 .if defined(PYDISTUTILS_INSTALLNOSINGLE)
149 DEV_WARNING+=   "PYDISTUTILS_INSTALLNOSINGLE is deprecated, please do not use it anymore"
150 .endif
151
152 .if defined(INSTALLS_EGGINFO)
153 DEV_ERROR+=     "INSTALLS_EGGINFO is no longer supported, please add the entry directly to the plist"
154 .endif
155
156 .if defined(WANT_SDL)
157 DEV_ERROR+=     "WANT_SDL is no longer supported. If you need SDL, use USE_SDL, if you need optional dependency, use options"
158 .endif
159
160 .if defined(USE_RC_SUBR) && ${USE_RC_SUBR:tu} == YES
161 DEV_ERROR+=     "USE_RC_SUBR=yes has not been supported for a long time, remove it."
162 .endif
163
164 .if defined(USE_RUBYGEMS) && !defined(RUBYGEM_AUTOPLIST)
165 DEV_ERROR+=     "USE_RUBYGEMS is no longer supported, please use USES=gem:noautoplist"
166 .endif
167
168 .if defined(RUBYGEM_AUTOPLIST)
169 DEV_ERROR+=     "RUBYGEM_AUTOPLIST is no longer supported, please use USES=gem"
170 .endif
171
172 SANITY_UNSUPPORTED=     USE_OPENAL USE_FAM USE_MAKESELF USE_ZIP USE_LHA USE_CMAKE \
173                 USE_READLINE USE_ICONV PERL_CONFIGURE PERL_MODBUILD \
174                 USE_PERL5_BUILD USE_PERL5_RUN USE_DISPLAY USE_FUSE \
175                 USE_GETTEXT USE_GMAKE USE_SCONS USE_DRUPAL NO_INSTALL_MANPAGES \
176                 INSTALLS_SHLIB USE_PYDISTUTILS PYTHON_CONCURRENT_INSTALL \
177                 PYDISTUTILS_AUTOPLIST PYTHON_PY3K_PLIST_HACK PYDISTUTILS_NOEGGINFO \
178                 USE_PYTHON_PREFIX USE_BZIP2 USE_XZ USE_PGSQL NEED_ROOT \
179                 UNIQUENAME LATEST_LINK USE_SQLITE USE_FIREBIRD USE_PHPEXT \
180                 USE_ZENDEXT USE_PHP_BUILD USE_BDB PLIST_DIRSTRY
181 SANITY_DEPRECATED=      PYTHON_PKGNAMESUFFIX USE_AUTOTOOLS \
182                         USE_MYSQL WANT_MYSQL_VER USE_OPENSSL \
183                         USE_PHPIZE WANT_PHP_CLI WANT_PHP_CGI WANT_PHP_MOD \
184                         WANT_PHP_WEB WANT_PHP_EMB
185 SANITY_NOTNEEDED=       WX_UNICODE
186
187 USE_AUTOTOOLS_ALT=      USES=autoreconf and GNU_CONFIGURE=yes
188 USE_OPENAL_ALT=         USES=openal
189 USE_FAM_ALT=            USES=fam
190 USE_MAKESELF_ALT=       USES=makeself
191 USE_ZIP_ALT=            USES=zip
192 USE_LHA_ALT=            USES=lha
193 USE_BZIP2_ALT=          USES=tar:bzip2
194 USE_XZ_ALT=             USES=tar:xz
195 USE_CMAKE_ALT=          USES=cmake
196 USE_READLINE_ALT=       USES=readline
197 USE_ICONV_ALT=          USES=iconv
198 USE_GMAKE_ALT=          USES=gmake
199 PERL_CONFIGURE_ALT=     USES=perl5 along with USE_PERL5=configure
200 PERL_MODBUILD_ALT=      USES=perl5 along with USE_PERL5=modbuild
201 USE_PERL5_BUILD_ALT=    USES=perl5 along with USE_PERL5=build
202 USE_PERL5_RUN_ALT=      USES=perl5 along with USE_PERL5=run
203 USE_DISPLAY_ALT=        USES=display
204 USE_FUSE_ALT=           USES=fuse
205 USE_GETTEXT_ALT=        USES=gettext
206 USE_SCONS_ALT=          USES=scons
207 USE_DRUPAL_ALT=         USES=drupal
208 USE_PYDISTUTILS_ALT=            USE_PYTHON=distutils
209 USE_PGSQL_ALT=          USES=pgsql
210 INSTALLS_SHLIB_ALT=     USE_LDCONFIG
211 NEED_ROOT_ALT=          USES=fakeroot or USES=uidfix
212 PYTHON_CONCURRENT_INSTALL_ALT=  USE_PYTHON=concurrent
213 PYDISTUTILS_AUTOPLIST_ALT=      USE_PYTHON=autoplist
214 PYTHON_PY3K_PLIST_HACK_ALT=     USE_PYTHON=py3kplist
215 PYDISTUTILS_NOEGGINFO_ALT=      USE_PYTHON=noegginfo
216 USE_PYTHON_PREFIX_ALT=          USE_PYTHON=pythonprefix
217 PYTHON_PKGNAMESUFFIX_ALT=       PYTHON_PKGNAMEPREFIX
218 NO_INSTALL_MANPAGES_ALT=        USES=imake:noman
219 UNIQUENAME_ALT=         PKGBASE
220 LATEST_LINK_ALT=        PKGBASE
221 WX_UNICODE_REASON=      Now no-op as only unicode is supported now
222 PLIST_DIRSTRY_ALT=      PLIST_DIRS
223 USE_SQLITE_ALT=         USES=sqlite
224 USE_FIREBIRD_ALT=       USES=firebird
225 USE_BDB_ALT=            USES=bdb:${USE_BDB}
226 USE_MYSQL_ALT=          USES=mysql:${USE_MYSQL}
227 WANT_MYSQL_VER_ALT=     USES=mysql:${WANT_MYSQL_VER}
228 USE_OPENSSL_ALT=        USES=ssl
229 USE_PHPIZE_ALT=         USES=php:phpize
230 USE_PHPEXT_ALT=         USES=php:ext
231 USE_ZENDEXT_ALT=        USES=php:zend
232 USE_PHP_BUILD_ALT=      USES=php:build
233 WANT_PHP_CLI_ALT=       USES=php:cli
234 WANT_PHP_CGI_ALT=       USES=php:cgi
235 WANT_PHP_MOD_ALT=       USES=php:mod
236 WANT_PHP_WEB_ALT=       USES=php:web
237 WANT_PHP_EMB_ALT=       USES=php:embed
238
239 .for a in ${SANITY_DEPRECATED}
240 .if defined(${a})
241 DEV_WARNING+=   "${a} is deprecated, please use ${${a}_ALT}"
242 .endif
243 .endfor
244
245 .for a in ${SANITY_NOTNEEDED}
246 .if defined(${a})
247 DEV_WARNING+=   "${a} is not needed: ${${a}_REASON}"
248 .endif
249 .endfor
250
251 .for a in ${SANITY_UNSUPPORTED}
252 .if defined(${a})
253 DEV_ERROR+=     "${a} is unsupported, please use ${${a}_ALT}"
254 .endif
255 .endfor