Sync Mk with ports
[dports.git] / Mk / Uses / samba.mk
1 # Handle dependency on samba
2 #
3 # Feature:      samba
4 # Usage:        USES=samba or USES=samba:ARGS
5 # Valid ARGS:   build, env, lib, run
6 #               default is build,run (implicit)
7 #
8 # When subpackages are available this can be more granular
9 #
10
11 .if !defined(_INCLUDE_USES_SAMBA_MK)
12 _INCLUDE_USES_SAMBA_MK=   yes
13
14 .  if !${samba_ARGS}
15 samba_ARGS=     build run
16 .  endif
17
18 .  if ${samba_ARGS:Nbuild:Nenv:Nlib:Nrun}
19 IGNORE=         USES=samba has invalid arguments: ${samba_ARGS:Nbuild:Nenv:Nlib:Nrun}
20 .  endif
21
22 SAMBAPORT=      net/samba${SAMBA_DEFAULT:S/.//}
23 SAMBAINCLUDES=  ${LOCALBASE}/include/samba4
24 .  if ${SAMBA_DEFAULT} == 4.13 || ${SAMBA_DEFAULT} == 4.16
25 SAMBALIBS=      ${LOCALBASE}/lib/samba4
26 .  else
27 IGNORE=         Invalid version of samba: ${SAMBA_DEFAULT}
28 .  endif
29
30 .  if ${samba_ARGS:Mbuild}
31 BUILD_DEPENDS+= smbd:${SAMBAPORT}
32 .  endif
33 .  if ${samba_ARGS:Mlib}
34 LIB_DEPENDS+=   libsmbclient.so:${SAMBAPORT}
35 .  endif
36 .  if ${samba_ARGS:Mrun}
37 RUN_DEPENDS+=   smbd:${SAMBAPORT}
38 .  endif
39
40 .endif