o hide some pre- and post- install commands

o add an INSTALL script to install /etc/wgetrc if necessary
o remove wgetrc install code from Makefile and packing list
o call install script from Makefile
o patch wget doc Makefile so it does NOT install into /etc automagically
o add DEINSTALL script to remind user to get rid of /etc/wgetrc
THIS PORT IS NOW FROZEN FOR 2.5
This commit is contained in:
marc 1999-04-10 02:50:54 +00:00
parent 74c82e5449
commit 49383b9b53
6 changed files with 152 additions and 21 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.7 1999/03/31 23:39:55 brad Exp $
# $OpenBSD: Makefile,v 1.8 1999/04/10 02:50:54 marc Exp $
DISTNAME= wget-1.5.3
CATEGORIES= net
@ -14,25 +14,14 @@ CONFIGURE_ENV= CPPFLAGS="-I/usr/local/include" \
LDFLAGS="-L/usr/local/lib"
pre-configure:
${RM} ${WRKSRC}/doc/wget.info*
@${RM} ${WRKSRC}/doc/wget.info*
post-install:
if [ ! -f ${PREFIX}/info/dir ]; then \
@if [ ! -f ${PREFIX}/info/dir ]; then \
sed -ne '1,/Menu:/p' /usr/share/info/dir > ${PREFIX}/info/dir; \
fi
@install-info ${PREFIX}/info/wget.info ${PREFIX}/info/dir
@${MKDIR} ${PREFIX}/lib/wget
@${INSTALL_DATA} ${WRKSRC}/doc/sample.wgetrc ${PREFIX}/lib/wget/wgetrc.sample
@${ECHO} ""
@${ECHO} "*** The latest version of the wgetrc file"
@${ECHO} "*** can be found in ${PREFIX}/lib/wget"
@if [ -f /etc/wgetrc ]; then \
${ECHO} "*** Your /etc/wgetrc has NOT been changed"; \
else \
cp ${PREFIX}/lib/wget/wgetrc.sample /etc; \
${ECHO} "*** wgetrc has been copied into /etc"; \
fi
@${ECHO} ""
@PKG_PREFIX="${PREFIX}" ${SH} ${PKGDIR}/INSTALL ${DISTNAME} POST-INSTALL
.include <bsd.port.mk>

View File

@ -1,5 +1,5 @@
--- doc/Makefile.in.orig Mon Mar 29 15:48:31 1999
+++ doc/Makefile.in Mon Mar 29 15:48:42 1999
--- doc/Makefile.in.orig Sat May 23 19:40:42 1998
+++ doc/Makefile.in Fri Apr 9 18:49:50 1999
@@ -22,7 +22,7 @@
SHELL = /bin/sh
@ -9,3 +9,34 @@
# Program to format Texinfo source into DVI files.
TEXI2DVI = texi2dvi
# Program to convert DVI files to PostScript
@@ -45,7 +45,7 @@
RM = rm -f
MAN = wget.$(manext)
-WGETRC = $(sysconfdir)/wgetrc
+WGETRCDIR = $(prefix)/lib/wget
#
# Dependencies for building
@@ -99,19 +99,8 @@
# install sample.wgetrc
install.wgetrc:
- $(top_srcdir)/mkinstalldirs $(sysconfdir)
- @if test -f $(WGETRC); then \
- if cmp -s $(srcdir)/sample.wgetrc $(WGETRC); then echo ""; \
- else \
- echo ' $(INSTALL_DATA) $(srcdir)/sample.wgetrc $(WGETRC).new'; \
- $(INSTALL_DATA) $(srcdir)/sample.wgetrc $(WGETRC).new; \
- echo "WARNING: File \`$(WGETRC)' already exists and is spared."; \
- echo " You might want to consider \`$(WGETRC).new',"; \
- echo " and merge both into \`$(WGETRC)', for the best."; \
- fi; \
- else \
- $(INSTALL_DATA) $(srcdir)/sample.wgetrc $(WGETRC); \
- fi
+ $(top_srcdir)/mkinstalldirs $(WGETRCDIR)
+ $(INSTALL_DATA) $(srcdir)/sample.wgetrc $(WGETRCDIR);
# uninstall info pages
uninstall.info:

20
net/wget/patches/patch-ac Normal file
View File

@ -0,0 +1,20 @@
--- doc/sample.wgetrc.~1~ Thu Feb 13 17:16:18 1997
+++ doc/sample.wgetrc Fri Apr 9 18:43:05 1999
@@ -7,7 +7,7 @@
## not contain a comprehensive list of commands -- look at the manual
## to find out what you can put into this file.
##
-## Wget initialization file can reside in /usr/local/etc/wgetrc
+## Wget initialization file can reside in /etc/wgetrc
## (global, for all users) or $HOME/.wgetrc (for a single user).
##
## To use any of the settings in this file, you will have to uncomment
@@ -15,7 +15,7 @@
##
-## Global settings (useful for setting up in /usr/local/etc/wgetrc).
+## Global settings (useful for setting up in /etc/wgetrc).
## Think well before you change them, since they may reduce wget's
## functionality, and make it behave contrary to the documentation:
##

24
net/wget/pkg/DEINSTALL Normal file
View File

@ -0,0 +1,24 @@
# $OpenBSD: DEINSTALL,v 1.1 1999/04/10 02:50:54 marc Exp $
#
# wget de-installation
set -e
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PREFIX=${PKG_PREFIX:-/usr/local}
CONFIG_FILE=/etc/wgetrc
if [ -f ${CONFIG_FILE} ]; then
echo
echo "+---------------"
echo "| To completely deinstall the $1 package you need to perform"
echo "| this step as root:"
echo "|"
echo "| rm -f ${CONFIG_FILE}"
echo "|"
echo "| Do not do this if you plan on re-installing $1"
echo "| at some future time."
echo "+---------------"
echo
fi
exit 0

68
net/wget/pkg/INSTALL Normal file
View File

@ -0,0 +1,68 @@
#!/bin/sh
# $OpenBSD: INSTALL,v 1.1 1999/04/10 02:50:54 marc Exp $
#
# Pre/post-installation setup of wget
# exit on errors, use a sane path and install prefix
#
set -e
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PREFIX=${PKG_PREFIX:-/usr/local}
CONFIG_FILE=/etc/wgetrc
# Function: tell the user what s/he needs to do to use the port just installed
#
do_notice()
{
echo
echo "+---------------"
echo "| The existing $1 configuration file, ${CONFIG_FILE},"
echo "| has NOT been changed. You may want to compare it to the"
echo "| current sample file, ${PREFIX}/lib/wget/sample.wgetrc,"
echo "| and update your configuration as needed."
echo "+---------------"
echo
}
# Function: install the system wgetrc from the sample
#
do_install()
{
cp ${PREFIX}/lib/wget/sample.wgetrc ${CONFIG_FILE}
echo
echo "+---------------"
echo "| The $1 configuration file, ${CONFIG_FILE},"
echo "| has been installed. Please view this file and change"
echo "| the configuration to meet your needs"
echo "+---------------"
echo
}
# verify proper execution
#
if [ $# -ne 2 ]; then
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
exit 1
fi
# Verify/process the command
#
case $2 in
PRE-INSTALL)
: nothing to pre-install for this port
;;
POST-INSTALL)
if [ -f $CONFIG_FILE ]; then
do_notice $1
else
do_install $1
fi
;;
*)
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
exit 1
;;
esac
exit 0

View File

@ -1,14 +1,13 @@
bin/wget
@unexec install-info --delete %D/info/wget.info %D/info/dir
info/wget.info
lib/wget/wgetrc.sample
@exec if [ ! -f /etc/wgetrc ]; then cp %D/%F /etc/wgetrc; fi
@exec [ -f %D/info/dir ] || sed -ne '1,/Menu:/p' /usr/share/info/dir > %D/info/dir
@exec install-info %D/info/wget.info %D/info/dir
lib/wget/sample.wgetrc
share/locale/cs/LC_MESSAGES/wget.mo
share/locale/de/LC_MESSAGES/wget.mo
share/locale/hr/LC_MESSAGES/wget.mo
share/locale/it/LC_MESSAGES/wget.mo
share/locale/no/LC_MESSAGES/wget.mo
share/locale/pt_BR/LC_MESSAGES/wget.mo
@exec [ -f %D/info/dir ] || sed -ne '1,/Menu:/p' /usr/share/info/dir > %D/info/dir
@exec install-info %D/info/wget.info %D/info/dir
@dirrm lib/wget