Bug#92594: configuration files should be moved to /etc
Frank Küster <frank@debian.org> wrote:
> This is my new version of setup-conffiles; it's not yet tested (and I
> won't be able to do much testing before I leave for vacation). I will
> check it in as soon as the upload of tetex-base as it is now is done.
Below is the complete patch. I did a
find -name "*cfg" -o "*cnf" -o "*.ini"
in the texmf tree, and had a look at those files. I had planned to write
a mail about this before I left (and I did indeed write it, but it seems
I failed to send). Therefore, things are not very much present in my
mind now...
There are a couple of them that I do not regard as configuration
files.
- First of all, theses are all *.ini files for format generation: They
correspond to a particular format as it is known, and you won't make
friends if your latex format is not the same as the LaTeX team's
version. The reasonable alternative is to have a mylatex (or
whateverlatex) format in $LOCALTEXMF.
- /usr/share/texmf/tex/generic/babel/frenchb.cfg
all customization can be done in preamble, and it's better to do so
according to documentation. This is formally a configuration file, but
it seems the authors prefer it not to be changed.
- not a configuration file
/usr/share/texmf/tex/generic/babel/hyphen.cfg
/usr/share/texmf/tex/fontinst/base/fontinst.ini
/usr/share/texmf/omega/lambda/misc/omarab.cfg
/usr/share/texmf/omega/lambda/misc/omlgc.cfg
/usr/share/texmf/context/data/conedt.ini
(The last is a configuration file, but for the Windows Editor WinEdt).
The transition from files to symlinks is easy, the transition from
directories to symlinks requires some tweaking in the
{pre,post}{inst,rm} scripts.
Regards, Frank
Index: changelog
===================================================================
RCS file: /cvs/tetex/tetex-base/debian/changelog,v
retrieving revision 1.113
diff -u -r1.113 changelog
--- changelog 13 Aug 2004 11:39:13 -0000 1.113
+++ changelog 16 Aug 2004 13:28:49 -0000
@@ -1,3 +1,10 @@
+tetex-base (2.0.2a-3.1) unstable; urgency=low
+
+ * Move configuration files from /usr/share/texmf to /etc/texmf (Closes:
+ #92594) [frank]
+
+ -- Frank Küster <frank@debian.org> Mon, 16 Aug 2004 15:21:47 +0200
+
tetex-base (2.0.2a-3) unstable; urgency=low
* This upload was practically by Hilmar. Thanks to Hilmar. [kohda]
Index: postinst
===================================================================
RCS file: /cvs/tetex/tetex-base/debian/postinst,v
retrieving revision 1.30
diff -u -r1.30 postinst
--- postinst 16 Jun 2004 08:22:36 -0000 1.30
+++ postinst 16 Aug 2004 13:28:49 -0000
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
set -e
@@ -48,6 +48,20 @@
# Use debconf.
. /usr/share/debconf/confmodule || exit
db_version 2.0
+
+# it is now safe to remove obsolete dirs
+NOWLINKDIRS="
+tex/latex/config
+etex/plain/config
+tex/platex/config
+tex/context/config
+tex/cyrplain/config
+"
+for dir in $NOWLINKDIRS; do
+ if [ -e /usr/share/texmf/$dir.moved-by-preinst -a -L /usr/share/texmf/$dir ]; then
+ test -e `readlink /usr/share/texmf/$dir` && rm -r /usr/share/texmf/$dir.moved-by-preinst
+ fi
+done
if [ x"$1" = xconfigure ]
then
Index: postrm
===================================================================
RCS file: /cvs/tetex/tetex-base/debian/postrm,v
retrieving revision 1.6
diff -u -r1.6 postrm
--- postrm 24 Mar 2004 09:39:38 -0000 1.6
+++ postrm 16 Aug 2004 13:28:49 -0000
@@ -2,6 +2,13 @@
set -e
BASE_UCF_FILES="/etc/texmf/mktex.cnf /etc/texmf/dvips/config.builtin35 /etc/texmf/updmap.d/00updmap.cfg"
+NOWLINKDIRS="
+tex/latex/config
+etex/plain/config
+tex/platex/config
+tex/context/config
+tex/cyrplain/config
+"
ucf_purge(){
if [ -x /usr/bin/ucf ]; then # we can't rely on ucf being still installed in postrm
@@ -21,6 +28,15 @@
rm -fr /var/spool/texmf /var/lib/texmf /var/cache/fonts /etc/texdoctk || true
rm -f /etc/texmf/updmap.cfg* /etc/texmf/language.dat*
ucf_purge
+fi
+
+if [ "$1" = "abort-install" -o "$1" = "abort-upgrade" ]; then
+ for dir in $NOWLINKDIRS; do
+ if [ -d /usr/share/texmf/$dir.moved-by-preinst -a -L /usr/share/texmf/$dir ]; then
+ rm /usr/share/texmf/$dir
+ mv /usr/share/texmf/$dir.moved-by-preinst /usr/share/texmf/$dir
+ fi
+ done
fi
#DEBHELPER#
Index: preinst
===================================================================
RCS file: /cvs/tetex/tetex-base/debian/preinst,v
retrieving revision 1.6
diff -u -r1.6 preinst
--- preinst 30 May 2003 04:54:57 -0000 1.6
+++ preinst 16 Aug 2004 13:28:49 -0000
@@ -1,5 +1,6 @@
-#!/bin/sh
+#!/bin/bash
# preinst script for tetex-base
+# (setq skeleton-pair t)
#
# see: dh_installdeb(1)
@@ -13,10 +14,13 @@
CNFS="psfonts.map pdftex.map dvipdfm.map"
ETCD=/etc/texmf/dvips
-#ETM=/etc/texmf
-#VARW=/var/lib/texmf/web2c
-#ELDAT=/etc/texmf/language.dat
-#VLDAT=/var/lib/texmf/language.dat
+NOWLINKDIRS="
+tex/latex/config
+etex/plain/config
+tex/platex/config
+tex/context/config
+tex/cyrplain/config
+"
# Use debconf.
. /usr/share/debconf/confmodule || exit
@@ -32,7 +36,13 @@
fi
done
fi
-
+ # change directories to symlinks in a safe way, thanks to Branden Robinson
+ for dir in $NOWLINKDIRS; do
+ if [ -e /usr/share/texmf/$dir -a ! -L /usr/share/texmf/$dir ]; then
+ echo "Removing obsolete directory /usr/share/texmf/$dir"
+ mv /usr/share/texmf/$dir /usr/share/texmf/$dir.moved-by-preinst
+ fi
+ done
;;
abort-upgrade)
Index: setup-conffiles
===================================================================
RCS file: /cvs/tetex/tetex-base/debian/setup-conffiles,v
retrieving revision 1.6
diff -u -r1.6 setup-conffiles
--- setup-conffiles 25 Feb 2003 06:48:41 -0000 1.6
+++ setup-conffiles 16 Aug 2004 13:28:49 -0000
@@ -1,23 +1,65 @@
#!/bin/sh
+set -e
DEB=debian/tetex-base
DEX=debian/tetex-extra
ETEX=/etc/texmf/etex
-ESOUR=texmf/etex/plain/config
-LAMBDA=/etc/texmf/lambda
-LAMSOUR=texmf/omega/lambda/base
-POLLTX=/etc/texmf/platex
-POLSOUR=texmf/tex/platex/config
+ETCTEXMF=/etc/texmf
if [ X"$1" = X-base ]; then
-mv ${DEB}/usr/share/${ESOUR}/language.def ${DEB}${ETEX}
-(cd ${DEB}/usr/share/${ESOUR}; ln -s ${ETEX}/language.def .)
-mv ${DEB}/usr/share/${POLSOUR}/language.dat ${DEB}${POLLTX}
-(cd ${DEB}/usr/share/${POLSOUR}; ln -s ${POLLTX}/language.dat .)
+ package=base
elif [ X"$1" = X-extra ]; then
-mv ${DEX}/usr/share/${LAMSOUR}/language.dat ${DEX}${LAMBDA}
-(cd ${DEX}/usr/share/${LAMSOUR}; ln -s ${LAMBDA}/language.dat .)
+ package=extra
+fi
+DEBETC=debian/tetex-$package/etc/texmf
+TEXMFDIR=debian/tetex-$package/usr/share/texmf
+
+LATEX_CONFFILES='
+listings/listings.cfg
+jurabib/jblong.cfg
+jurabib/jurabib.cfg
+endfloat/efxmpl.cfg
+adrconv/adrplaner.cfg
+adrconv/adrdir.cfg
+adrconv/adrsmall.cfg
+hyperref/htex4ht.cfg
+'
+
+move_and_link_file(){
+ sourcedir=$1
+ sourcefile=$2 # file
+ dest=$3 # dir
+ if [ ! -d ${DEBETC}/$dest ]; then mkdir -p ${DEBETC}/$dest; fi
+ mv ${TEXMFDIR}/$sourcedir/$sourcefile ${DEBETC}/$dest
+ ln -s ${ETCTEXMF}/$dest/$sourcefile ${TEXMFDIR}/$sourcedir
+}
+move_and_link_dir(){
+ sourcedir=$1
+ dest=$2 # must be dir with existing parents, "" if directly in /etc/texmf
+ mv ${TEXMFDIR}/$sourcedir ${DEBETC}/$dest
+ ln -s ${ETCTEXMF}/$dest ${TEXMFDIR}/$sourcedir
+}
+
+if [ X"$1" = X-base ]; then
+ move_and_link_dir tex/latex/config latex
+ move_and_link_dir etex/plain/config etex
+ move_and_link_dir tex/platex/config platex
+ move_and_link_dir tex/context/config context
+ move_and_link_dir tex/cyrplain/config cyrplain
+
+ move_and_link_file tex/generic/config fontmath.cfg latex
+ move_and_link_file tex/generic/config fonttext.cfg latex
+ move_and_link_file tex/generic/config preload.cfg latex
+ move_and_link_file tex/cslatex fonttext.cfg cslatex
+ move_and_link_file tex/cslatex hyphen.cfg cslatex
+ move_and_link_file context/config texexec.ini context
+
+elif [ X"$1" = X-extra ]; then
+ move_and_link_file omega/lambda/base language.dat lambda
+ for file in ${LATEX_CONFFILES}; do
+ mv ${TEXMFDIR}/tex/latex/$file ${DEBETC}/latex
+ done
else
-echo "Bad Usage!"
+ echo "Bad Usage!"
fi
Index: setup-maps
===================================================================
RCS file: /cvs/tetex/tetex-base/debian/setup-maps,v
retrieving revision 1.11
diff -u -r1.11 setup-maps
--- setup-maps 26 Jul 2004 11:51:54 -0000 1.11
+++ setup-maps 16 Aug 2004 13:28:49 -0000
@@ -1,4 +1,5 @@
#!/bin/sh
+set -e
DVIPS=/etc/texmf/dvips
TXMFD=debian/tetex-base/usr/share/texmf/dvips
Index: tetex-extra.dirs
===================================================================
RCS file: /cvs/tetex/tetex-base/debian/tetex-extra.dirs,v
retrieving revision 1.4
diff -u -r1.4 tetex-extra.dirs
--- tetex-extra.dirs 24 Mar 2004 09:39:38 -0000 1.4
+++ tetex-extra.dirs 16 Aug 2004 13:28:49 -0000
@@ -1,4 +1,5 @@
etc/texmf/lambda
+etc/texmf/latex
etc/texmf/dvips
usr/share/texmf/dvips/tetex
usr/share/tetex-extra
--
Frank Küster, Biozentrum der Univ. Basel
Abt. Biophysikalische Chemie
Reply to: