Source: manpages-pl
Section: doc
Priority: optional
Maintainer: Piotr Roszatycki <dexter@debian.org>
Standards-Version: 3.0.0.0
Upstream-Source: <URI:http://cvs.pld.org.pl/pl_PL/>
Description: Polish manpages
 This package contains the Linux manual pages translated into Polish.
 Following sections are provided:
Packaged-For: Debian
Copyright: GPL
 You may distribute under the terms of the GNU General Public
 License as specified in the README file that comes with the man 1.0
 distribution.
 .
 Authors of translated manpages are listed in /usr/doc/manpages-pl/translators
 file
Major-Changes:
Build-Depends: debhelper

Package: manpages-pl
Architecture: all
Suggests: man-browser, manpages-pl-dev
Description: Polish man-pages.
  * 1 = User programs (e.g. ls, ln)
  * 4 = Devices (e.g. hd, sd).
  * 5 = File formats and protocols, syntaxis of several system
        files (e.g. wtmp, /etc/passwd, nfs).
  * 6 = Games etc.
  * 7 = Conventions and standards, macro packages, etc.
        (e.g. nroff, ascii).
  * 8 = Administration and privileged commands.
Install: sh
 for m in man[1,4-8] debian/man[1,4-8]; do
     yada install -man $m/*.* -into /usr/share/man/pl_PL
 done
 for i in $ROOT/usr/share/man/pl_PL/man[1,4-8]/*; do
     m=$(dirname ${i#$ROOT/usr/share/man/pl_PL/})
     if ( head -n 1 $i | grep "^\.so " >/dev/null ); then
         ln=$( head -n 1 $i | sed -e 's/.so //' -e 's/'$m'\///')
         echo "Creating symlink ${i##$ROOT} -> $ln"
         rm -f $i
         test -f $ROOT/usr/share/man/pl_PL/$m/$ln && ln -s $ln $i
     fi
 done
 yada install -doc FAQ -as README
 yada install -doc robotnicy -as translators
Finalise: sh
 dh_fixperms -p$PACKAGE -P$ROOT
 dh_md5sums -p$PACKAGE -P$ROOT
Preinst: sh
 if [ "$1" = install ] && [ -d /usr/share/man/pl ] && [ ! -L /usr/share/man/pl ]; then
     echo ""
     echo "Please remove /usr/share/man/pl directory."
     echo "It should be a symlink to /usr/share/man/pl_PL."
     echo ""
     exit 1
 fi
Postinst: sh
 if [ "$1" = "configure" ]; then
     test ! -e /usr/share/man/pl \
         && echo "Creating symlink /usr/share/man/pl_PL -> pl" \
	 && ln -s pl_PL /usr/share/man/pl
     echo ""
     echo "To enable these manpages set LC_MESSAGES to 'pl_PL'."
     echo "Man will then search for Polish manpages under /usr/share/man/pl_PL."
     echo ""
 fi
Postrm: sh
 if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
     test ! -e /usr/share/man/pl_PL && test -L /usr/share/man/pl && \
         echo "Removing symlink /usr/share/man/pl" && \
         rm -f /usr/share/man/pl
 fi
     
Package: manpages-pl-dev
Architecture: all
Suggests: man-browser, manpages-pl
Description: Polish man-pages for developers.
  * 2 = Linux system calls.
  * 3 = Libc calls (note that a more comprehensive source of
        information may be found in the libc6-doc package).
Install: sh
 for m in man[2,3]; do
     yada install -man $m/*.* -into /usr/share/man/pl_PL
 done
 for i in $ROOT/usr/share/man/pl_PL/man[2,3]/*; do
     m=$(dirname ${i#$ROOT/usr/share/man/pl_PL/})
     if ( head -n 1 $i | grep "^\.so " >/dev/null ); then
    	  ln=$( head -n 1 $i | sed -e 's/.so //' -e 's/'$m'\///')
	  echo "Creating symlink ${i##$ROOT} -> $ln"
          rm -f $i
          test -f $ROOT/usr/share/man/pl_PL/$m/$ln && ln -s $ln $i
     fi
 done
 yada install -doc FAQ -as README
 yada install -doc robotnicy -as translators
Finalise: sh
 dh_fixperms -p$PACKAGE -P$ROOT
 dh_md5sums -p$PACKAGE -P$ROOT
Preinst: sh
 if [ "$1" = install ] && [ -d /usr/share/man/pl ] && [ ! -L /usr/share/man/pl ]; then
     echo ""
     echo "Please remove /usr/share/man/pl directory."
     echo "It should be a symlink to /usr/share/man/pl_PL."
     echo ""
     exit 1
 fi
Postinst: sh
 if [ "$1" = "configure" ]; then
     test ! -e /usr/share/man/pl && \
         echo "Creating symlink /usr/share/man/pl_PL -> pl" && \
         ln -s pl /usr/share/man/pl
     echo ""
     echo "To enable these manpages set LC_MESSAGES to 'pl_PL'."
     echo "Man will then search for Polish manpages under /usr/share/man/pl_PL."
     echo ""
 fi                                                          
Postrm: sh
 if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
     test ! -e /usr/share/man/pl_PL && test -L /usr/share/man/pl && \
         echo "Removing symlink /usr/share/man/pl" && \
         rm -f /usr/share/man/pl
 fi
