chiark / gitweb /
more packaging
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 9 Jan 2012 04:18:44 +0000 (04:18 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 9 Jan 2012 04:18:44 +0000 (04:18 +0000)
debian/control
debian/xfonts-traditional.config [new file with mode: 0644]
debian/xfonts-traditional.postinst [new file with mode: 0644]
debian/xfonts-traditional.prerm [new file with mode: 0644]
debian/xfonts-traditional.templates [new file with mode: 0644]

index 30b5065..3fc9dec 100644 (file)
@@ -14,12 +14,12 @@ Description: Traditional fixed-with fonts for X
  These are a set of 6x13 fonts (including "fixed"), with foundry name
  "trad" instead of "misc", with several glyphs replaced with earlier
  versions from before Markus Kuhn's changes:
-  - balanced ` and '
-  - less tall [ ] ( ) { }
-  - centred *
-  - high ~
-  - slightly higher &
-  - traditional appearance of: a W
+  - balanced  ` '
+  - less tall  [ ] ( ) { }
+  - centred  *
+  - high  ~
+  - slightly higher  &
+  - traditional appearance of  W a
  .
  These changes make the fonts compatible with the US-ASCII character
  set.  (UTF-8 is not compatible with ASCII in its usage of the
@@ -32,4 +32,4 @@ Description: Traditional fixed-with fonts for X
  .
  (This package does not actually contain the bulk of the font data;
  rather, it automatically generates the required modified fonts for
- each font you have installed.)
+ each relevant font you have installed.)
diff --git a/debian/xfonts-traditional.config b/debian/xfonts-traditional.config
new file mode 100644 (file)
index 0000000..86c93bf
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/sh
+set -e
+
+. /usr/share/debconf/confmodule
+
+check_aliasfile () {
+       aliasfile=/etc/X11/fonts/misc/xfonts-base.alias
+       if ! test -f $aliasfile; then return; fi
+       if test -e $aliasfile.not-trad; then return; fi
+
+       perl -pe '
+ s/^(fixed\s+)\-misc\-(fixed-medium-r-semicondensed)/$1-trad-$2$/
+               ' <$aliasfile >$aliasfile.trad
+       if cmp -s $aliasfile $aliasfile.trad; then
+               rm $aliasfile.trad
+               return
+       fi
+       db_get xfonts-traditional/remap-fixed
+       if [ $RET != true ]; then return; fi
+
+       ln $aliasfile $aliasfile.not-trad
+       mv -f $aliasfile.trad $aliasfile
+}
+
+db_get xfonts-traditional/generate
+if [ "$RET" = true ]; then
+
+       update-xfonts-traditional --update
+
+       check_aliasfile
+
+fi
diff --git a/debian/xfonts-traditional.postinst b/debian/xfonts-traditional.postinst
new file mode 100644 (file)
index 0000000..fe81215
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+set -e
+. /usr/share/debconf/confmodule
+db_input low xfonts-traditional/generate || true
+db_input high xfonts-traditional/remap-fixed || true
+db_go || true
diff --git a/debian/xfonts-traditional.prerm b/debian/xfonts-traditional.prerm
new file mode 100644 (file)
index 0000000..4dc7f2c
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/sh
+set -e
+
+. /usr/share/debconf/confmodule
+
+case "$1" in
+
+remove)
+
+       echo 'Checking that "fixed" is not from xfonts-traditional..."
+
+       if grep '^fixed[         ][      ]*-trad-'; then
+               cat >&2 <<END
+You should not remove xfonts-traditional while "fixed" refers to one
+of its fonts.  You probably want to check the differences between
+/etc/X11/fonts/misc/xfonts-base.alias and xfonts-base.alias.not-trad,
+and probably replace the former with the latter, and retry the removal.
+END
+               exit 1
+       fi
+
+       ;;
+
+       find /usr/share/fonts/X11 /usr/local/share/fonts/X11 \
+                  -type f \
+               \( -name xfonts-traditional.log -o \
+                  -name xfonts-traditional.done -o 
+                  -name xfonts-traditional.done.new -o 
+                  -name trad--\*.pcf.gz.new \) \
+               -print0 | xargs -0r rm
+
+       find /usr/share/fonts/X11 /usr/local/share/fonts/X11 \
+                  -type f \
+                  -name trad--\*.pcf.gz \
+               -print0 | xargs -0r rm
+
+esac
diff --git a/debian/xfonts-traditional.templates b/debian/xfonts-traditional.templates
new file mode 100644 (file)
index 0000000..9ba84de
--- /dev/null
@@ -0,0 +1,27 @@
+Template: xfonts-traditional/generate
+Type: boolean
+Default: true
+Description: Generate traditional versions of fonts?
+ xfonts-traditional can automatically generate traditional versions
+ (with foundry "Trad" instead of "Misc" of all fonts for which it has
+ an idea about the glyphs.  (Currently this is versions of 6x13, aka
+ "fixed").
+ .
+ But you may prefer not to do this automatically, and would rather
+ just have the tool installed.
+
+Template: xfonts-traditional/remap-fixed
+Type: boolean
+Default: true
+Description: Configure system to use traditional "fixed"?
+ Would you like the font alias "fixed" remapped to the traditional version?
+ .
+ If you say "yes", I will edit /etc/X11/fonts/misc/xfonts-base.alias
+ for you, and save your old file as xfonts-base.alias.not-trad.  (Note
+ that this is a conffile so you may get prompts from dpkg about it in
+ the future.)  If you say no I will generate xfonts-base-alias.trad
+ for you to do what you like with.
+ .
+ To revert this change, simply change the alias fixed back from
+ "-trad-..."  to "-misc-...", or rename the old file back into place,
+ and dpkg-reconfigure xfonts-base-traditional.