Attempt to preserve lib/charset.alias and share/locale/locale.alias

before installation and restore them after deinstallation.

Submitted by:	bento
This commit is contained in:
Akinori MUSHA 2003-01-14 11:10:07 +00:00
parent 99ee933f10
commit 8c811743b4
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=73118
4 changed files with 67 additions and 0 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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