Add files from parent branch HEAD:
[pkgsrcv2.git] / sysutils / libgtop / Makefile
1 # $NetBSD: Makefile,v 1.28 2009/08/27 20:03:17 ahoka Exp $
2
3 DISTNAME=               libgtop-2.28.0
4 CATEGORIES=             sysutils gnome
5 MASTER_SITES=           ${MASTER_SITE_GNOME:=sources/libgtop/2.28/}
6 EXTRACT_SUFX=           .tar.bz2
7
8 MAINTAINER=             pkgsrc-users@NetBSD.org
9 HOMEPAGE=               http://www.gnome.org/
10 COMMENT=                Library to retrieve system information, used in GNOME2
11
12 PKG_DESTDIR_SUPPORT=    destdir
13
14 OSVERSION_SPECIFIC=     YES
15
16 GNU_CONFIGURE=          YES
17 INFO_FILES=             YES
18 PKGCONFIG_OVERRIDE=     libgtop-2.0.pc.in
19 TEXINFO_REQD=           4.6
20 USE_LIBTOOL=            YES
21 USE_PKGLOCALEDIR=       YES
22 USE_TOOLS+=             gmake makeinfo msgfmt perl pkg-config intltool
23
24 CONFIGURE_ARGS+=        --enable-gtk-doc
25 CONFIGURE_ARGS+=        --without-x
26 CONFIGURE_ENV+=         LN_S="${LN} -s"
27
28 CONFLICTS+=             libgtop2-[0-9]*
29
30 post-patch:
31         ${CP} ${FILESDIR}/procaffinity.c ${WRKSRC}/sysdeps/bsd/
32
33 # The following flags are for debugging purposes.  They don't need to
34 # be used unless you are actively developing/debugging libgtop.
35 #CPPFLAGS+=             -DLIBGTOP_ENABLE_DEBUG -DLIBGTOP_FATAL_WARNINGS
36 #CFLAGS+=               -g
37 #LDFLAGS+=              -g
38
39 PRINT_PLIST_AWK+=       /^bin\/libgtop_server2$$/ \
40                                 { print "$${LIBGTOP_SERVER}" $$0; next }
41 PRINT_PLIST_AWK+=       /^include\/libgtop-2.0\/glibtop_suid.h$$/ \
42                                 { print "$${LIBGTOP_SUID_H}" $$0; next }
43
44 .include "../../mk/bsd.prefs.mk"
45
46 .if ${OPSYS} == NetBSD
47 CONFIGURE_ENV+= fu_cv_sys_mounted_getmntinfo=yes
48 .endif
49
50 PLIST_VARS+=    server suid.h
51 .if ${OPSYS} == "Linux"
52 #               nothing
53 .elif ${OPSYS} == "SunOS"
54 PLIST.server=   yes
55 .else
56 PLIST.server=   yes
57 PLIST.suid.h=   yes
58 .endif
59
60 .if defined(PLIST.server)
61 post-install:
62         ${CHMOD} g+s ${DESTDIR}${PREFIX}/bin/libgtop_server2
63 .endif
64
65 PLIST_VARS+=    glibtop_private.h
66 .if ${OPSYS} == "SunOS" || ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly"
67 PLIST.glibtop_private.h= yes
68 .endif
69
70 # XXX This needs a check in the configure script, which should be clean
71 # enough to be integrated in the mainstream sources.
72 statvfs_h=      /usr/include/sys/statvfs.h
73 .if exists(${statvfs_h})
74 reads_count!=   if ${GREP} f_syncreads ${statvfs_h} >/dev/null; then \
75                 ${ECHO} yes; else ${ECHO} no; fi
76 .  if ${reads_count} == "yes"
77 CPPFLAGS+=      -DHAVE_STATVFS_READS_COUNT
78 .  endif
79 .  undef reads_count
80
81 writes_count!=  if ${GREP} f_syncwrites ${statvfs_h} >/dev/null; then \
82                 ${ECHO} yes; else ${ECHO} no; fi
83 .  if ${writes_count} == "yes"
84 CPPFLAGS+=      -DHAVE_STATVFS_WRITES_COUNT
85 .  endif
86 .  undef writes_count
87 .endif
88 .undef statvfs_h
89
90 .include "../../devel/gettext-lib/buildlink3.mk"
91 BUILDLINK_API_DEPENDS.glib2+=   glib2>=2.6.0
92 .include "../../devel/glib2/buildlink3.mk"
93 .include "../../textproc/gtk-doc/buildlink3.mk"
94 .include "../../x11/libXau/buildlink3.mk"
95 .include "../../mk/bsd.pkg.mk"