From 19577f03fbda85cc282b28b6a01b1bb7f13dbbd0 Mon Sep 17 00:00:00 2001 From: knu Date: Tue, 14 Jan 2003 11:10:07 +0000 Subject: Attempt to preserve lib/charset.alias and share/locale/locale.alias before installation and restore them after deinstallation. Submitted by: bento --- databases/namazu2/Makefile | 4 ++++ databases/namazu2/pkg-deinstall | 29 +++++++++++++++++++++++++++++ databases/namazu2/pkg-install | 30 ++++++++++++++++++++++++++++++ databases/namazu2/pkg-plist | 4 ++++ 4 files changed, 67 insertions(+) create mode 100644 databases/namazu2/pkg-deinstall create mode 100644 databases/namazu2/pkg-install diff --git a/databases/namazu2/Makefile b/databases/namazu2/Makefile index 9edd4ab75905..1a53c302899c 100644 --- a/databases/namazu2/Makefile +++ b/databases/namazu2/Makefile @@ -34,7 +34,11 @@ INSTALLS_SHLIB= yes post-configure: ${PERL} -i~ -pe 's,^(LIBS *= *)(.*),$$1 -L${LOCALBASE}/lib -lintl $$2\n,' ${WRKSRC}/nmz/Makefile +pre-install: + @${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGDIR}/pkg-install ${PKGNAME} PRE-INSTALL + post-install: + @${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGDIR}/pkg-install ${PKGNAME} POST-INSTALL .if defined(NOPORTDOCS) ${RM} -rf ${PREFIX}/share/namazu/doc .endif diff --git a/databases/namazu2/pkg-deinstall b/databases/namazu2/pkg-deinstall new file mode 100644 index 000000000000..fae5a47c6f59 --- /dev/null +++ b/databases/namazu2/pkg-deinstall @@ -0,0 +1,29 @@ +#!/bin/sh +# +# $FreeBSD$ + +PATH=/bin:/usr/bin + +files="${PKG_PREFIX}/lib/charset.alias ${PKG_PREFIX}/share/locale/locale.alias" +sfx=.namazu2.backup + +case $2 in + DEINSTALL) + for f in $files; do + [ -f $f$sfx ] || continue + if [ $f -nt $f$sfx ]; then + cp -p $f $f$sfx + fi + done + ;; + + POST-DEINSTALL) + for f in $files; do + if [ -f $f$sfx ]; then + mv -f $f$sfx $f + fi + done + ;; +esac + +exit 0 diff --git a/databases/namazu2/pkg-install b/databases/namazu2/pkg-install new file mode 100644 index 000000000000..fdb791adc59d --- /dev/null +++ b/databases/namazu2/pkg-install @@ -0,0 +1,30 @@ +#!/bin/sh +# +# $FreeBSD$ + +PATH=/bin:/usr/bin + +files="${PKG_PREFIX}/lib/charset.alias ${PKG_PREFIX}/share/locale/locale.alias" +sfx=.namazu2.backup + +case $2 in + PRE-INSTALL) + for f in $files; do + if [ -f $f ]; then + cp $f $f$sfx + fi + done + ;; + + POST-INSTALL) + for f in $files; do + if [ -f $f$sfx ]; then + touch $f$sfx + else + cp $f $fsfx + fi + done + ;; +esac + +exit 0 diff --git a/databases/namazu2/pkg-plist b/databases/namazu2/pkg-plist index 7cc94341539e..62497786f319 100644 --- a/databases/namazu2/pkg-plist +++ b/databases/namazu2/pkg-plist @@ -31,11 +31,15 @@ include/namazu/util.h include/namazu/var.h include/namazu/wakati.h @dirrm include/namazu +@comment see pkg-{install,deinstall} for this file +lib/charset.alias lib/libnmz.a lib/libnmz.la lib/libnmz.so lib/libnmz.so.6 libexec/namazu.cgi +@comment see pkg-{install,deinstall} for this file +share/locale/locale.alias share/locale/es/LC_MESSAGES/namazu.mo share/locale/fr/LC_MESSAGES/namazu.mo share/locale/ja/LC_MESSAGES/namazu.mo -- cgit