Pullup ticket #2676 - requested by hira
[pkgsrc.git] / mk / fuse.buildlink3.mk
1 # $NetBSD: fuse.buildlink3.mk,v 1.7 2007/03/06 00:03:40 xtraeme Exp $
2 #
3 # Makefile fragment for packages using the FUSE framework.
4 #
5
6 .if !defined(FUSE_BUILDLINK3_MK)
7 FUSE_BUILDLINK3_MK=     # defined
8
9 .include "bsd.fast.prefs.mk"
10
11 .  if ${OPSYS} == "Linux"
12
13 .    include "../../filesystems/fuse/buildlink3.mk"
14
15 .  elif ${OPSYS} == "NetBSD"
16 .     if !exists(/usr/include/fuse.h)
17 PKG_FAIL_REASON+=       "Couldn't find fuse headers, please install librefuse."
18 .     endif
19
20 .    if !empty(USE_TOOLS:C/:.*//:Mpkg-config)
21 do-configure-pre-hook: override-fuse-pkgconfig
22
23 BLKDIR_PKGCFG=  ${BUILDLINK_DIR}/lib/pkgconfig
24 FUSE_PKGCFGF=   fuse.pc
25
26 override-fuse-pkgconfig: override-message-fuse-pkgconfig
27 override-message-fuse-pkgconfig:
28         @${STEP_MSG} "Magical transformations for fuse on NetBSD."
29
30 override-fuse-pkgconfig:
31         ${_PKG_SILENT}${_PKG_DEBUG}set -e;              \
32         ${MKDIR} ${BLKDIR_PKGCFG};                      \
33         {                                               \
34         ${ECHO} "prefix=/usr";                          \
35         ${ECHO} "exec_prefix=\$${prefix}";              \
36         ${ECHO} "libdir=\$${exec_prefix}/lib";          \
37         ${ECHO} "includedir=\$${prefix}/include";       \
38         ${ECHO} "";                                     \
39         ${ECHO} "Name: FuSE";                           \
40         ${ECHO} "Description: Filesystem USEr Space";   \
41         ${ECHO} "Version: 2.6.0";                       \
42         ${ECHO} "Libs: -Wl,-R\$${libdir} -L\$${libdir} -lrefuse";       \
43         ${ECHO} "Cflags: -I\$${includedir}";            \
44         } >> ${BLKDIR_PKGCFG}/${FUSE_PKGCFGF};
45
46 .    endif # pkg-config
47
48 # To make sure
49 BUILDLINK_TRANSFORM+=   l:fuse:refuse
50
51 # Undefined reference to fuse_main()... use fuse_exit() for now.
52 .    if defined(GNU_CONFIGURE)
53 SUBST_CLASSES+=         refuse
54 SUBST_STAGE.refuse=     pre-configure
55 SUBST_FILES.refuse=     configure
56 .      for _f_ in configure.in configure.ac
57 .        if exists(${WRKSRC}/${_f_})
58 SUBST_FILES.refuse+=    ${_f_}
59 .        endif
60 .      endfor
61 SUBST_SED.refuse=       -e "s|fuse_main|fuse_exit|g"
62 .    endif
63
64 .  else # !NetBSD
65
66 PKG_FAIL_REASON+=       "Your OS is not supported by the FUSE pkgsrc framework."
67
68 .  endif # end of Operating Systems
69
70 .endif # FUSE_BUILDLINK3_MK