postinst is in r-base-core 2.14.1-1.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | #!/bin/sh
#
# postinst script for the Debian GNU/Linux r-base-core package
# This version originally written by Douglas Bates <bates@stat.wisc.edu>
# and now written and maintained by Dirk Eddelbuettel <edd@debian.org>
set -e
# Automatically added by dh_installmenu
if [ "$1" = "configure" ] && [ -x "`which update-menus 2>/dev/null`" ]; then
update-menus
fi
# End automatically added section
case "$1" in
configure)
# edd 19 June 2004 deal with papersize
# edd 22 June 2004 make that conditional on paperconf
# edd 25 Oct 2006 rewritten for R 2.4.0 and R_PAPERSIZE_USER
# edd 21 Jun 2008 rewritten for R 2.7.1 and ucf input
if [ -x /usr/bin/paperconf ]; then
## get the value we want from Debian's paperconf utility
papersize=`paperconf`
## this is the file we need to set it in
#Renviron=/etc/R/Renviron
Renviron=/usr/lib/R/etc/Renviron.ucf
if [ -f $Renviron ]; then
## test if the file is unmodified `as shipped'
if grep -q -E "^R_PAPERSIZE_USER=\\$\{R_PAPERSIZE\}" $Renviron; then
echo "Setting R_PAPERSIZE_USER default to '$papersize'"
## have perl subst. second expression with $papersize for first
## uses the x mod. and curlies to denote the usual s|1st|2nd|
perl -p -i -e "s{^R_PAPERSIZE_USER=\\$\{R_PAPERSIZE\}}
{R_PAPERSIZE_USER=\\$\{R_PAPERSIZE-'$papersize'\}}x" $Renviron
fi
fi
fi
# edd 21 Jun 2008 whether or not Renviron was modified, ucf will handle it,
# so tell ucf that file Renviron.ucf is the source for
# conffile in /etc and register it
ucf /usr/lib/R/etc/Renviron.ucf /etc/R/Renviron
ucfr r-base-core /etc/R/Renviron
#
if [ -x /usr/bin/update-menus ]; then
update-menus
fi
# edd 03 Apr 2003 cf Section 10.1.2 of Debian Policy
if [ ! -e /usr/local/lib/R ]; then
if mkdir /usr/local/lib/R 2>/dev/null; then
chown root:staff /usr/local/lib/R
chmod 2775 /usr/local/lib/R
fi
fi
if [ ! -e /usr/local/lib/R/site-library ]; then
if mkdir /usr/local/lib/R/site-library 2>/dev/null; then
chown root:staff /usr/local/lib/R/site-library
chmod 2775 /usr/local/lib/R/site-library
fi
fi
if [ -x /usr/bin/mktexlsr ]; then
mktexlsr /usr/share/texmf
fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
;;
esac
|