1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-05 06:27:37 +00:00

make the plugin ports be able to depend on ${GKRELLM_SERVER_ONLY}

to install server-only plugins:

- install all gkrellmd-related files to ${PREFIX} instead of
  ${X11BASE}.
- generates a gkrellmd.pc file for use with ports that install
  server-only plugins.
- glib20 is chosen over glib12 for server-only build.

PR:		ports/82197
Submitted by:	Jonathan Noack <noackjr__at__alumni.rice.edu>
This commit is contained in:
Hajimu UMEMOTO 2005-11-04 19:20:01 +00:00
parent da5e912e2a
commit b7ed2603c5
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=147225
4 changed files with 76 additions and 16 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= gkrellm
PORTVERSION= 2.2.7
#PORTREVISION= 0
PORTREVISION= 1
CATEGORIES= sysutils ipv6
MASTER_SITES= http://members.dslextreme.com/users/billw/gkrellm/ \
${MASTER_SITE_LOCAL}
@ -37,7 +37,7 @@ WITH_GNUTLS= yes
.if defined(GKRELLM_SERVER_ONLY)
BUILD_WRKSRC= ${WRKSRC}/server
INSTALL_WRKSRC= ${WRKSRC}/server
USE_GNOME= glib12
USE_GNOME= glib20
.else
USE_GNOME= gtk20
.if defined(WITHOUT_NLS)
@ -60,6 +60,7 @@ MAKE_ENV+= without-gnutls=1 without-ssl=1
USE_BZIP2= yes
USE_GMAKE= yes
USE_REINPLACE= yes
PLIST_SUB= PREFIX=${PREFIX}
.if defined(GKRELLM_SERVER_ONLY)
@ -90,12 +91,12 @@ ALL_TARGET= freebsd
.endif
INSTALL_TARGET= install_freebsd
MAKE_ENV+= INSTALLROOT=${X11BASE} SINSTALLDIR=${PREFIX}/sbin \
MAKE_ENV+= INSTALLROOT=${X11BASE} INSTALLDIR=${X11BASE}/bin \
PKGCONFIGDIR=${X11BASE}/libdata/pkgconfig \
MANDIR=${MAN1PREFIX}/man/man1 SMANDIR=${MANPREFIX}/man/man8
.if defined(GKRELLM_SERVER_ONLY)
MAKE_ENV+= glib12=1
.endif
SINSTALLROOT=${PREFIX} SINSTALLDIR=${PREFIX}/sbin \
SPKGCONFIGDIR=${PREFIX}/libdata/pkgconfig \
MANDIR=${MAN1PREFIX}/man/man1 SMANDIR=${MANPREFIX}/man/man8 \
VERSION=${PORTVERSION}
CFLAGS+= -DSYSTEM_THEMES_DIR='\"${X11BASE}/share/gkrellm2/themes\"' \
-DSYSTEM_PLUGINS_DIR='\"${X11BASE}/libexec/gkrellm2/plugins\"' \
@ -109,6 +110,12 @@ pre-everything::
@${ECHO_MSG} ""
.endif
post-patch:
@${REINPLACE_CMD} -e 's/INCLUDEDIR/SINCLUDEDIR/g' \
-e 's/INSTALLROOT/SINSTALLROOT/g' \
-e 's/PKGCONFIGDIR/SPKGCONFIGDIR/g' \
${WRKSRC}/server/Makefile
post-install:
.if !defined(GKRELLM_SERVER_ONLY)
@${MKDIR} ${X11BASE}/libexec/gkrellm2/plugins

View File

@ -4,7 +4,7 @@ diff -u gkrellmd.1.orig gkrellmd.1
+++ gkrellmd.1 Tue Apr 13 17:14:02 2004
@@ -1,4 +1,4 @@
-.TH gkrellmd 1 "June 7, 2003" "GNU/Linux" "User's Manual"
+.TH gkrellmd 1 "June 7, 2003" "FreeBSD" "User's Manual"
+.TH gkrellmd 8 "June 7, 2003" "FreeBSD" "User's Manual"
.SH "NAME"
gkrellmd \- The GNU Krell Monitors Server

View File

@ -1,8 +1,14 @@
Index: server/Makefile
diff -u server/Makefile.orig server/Makefile
--- server/Makefile.orig Mon Apr 12 22:30:48 2004
+++ server/Makefile Tue Apr 13 14:15:40 2004
@@ -27,18 +27,18 @@
--- server/Makefile.orig Mon Apr 12 08:30:48 2004
+++ server/Makefile Mon Jun 13 07:45:44 2005
@@ -18,6 +18,7 @@
MANMODE ?= 644
MANDIRMODE ?= 755
INSTALL ?= install
+PKGCONFIGDIR ?= $(INSTALLROOT)/lib/pkgconfig
LINK_FLAGS ?= -Wl,-E
CC ?= gcc
STRIP ?= -s
@@ -27,18 +28,18 @@
PKG_INCLUDE = `$(PKG_CONFIG) --cflags glib-2.0 gthread-2.0`
PKG_LIB = `$(PKG_CONFIG) --libs glib-2.0 gmodule-2.0 gthread-2.0`
@ -27,7 +33,35 @@ diff -u server/Makefile.orig server/Makefile
LIBS = $(PKG_LIB) $(GTOP_LIBS_D) $(SYS_LIBS)
ifeq ($(glib12),1)
@@ -133,7 +133,7 @@
@@ -87,10 +88,18 @@
all: gkrellmd
-gkrellmd: $(OBJS)
+gkrellmd.pc: Makefile
+ echo "prefix=$(INSTALLROOT)" > gkrellmd.pc
+ echo "Name: GKrellMd" >> gkrellmd.pc
+ echo "Description: Extensible GLIB system monitoring application server" >> gkrellmd.pc
+ echo "Version: $(VERSION)" >> gkrellmd.pc
+ echo "Requires: glib-2.0" >> gkrellmd.pc
+ echo "Cflags: -I$(INCLUDEDIR)" >> gkrellmd.pc
+
+gkrellmd: gkrellmd.pc $(OBJS)
$(CC) $(OBJS) -o gkrellmd $(LIBS) $(LINK_FLAGS)
-static: $(OBJS)
+static: gkrellmd.pc $(OBJS)
$(CC) $(OBJS) -o gkrellmd.static -static \
$(LIBS) $(LINK_FLAGS)
@@ -127,17 +136,22 @@
LINK_FLAGS="" gkrellmd
endif
-install:
+install: install_gkrellmd.pc
$(INSTALL) -d -m $(INSTALLDIRMODE) $(SINSTALLDIR)
$(INSTALL) -c $(STRIP) -m $(BINMODE) gkrellmd $(SINSTALLDIR)/$(PACKAGE_D)
$(INSTALL) -d -m $(INCLUDEDIRMODE) $(INCLUDEDIR)/gkrellm2
$(INSTALL) -c -m $(INCLUDEMODE) $(GKRELLMD_INCLUDES) $(INCLUDEDIR)/gkrellm2
$(INSTALL) -d -m $(MANDIRMODE) $(SMANDIR)
@ -36,3 +70,20 @@ diff -u server/Makefile.orig server/Makefile
uninstall:
rm -f $(SINSTALLDIR)/$(PACKAGE_D)
rm -f $(SMANDIR)/$(PACKAGE_D).1
+ rm -f $(PKGCONFIGDIR)/gkrellmd.pc
+
+install_gkrellmd.pc:
+ $(INSTALL) -d $(PKGCONFIGDIR)
+ $(INSTALL) -c -m $(INCLUDEMODE) gkrellmd.pc $(PKGCONFIGDIR)
install_darwin:
$(MAKE) install STRIP=
@@ -162,6 +176,7 @@
clean:
rm -f *.o *~ *.bak gkrellmd core
+ rm -f gkrellmd.pc
SYSDEPS = ../src/sysdeps/bsd-common.c ../src/sysdeps/bsd-net-open.c \
../src/sysdeps/freebsd.c ../src/sysdeps/gtop.c \

View File

@ -1,3 +1,6 @@
include/gkrellm2/gkrellmd.h
@dirrm include/gkrellm2
libdata/pkgconfig/gkrellmd.pc
sbin/gkrellmd
@exec mkdir -p %D/libexec/gkrellm2/plugins-gkrellmd
@unexec rmdir %D/libexec/gkrellm2/plugins-gkrellmd 2>/dev/null || true
@ -9,8 +12,7 @@ sbin/gkrellmd
@cwd %%X11BASE%%
%%CLIENT%%include/gkrellm2/gkrellm.h
%%CLIENT%%include/gkrellm2/gkrellm-public-proto.h
include/gkrellm2/gkrellmd.h
@dirrm include/gkrellm2
%%CLIENT%%@dirrm include/gkrellm2
%%CLIENT%%man/man1/gkrellm.1.gz
%%CLIENT%%@unexec rm -f %D/man/cat1/gkrellm.1 %D/man/cat1/gkrellm.1.gz
%%CLIENT%%bin/gkrellm