Add a WITHOUT_X11 knob and set PREFIX to LOCALBASE.

Submitted by:	MAINTAINER
This commit is contained in:
Akinori MUSHA 2001-09-24 07:39:17 +00:00
parent dc68b3063d
commit 81c7e61f5a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=48137
6 changed files with 122 additions and 28 deletions

View file

@ -7,6 +7,7 @@
PORTNAME= xmbmon
PORTVERSION= 106p1
PORTREVISION= 1
CATEGORIES= sysutils
MASTER_SITES= http://www.nt.phys.kyushu-u.ac.jp/shimizu/download/
DISTNAME= ${PORTNAME}${PORTVERSION:S/p/pl/}
@ -14,18 +15,40 @@ DISTNAME= ${PORTNAME}${PORTVERSION:S/p/pl/}
MAINTAINER= kaz@kobe1995.net
GNU_CONFIGURE= yes
USE_X_PREFIX= yes
DOCS= 00README.txt 00READMEj.txt DEBUG_Info xmbmon.resources
WITHOUT_X11?= no
.if (${WITHOUT_X11} == yes)
MAKE_ARGS+= WITHOUT_X11=yes DOCSDIR='$(DOCSDIR)' INSTALL_DATA='$(INSTALL_DATA)'
DOCS= 00README.txt 00READMEj.txt DEBUG_Info
PLIST_SUB= X11_ONLY="@comment "
.else
USE_XLIB= yes
MAKE_ARGS+= DOCSDIR='$(DOCSDIR)' INSTALL_DATA='$(INSTALL_DATA)'
PLIST_SUB= X11_ONLY=""
.endif
.include <bsd.port.pre.mk>
pre-extract:
@${ECHO}
@${ECHO} "set WITHOUT_X11 variable to 'yes' if you want to build without X11"
@${ECHO}
post-patch:
@${MV} -f ${WRKSRC}/Makefile.in ${WRKSRC}/Makefile.in.X
.if ${WITHOUT_X11} == yes
@${GREP} -v '^PROGRAM+=' ${WRKSRC}/Makefile.in.X | ${SED} 's/__DOCS__/$(DOCS)/' > ${WRKSRC}/Makefile.in
.else
@${SED} 's/__DOCS__/$(DOCS)/' ${WRKSRC}/Makefile.in.X > ${WRKSRC}/Makefile.in
.endif
@${RM} -f ${WRKSRC}/Makefile.in.X
post-install:
.if !defined(NOPORTDOCS)
${MKDIR} ${DOCSDIR}
.for f in ${DOCS}
${INSTALL_DATA} ${WRKSRC}/${f} ${DOCSDIR}/
.endfor
(cd ${WRKSRC}; ${MAKE} ${MAKE_ARGS} install-doc)
.endif
.include <bsd.port.post.mk>

View file

@ -1,11 +1,10 @@
--- Makefile.in.orig Tue Aug 28 05:43:05 2001
+++ Makefile.in Tue Sep 4 02:18:09 2001
@@ -12,9 +12,10 @@
+++ Makefile.in Wed Sep 19 19:39:43 2001
@@ -12,9 +12,9 @@
DEFS=-DHAVE_CONFIG_H
-LIBDIR=/usr/X11R6/lib
+X11BASE?=/usr/X11R6
+LIBDIR=$(X11BASE)/lib
INCDIR=.
-XINCDIR=/usr/X11R6/include
@ -13,7 +12,7 @@
XLIB=-lXaw -lXmu
EXTENSIONLIB=-lXext
INCLUDES=-I$(INCDIR)
@@ -22,9 +23,9 @@
@@ -22,9 +22,9 @@
LIBS=-L$(LIBDIR) -lXaw $(XLIB) -lXt $(EXTENSIONLIB) -lX11 -lm
#CC=/compat/linux/usr/bin/gcc
@ -26,16 +25,41 @@
LDFLAGS=-s
LINT=lint
@@ -33,9 +34,9 @@
@@ -33,14 +33,16 @@
RM=rm -f
INSTALL=install
-INST_DIR=/usr/local/bin
-INST_XDIR=/usr/X11R6/bin
-INST_XRDIR=/usr/X11R6/lib/X11/app-defaults
+INST_DIR=$(X11BASE)/bin
+INST_XDIR=$(X11BASE)/bin
+INST_DIR=$(PREFIX)/bin
+INST_XDIR=$(PREFIX)/bin
+INST_XRDIR=$(X11BASE)/lib/X11/app-defaults
.c.o:
$(CC) -c $(CFLAGS) $*.c
-PROGRAM = mbmon xmbmon testpci testsmb testhwm testfan
+PROGRAM = mbmon testpci testsmb testhwm testfan
+DOCS= __DOCS__
+PROGRAM+= xmbmon
all: $(PROGRAM)
@@ -69,8 +71,14 @@
$(RM) Makefile config.cache config.log config.h config.status
install: $(PROGRAM)
- $(INSTALL) -o root -g wheel -m 4555 -c -p mbmon $(INST_DIR)
- $(INSTALL) -o root -g wheel -m 4555 -c -p xmbmon $(INST_XDIR)
+ @for i in $(PROGRAM); do \
+ $(INSTALL) -o root -g wheel -m 4555 -c -p $$i $(INST_DIR); \
+ done
lint:
$(LINT) $(INCLUDES) $(DEFS) $(FONTDEFINES) $(SRCS) -lm
+
+install-doc: $(DOCS)
+ @for f in $(DOCS); do \
+ $(INSTALL_DATA) $$f $(DOCSDIR)/; \
+ done

View file

@ -1,7 +1,7 @@
bin/mbmon
bin/xmbmon
%%X11_ONLY%%bin/xmbmon
%%PORTDOCS%%share/doc/xmbmon/00README.txt
%%PORTDOCS%%share/doc/xmbmon/00READMEj.txt
%%PORTDOCS%%share/doc/xmbmon/DEBUG_Info
%%PORTDOCS%%share/doc/xmbmon/xmbmon.resources
%%X11_ONLY%%%%PORTDOCS%%share/doc/xmbmon/xmbmon.resources
%%PORTDOCS%%@dirrm share/doc/xmbmon

View file

@ -7,6 +7,7 @@
PORTNAME= xmbmon
PORTVERSION= 106p1
PORTREVISION= 1
CATEGORIES= sysutils
MASTER_SITES= http://www.nt.phys.kyushu-u.ac.jp/shimizu/download/
DISTNAME= ${PORTNAME}${PORTVERSION:S/p/pl/}
@ -14,18 +15,40 @@ DISTNAME= ${PORTNAME}${PORTVERSION:S/p/pl/}
MAINTAINER= kaz@kobe1995.net
GNU_CONFIGURE= yes
USE_X_PREFIX= yes
DOCS= 00README.txt 00READMEj.txt DEBUG_Info xmbmon.resources
WITHOUT_X11?= no
.if (${WITHOUT_X11} == yes)
MAKE_ARGS+= WITHOUT_X11=yes DOCSDIR='$(DOCSDIR)' INSTALL_DATA='$(INSTALL_DATA)'
DOCS= 00README.txt 00READMEj.txt DEBUG_Info
PLIST_SUB= X11_ONLY="@comment "
.else
USE_XLIB= yes
MAKE_ARGS+= DOCSDIR='$(DOCSDIR)' INSTALL_DATA='$(INSTALL_DATA)'
PLIST_SUB= X11_ONLY=""
.endif
.include <bsd.port.pre.mk>
pre-extract:
@${ECHO}
@${ECHO} "set WITHOUT_X11 variable to 'yes' if you want to build without X11"
@${ECHO}
post-patch:
@${MV} -f ${WRKSRC}/Makefile.in ${WRKSRC}/Makefile.in.X
.if ${WITHOUT_X11} == yes
@${GREP} -v '^PROGRAM+=' ${WRKSRC}/Makefile.in.X | ${SED} 's/__DOCS__/$(DOCS)/' > ${WRKSRC}/Makefile.in
.else
@${SED} 's/__DOCS__/$(DOCS)/' ${WRKSRC}/Makefile.in.X > ${WRKSRC}/Makefile.in
.endif
@${RM} -f ${WRKSRC}/Makefile.in.X
post-install:
.if !defined(NOPORTDOCS)
${MKDIR} ${DOCSDIR}
.for f in ${DOCS}
${INSTALL_DATA} ${WRKSRC}/${f} ${DOCSDIR}/
.endfor
(cd ${WRKSRC}; ${MAKE} ${MAKE_ARGS} install-doc)
.endif
.include <bsd.port.post.mk>

View file

@ -1,11 +1,10 @@
--- Makefile.in.orig Tue Aug 28 05:43:05 2001
+++ Makefile.in Tue Sep 4 02:18:09 2001
@@ -12,9 +12,10 @@
+++ Makefile.in Wed Sep 19 19:39:43 2001
@@ -12,9 +12,9 @@
DEFS=-DHAVE_CONFIG_H
-LIBDIR=/usr/X11R6/lib
+X11BASE?=/usr/X11R6
+LIBDIR=$(X11BASE)/lib
INCDIR=.
-XINCDIR=/usr/X11R6/include
@ -13,7 +12,7 @@
XLIB=-lXaw -lXmu
EXTENSIONLIB=-lXext
INCLUDES=-I$(INCDIR)
@@ -22,9 +23,9 @@
@@ -22,9 +22,9 @@
LIBS=-L$(LIBDIR) -lXaw $(XLIB) -lXt $(EXTENSIONLIB) -lX11 -lm
#CC=/compat/linux/usr/bin/gcc
@ -26,16 +25,41 @@
LDFLAGS=-s
LINT=lint
@@ -33,9 +34,9 @@
@@ -33,14 +33,16 @@
RM=rm -f
INSTALL=install
-INST_DIR=/usr/local/bin
-INST_XDIR=/usr/X11R6/bin
-INST_XRDIR=/usr/X11R6/lib/X11/app-defaults
+INST_DIR=$(X11BASE)/bin
+INST_XDIR=$(X11BASE)/bin
+INST_DIR=$(PREFIX)/bin
+INST_XDIR=$(PREFIX)/bin
+INST_XRDIR=$(X11BASE)/lib/X11/app-defaults
.c.o:
$(CC) -c $(CFLAGS) $*.c
-PROGRAM = mbmon xmbmon testpci testsmb testhwm testfan
+PROGRAM = mbmon testpci testsmb testhwm testfan
+DOCS= __DOCS__
+PROGRAM+= xmbmon
all: $(PROGRAM)
@@ -69,8 +71,14 @@
$(RM) Makefile config.cache config.log config.h config.status
install: $(PROGRAM)
- $(INSTALL) -o root -g wheel -m 4555 -c -p mbmon $(INST_DIR)
- $(INSTALL) -o root -g wheel -m 4555 -c -p xmbmon $(INST_XDIR)
+ @for i in $(PROGRAM); do \
+ $(INSTALL) -o root -g wheel -m 4555 -c -p $$i $(INST_DIR); \
+ done
lint:
$(LINT) $(INCLUDES) $(DEFS) $(FONTDEFINES) $(SRCS) -lm
+
+install-doc: $(DOCS)
+ @for f in $(DOCS); do \
+ $(INSTALL_DATA) $$f $(DOCSDIR)/; \
+ done

View file

@ -1,7 +1,7 @@
bin/mbmon
bin/xmbmon
%%X11_ONLY%%bin/xmbmon
%%PORTDOCS%%share/doc/xmbmon/00README.txt
%%PORTDOCS%%share/doc/xmbmon/00READMEj.txt
%%PORTDOCS%%share/doc/xmbmon/DEBUG_Info
%%PORTDOCS%%share/doc/xmbmon/xmbmon.resources
%%X11_ONLY%%%%PORTDOCS%%share/doc/xmbmon/xmbmon.resources
%%PORTDOCS%%@dirrm share/doc/xmbmon