]> git.pld-linux.org Git - packages/plptools.git/commitdiff
- by Bobby Spark
authorsaq <saq@pld-linux.org>
Sat, 25 Sep 2004 14:04:09 +0000 (14:04 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    plptools-assert.patch -> 1.1
    plptools-kde.patch -> 1.1
    plptools-pl.patch -> 1.1
    plptools.am_edit -> 1.1
    plptools.init -> 1.1

plptools-assert.patch [new file with mode: 0644]
plptools-kde.patch [new file with mode: 0644]
plptools-pl.patch [new file with mode: 0644]
plptools.am_edit [new file with mode: 0644]
plptools.init [new file with mode: 0644]

diff --git a/plptools-assert.patch b/plptools-assert.patch
new file mode 100644 (file)
index 0000000..a789ef3
--- /dev/null
@@ -0,0 +1,10 @@
+--- plptools-0.12/lib/Enum.h.orig      2004-06-28 17:25:52.444060736 +0200
++++ plptools-0.12/lib/Enum.h   2004-06-28 17:26:00.591822088 +0200
+@@ -31,6 +31,7 @@
+ #include <map>
+ #include <string>
++#include <assert.h>
+ /**
+  * the Base for the Enum template.
diff --git a/plptools-kde.patch b/plptools-kde.patch
new file mode 100644 (file)
index 0000000..b9d450a
--- /dev/null
@@ -0,0 +1,19 @@
+diff -Nur plptools-0.12/conf/m4/kde/KDE_SUBST_PROGRAMS.m4 plptools-0.12.new/conf/m4/kde/KDE_SUBST_PROGRAMS.m4
+--- plptools-0.12/conf/m4/kde/KDE_SUBST_PROGRAMS.m4    2001-05-21 21:05:17.000000000 +0200
++++ plptools-0.12.new/conf/m4/kde/KDE_SUBST_PROGRAMS.m4        2004-09-21 13:08:50.123573600 +0200
+@@ -14,7 +14,6 @@
+         KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
+         KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
+         KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(mcopidl)])
+-        KDE_FIND_PATH(kdb2html, KDB2HTML, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kdb2html)])
+         KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(artsc-config)])
+         KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kde-config)])
+@@ -23,7 +22,6 @@
+         AC_SUBST(DCOPIDL2CPP)
+         AC_SUBST(DCOP_DEPENDENCIES)
+         AC_SUBST(MCOPIDL)
+-        AC_SUBST(KDB2HTML)
+         AC_SUBST(ARTSCCONFIG)
+         AC_SUBST(KDECONFIG)
diff --git a/plptools-pl.patch b/plptools-pl.patch
new file mode 100644 (file)
index 0000000..05c1890
--- /dev/null
@@ -0,0 +1,805 @@
+diff -Nur plptools-0.12.orig/configure.in plptools-0.12/configure.in
+--- plptools-0.12.orig/configure.in    2003-02-04 11:26:52.000000000 +0100
++++ plptools-0.12/configure.in 2004-09-24 01:05:00.194807256 +0200
+@@ -338,9 +338,11 @@
+       kde2/doc/Makefile
+       kde2/doc/en/Makefile
+       kde2/doc/de/Makefile
++      kde2/doc/pl/Makefile
+       kde2/doc/kioslave/Makefile
+       kde2/doc/kioslave/de/Makefile
+       kde2/doc/kioslave/en/Makefile
++      kde2/doc/kioslave/pl/Makefile
+       plpbackup/Makefile
+       plpprint/Makefile
+       plpprint/prolog.ps
+diff -Nur plptools-0.12.orig/kde2/doc/kioslave/Makefile.am plptools-0.12/kde2/doc/kioslave/Makefile.am
+--- plptools-0.12.orig/kde2/doc/kioslave/Makefile.am   2002-08-10 21:13:51.000000000 +0200
++++ plptools-0.12/kde2/doc/kioslave/Makefile.am        2004-09-24 01:05:00.195806104 +0200
+@@ -1,4 +1,4 @@
+-SUBDIRS = en de
++SUBDIRS = en de pl
+ maintainer-clean-local:
+       rm -f Makefile.in
+diff -Nur plptools-0.12.orig/kde2/doc/kioslave/pl/Makefile.am plptools-0.12/kde2/doc/kioslave/pl/Makefile.am
+--- plptools-0.12.orig/kde2/doc/kioslave/pl/Makefile.am        1970-01-01 01:00:00.000000000 +0100
++++ plptools-0.12/kde2/doc/kioslave/pl/Makefile.am     2004-09-24 01:05:00.196804952 +0200
+@@ -0,0 +1,7 @@
++KDE_LANG = pl
++kiodocdir = $(kde_libs_htmldir)/$(KDE_LANG)/kioslave
++kiodoc_DATA = psion.docbook
++EXTRA_DIST = $(kiodoc_DATA)
++
++maintainer-clean-local:
++      rm -f Makefile.in
+diff -Nur plptools-0.12.orig/kde2/doc/kioslave/pl/psion.docbook plptools-0.12/kde2/doc/kioslave/pl/psion.docbook
+--- plptools-0.12.orig/kde2/doc/kioslave/pl/psion.docbook      1970-01-01 01:00:00.000000000 +0100
++++ plptools-0.12/kde2/doc/kioslave/pl/psion.docbook   2004-09-24 01:05:00.197803800 +0200
+@@ -0,0 +1,32 @@
++<article lang="&language;" id="psion">
++<title>psion</title>
++<articleinfo>
++<authorgroup>
++<author><firstname>Fritz</firstname><surname>Elfert</surname>
++<affiliation><address><email>felfert@users.sourceforge.net</email></address></affiliation>
++</author>
++</authorgroup>
++</articleinfo>
++
++<para>
++Psion ioslave umo¿liwia ci przegl±danie dysków podpiêtych palmtopów Psiona.
++</para>
++
++<para>
++To see the drives of a Psion, enter
++</para>
++<para><userinput><command>psion:/</command></userinput></para>
++<para>
++or (if the Psion is connected at a remote machine)
++</para>
++<para><userinput><command>psion://</command><replaceable>host/</replaceable></userinput>.</para>
++
++<para>
++The psion ioslave connects to a Psion using the ncpd daemon. Therefore,
++this daemon must be running on the machine. The psion ioslave, the daemon
++as well as other tools for Psion connectivity are part of the plptools
++package. This package is available at <ulink url="http://plptools.sourceforge.net/"
++>http://plptools.sourceforge.net/</ulink>.
++</para>
++
++</article>
+diff -Nur plptools-0.12.orig/kde2/doc/Makefile.am plptools-0.12/kde2/doc/Makefile.am
+--- plptools-0.12.orig/kde2/doc/Makefile.am    2002-08-10 21:13:35.000000000 +0200
++++ plptools-0.12/kde2/doc/Makefile.am 2004-09-24 01:05:47.194601048 +0200
+@@ -1,4 +1,4 @@
+-SUBDIRS = en de kioslave
++SUBDIRS = en de pl kioslave
+ maintainer-clean-local:
+       rm -f Makefile.in
+diff -Nur plptools-0.12.orig/kde2/doc/pl/index.docbook.in plptools-0.12/kde2/doc/pl/index.docbook.in
+--- plptools-0.12.orig/kde2/doc/pl/index.docbook.in    1970-01-01 01:00:00.000000000 +0100
++++ plptools-0.12/kde2/doc/pl/index.docbook.in 2004-09-24 01:05:00.203796888 +0200
+@@ -0,0 +1,706 @@
++<?xml version="1.0" ?>
++<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.1-Based Variant V1.0//EN" "dtd/kdex.dtd" [
++  <!ENTITY kpsion  "<application>KPsion</application>">
++  <!ENTITY kappname "&kpsion;">
++  <!ENTITY % addindex "IGNORE">
++  <!ENTITY % Polish "INCLUDE">
++  <!-- DO NOT DELETE! $Revision$ -->
++  <!-- DO NOT DELETE! $Date$ -->
++]>
++
++<book lang="&language;">
++<bookinfo>
++
++<title>Podręcznik &kpsion;</title>
++
++<authorgroup>
++<author>
++<firstname>Fritz</firstname>
++<surname>Elfert</surname>
++<affiliation>
++<address><email>felfert@to.com</email></address>
++</affiliation>
++</author>
++
++
++<othercredit role="reviewer">
++<firstname>Michał</firstname>
++<surname>Cieślicki</surname>
++<affiliation>
++<address><email>yoshi@aip.pl</email></address>
++</affiliation>
++<contrib>Reviewer</contrib>
++</othercredit>
++
++</authorgroup>
++
++<copyright>
++<year>2001</year>
++<holder>Fritz Elfert</holder>
++</copyright>
++
++<legalnotice>&FDLNotice;</legalnotice>
++
++<date>__DATE__</date>
++<releaseinfo>__VERSION__</releaseinfo>
++
++
++<abstract><para>
++&kpsion; jest aplikacją przeznaczonią do robienia kopii bezpieczeństwa i ich 
++odzyskiwania, a także formatowania dysków na palmtopach Psion.
++</para></abstract>
++
++<keywordset>
++<keyword>KDE</keyword>
++<keyword>plptools</keyword>
++<keyword>KPsion</keyword>
++<keyword>Psion</keyword>
++<keyword>EPOC</keyword>
++<keyword>PDA</keyword>
++<keyword>backup</keyword>
++<keyword>restore</keyword>
++<keyword>format</keyword>
++</keywordset>
++
++</bookinfo>
++
++<chapter id="Introduction">
++<title>Wprowadzenie</title>
++
++<para>
++Witaj w &kpsion;! &kpsion; jest aplikacją przeznaczoną do robienia kopii danych
++i ich odzyskiwania, a także do formatowania dysków palmtopów Psion przeznaczoną
++dla środowiska K Desktop Environment. Do działania wykorzystywany jest
++daemon <command>ncpd</command> i biblioteki z pakietu plptools.
++</para>
++
++<para>Ten program powinien być uruchamiany albo z linii poleceń, albo poprzez 
++pliki typu <filename>.desktop</filename>.
++</para>
++
++</chapter>
++
++<chapter id="installation">
++<title>Instalacja</title>
++
++<sect1 id="downloading">
++<title>Pobieranie</title>
++
++<para>&kpsion; jest częścią pakietu plptools, który jest osiągalny pod adresem
++<ulink url="http://plptools.sourceforge.net/">http://plptools.sourceforge.net/</ulink>.</para>
++
++</sect1>
++
++<sect1 id="compiling">
++<title>Kompilacja</title>
++
++<para>Pakiet plptools nie jest skoncentrowany na działanie w środowisku KDE.
++Dlatego, aby umożliwić zbudowanie oprogramowania dla KDE (&kpsion; jest jego 
++częśćią) musisz użyć opcji <option>--enable-kde</option> w programie konfiguracyjnym plptools configure.</para>
++
++<para>Proces budowania przeważnie wygląda tak:</para>
++
++<screen>
++<prompt>$</prompt> <command>./configure <option>--enable-kde</option></command>
++<prompt>$</prompt> <command>make</command>
++<prompt>$</prompt> <command>make <option>install</option></command>
++</screen>
++
++<para>Ostatni krok będziesz musiał wykonać jako root. Proces instalacji
++musi miec możliwość pisania w katalogach systemowych KDE.</para>
++
++</sect1>
++</chapter>
++
++<chapter id="using-kpsion">
++<title>Użytkowanie &kpsion;</title>
++
++<para>
++Użytkowanie &kpsion; jest proste. Normalnie uruchamiasz &kpsion; 
++używając pozycji w menu narzędzia K - Menu.
++Można także uruchomić &kpsion; z shella. Składnia może być następująca:
++</para>
++
++    <cmdsynopsis>
++      <command>kpsion</command>
++    </cmdsynopsis>
++
++    <cmdsynopsis>
++      <command>kpsion</command>
++      <arg>--autobackup</arg>
++    </cmdsynopsis>
++
++    <cmdsynopsis>
++      <command>kpsion</command>
++      <arg>--backup <replaceable>DYSK</replaceable></arg>
++    </cmdsynopsis>
++
++    <cmdsynopsis>
++      <command>kpsion</command>
++      <arg>--restore <replaceable>DYSK</replaceable></arg>
++    </cmdsynopsis>
++
++    <cmdsynopsis>
++      <command>kpsion</command>
++      <arg>--format <replaceable>DYSK</replaceable></arg>
++    </cmdsynopsis>
++
++<para>Gdy uruchomiony bez opcji, &kpsion; uruchomi się w trybie interaktywnym, 
++gdy uruchomiony z dowolną z powyższych opcji &kpsion; przeprowadzi żądaną
++czynność nieinteraktywnie.</para>
++<variablelist>
++<varlistentry>
++<term><option>--autobackup</option></term>
++<listitem><para>
++Ta opcja wymusza przeprowadzenie ustalonego na dany czas backupu.
++Jeśli Psion nie będzie podłączony, nic się nie wydarzy.
++</para></listitem>
++</varlistentry>
++
++<varlistentry>
++<term><option>--backup <replaceable>DYSK</replaceable></option></term>
++<listitem><para>
++Ta opcja powoduje rozpoczęcie backupu określonego <replaceable>DYSKU</replaceable>
++<replaceable>DYSK</replaceable> jest pojedyńczą literą dysku.
++</para></listitem>
++</varlistentry>
++
++<varlistentry>
++<term><option>--restore <replaceable>DYSK</replaceable></option></term>
++<listitem><para>
++Ta opcja uruchamia odzyskiwanie danych dla określonego <replaceable>DYSKU</replaceable>.
++<replaceable>DYSK</replaceable> jest pojedyńczą literą dysku.
++</para></listitem>
++</varlistentry>
++
++<varlistentry>
++<term><option>--format <replaceable>DYSK</replaceable></option></term>
++<listitem><para>
++              Ta opcja spowoduje rozpoczęcie formatowania okreslonego <replaceable>DYSKU</replaceable>.
++<replaceable>DYSK</replaceable> jest pojedyńczą literą dysku.
++              
++</para></listitem>
++</varlistentry>
++
++</variablelist>
++
++</chapter>
++
++<chapter id="commands">
++<title>Polecenia</title>
++
++<sect1 id="kpsion-mainwindow">
++<title>Główne okno &kpsion; </title>
++<para>
++<screenshot>
++<screeninfo>Główne okno &kpsion;</screeninfo>
++  <mediaobject>
++    <imageobject>
++      <imagedata fileref="toplevel.png" format="PNG"></imagedata>
++    </imageobject>
++    <textobject>
++    <phrase>Główne okno&kpsion;</phrase>
++    </textobject>
++  </mediaobject>
++</screenshot>
++Gdy palmtop Psion jest podłączony, główne okno pokazuje jego dyski.
++Klikając na ikonie dysku możesz zmieniać wybór. Jeśli jakiś dysk zostanie 
++wybrany, pozycje w menu i pasku narzędzi zostają udostępnione.
++Najczciej realizowane  <guimenu>akcje</guimenu> są dostępne poprzez
++pasek narzędzi. Należą do nich:</para>
++<para>
++<itemizedlist>
++<listitem><para>
++<guiicon>
++  <inlinemediaobject>
++    <imageobject>
++      <imagedata fileref="psion_backup.png" format="PNG"></imagedata>
++    </imageobject>
++  </inlinemediaobject>
++</guiicon> Pełny backup.
++</para></listitem>
++<listitem><para>
++<guiicon>
++  <inlinemediaobject>
++    <imageobject>
++      <imagedata fileref="psion_restore.png" format="PNG"></imagedata>
++    </imageobject>
++  </inlinemediaobject>
++</guiicon> Odzyskanie danych.
++</para></listitem>
++</itemizedlist>
++</para>
++
++<sect2><title>Menu Plik</title><para><variablelist>
++
++<varlistentry>
++<term><menuchoice>
++<shortcut>
++<keycombo><keycap>Ctrl</keycap><keycap>b</keycap></keycombo>
++</shortcut>
++<guimenu>Plik</guimenu>
++<guimenuitem>Uruchom pełny backup</guimenuitem>
++</menuchoice></term>
++<listitem><para>
++Uruchamia <action>pełny backup</action> wybranego dysku.
++</para></listitem>
++</varlistentry>
++
++<varlistentry>
++<term><menuchoice>
++<shortcut>
++<keycombo><keycap>Ctrl</keycap><keycap>i</keycap></keycombo>
++</shortcut>
++<guimenu>Plik</guimenu>
++<guimenuitem>Backup różnicowy</guimenuitem>
++</menuchoice></term>
++<listitem><para>
++Uruchamia <action>różniowy backup</action> wybranego dysku.
++</para></listitem>
++</varlistentry>
++
++<varlistentry>
++<term><menuchoice>
++<shortcut>
++<keycombo><keycap>Ctrl</keycap><keycap>r</keycap></keycombo>
++</shortcut>
++<guimenu>Plik</guimenu>
++<guimenuitem>Odzyskiwanie danych.</guimenuitem>
++</menuchoice></term>
++<listitem><para>
++Uruchamia proces <action>odzyskiwania danych</action> wybranego dysku.
++</para></listitem>
++</varlistentry>
++
++<varlistentry>
++<term><menuchoice>
++<shortcut>
++<keycombo><keycap>Ctrl</keycap><keycap>f</keycap></keycombo>
++</shortcut>
++<guimenu>Plik</guimenu>
++<guimenuitem>Formatowanie</guimenuitem>
++</menuchoice></term>
++<listitem><para>
++Uruchamia <action>formatowanie</action> wybranego dysku.
++</para></listitem>
++</varlistentry>
++
++<varlistentry>
++<term><menuchoice>
++<shortcut>
++<keycombo><keycap>Ctrl</keycap><keycap>q</keycap></keycombo>
++</shortcut>
++<guimenu>Plik</guimenu>
++<guimenuitem>Koniec</guimenuitem>
++</menuchoice></term>
++<listitem><para>
++<action>Kończy</action> &kpsion;.
++</para></listitem>
++</varlistentry>
++
++</variablelist></para></sect2>
++
++</sect1>
++
++</chapter>
++
++<chapter id="Configuration">
++<title>Konfiguracja</title>
++
++<sect1 id="firsttime">
++<title>Pierwsze uruchomienie</title>
++
++<para>
++Gdy uruchamiasz &kpsion; po raz pierwszy, pojawia się kreator, który pozwala Ci
++w prosty sposób skonfigurować aplikację dla osobistego uytku. Wstępna 
++konfiguracja jest podzielona na trzy kroki:
++</para>
++
++<sect2>
++<title>Wybór katalogu na kopie danych.</title>
++<para>
++<screenshot>
++<screeninfo>Krok pierwszy. Wybierz katalog na kopie danych.</screeninfo>
++  <mediaobject>
++    <imageobject>
++      <imagedata fileref="firstwizard-1.png" format="PNG"></imagedata>
++    </imageobject>
++    <textobject>
++<phrase>Wybieranie katalogu na kopie danych</phrase>
++    </textobject>
++  </mediaobject>
++</screenshot>
++Katalog na kopie danych będzie używany przez &kpsion; do przechowywania 
++archiwów zawartości Twojego Psiona. Moesz po prostu zaakceptowa domylne
++propozycje kreatora, zwaszcza jeśli nie musisz się martwić ilością miejsca 
++w Twoim katalogu domowym. W przeciwnym wypadku, wybierz katalogu zgodnie z
++wasnym wyborem klikając na przycisk "Przeglądaj". &kpsion; tworzy taki
++katalog, jeśli nie istnieje. Oczywiście musisz mieć odpowiednie uprawnienia
++do zapisu.
++</para>
++<para></para>
++</sect2>
++
++<sect2>
++<title>Ustalanie strategii kopii</title>
++<para>
++<screenshot>
++<screeninfo>Krok drugi. Strategia backupu.</screeninfo>
++  <mediaobject>
++    <imageobject>
++      <imagedata fileref="firstwizard-2.png" format="PNG"></imagedata>
++    </imageobject>
++    <textobject>
++      <phrase>Ustalanie strategii backupu.</phrase>
++    </textobject>
++  </mediaobject>
++</screenshot>
++W drugim kroku masz możliwość ustalenia strategii backupu. Dla obydwu typów,
++backupu, pełnego i różnicowego, możesz określić przedział czasowy.
++Jeśli jakikolwiek z tych interwałów jest określony, &kpsion; stworzy plik
++typu <filename>.desktop</filename> w Twoim katalogu Autostartu KDE.
++Ilekroć Kde zostanie uruchomione, zostanie uruchomiony &kpsion; w trybie 
++autmatycznego robienia kopii. Jeśli żądany czas minął, a Psion będzie 
++aktualnie podłączony, procedura backupu zostanie uruchomiona.
++</para>
++<para>
++Kolejne ustawienie, to ilość kopii, która będzie przechowywana.
++Na backup skadaj się procedury pełnego backupu i backupu różnicowego.
++Jeśli backup zostanie zakończony sukcesem, &kpsion; sprawdzi, czy jest więcej
++plików backupu i usunie starsze kopie.
++</para>
++<para></para>
++</sect2>
++
++<sect2>
++<title>Parametry komunikacji</title>
++<para>
++<screenshot>
++<screeninfo>Krok trzeci. Parametry komunikacji.</screeninfo>
++  <mediaobject>
++    <imageobject>
++      <imagedata fileref="firstwizard-3.png" format="PNG"></imagedata>
++    </imageobject>
++    <textobject>
++      <phrase>Ustalanie parametrów komunikacji.</phrase>
++    </textobject>
++  </mediaobject>
++</screenshot>
++W trzecim kroku możesz ustalić zachowanie &kpsion; w trakcie łączenia z Psionem.
++Jeśli ustalisz czas ponawiania połączenia na wartość niezerową, &kpsion;
++będzie podejmował próby połączenia jeśli mu się nie powiedzie.
++Ponieważ &kpsion; potrzebuje działającego daemona ncpd, jest take możliwe 
++uruchomienie tego daemona "z lotu", jeśli okazałoby się, że nie działa.
++Aby to działało musisz mieć uprawnienia do korzystania z danego portu 
++(zapewne grupy tty, ttyS; przyp. tłum.).
++</para>
++<para></para>
++</sect2>
++
++</sect1>
++
++<sect1 id="newpsion">
++<title>Podłączanie nowego Psiona</title>
++
++<para>
++Kiedy &kpsion; podłącza się do Psiona, odczytuje unikalne informacje 
++identyfikacyjne (ID) i sprawdza, czy ten palmtop był podłączany już wcześniej.
++Jeśli podłączany Psion nie był wcześniej używany z &kpsion;, zostaje uruchomiony
++kreator, który pozwala na dodanie nowej nazwy dla tego palmtopa i określenie
++które dyski będą backupowane, gdy uruchamiany w trybie nieinteraktywnym.
++</para>
++
++<sect2>
++<title>Nazwa Psiona</title>
++<para>
++<screenshot>
++<screeninfo>Krok pierwszy. Nazwa Psiona.</screeninfo>
++  <mediaobject>
++    <imageobject>
++      <imagedata fileref="newpsionwizard-1.png" format="PNG"></imagedata>
++    </imageobject>
++    <textobject>
++      <phrase>Ustalanie nazwy dla Psiona.</phrase>
++    </textobject>
++  </mediaobject>
++</screenshot>
++Nazwa nowego Psiona nie jest używana przez &kpsion; wewnętrznie, tylko
++jest używana do określania nazwy maszyny, gdy podpęita.
++</para>
++<para></para>
++</sect2>
++
++<sect2>
++      <title>Określanie dysków do backupowania.</title>
++<para>
++<screenshot>
++      <screeninfo>Krok drugi. Określanie dysków do backupowania.</screeninfo>
++  <mediaobject>
++    <imageobject>
++      <imagedata fileref="newpsionwizard-2.png" format="PNG"></imagedata>
++    </imageobject>
++    <textobject>
++      <phrase>Określanie dysków do backupowania.</phrase>
++    </textobject>
++  </mediaobject>
++</screenshot>
++Zwykle powinieneś wybrać wszystkie dyski, oprócz ROM dysku. ROM dysk
++może zostać zbackupowany, ale oczywiście nie może zostać taka kopia 
++odtworzona.
++</para>
++<para></para>
++</sect2>
++</sect1>
++
++<sect1 id="settings">
++<title>Ustawienia</title>
++
++<para>
++Wszystkie ustawienia, skonfigurowane przy kreatorze pojawiającym się przy 
++pierwszym podłączeniu nowego Palmtopa, mogą zostać w dowolnym momencie 
++zmienione, przy uyciu opcji ustawień z menu. Okienko dialogowe ustawień
++składa się z następujących trzech pozycji:
++</para>
++
++<sect2>
++<title>Backup</title>
++<para>
++<screenshot>
++<screeninfo>Ustawienia, Backup.</screeninfo>
++  <mediaobject>
++    <imageobject>
++      <imagedata fileref="settings-backup.png" format="PNG"></imagedata>
++    </imageobject>
++    <textobject>
++      <phrase>Ustawienia, Backup</phrase>
++    </textobject>
++  </mediaobject>
++</screenshot>
++</para>
++<para></para>
++</sect2>
++
++<sect2>
++<title>Połączenia</title>
++<para>
++<screenshot>
++<screeninfo>Ustawienia, połączenia.</screeninfo>
++  <mediaobject>
++    <imageobject>
++      <imagedata fileref="settings-connection.png" format="PNG"></imagedata>
++    </imageobject>
++    <textobject>
++    <phrase>Ustawienia, połączenia</phrase>
++    </textobject>
++  </mediaobject>
++</screenshot>
++</para>
++<para></para>
++</sect2>
++
++<sect2>
++<title>Maszyny</title>
++<para>
++<screenshot>
++<screeninfo>Ustawienia, maszyny.</screeninfo>
++  <mediaobject>
++    <imageobject>
++      <imagedata fileref="settings-machines.png" format="PNG"></imagedata>
++    </imageobject>
++    <textobject>
++    <phrase>Ustawienia, maszyny</phrase>
++    </textobject>
++  </mediaobject>
++</screenshot>
++</para>
++<para></para>
++</sect2>
++
++</sect1>
++
++</chapter>
++
++<chapter id="Internals">
++<title>Kwestie wewnętrzne</title>
++
++<sect1 id="backupformat">
++<title>Pliki backupu</title>
++
++<para>Pliki backupu stworzone przez  &kpsion; są po prostu zgzipowanymi plikami
++      archiwum tar. Pliki są nazywane zgodnie z poniższą zasadą:
++<variablelist>
++<varlistentry>
++<term>TYP-YYYY-MO-DD-HH-MI-SS.tar.gz</term>
++<listitem><para>
++   gdzie
++  <variablelist>
++  <varlistentry>
++  <term>TYP</term>
++  <listitem><para>
++    jest pojedyńczym znakiem, reprezntujcym typ backupu.
++    'I' określa backup różnicowy (ang. incremental)
++    'F' określa backup pełny (ang. full).
++  </para></listitem>
++  </varlistentry>
++  <varlistentry>
++  <term>YYYY</term>
++  <listitem><para>
++      rok utworzenia
++  </para></listitem>
++  </varlistentry>
++  <varlistentry>
++  <term>MO</term>
++  <listitem><para>
++                miesiąc utworzenia
++  </para></listitem>
++  </varlistentry>
++  <varlistentry>
++  <term>DD</term>
++  <listitem><para>
++                dzień utworzenia
++  </para></listitem>
++  </varlistentry>
++  <varlistentry>
++  <term>HH</term>
++  <listitem><para>
++                godzina utworzenia
++  </para></listitem>
++  </varlistentry>
++  <varlistentry>
++  <term>MI</term>
++  <listitem><para>
++                minuta utworzenia
++  </para></listitem>
++  </varlistentry>
++  <varlistentry>
++  <term>SS</term>
++  <listitem><para>
++                sekunda utworzenia
++  </para></listitem>
++  </varlistentry>
++  </variablelist>
++</para></listitem>
++</varlistentry>
++</variablelist>
++Nazwy plików w archiwum tara są konwertowane aby sprostać oglónym zasadom 
++nazewnictwa plików. Wszystkie wystąpienia znaku '%' są zmieniane na 
++łańcuch '%25', wszystkie wystąpienia '/' są zamieniane na '%2f', a wystąpienia
++'\' są zamieniane na '/'.
++</para>
++<para>
++W powiązaniu do plików danych na Psionie, każde archiwum zawiera
++specjalny plik indeksujący, gdzie są zachowane oryginalne atrybuty
++i charakterystyczny dla Psiona 64 bitowy czas pliku. Ten plik nazywa się
++KPsionIncrementalIndex dla kopii różnicowych oraz KPsionFullIndex dla kopii
++pełnych. Plik indeksu jest przechowywany w katalogu backupu jako plik ASCII,
++zawierający jedną linię danych na jeden plik, z następującymi polami:
++<variablelist>
++<varlistentry>
++<term>hhhhhhhh llllllll ssssssss aaaaaaaa fn</term>
++<listitem><para>
++              gdzie
++  <variablelist>
++  <varlistentry>
++  <term>hhhhhhhh</term>
++  <listitem><para>
++                to 8 cyfrowy szesnastkowy numer reprezentujący wyższą
++                połówkę czasu modyfikacji pliku.
++  </para></listitem>
++  </varlistentry>
++  <varlistentry>
++  <term>llllllll</term>
++  <listitem><para>
++                to 8 cyfrowy szesnastkowy numer reprezentującą niższą
++                połówkę czasu modyfikacji pliku.
++  </para></listitem>
++  </varlistentry>
++  <varlistentry>
++  <term>ssssssss</term>
++  <listitem><para>
++                to 8 cyfrowy szesnastkowy numer reprezentujący rozmiar pliku.
++  </para></listitem>
++  </varlistentry>
++  <varlistentry>
++  <term>aaaaaaaa</term>
++  <listitem><para>
++                to 8 cyfrowy szesnastkowy numer reprezentujący natywne
++                atrybuty pliku.
++  </para></listitem>
++  </varlistentry>
++  <varlistentry>
++  <term>fn</term>
++  <listitem><para>
++                Nieskonwertowana oryginalna nazwa absolutna pliku.
++  </para></listitem>
++  </varlistentry>
++  </variablelist>
++</para></listitem>
++</varlistentry>
++</variablelist>
++Pierwsza linia pliku indeksu zawiera nagłówek o następującym formacie:
++<variablelist>
++<varlistentry>
++<term>#plpbackup index T</term>
++<listitem><para>
++  gdzie
++  <variablelist>
++  <varlistentry>
++  <term>T</term>
++  <listitem><para>
++  jest pojedyńczym znakiem, reprezentującym typ kopii.
++  'I' określa backup różnicowy (ang. incremental)
++  'F' określa backup pełny (ang. full).
++  </para></listitem>
++  </varlistentry>
++  </variablelist>
++</para></listitem>
++</varlistentry>
++</variablelist>
++</para>
++</sect1>
++</chapter>
++
++<chapter id="faq">
++      <title>FAQ - Pytania i odpowiedzi</title>
++
++&reporting.bugs;
++ 
++<qandaset id="faqlist">
++<qandaentry>
++<question>
++      <para>Mam Psiona serii 3 i &kpsion; nie działa.</para>
++</question>
++<answer>
++<para>
++      Ten problem jest aktualnie znany i wynika z błędu w plplib. Przykro mi, 
++      ale musisz poczekać aż to zostanie naprawione.
++</para>
++</answer>
++</qandaentry>
++</qandaset>
++</chapter>
++
++<chapter id="Author">
++<title>Author</title>
++
++<para>Copyright 2001 Fritz Elfert</para>
++
++<para>&kpsion; is written by Fritz Elfert.</para>
++
++<para>The author can be reached through email at
++<email>felfert@to.com</email>.  Please report any bugs you find to me so
++that I can fix them. If you have a suggestion, feel free to contact me.</para>
++
++&underFDL;
++&underGPL;
++
++</chapter>
++</book>
++<!--
++Local Variables:
++mode: sgml
++sgml-omittag: nil
++sgml-shorttag: t
++sgml-set-face: t
++End:
++-->
+diff -Nur plptools-0.12.orig/kde2/doc/pl/Makefile.am plptools-0.12/kde2/doc/pl/Makefile.am
+--- plptools-0.12.orig/kde2/doc/pl/Makefile.am 1970-01-01 01:00:00.000000000 +0100
++++ plptools-0.12/kde2/doc/pl/Makefile.am      2004-09-24 01:05:00.204795736 +0200
+@@ -0,0 +1,11 @@
++
++KDE_LANG = pl
++KDE_DOCS = kpsion
++
++EXTRA_DIST = index.docbook.in
++
++index.docbook: index.docbook.in
++      cat index.docbook.in | perl -e 'while (<>) { if (/\$$Date$$/) { $$d=$$1; } s/__DATE__/$$d/; s/__VERSION__/$(VERSION)/; print; }' > index.docbook
++
++maintainer-clean-local:
++      rm -f Makefile.in
diff --git a/plptools.am_edit b/plptools.am_edit
new file mode 100644 (file)
index 0000000..9e37025
--- /dev/null
@@ -0,0 +1,1998 @@
+#!/usr/bin/perl -w
+
+# Expands the specialised KDE tags in Makefile.in to (hopefully) valid
+# make syntax.
+# When called without file parameters, we work recursively on all Makefile.in
+# in and below the current subdirectory. When called with file parameters,
+# only those Makefile.in are changed.
+# The currently supported tags are
+#
+# {program}_METASOURCES
+# where you have a choice of two styles
+#   {program}_METASOURCES = name1.moc name2.moc ... [\]
+#   {program}_METASOURCES = AUTO
+#       The second style requires other tags as well.
+#
+# To install icons :
+#    KDE_ICON = iconname iconname2 ...
+#    KDE_ICON = AUTO
+#
+# For documentation :
+#    ...
+#
+# and more new tags TBD!
+#
+# The concept (and base code) for this program came from automoc,
+# supplied by the following
+#
+# Matthias Ettrich <ettrich@kde.org>      (The originator)
+# Kalle Dalheimer <kalle@kde.org>      (The original implementator)
+# Harri Porten  <porten@tu-harburg.de>
+# Alex Zepeda  <jazepeda@pacbell.net>
+# David Faure <faure@kde.org>
+# Stephan Kulow <coolo@kde.org>
+
+use Cwd;
+use File::Find;
+use File::Basename;
+
+# Prototype the functions
+sub initialise ();
+sub processMakefile ($);
+sub updateMakefile ();
+sub restoreMakefile ();
+
+sub removeLine ($$);
+sub appendLines ($);
+sub substituteLine ($$);
+
+sub findMocCandidates ();
+sub pruneMocCandidates ($);
+sub checkMocCandidates ();
+sub addMocRules ();
+
+sub tag_AUTOMAKE ();
+sub tag_META_INCLUDES ();
+sub tag_METASOURCES ();
+sub tag_POFILES ();
+sub tag_DOCFILES ();
+sub tag_LOCALINSTALL();
+sub tag_IDLFILES();
+sub tag_UIFILES();
+sub tag_SUBDIRS();
+sub tag_ICON();
+sub tag_CLOSURE();
+sub tag_DIST();
+
+# Some global globals...
+$verbose    = 0;        # a debug flag
+$thisProg   = "$0";     # This programs name
+$topdir     = cwd();    # The current directory
+@makefiles  = ();       # Contains all the files we'll process
+@foreignfiles = ();
+$start      = (times)[0]; # some stats for testing - comment out for release
+$version    = "v0.2";
+$errorflag  = 0;
+$cppExt     = "(cpp|cc|cxx|C|c\\+\\+)";
+$hExt       = "(h|H|hh|hxx|hpp|h\\+\\+)";
+$progId     = "KDE tags expanded automatically by " . basename($thisProg);
+$automkCall = "\n";
+$printname  = "";  # used to display the directory the Makefile is in
+$use_final  = 1;        # create code for --enable-final
+$cleantarget = "clean";
+$dryrun     = 0;
+$pathoption = 0;
+$foreign_libtool = 0;
+
+while (defined ($ARGV[0]))
+{
+    $_ = shift;
+    if (/^--version$/)
+    {
+        print STDOUT "\n";
+        print STDOUT basename($thisProg), " $version\n",
+                "This is really free software, unencumbered by the GPL.\n",
+                "You can do anything you like with it except sueing me.\n",
+                "Copyright 1998 Kalle Dalheimer <kalle\@kde.org>\n",
+                "Concept, design and unnecessary questions about perl\n",
+                "       by Matthias Ettrich <ettrich\@kde.org>\n\n",
+                "Making it useful by Stephan Kulow <coolo\@kde.org> and\n",
+                "Harri Porten <porten\@kde.org>\n",
+                "Updated (Feb-1999), John Birch <jb.nz\@writeme.com>\n",
+               "Current Maintainer Stephan Kulow\n\n";
+        exit 0;
+    }
+    elsif (/^--verbose$|^-v$/)
+    {
+        $verbose = 1;       # Oh is there a problem...?
+    }
+    elsif (/^-p(.+)$|^--path=(.+)$/)
+    {
+        $thisProg = "$1/".basename($thisProg) if($1);
+        $thisProg = "$2/".basename($thisProg) if($2);
+        warn ("$thisProg doesn't exist\n")      if (!(-f $thisProg));
+        $pathoption=1;
+    }
+    elsif (/^--help$|^-h$/)
+    {
+        print STDOUT "Usage $thisProg [OPTION] ... [dir/Makefile.in]...\n",
+                "\n",
+                "Patches dir/Makefile.in generated from automake\n",
+                "(where dir can be a full or relative directory name)",
+                "\n",
+                "  -v, --verbose      verbosely list files processed\n",
+                "  -h, --help         print this help, then exit\n",
+                "  --version          print version number, then exit\n",
+                "  -p, --path=        use the path to am_edit if the path\n",
+               "  --no-final         don't patch for --enable-final\n",
+                "                     called from is not the one to be used\n";
+       
+        exit 0;
+    }
+    elsif (/^--no-final$/)
+    {
+       $use_final = 0;
+        $thisProg .= " --no-final";
+    }
+    elsif (/^--foreign-libtool$/)
+    {
+        $foreign_libtool = 1;
+        $thisProg .= " --foreign-libtool";
+    }
+    elsif (/^-n$/)
+    {
+       $dryrun = 1;
+    }
+    else
+    {
+        # user selects what input files to check
+        # add full path if relative path is given
+        $_ = cwd()."/".$_   if (! /^\//);
+        print "User wants $_\n" if ($verbose);
+        push (@makefiles, $_);
+    }
+}
+
+if ($thisProg =~ /^\// && !$pathoption )
+{
+  print STDERR "Illegal full pathname call performed...\n",
+      "The call to \"$thisProg\"\nwould be inserted in some Makefile.in.\n",
+      "Please use option --path.\n";
+  exit 1;
+}
+
+# Only scan for files when the user hasn't entered data
+if (!@makefiles)
+{
+    print STDOUT "Scanning for Makefile.in\n"       if ($verbose);
+    find (\&add_makefile, cwd());
+    #chdir('$topdir');
+} else {
+    print STDOUT "Using user enter input files\n"   if ($verbose);
+}
+
+foreach $makefile (sort(@makefiles))
+{
+    processMakefile ($makefile);
+    last            if ($errorflag);
+}
+
+# Just some debug statistics - comment out for release as it uses printf.
+printf STDOUT "Time %.2f CPU sec\n", (times)[0] - $start     if ($verbose);
+
+exit $errorflag;        # causes make to fail if erroflag is set
+
+#-----------------------------------------------------------------------------
+
+# In conjunction with the "find" call, this builds the list of input files
+sub add_makefile ()
+{
+  push (@makefiles, $File::Find::name) if (/Makefile.in$/);
+}
+
+#-----------------------------------------------------------------------------
+
+# Processes a single make file
+# The parameter contains the full path name of the Makefile.in to use
+sub processMakefile ($)
+{
+    # some useful globals for the subroutines called here
+    local ($makefile)       = @_;
+    local @headerdirs       = ('.');
+    local $haveAutomocTag   = 0;
+    local $MakefileData     = "";
+
+    local $cxxsuffix  = "KKK";
+
+    local @programs = ();  # lists the names of programs and libraries
+    local $program = "";
+
+    local %realObjs = ();  # lists the objects compiled into $program
+    local %sources = ();   # lists the sources used for $program
+    local %finalObjs = (); # lists the objects compiled when final
+    local %realname = ();  # the binary name of program variable
+    local %idlfiles = ();  # lists the idl files used for $program
+    local %globalmocs = ();# list of all mocfiles (in %mocFiles format)
+    local %important = (); # list of files to be generated asap
+    local %uiFiles = ();
+
+    local $allidls = "";
+    local $idl_output = "";# lists all idl generated files for cleantarget
+    local $ui_output = "";# lists all uic generated files for cleantarget
+
+    local %depedmocs = ();
+    
+    local $metasourceTags = 0;
+    local $dep_files      = "";
+    local $dep_finals     = "";
+    local %target_adds    = (); # the targets to add
+    local $kdelang        = "";
+    local @cleanfiles     = ();
+    local $cleanMoc       = "";
+    local $closure_output = "";
+
+    $makefileDir = dirname($makefile);
+    chdir ($makefileDir);
+    $printname = $makefile;
+    $printname =~ s/^\Q$topdir\E\///;
+    $makefile = basename($makefile);
+
+    print STDOUT "Processing makefile $printname\n"   if ($verbose);
+    
+    # Setup and see if we need to do this.
+    return      if (!initialise());
+    
+    tag_AUTOMAKE ();            # Allows a "make" to redo the Makefile.in
+    tag_META_INCLUDES ();       # Supplies directories for src locations
+    
+    foreach $program (@programs) {
+        $sources_changed{$program} = 0;
+        $depedmocs{$program} = "";
+        $important{$program} = "";
+       tag_IDLFILES();             # Sorts out idl rules
+       tag_CLOSURE();
+       tag_UIFILES();             # Sorts out ui rules
+        tag_METASOURCES ();         # Sorts out the moc rules
+        if ($sources_changed{$program}) {
+            my $lookup = "$program" . '_SOURCES\s*=\s*(.*)';
+            substituteLine($lookup, "$program\_SOURCES=" . $sources{$program});
+        }
+        if ($important{$program}) {
+            local %source_dict = ();
+            for $source (split(/[\034\s]+/, $sources{$program})) {
+                $source_dict{$source} = 1;
+            }
+            for $source (@cleanfiles) {
+                $source_dict{$source} = 0;
+            }
+            for $source (keys %source_dict) {
+                next if (!$source);
+                if ($source_dict{$source}) {
+                    # sanity check
+                    if (! -f $source) {
+                        print STDERR "Error: $source is listed in a _SOURCE line in $printname, but doesn't exist yet. Put it in DISTCLEANFILES!\n";
+                    } else {
+                        $target_adds{"\$(srcdir)/$source"} .= $important{$program};
+                    }
+                }
+            }
+        }
+    }
+    if ($cleanMoc) {
+        # Always add dist clean tag
+        # Add extra *.moc.cpp files created for USE_AUTOMOC because they
+        # aren't included in the normal *.moc clean rules.
+        appendLines ("$cleantarget-metasources:\n\t-rm -f $cleanMoc\n");
+        $target_adds{"$cleantarget-am"} .= "$cleantarget-metasources ";
+    }
+    
+    tag_DIST() unless ($kdeopts{"noautodist"});
+
+    if ($idl_output) {
+        appendLines ("$cleantarget-idl:\n\t-rm -f $idl_output\n");
+        $target_adds{"$cleantarget-am"} .= "$cleantarget-idl ";
+    }
+
+    if ($ui_output) {
+        appendLines ("$cleantarget-ui:\n\t-rm -f $ui_output\n");
+        $target_adds{"$cleantarget-am"} .= "$cleantarget-ui ";
+    }
+
+    if ($closure_output) {
+        appendLines ("$cleantarget-closures:\n\t-rm -f $closure_output\n");
+        $target_adds{"$cleantarget-am"} .= "$cleantarget-closures ";
+    }
+
+    if ($MakefileData =~ /\nKDE_LANG\s*=\s*(\S*)\s*\n/) {
+        $kdelang = '$(KDE_LANG)'
+    } else {
+        $kdelang = '';
+    }
+
+    tag_POFILES ();             # language rules for po directory
+    tag_DOCFILES ();            # language rules for doc directories
+    tag_LOCALINSTALL();         # add $(DESTDIR) before all kde_ dirs
+    tag_ICON();
+    tag_SUBDIRS();
+
+    my $tmp = "force-reedit:\n";
+    $tmp   .= "\t$automkCall\n\tcd \$(top_srcdir) && perl $thisProg $printname\n\n";
+    appendLines($tmp);
+    
+    make_meta_classes();
+    tag_COMPILE_FIRST();
+    tag_FINAL() if (!$kdeopts{"nofinal"});
+
+    my $final_lines = "final:\n\t\$(MAKE) ";
+    my $final_install_lines = "final-install:\n\t\$(MAKE) ";
+    my $nofinal_lines = "no-final:\n\t\$(MAKE) ";
+    my $nofinal_install_lines = "no-final-install:\n\t\$(MAKE) ";
+
+    foreach $program (@programs) {
+        
+        my $lookup = "$program\_OBJECTS.*=[^\n]*";
+        
+        my $new = "";
+        
+        my @list = split(/[\034\s]+/, $realObjs{$program});
+        
+        if (!$kdeopts{"nofinal"} && @list > 1 && $finalObjs{$program}) {
+            
+            $new .= "$program\_final\_OBJECTS = " . $finalObjs{$program};
+            $new .= "\n$program\_nofinal\_OBJECTS = " . $realObjs{$program};
+            $new .= "\n\@KDE_USE_FINAL_FALSE\@$program\_OBJECTS = \$($program\_nofinal\_OBJECTS)";
+            $new .= "\n\@KDE_USE_FINAL_TRUE\@$program\_OBJECTS = \$($program\_final\_OBJECTS)";
+            
+            $final_lines .= "$program\_OBJECTS=\"\$($program\_final_OBJECTS)\" ";
+            $final_install_lines .= "$program\_OBJECTS=\"\$($program\_final_OBJECTS)\" ";
+            $nofinal_lines .= "$program\_OBJECTS=\"\$($program\_nofinal\_OBJECTS)\" ";
+            $nofinal_install_lines .= "$program\_OBJECTS=\"\$($program\_nofinal_OBJECTS)\" ";
+        } else {
+            $new = "$program\_OBJECTS = " . $realObjs{$program};
+        }
+        substituteLine ($lookup, $new);
+    }
+    appendLines($final_lines . "all-am");
+    appendLines($final_install_lines . "install-am");
+    appendLines($nofinal_lines . "all-am");
+    appendLines($nofinal_install_lines . "install-am");
+    
+    my $lookup = 'DEP_FILES\s*=([^\n]*)';
+    if ($MakefileData =~ /\n$lookup\n/o) {
+        $depfiles = $1;
+        
+        if ($dep_finals) {
+            $lines  = "\@KDE_USE_FINAL_TRUE\@DEP_FILES = $dep_files $dep_finals \034\t$depfiles\n";
+            $lines .= "\@KDE_USE_FINAL_FALSE\@DEP_FILES = $dep_files $depfiles\n";
+        } else {
+            $lines = "DEP_FILES = $dep_files $depfiles\n";
+        }
+        
+        substituteLine($lookup, $lines);
+    }
+    
+    my $cvs_lines = "cvs-clean:\n";
+    $cvs_lines .= "\t\$(MAKE) -f \$(top_srcdir)/admin/Makefile.common cvs-clean\n";
+    appendLines($cvs_lines);
+    
+    $cvs_lines  = "kde-rpo-clean:\n";
+    $cvs_lines .= "\t-rm -f *.rpo\n";
+    appendLines($cvs_lines);
+    $target_adds{"clean"} .= "kde-rpo-clean ";
+
+    # some strange people like to do a install-exec, and expect that also
+    # all modules are installed.  automake doesn't know this, so we need to move
+    # this here from install-data to install-exec.
+    if ($MakefileData =~ m/\nkde_module_LTLIBRARIES\s*=/) {
+      $target_adds{"install-exec-am"} .= "install-kde_moduleLTLIBRARIES";
+      my $lookup = 'install-data-am:\s*(.*)';
+      if ($MakefileData =~ /\n$lookup\n/) {
+        my $newdeps = $1;
+       $newdeps =~ s/\s*install-kde_moduleLTLIBRARIES\s*/ /g;
+       substituteLine($lookup, "install-data-am: " . $newdeps);
+      }
+    }
+    
+    my $lines = "";
+
+    foreach $add (keys %target_adds) {
+       my $lookup = quotemeta($add) . ':([^\n]*)';
+        if ($MakefileData =~ /\n$lookup\n/) {
+            substituteLine($lookup, "$add: " . $target_adds{$add} . $1);
+        } else {
+            $lines .= "$add: " . $target_adds{$add} . "\n";
+        }
+    }
+    if ($lines) {
+        appendLines($lines);
+    }
+
+    my $found = 1;
+    
+    while ($found) {
+        if ($MakefileData =~ m/\n(.*)\$\(CXXFLAGS\)(.*)\n/) {
+            my $vor = $1;   # "vor" means before in German
+            my $nach = $2; # "nach" means after in German
+            my $lookup = quotemeta("$1\$(CXXFLAGS)$2");
+            my $replacement = "$1\$(KCXXFLAGS)$2";
+            $MakefileData =~ s/$lookup/$replacement/;
+            $lookup =~ s/\\\$\\\(CXXFLAGS\\\)/\\\$\\\(KCXXFLAGS\\\)/;
+            $replacement = "$vor\$(KCXXFLAGS) \$(KDE_CXXFLAGS)$nach";
+            substituteLine($lookup, $replacement);
+        } else {
+            $found = 0;
+        }
+    }
+
+    if($foreign_libtool == 0) {
+        $lookup = '(\n[^#].*\$\(LIBTOOL\) --mode=link) (\$\(CXXLD\).*\$\(KCXXFLAGS\))';
+    
+        if ($MakefileData =~ m/$lookup/ ) {
+            $MakefileData =~ s/$lookup/$1 --tag=CXX $2/;
+        }
+
+        $lookup = '(\n[^#].*\$\(LIBTOOL\) --mode=compile)\s+(\$\(CXX\)\s+)';
+        if ($MakefileData =~ m/$lookup/ ) {
+            $MakefileData =~ s/$lookup/$1 --tag=CXX $2/;
+        }
+    }
+
+    $MakefileData =~ s/\$\(KCXXFLAGS\)/\$\(CXXFLAGS\)/g;
+
+    $lookup = '(.*)cp -pr \$\$/\$\$file \$\(distdir\)/\$\$file(.*)';
+    if ($MakefileData =~ m/\n$lookup\n/) {
+        substituteLine($lookup, "$1cp -pr \$\$d/\$\$file \$(distdir)/\$\$file$2");
+    }
+
+    # Always update the Makefile.in
+    updateMakefile ();
+    return;
+}
+
+#-----------------------------------------------------------------------------
+
+# Check to see whether we should process this make file.
+# This is where we look for tags that we need to process.
+# A small amount of initialising on the tags is also done here.
+# And of course we open and/or create the needed make files.
+sub initialise ()
+{
+    if (! -r "Makefile.am") {
+       print STDOUT "found Makefile.in without Makefile.am\n" if ($verbose);
+       return 0;
+    }
+
+    # Checking for files to process...
+    open (FILEIN, $makefile)
+      || die "Could not open $makefileDir/$makefile: $!\n";
+    # Read the file
+    # stat(FILEIN)[7] might look more elegant, but is slower as it 
+    # requires stat'ing the file
+    seek(FILEIN, 0, 2);
+    my $fsize = tell(FILEIN);
+    seek(FILEIN, 0, 0);
+    read FILEIN, $MakefileData, $fsize;
+    close FILEIN;
+    print "DOS CRLF within $makefileDir/$makefile!\n" if($MakefileData =~ y/\r//d);
+
+    # Remove the line continuations, but keep them marked
+    # Note: we lose the trailing spaces but that's ok.
+    $MakefileData =~ s/\\\s*\n\s*/\034/g;
+
+    # If we've processed the file before...
+    restoreMakefile ()      if ($MakefileData =~ /$progId/);
+
+    foreach $dir (@foreignfiles) {
+      if (substr($makefileDir,0,length($dir)) eq $dir) {
+       return 0;
+      }
+    }
+
+    %kdeopts = ();
+    $kdeopts{"foreign"} = 0;
+    $kdeopts{"qtonly"} = 0;
+    $kdeopts{"noautodist"} = 0;
+    $kdeopts{"foreign-libtool"} = $foreign_libtool;
+    $kdeopts{"nofinal"} = !$use_final; # default
+
+    if ($MakefileData =~ /\nKDE_OPTIONS\s*=\s*([^\n]*)\n/) {
+        local @kde_options = split(/[\s\034]/, $1);
+        if (grep(/^foreign$/, @kde_options)) {
+            push(@foreignfiles, $makefileDir . "/");
+            return 0; # don't touch me
+        }
+        for $opt (@kde_options) {
+            if (!defined $kdeopts{$opt}) {
+                print STDERR "Warning: unknown option $opt in $printname\n";
+            } else {
+                $kdeopts{$opt} = 1;
+            }
+        }
+    }
+
+    # Look for the tags that mean we should process this file.
+    $metasourceTags = 0;
+    $metasourceTags++    while ($MakefileData =~ /\n[^=\#]*METASOURCES\s*=/g);
+
+    my $pofileTag = 0;
+    $pofileTag++    while ($MakefileData =~ /\nPOFILES\s*=/g);
+    if ($pofileTag > 1)
+      {
+          print STDERR "Error: Only one POFILES tag allowed\n";
+          $errorflag = 1;
+      }
+
+    while ($MakefileData =~ /\n\.SUFFIXES:([^\n]+)\n/g) {
+       my @list=split(' ', $1);
+       foreach $ext (@list) {
+           if ($ext =~ /^\.$cppExt$/) {
+               $cxxsuffix = $ext;
+               $cxxsuffix =~ s/\.//g;
+               print STDOUT "will use suffix $cxxsuffix\n" if ($verbose);
+               last;
+           }
+       }
+    }
+                                                     
+    while ($MakefileData =~ /\n(\S*)_OBJECTS\s*=[ \t\034]*([^\n]*)\n/g) {
+        
+        my $program = $1;
+        my $objs = $2; # safe them
+        
+        my $ocv = 0;
+        
+        my @objlist = split(/[\s\034]+/, $objs);
+        foreach $obj (@objlist) {
+            if ($obj =~ /\$\((\S+)\)/ ) {
+                my $variable = $1;
+                if ($variable !~ 'OBJEXT') {
+                    $ocv = 1;
+                }
+            }
+        }
+        
+        next if ($ocv);
+
+        $program =~ s/^am_// if ($program =~ /^am_/);
+        
+        my $sourceprogram = $program;
+        $sourceprogram =~ s/\@am_/\@/ if($sourceprogram =~ /^.*\@am_.+/);
+        
+        print STDOUT "found program $program\n" if ($verbose);
+        push(@programs, $program);
+        
+        $realObjs{$program} = $objs;
+        
+        if ($MakefileData =~ /\n$sourceprogram\_SOURCES\s*=\s*(.*)\n/) {
+            $sources{$program} = $1;
+        } 
+        else {
+            $sources{$program} = "";
+            print STDERR "found program with no _SOURCES: $program\n";
+        }
+        
+        my $realprogram = $program;
+        $realprogram =~ s/_/./g; # unmask to regexp
+        if ($MakefileData =~ /\n($realprogram)(\$\(EXEEXT\)?)?:.*\$\($program\_OBJECTS\)/) {
+            $realname{$program} = $1;
+        } else {
+            # not standard Makefile - nothing to worry about
+            $realname{$program} = "";
+        }
+    }
+    
+    my $lookup = '\nDEPDIR\s*=.*';
+    if ($MakefileData !~ /($lookup)\n/o) {
+        $lookup = '\nbindir\s*=.*';
+        if ($MakefileData =~ /($lookup)\n/) {
+            substituteLine ($lookup, "DEPDIR = .deps\n$1");
+        }
+    } 
+
+    my @marks = ('MAINTAINERCLEANFILES', 'CLEANFILES', 'DISTCLEANFILES');
+    foreach $mark (@marks) {
+        while ($MakefileData =~ /\n($mark)\s*=\s*([^\n]*)/g) {
+            foreach $file (split('[\034\s]', $2)) {
+                $file =~ s/\.\///;
+                push(@cleanfiles, $file);
+            }
+        }
+    }
+
+    my $localTag = 0;
+    $localTag++ if ($MakefileData =~ /\ninstall-\S+-local:/);
+    
+    return (!$errorflag);
+}
+
+#-----------------------------------------------------------------------------
+
+# Gets the list of user defined directories - relative to $srcdir - where
+# header files could be located.
+sub tag_META_INCLUDES ()
+{
+    my $lookup = '[^=\n]*META_INCLUDES\s*=\s*(.*)';
+    return 1    if ($MakefileData !~ /($lookup)\n/o);
+    print STDOUT "META_INCLUDE processing <$1>\n"       if ($verbose);
+
+    my $headerStr = $2;
+    removeLine ($lookup, $1);
+
+    $headerStr =~ tr/\034/ /;
+    my @headerlist = split(' ', $headerStr);
+
+    foreach $dir (@headerlist)
+    {
+        $dir =~ s#\$\(srcdir\)#.#;
+        if (! -d $dir)
+        {
+            print STDERR "Warning: $dir can't be found. ",
+                            "Must be a relative path to \$(srcdir)\n";
+        }
+        else
+        {
+            push (@headerdirs, $dir);
+        }
+    }
+
+    return 0;
+}
+
+#-----------------------------------------------------------------------------
+
+sub tag_FINAL()
+{
+    my @final_names = ();
+    
+    foreach $program (@programs) {
+        
+        if ($sources{$program} =~ /\(/) {
+            print STDOUT "found ( in $program\_SOURCES. skipping\n" if ($verbose);
+            next;
+        }
+        
+        my $mocsources = "";
+        
+        my @progsources = split(/[\s\034]+/, $sources{$program});
+        my %sourcelist = ();
+        
+        foreach $source (@progsources) {
+            my $suffix = $source;
+            $suffix =~ s/^.*\.([^\.]+)$/$1/;
+            
+            if (defined($sourcelist{$suffix})) {
+                $sourcelist{$suffix} .= " " . $source;
+            } else {
+                $sourcelist{$suffix} .= $source;
+            }
+        }
+        
+        foreach $suffix (keys %sourcelist) {
+            
+            # See if this file contains c++ code. (ie Just check the files suffix against
+            my $suffix_is_cxx = 0;
+            if($suffix =~ /($cppExt)$/) {
+              $cxxsuffix = $1;
+              $suffix_is_cxx = 1;
+            }
+            
+            my $mocfiles_in = ($suffix eq $cxxsuffix) &&
+              defined($depedmocs{$program});
+            
+            my @sourcelist = split(/[\s\034]+/, $sourcelist{$suffix});
+            
+            if ((@sourcelist == 1 && !$mocfiles_in) || $suffix_is_cxx != 1 ) {
+                
+                # we support IDL on our own
+                if ($suffix =~ /^skel$/ || $suffix =~ /^stub/ || $suffix =~ /^signals/ 
+                    || $suffix =~ /^h$/ || $suffix =~ /^ui$/ ) {
+                    next;
+                }
+                
+                foreach $file (@sourcelist) {
+                    
+                    $file =~ s/\Q$suffix\E$//;
+                    
+                    $finalObjs{$program} .= $file;
+                    if ($program =~ /_la$/) {
+                        $finalObjs{$program} .= "lo ";
+                    } else {
+                        $finalObjs{$program} .= "o ";
+                    }
+                }
+                next; # suffix
+            }
+            
+            my $source_deps = "";
+            foreach $source (@sourcelist) {
+                if (-f $source) {
+                    $source_deps .= "\$(srcdir)/$source ";
+                } else {
+                    $source_deps .= "$source ";
+                }
+            }
+            
+            $handling = "$program.all_$suffix.$suffix: \$(srcdir)/Makefile.in " . $source_deps . " ";
+            
+            if ($mocfiles_in) {
+                $handling .= $depedmocs{$program};
+                foreach $mocfile (split(' ', $depedmocs{$program})) {
+                   
+                    if ($mocfile =~ m/\.$suffix$/) {
+                        $mocsources .= " " . $mocfile;
+                    }
+                }
+            }
+            
+            $handling .= "\n";
+            $handling .= "\t\@echo 'creating $program.all_$suffix.$suffix ...'; \\\n";
+            $handling .= "\trm -f $program.all_$suffix.files $program.all_$suffix.final; \\\n";
+            $handling .= "\techo \"#define KDE_USE_FINAL 1\" >> $program.all_$suffix.final; \\\n";
+            $handling .= "\tfor file in " . $sourcelist{$suffix} . " $mocsources; do \\\n";
+            $handling .= "\t  echo \"#include \\\"\$\$file\\\"\" >> $program.all_$suffix.files; \\\n";
+            $handling .= "\t  test ! -f \$\(srcdir\)/\$\$file || egrep '^#pragma +implementation' \$\(srcdir\)/\$\$file >> $program.all_$suffix.final; \\\n";
+            $handling .= "\tdone; \\\n";
+            $handling .= "\tcat $program.all_$suffix.final $program.all_$suffix.files  > $program.all_$suffix.$suffix; \\\n";
+            $handling .= "\trm -f $program.all_$suffix.final $program.all_$suffix.files\n";
+            
+            appendLines($handling);
+            
+            push(@final_names, "$program.all_$suffix.$suffix");
+            $finalObjs{$program} .= "$program.all_$suffix.";
+            if ($program =~ /_la$/) {
+                $finalObjs{$program} .= "lo ";
+            } else {
+                $finalObjs{$program} .= "o ";
+            }
+        }
+    }
+    
+    if (!$kdeopts{"nofinal"} && @final_names >= 1) {
+        # add clean-final target
+        my $lines = "$cleantarget-final:\n";
+        $lines .= "\t-rm -f " . join(' ', @final_names) . "\n" if (@final_names);
+        appendLines($lines);
+        $target_adds{"$cleantarget-am"} .= "$cleantarget-final ";
+        
+        foreach $finalfile (@final_names) {
+            $finalfile =~ s/\.[^.]*$/.P/;
+            $dep_finals .= " \$(DEPDIR)/$finalfile";
+        }
+    }
+}
+
+#-----------------------------------------------------------------------------
+
+sub tag_COMPILE_FIRST()
+{
+  foreach $program (@programs) {
+    my $lookup = "$program" . '_COMPILE_FIRST\s*=\s*(.*)';
+    if ($MakefileData =~ m/\n$lookup\n/) {
+      my @compilefirst = split(/[\s\034]+/, $1);
+      my @progsources = split(/[\s\034]+/, $sources{$program});
+      my %donesources = ();
+      $handling = "";
+      foreach $source (@progsources) {
+        my @deps  = ();
+        my $sdeps = "";
+        if (-f $source) {
+          $sdeps = "\$(srcdir)/$source";
+        } else {
+          $sdeps = "$source";
+        }
+        foreach $depend (@compilefirst) {
+          next if ($source eq $depend);
+          # avoid cyclic dependencies
+          next if defined($donesources{$depend});
+          push @deps, $depend;
+        }
+        $handling .= "$sdeps: " . join(' ', @deps) . "\n" if (@deps);
+        $donesources{$source} = 1;
+      }
+      appendLines($handling) if (length($handling));
+    }
+  }
+}
+
+#-----------------------------------------------------------------------------
+
+
+# Organises the list of headers that we'll use to produce moc files
+# from.
+sub tag_METASOURCES ()
+{
+    local @newObs           = ();  # here we add to create object files
+    local @deped            = ();  # here we add to create moc files
+    local $mocExt           = ".moc";
+    local %mocFiles         = ();
+
+    my $line = "";
+    my $postEqual = "";
+
+    my $lookup;
+    my $found = "";
+
+    if ($metasourceTags > 1) {
+       $lookup = $program . '_METASOURCES\s*=\s*(.*)';
+       return 1    if ($MakefileData !~ /\n($lookup)\n/);
+       $found = $1;
+    } else {
+       $lookup = $program . '_METASOURCES\s*=\s*(.*)';
+       if ($MakefileData !~ /\n($lookup)\n/) {
+           $lookup = 'METASOURCES\s*=\s*(.*)';
+           return 1    if ($MakefileData !~ /\n($lookup)\n/o);
+           $found = $1;
+           $metasourceTags = 0; # we can use the general target only once
+       } else {
+            $found = $1;
+        }
+    }
+    print STDOUT "METASOURCE processing <$found>)\n"      if ($verbose);
+    
+    $postEqual = $found;
+    $postEqual =~ s/[^=]*=//;
+    
+    removeLine ($lookup, $found);
+    
+    # Always find the header files that could be used to "moc"
+    return 1    if (findMocCandidates ());
+    
+    if ($postEqual =~ /AUTO\s*(\S*)|USE_AUTOMOC\s*(\S*)/)
+    {
+       print STDERR "$printname: the argument for AUTO|USE_AUTOMOC is obsolete" if ($+);
+       $mocExt = ".moc.$cxxsuffix";
+       $haveAutomocTag = 1;
+    }
+    else
+    {
+        # Not automoc so read the list of files supplied which
+        # should be .moc files.
+
+        $postEqual =~ tr/\034/ /;
+
+        # prune out extra headers - This also checks to make sure that
+        # the list is valid.
+        pruneMocCandidates ($postEqual);
+    }
+
+    checkMocCandidates ();
+    
+    if (@newObs) {
+        my $ext =  ($program =~ /_la$/) ? ".moc.lo " : ".moc.o ";
+        $realObjs{$program} .= "\034" . join ($ext, @newObs) . $ext;
+        $depedmocs{$program} = join (".moc.$cxxsuffix " , @newObs) . ".moc.$cxxsuffix";
+        foreach $file (@newObs) {
+            $dep_files .= " \$(DEPDIR)/$file.moc.P" if($dep_files !~/$file.moc.P/);
+        }
+    }
+    if (@deped) {
+        $depedmocs{$program} .= " ";
+        $depedmocs{$program} .= join('.moc ', @deped) . ".moc";
+        $depedmocs{$program} .= " ";
+    }
+    addMocRules ();
+    @globalmocs{keys %mocFiles}=values %mocFiles;
+}
+
+#-----------------------------------------------------------------------------
+
+# Returns 0 if the line was processed - 1 otherwise.
+# Errors are logged in the global $errorflags
+sub tag_AUTOMAKE ()
+{
+    my $lookup = '.*cd \$\(top_srcdir\)\s+&&[\s\034]+\$\(AUTOMAKE\)(.*)';
+    return 1    if ($MakefileData !~ /\n($lookup)\n/);
+    print STDOUT "AUTOMAKE processing <$1>\n"        if ($verbose);
+
+    my $newLine = $1."\n\tcd \$(top_srcdir) && perl $thisProg $printname";
+    substituteLine ($lookup, $newLine);
+    $automkCall = $1;
+    return 0;
+}
+
+#-----------------------------------------------------------------------------
+
+sub handle_TOPLEVEL()
+{
+    my $pofiles = "";
+    my @restfiles = ();
+    opendir (THISDIR, ".");
+    foreach $entry (readdir(THISDIR)) {
+        next if (-d $entry);
+        
+        next if ($entry eq "CVS" || $entry =~ /^\./  || $entry =~ /^Makefile/ || $entry =~ /~$/ || $entry =~ /^\#.*\#$/ || $entry =~ /.gmo$/);
+                 
+        if ($entry =~ /\.po$/) {
+             next;
+        }
+        push(@restfiles, $entry);
+    }
+    closedir (THISDIR);
+            
+    if (@restfiles) {
+        $target_adds{"install-data-am"} .= "install-nls-files ";
+        $lines = "install-nls-files:\n";
+        $lines .= "\t\$(mkinstalldirs) \$(DESTDIR)\$(kde_locale)/$kdelang\n";
+        for $file (@restfiles) {
+            $lines .= "\t\$(INSTALL_DATA) \$\(srcdir\)/$file \$(DESTDIR)\$(kde_locale)/$kdelang/$file\n";
+        }
+       $target_adds{"uninstall"} .= "uninstall-nls-files ";
+        $lines .= "uninstall-nls-files:\n";
+        for $file (@restfiles) {
+            $lines .= "\t-rm -f \$(DESTDIR)\$(kde_locale)/$kdelang/$file\n";
+        }
+        appendLines($lines);
+    }
+    
+    return 0;
+}
+
+#-----------------------------------------------------------------------------
+
+sub tag_SUBDIRS ()
+{
+  if ($MakefileData !~ /\nSUBDIRS\s*=\s*\$\(AUTODIRS\)\s*\n/) {
+    return 1;
+  }
+
+  my $subdirs = ".";
+
+  opendir (THISDIR, ".");
+  foreach $entry (readdir(THISDIR)) {
+    next if ($entry eq "CVS" || $entry =~ /^\./);
+    if (-d $entry && -f $entry . "/Makefile.am") {
+      $subdirs .= " $entry";
+      next;
+    }
+  }
+  closedir (THISDIR);
+
+  my $lines = "SUBDIRS =$subdirs\n";
+  substituteLine('SUBDIRS\s*=.*', $lines);
+  return 0;
+}
+
+sub tag_IDLFILES ()
+{
+    my @psources = split(/[\034\s]+/, $sources{$program});
+    my $dep_lines = "";
+    my @cppFiles = ();
+    
+    foreach $source (@psources) {
+        
+        my $skel = ($source =~ m/\.skel$/);
+        my $stub = ($source =~ m/\.stub$/);
+        my $signals = ($source =~ m/\.signals$/);
+        
+        if ($stub || $skel || $signals) {
+            
+            my $qs = quotemeta($source);
+            $sources{$program} =~ s/$qs//;
+            $sources_changed{$program} = 1;
+            
+            print STDOUT "adding IDL file $source\n" if ($verbose);
+            
+            $source =~ s/\.(stub|skel|signals)$//;
+            
+            my $sourcename;
+            
+            if ($skel) {
+                $sourcename = "$source\_skel";
+            } elsif ($stub) {
+                $sourcename = "$source\_stub";
+            } else {
+                $sourcename = "$source\_signals";
+            }
+            
+            my $sourcedir = '';
+            if (-f "$makefileDir/$source.h") {
+                $sourcedir = '$(srcdir)/';
+            } else {
+                if ($MakefileData =~ /\n$source\_DIR\s*=\s*(\S+)\n/) {
+                    $sourcedir = $1;
+                    $sourcedir .= "/" if ($sourcedir !~ /\/$/);
+                }
+            }
+            
+            if ($allidls !~ /$source\_kidl/) {
+                
+                $dep_lines .= "$source.kidl: $sourcedir$source.h \$(DCOPIDL_DEPENDENCIES)\n";
+                $dep_lines .= "\t\$(DCOPIDL) $sourcedir$source.h > $source.kidl || ( rm -f $source.kidl ; /bin/false )\n";
+                
+                $allidls .= $source . "_kidl ";
+            }
+            
+            if ($allidls !~ /$sourcename/) {
+                
+                $dep_lines_tmp = "";
+
+                if ($skel) {
+                    $dep_lines .= "$sourcename.$cxxsuffix: $source.kidl\n";
+                    $dep_lines .= "\t\$(DCOPIDL2CPP) --c++-suffix $cxxsuffix --no-signals --no-stub $source.kidl\n";
+                } elsif ($stub) {
+                    $dep_lines_tmp = "\t\$(DCOPIDL2CPP) --c++-suffix $cxxsuffix --no-signals --no-skel $source.kidl\n";
+                } else { # signals
+                    $dep_lines_tmp = "\t\$(DCOPIDL2CPP) --c++-suffix $cxxsuffix --no-stub --no-skel $source.kidl\n";
+                }
+
+                if ($stub || $signals) {
+                    $target_adds{"$sourcename.$cxxsuffix"} .= "$sourcename.h ";
+                    $dep_lines .= "$sourcename.h: $source.kidl\n";
+                    $dep_lines .= $dep_lines_tmp;
+                }
+                
+                $allidls .= $sourcename . " ";
+            }
+            
+            $idlfiles{$program} .= $sourcename . " ";
+            
+            if ($program =~ /_la$/) {
+                $realObjs{$program} .= " $sourcename.lo";
+            } else {
+                $realObjs{$program} .= " $sourcename.\$(OBJEXT)";
+            }
+            $sources{$program} .= " $sourcename.$cxxsuffix";
+            $sources_changed{$program} = 1;
+            $important{$program} .= "$sourcename.h " if (!$skel);
+            $idl_output .= "\\\n\t$sourcename.$cxxsuffix $sourcename.h $source.kidl ";
+            push(@cleanfiles, "$sourcename.$cxxsuffix");
+            push(@cleanfiles, "$sourcename.h");
+            push(@cleanfiles, "$sourcename.kidl");
+            $dep_files .= " \$(DEPDIR)/$sourcename.P" if ($dep_files !~/$sourcename.P/);
+        }
+    }
+    if ($dep_lines) {
+        appendLines($dep_lines);
+    }
+    
+    if (0) {
+        my $lookup = "($program)";
+        $lookup .= '(|\$\(EXEEXT\))';
+        $lookup =~ s/\_/./g;
+        $lookup .= ":(.*..$program\_OBJECTS..*)";
+        #    $lookup = quotemeta($lookup);
+        if ($MakefileData =~ /\n$lookup\n/) {
+            
+            my $line = "$1$2: ";
+            foreach $file (split(' ', $idlfiles{$program})) {
+                $line .= "$file.$cxxsuffix ";
+            }
+            $line .= $3;
+            substituteLine($lookup, $line);
+        } else {
+            print STDERR "no built dependency found $lookup\n";
+        }
+    }
+}
+
+sub tag_UIFILES ()
+{
+    my @psources = split(/[\034\s]+/, $sources{$program});
+    my $dep_lines = "";
+    my @depFiles = ();
+    
+    foreach $source (@psources) {
+
+        if ($source =~ m/\.ui$/) {
+
+            print STDERR "adding UI file $source\n" if ($verbose);
+
+            my $qs = quotemeta($source);
+            $sources{$program} =~ s/$qs//;
+            $sources_changed{$program} = 1;
+      
+            $source =~ s/\.ui$//;
+
+            my $sourcedir = '';
+            if (-f "$makefileDir/$source.ui") {
+                $sourcedir = '$(srcdir)/';
+            }
+
+            if (!$uiFiles{$source}) {
+
+                $dep_lines .= "$source.$cxxsuffix: $sourcedir$source.ui $source.h $source.moc\n";
+                $dep_lines .= "\trm -f $source.$cxxsuffix\n";
+                if (!$kdeopts{"qtonly"}) {
+                    $dep_lines .= "\techo '#include <klocale.h>' > $source.$cxxsuffix\n";
+                    my ($mangled_source) = $source;
+                    $mangled_source =~ s/[^A-Za-z0-9]/_/g;  # get rid of garbage
+                    $dep_lines .= "\t\$(UIC) -tr \${UIC_TR} -i $source.h $sourcedir$source.ui | sed -e \"s,\${UIC_TR}( \\\"\\\" ),QString::null,g\" | sed -e \"s,\${UIC_TR}( \\\"\\\"\\, \\\"\\\" ),QString::null,g\" | sed -e \"s,image\\([0-9][0-9]*\\)_data,img\\1_" . $mangled_source . ",g\" >> $source.$cxxsuffix || rm -f $source.$cxxsuffix\n";
+                } else {
+                    $dep_lines .= "\t\$(UIC) -i $source.h $sourcedir$source.ui > $source.$cxxsuffix || rm -f $source.$cxxsuffix\n";
+                }
+                $dep_lines .= "\techo '#include \"$source.moc\"' >> $source.$cxxsuffix\n\n";
+                $dep_lines .= "$source.h: $sourcedir$source.ui\n";
+                $dep_lines .= "\t\$(UIC) -o $source.h $sourcedir$source.ui\n\n";
+                $dep_lines .= "$source.moc: $source.h\n";
+                $dep_lines .= "\t\$(MOC) $source.h -o $source.moc\n";
+
+               $uiFiles{$source} = 1;
+                $depedmocs{$program} .= " $source.moc";
+                $globalmocs{$source} = "\035$source.h\035$source.cpp";
+            }
+            
+            if ($program =~ /_la$/) {
+                $realObjs{$program} .= " $source.lo";
+            } else {
+                $realObjs{$program} .= " $source.\$(OBJEXT)";
+            }
+            $sources{$program} .= " $source.$cxxsuffix";
+            $sources_changed{$program} = 1;
+            $important{$program} .= "$source.h ";
+            $ui_output .= "\\\n\t$source.$cxxsuffix $source.h $source.moc ";
+            push(@cleanfiles, "$source.$cxxsuffix");
+            push(@cleanfiles, "source.h");
+            push(@cleanfiles, "$source.moc");
+            $dep_files .= " \$(DEPDIR)/$source.P" if($dep_files !~/$source.P/ );
+        }
+    }
+    if ($dep_lines) {
+        appendLines($dep_lines);
+    }
+}
+
+sub tag_ICON()
+{
+    my $lookup = '([^\s]*)_ICON\s*=\s*([^\n]*)';
+    my $install = "";
+    my $uninstall = "";
+
+    while ($MakefileData =~ /\n$lookup/og) {
+        my $destdir;
+        if ($1 eq "KDE") {
+            $destdir = "kde_icondir";
+        } else {
+            $destdir = $1 . "dir";
+        }
+        my $iconauto = ($2 =~ /AUTO\s*$/);
+        my @appnames = ();
+        if ( ! $iconauto ) {
+            my @_appnames = split(" ", $2);
+            print STDOUT "KDE_ICON processing <@_appnames>\n"   if ($verbose);
+            foreach $appname (@_appnames) {
+                push(@appnames, quotemeta($appname));
+            }
+        } else {
+            print STDOUT "KDE_ICON processing <AUTO>\n"   if ($verbose);
+        }
+
+        my @files = ();
+        opendir (THISDIR, ".");
+        foreach $entry (readdir(THISDIR)) {
+            next if ($entry eq "CVS" || $entry =~ /^\./  || $entry =~ /^Makefile/ || $entry =~ /~$/ || $entry =~ /^\#.*\#$/);
+            next if (! -f $entry);
+            if ( $iconauto )
+              {
+                  push(@files, $entry)
+                    if ($entry =~ /\.xpm/ || $entry =~ /\.png/ || $entry =~ /\.mng/);
+              } else {
+                  foreach $appname (@appnames) {
+                      push(@files, $entry)
+                        if ($entry =~ /-$appname\.xpm/ || $entry =~ /-$appname\.png/ || $entry =~ /-$appname\.mng/);
+                  }
+              }
+        }
+        closedir (THISDIR);
+        
+        my %directories = ();
+        
+        foreach $file (@files) {
+            my $newfile = $file;
+            my $prefix = $file;
+            $prefix =~ s/\.(png|xpm|mng)$//;
+            my $appname = $prefix;
+            $appname =~ s/^[^-]+-// if ($appname =~ /-/) ;
+            $appname =~ s/^[^-]+-// if ($appname =~ /-/) ;
+            $appname = quotemeta($appname);
+            $prefix =~ s/$appname$//;
+            $prefix =~ s/-$//;
+            
+            $prefix = 'lo16-app' if ($prefix eq 'mini');
+            $prefix = 'lo32-app' if ($prefix eq 'lo');
+            $prefix = 'hi48-app' if ($prefix eq 'large');
+            $prefix .= '-app' if ($prefix =~ m/^...$/);
+            
+            my $type = $prefix;
+            $type =~ s/^.*-([^-]+)$/$1/;
+            $prefix =~ s/^(.*)-[^-]+$/$1/;
+            
+            my %type_hash =
+              (
+               'action' => 'actions',
+               'app' => 'apps',
+               'device' => 'devices',
+               'filesys' => 'filesystems',
+               'mime' => 'mimetypes'
+              );
+            
+            if (! defined $type_hash{$type} ) {
+                print STDERR "unknown icon type $type in $printname ($file)\n";
+                next;
+            }
+            
+            my %dir_hash =
+              (
+               'los' => 'locolor/16x16',
+               'lom' => 'locolor/32x32',
+               'him' => 'hicolor/32x32',
+               'hil' => 'hicolor/48x48',
+               'lo16' => 'locolor/16x16',
+               'lo22' => 'locolor/22x22',
+               'lo32' => 'locolor/32x32',
+               'hi16' => 'hicolor/16x16',
+               'hi22' => 'hicolor/22x22',
+               'hi32' => 'hicolor/32x32',
+               'hi48' => 'hicolor/48x48',
+               'hi64' => 'hicolor/64x64',
+               'hisc' => 'hicolor/scalable'
+              );
+            
+            $newfile =~ s@.*-($appname\.(png|xpm|mng?))@$1@;
+            
+            if (! defined $dir_hash{$prefix}) {
+                print STDERR "unknown icon prefix $prefix in $printname\n";
+                next;
+            }
+            
+            my $dir = $dir_hash{$prefix} . "/" . $type_hash{$type};
+            if ($newfile =~ /-[^\.]/) {
+                my $tmp = $newfile;
+                $tmp =~ s/^([^-]+)-.*$/$1/;
+                $dir = $dir . "/" . $tmp;
+                $newfile =~ s/^[^-]+-//;
+            }
+            
+            if (!defined $directories{$dir}) {
+                $install .= "\t\$(mkinstalldirs) \$(DESTDIR)\$($destdir)/$dir\n";
+                $directories{$dir} = 1;
+            }
+            
+            $install .= "\t\$(INSTALL_DATA) \$(srcdir)/$file \$(DESTDIR)\$($destdir)/$dir/$newfile\n";
+            $uninstall .= "\t-rm -f \$(DESTDIR)\$($destdir)/$dir/$newfile\n";
+            
+        }
+    }
+
+    if (length($install)) {
+        $target_adds{"install-data-am"} .= "install-kde-icons ";
+        $target_adds{"uninstall-am"} .= "uninstall-kde-icons ";
+        appendLines("install-kde-icons:\n" . $install . "\nuninstall-kde-icons:\n" . $uninstall);
+    }
+}
+
+sub handle_POFILES($$)
+{
+  my @pofiles = split(" ", $_[0]);
+  my $lang = $_[1];
+
+  # Build rules for creating the gmo files
+  my $tmp = "";
+  my $allgmofiles     = "";
+  my $pofileLine   = "POFILES =";
+  foreach $pofile (@pofiles)
+    {
+        $pofile =~ /(.*)\.[^\.]*$/;          # Find name minus extension
+        $tmp .= "$1.gmo: $pofile\n";
+        $tmp .= "\trm -f $1.gmo; \$(GMSGFMT) -o $1.gmo \$(srcdir)/$pofile\n";
+        $tmp .= "\ttest ! -f $1.gmo || touch $1.gmo\n";
+        $allgmofiles .= " $1.gmo";
+        $pofileLine  .= " $1.po";
+    }
+  appendLines ($tmp);
+  my $lookup = 'POFILES\s*=([^\n]*)';
+  if ($MakefileData !~ /\n$lookup/o) {
+    appendLines("$pofileLine\nGMOFILES =$allgmofiles");
+  } else {
+    substituteLine ($lookup, "$pofileLine\nGMOFILES =$allgmofiles");
+  }
+
+    if ($allgmofiles) {
+
+        # Add the "clean" rule so that the maintainer-clean does something
+        appendLines ("clean-nls:\n\t-rm -f $allgmofiles\n");
+
+       $target_adds{"maintainer-clean"} .= "clean-nls ";
+
+       $lookup = 'DISTFILES\s*=\s*(.*)';
+       if ($MakefileData =~ /\n$lookup\n/o) {
+         $tmp = "DISTFILES = \$(GMOFILES) \$(POFILES) $1";
+         substituteLine ($lookup, $tmp);
+       }
+    }
+
+  $target_adds{"install-data-am"} .= "install-nls ";
+
+  $tmp = "install-nls:\n";
+  if ($lang) {
+    $tmp  .= "\t\$(mkinstalldirs) \$(DESTDIR)\$(kde_locale)/$lang/LC_MESSAGES\n";
+  }
+  $tmp .= "\t\@for base in ";
+  foreach $pofile (@pofiles)
+    {
+      $pofile =~ /(.*)\.[^\.]*$/;          # Find name minus extension
+      $tmp .= "$1 ";
+    }
+
+  $tmp .= "; do \\\n";
+  if ($lang) {
+    $tmp .= "\t  echo \$(INSTALL_DATA) \$\$base.gmo \$(DESTDIR)\$(kde_locale)/$lang/LC_MESSAGES/\$\$base.mo ;\\\n";
+    $tmp .= "\t  test ! -f \$\$base.gmo || \$(INSTALL_DATA) \$\$base.gmo \$(DESTDIR)\$(kde_locale)/$lang/LC_MESSAGES/\$\$base.mo ;\\\n"
+  } else {
+    $tmp .= "\t  echo \$(INSTALL_DATA) \$\$base.gmo \$(DESTDIR)\$(kde_locale)/\$\$base/LC_MESSAGES/\$(PACKAGE).mo ;\\\n";
+    $tmp .= "\t  \$(mkinstalldirs) \$(DESTDIR)\$(kde_locale)/\$\$base/LC_MESSAGES ; \\\n";
+    $tmp .= "\t  test ! -f \$\$base.gmo || \$(INSTALL_DATA) \$\$base.gmo \$(DESTDIR)\$(kde_locale)/\$\$base/LC_MESSAGES/\$(PACKAGE).mo ;\\\n";
+  }
+  $tmp .= "\tdone\n\n";
+  appendLines ($tmp);
+
+  $target_adds{"uninstall"} .= "uninstall-nls ";
+
+  $tmp = "uninstall-nls:\n";
+  foreach $pofile (@pofiles)
+    {
+      $pofile =~ /(.*)\.[^\.]*$/;          # Find name minus extension
+      if ($lang) {
+       $tmp .= "\trm -f \$(DESTDIR)\$(kde_locale)/$lang/LC_MESSAGES/$1.mo\n";
+      } else {
+       $tmp .= "\trm -f \$(DESTDIR)\$(kde_locale)/$1/LC_MESSAGES/\$(PACKAGE).mo\n";
+      }
+    }
+  appendLines($tmp);
+
+  $target_adds{"all"} .= "all-nls ";
+
+  $tmp = "all-nls: \$(GMOFILES)\n";
+
+  appendLines($tmp);
+
+  $target_adds{"distdir"} .= "distdir-nls ";
+
+  $tmp = "distdir-nls:\$(GMOFILES)\n";
+  $tmp .= "\tfor file in \$(POFILES); do \\\n";
+  $tmp .= "\t  cp \$(srcdir)/\$\$file \$(distdir); \\\n";
+  $tmp .= "\tdone\n";
+  $tmp .= "\tfor file in \$(GMOFILES); do \\\n";
+  $tmp .= "\t  cp \$(srcdir)/\$\$file \$(distdir); \\\n";
+  $tmp .= "\tdone\n";
+
+  appendLines ($tmp);
+
+  if (!$lang) {
+    appendLines("merge:\n\t\$(MAKE) -f \$(top_srcdir)/admin/Makefile.common package-merge POFILES=\"\${POFILES}\" PACKAGE=\${PACKAGE}\n\n");
+  }
+}
+
+#-----------------------------------------------------------------------------
+
+# Returns 0 if the line was processed - 1 otherwise.
+# Errors are logged in the global $errorflags
+sub tag_POFILES ()
+{
+    my $lookup = 'POFILES\s*=([^\n]*)';
+    return 1    if ($MakefileData !~ /\n$lookup/o);
+    print STDOUT "POFILES processing <$1>\n"   if ($verbose);
+
+    my $tmp = $1;
+
+    # make sure these are all gone.
+    if ($MakefileData =~ /\n\.po\.gmo:\n/)
+    {
+        print STDERR "Warning: Found old .po.gmo rules in $printname. New po rules not added\n";
+        return 1;
+    }
+
+    # Either find the pofiles in the directory (AUTO) or use
+    # only the specified po files.
+    my $pofiles = "";
+    if ($tmp =~ /^\s*AUTO\s*$/)
+    {
+        opendir (THISDIR, ".");
+       $pofiles =  join(" ", grep(/\.po$/, readdir(THISDIR)));
+        closedir (THISDIR);
+        print STDOUT "pofiles found = $pofiles\n"   if ($verbose);
+       if (-f "charset" && -f "kdelibs.po") {
+           handle_TOPLEVEL();
+       }
+    }
+    else
+    {
+        $tmp =~ s/\034/ /g;
+        $pofiles = $tmp;
+    }
+    return 1    if (!$pofiles);        # Nothing to do
+
+    handle_POFILES($pofiles, $kdelang);
+
+    return 0;
+}
+
+sub helper_LOCALINSTALL($)
+{
+  my $lookup = "\n" . $_[0] . ":";
+  if ($MakefileData =~ /($lookup)/) {
+
+    my $install = $MakefileData;
+    $install =~ s/\n/\035/g;
+    $install =~ s/.*\035$_[0]:[^\035]*\035//;
+    my $emptyline = 0;
+    while (! $emptyline) {
+      if ($install =~ /([^\035]*)\035(.*)/) {
+       local $line = $1;
+       $install = $2;
+       if ($line !~ /^\s*$/ && $line !~ /^(\@.*\@)*\t/) {
+         $emptyline = 1;
+       } else {
+         replaceDestDir($line);
+       }
+      } else {
+       $emptyline = 1;
+      }
+    }
+  }
+
+}
+
+sub tag_LOCALINSTALL ()
+{
+  helper_LOCALINSTALL('install-exec-local');
+  helper_LOCALINSTALL('install-data-local');
+  helper_LOCALINSTALL('uninstall-local');
+
+  return 0;
+}
+
+sub replaceDestDir($) {
+  local $line = $_[0];
+
+  if (   $line =~ /^\s*(\@.*\@)*\s*\$\(mkinstalldirs\)/
+      || $line =~ /^\s*(\@.*\@)*\s*\$\(INSTALL\S*\)/
+      || $line =~ /^\s*(\@.*\@)*\s*(-?rm.*) \S*$/)
+  {
+    $line =~ s/^(.*) ([^\s]+)\s*$/$1 \$(DESTDIR)$2/ if ($line !~ /\$\(DESTDIR\)/);
+  }
+
+  if ($line ne $_[0]) {
+    $_[0] = quotemeta $_[0];
+    substituteLine($_[0], $line);
+  }
+}
+
+#---------------------------------------------------------------------------
+sub tag_CLOSURE () {
+    return if ($program !~ /_la$/);
+    
+    my $lookup = quotemeta($realname{$program}) . ":.*?\n\t.*?\\((.*?)\\) .*\n";
+    $MakefileData =~ m/$lookup/;
+    return if ($1 !~ /CXXLINK/);
+
+    if ($MakefileData !~ /\n$program\_LDFLAGS\s*=.*-no-undefined/ &&
+        $MakefileData !~ /\n$program\_LDFLAGS\s*=.*KDE_PLUGIN/ ) {
+        print STDERR "Report: $program contains undefined in $printname\n" if ($program =~ /^lib/ && $dryrun);
+        return;
+    }
+    my $closure = $realname{$program} . ".closure";
+    my $lines = "$closure: \$($program\_OBJECTS) \$($program\_DEPENDENCIES)\n";
+    $lines .= "\t\@echo \"int main() {return 0;}\" > $program\_closure.$cxxsuffix\n";
+    $lines .= "\t\@\$\(LTCXXCOMPILE\) -c $program\_closure.$cxxsuffix\n";
+    $lines .= "\t\$\(CXXLINK\) $program\_closure.lo \$($program\_LDFLAGS) \$($program\_OBJECTS) \$($program\_LIBADD) \$(LIBS)\n";
+    $lines .= "\t\@rm -f $program\_closure.* $closure\n";
+    $lines .= "\t\@echo \"timestamp\" > $closure\n";
+    $lines .= "\n";
+    appendLines($lines);
+    $lookup = $realname{$program} . ": (.*)";
+    if ($MakefileData =~ /\n$lookup\n/) {
+        $lines  = "\@KDE_USE_CLOSURE_TRUE@". $realname{$program} . ": $closure $1";
+        $lines .= "\n\@KDE_USE_CLOSURE_FALSE@" . $realname{$program} . ": $1";
+        substituteLine($lookup, $lines);
+    }
+    $closure_output .= " $closure";
+}
+
+sub tag_DIST () {
+    my %foundfiles = ();
+    opendir (THISDIR, ".");
+    foreach $entry (readdir(THISDIR)) {
+        next if ($entry eq "CVS" || $entry =~ /^\./  || $entry =~ /^Makefile$$/ || $entry =~ /~$/ || $entry =~ /^\#.*\#$/);
+        next if (! -f $entry);
+        next if ($entry =~ /\.moc/ || $entry =~ /\.lo$/ || $entry =~ /\.la$/ || $entry =~ /\.o/);
+        next if ($entry =~ /.+meta_unload.$cppExt$/ || $entry =~ /\.all_$cppExt\.$cppExt$/);
+        $foundfiles{$entry} = 1;
+    }
+    closedir (THISDIR);
+
+    # doing this for MAINTAINERCLEANFILES would be wrong
+    my @marks = ("EXTRA_DIST", "DIST_COMMON", '\S*_SOURCES', '\S*_HEADERS', 'CLEANFILES', 'DISTCLEANFILES', '\S*_OBJECTS');
+    foreach $mark (@marks) {
+        while ($MakefileData =~ /\n($mark)\s*=\s*([^\n]*)/g) {
+            foreach $file (split('[\034\s]', $2)) {
+                $file =~ s/\.\///;
+                $foundfiles{$file} = 0 if (defined $foundfiles{$file});
+            }
+        }
+    }
+    my @files = ("Makefile", "config.cache", "config.log", "stamp-h",
+                 "stamp-h1", "stamp-h1", "config.h", "Makefile", "config.status", "config.h", "libtool");
+    foreach $file (@files) {
+        $foundfiles{$file} = 0 if (defined $foundfiles{$file});
+    }
+
+    my $KDE_DIST = "";
+    foreach $file (keys %foundfiles) {
+        if ($foundfiles{$file} == 1) {
+            $KDE_DIST .= "$file ";
+        }
+    }
+    if ($KDE_DIST) {
+        print "KDE_DIST $printname $KDE_DIST\n" if ($verbose);
+        
+        my $lookup = "DISTFILES *=(.*)";
+        if ($MakefileData =~ /\n$lookup\n/o) {
+            substituteLine($lookup, "KDE_DIST=$KDE_DIST\n\nDISTFILES=$1 \$(KDE_DIST)\n");
+        }
+    }
+}
+
+#-----------------------------------------------------------------------------
+# Returns 0 if the line was processed - 1 otherwise.
+# Errors are logged in the global $errorflags
+sub tag_DOCFILES ()
+{
+#    if ($MakefileData =~ /\nSUBDIRS\s*=/) { # subdirs
+#      $MakefileData =~ /\n(.*-recursive:\s*)\n/;
+#      my $orig_rules = $1;
+#      my $rules = $orig_rules;
+#      $rules =~ s/:\s*$//;
+#      substituteLine($orig_rules, "$rules docs-recursive:");
+#      appendLines("docs: docs-recursive docs-am\n");
+#    } else {
+#      appendLines("docs: docs-am\n");
+#    }
+    $target_adds{"all"} .= "docs-am ";
+
+    my $lookup = 'KDE_DOCS\s*=\s*([^\n]*)';
+    goto nodocs    if ($MakefileData !~ /\n$lookup/o);
+    print STDOUT "KDE_DOCS processing <$1>\n"   if ($verbose);
+
+    my $tmp = $1;
+
+    # Either find the files in the directory (AUTO) or use
+    # only the specified po files.
+    my $files = "";
+    my $appname = $tmp;
+    $appname =~ s/^(\S*)\s*.*$/$1/;
+    if ($appname =~ /AUTO/) {
+      $appname = basename($makefileDir);
+      if ("$appname" eq "en") {
+         print STDERR "Error: KDE_DOCS = AUTO relies on the directory name. Yours is 'en' - you most likely want something else, e.g. KDE_DOCS = myapp\n";
+          exit(1);
+      }
+    }
+
+    if ($tmp !~ / - /)
+    {
+        opendir (THISDIR, ".");
+       foreach $entry (readdir(THISDIR)) {
+         next if ($entry eq "CVS" || $entry =~ /^\./  || $entry =~ /^Makefile/ || $entry =~ /~$/ || $entry =~ /^\#.*\#$/);
+         next if (! -f $entry);
+         $files .= "$entry ";
+       }
+        closedir (THISDIR);
+        print STDOUT "docfiles found = $files\n"   if ($verbose);
+    }
+    else
+    {
+        $tmp =~ s/\034/ /g;
+       $tmp =~ s/^\S*\s*-\s*//;
+        $files = $tmp;
+    }
+    goto nodocs if (!$files);        # Nothing to do
+
+    if ($files =~ /(^| )index\.docbook($| )/) {
+      
+      my $lines = "";
+      my $lookup = 'MEINPROC\s*=';
+      if ($MakefileData !~ /\n($lookup)/) {
+       $lines = "MEINPROC=/\$(kde_bindir)/meinproc\n";
+      }
+      $lookup = 'KDE_XSL_STYLESHEET\s*=';
+      if ($MakefileData !~ /\n($lookup)/) {
+        $lines .= "KDE_XSL_STYLESHEET=/\$(kde_datadir)/ksgmltools2/customization/kde-chunk.xsl\n";
+      }
+      $lookup = '\nindex.cache.bz2:';
+      if ($MakefileData !~ /\n($lookup)/) {
+         $lines .= "index.cache.bz2: \$(srcdir)/index.docbook \$(KDE_XSL_STYLESHEET) $files\n";
+         $lines .= "\t-\@if test -n \"\$(MEINPROC)\"; then echo \$(MEINPROC) --check --cache index.cache.bz2 \$(srcdir)/index.docbook; \$(MEINPROC) --check --cache index.cache.bz2 \$(srcdir)/index.docbook; fi\n";
+         $lines .= "\n";
+      }
+      $lines .= "docs-am: index.cache.bz2\n";  
+      $lines .= "\n";
+      $lines .= "install-docs: docs-am install-nls\n";
+      $lines .= "\t\$(mkinstalldirs) \$(DESTDIR)\$(kde_htmldir)/$kdelang/$appname\n";
+      $lines .= "\t\@if test -f index.cache.bz2; then \\\n";
+      $lines .= "\techo \$(INSTALL_DATA) index.cache.bz2 \$(DESTDIR)\$(kde_htmldir)/$kdelang/$appname/; \\\n";
+      $lines .= "\t\$(INSTALL_DATA) index.cache.bz2 \$(DESTDIR)\$(kde_htmldir)/$kdelang/$appname/; \\\n";
+      $lines .= "\tfi\n";
+      $lines .= "\t-rm -f \$(DESTDIR)\$(kde_htmldir)/$kdelang/$appname/common\n";
+      $lines .= "\t\$(LN_S) \$(kde_libs_htmldir)/$kdelang/common \$(DESTDIR)\$(kde_htmldir)/$kdelang/$appname/common\n";
+
+      $lines .= "\n";
+      $lines .= "uninstall-docs:\n";
+      $lines .= "\t-rm -rf \$(kde_htmldir)/$kdelang/$appname\n";
+      $lines .= "\n";
+      $lines .= "clean-docs:\n";
+      $lines .= "\t-rm -f index.cache.bz2\n";
+      $lines .= "\n";
+      $target_adds{"install-data-am"} .= "install-docs ";
+      $target_adds{"uninstall"} .= "uninstall-docs ";
+      $target_adds{"clean-am"} .= "clean-docs ";
+      appendLines ($lines);
+    } else {
+      appendLines("docs-am: $files\n");
+    }
+
+    $target_adds{"install-data-am"} .= "install-nls";
+    $target_adds{"uninstall"} .= "uninstall-nls ";
+
+    $tmp = "install-nls:\n";
+    $tmp .= "\t\$(mkinstalldirs) \$(DESTDIR)\$(kde_htmldir)/$kdelang/$appname\n";
+    $tmp .= "\t\@for base in $files; do \\\n";
+    $tmp .= "\t  echo \$(INSTALL_DATA) \$\$base \$(DESTDIR)\$(kde_htmldir)/$kdelang/$appname/\$\$base ;\\\n";
+    $tmp .= "\t  \$(INSTALL_DATA) \$(srcdir)/\$\$base \$(DESTDIR)\$(kde_htmldir)/$kdelang/$appname/\$\$base ;\\\n";
+    $tmp .= "\tdone\n";
+    if ($appname eq 'common') {
+      $tmp .= "\t\@echo \"merging common and language specific dir\" ;\\\n";
+      $tmp .= "\tif test ! -e \$(kde_htmldir)/en/common/kde-common.css; then echo 'no english docs found in \$(kde_htmldir)/en/common/'; exit 1; fi \n";
+      $tmp .= "\t\@com_files=`cd \$(kde_htmldir)/en/common && echo *` ;\\\n";
+      $tmp .= "\tcd \$(DESTDIR)\$(kde_htmldir)/$kdelang/common ;\\\n";
+      $tmp .= "\tif test -n \"\$\$com_files\"; then for p in \$\$com_files ; do \\\n";
+      $tmp .= "\t  case \" $files \" in \\\n";
+      $tmp .= "\t    *\" \$\$p \"*) ;; \\\n";
+      $tmp .= "\t    *) test ! -e \$\$p && echo \$(LN_S) ../../en/common/\$\$p \$(DESTDIR)\$(kde_htmldir)/$kdelang/common/\$\$p && \$(LN_S) ../../en/common/\$\$p \$\$p ;; \\\n";
+      $tmp .= "\t  esac ; \\\n";
+      $tmp .= "\tdone ; fi ; true\n";
+    }
+    $tmp .= "\n";
+    $tmp .= "uninstall-nls:\n";
+    $tmp .= "\tfor base in $files; do \\\n";
+    $tmp .= "\t  rm -f \$(DESTDIR)\$(kde_htmldir)/$kdelang/$appname/\$\$base ;\\\n";
+    $tmp .= "\tdone\n\n";
+    appendLines ($tmp);
+
+    $target_adds{"distdir"} .= "distdir-nls ";
+
+    $tmp = "distdir-nls:\n";
+    $tmp .= "\tfor file in $files; do \\\n";
+    $tmp .= "\t  cp \$(srcdir)/\$\$file \$(distdir); \\\n";
+    $tmp .= "\tdone\n";
+
+    appendLines ($tmp);
+
+    return 0;
+
+  nodocs:
+    appendLines("docs-am:\n");
+    return 1;
+}
+
+#-----------------------------------------------------------------------------
+# Find headers in any of the source directories specified previously, that
+# are candidates for "moc-ing".
+sub findMocCandidates ()
+{
+    foreach $dir (@headerdirs)
+    {
+        my @list = ();
+        opendir (SRCDIR, "$dir");
+        @hFiles = grep { /.+\.$hExt$/o && !/^\./ } readdir(SRCDIR);
+        closedir SRCDIR;
+        foreach $hf (@hFiles)
+        {
+            next if ($hf =~ /^\.\#/);
+           $hf =~ /(.*)\.[^\.]*$/;          # Find name minus extension
+           next if ($uiFiles{$1});
+            open (HFIN, "$dir/$hf") || die "Could not open $dir/$hf: $!\n";
+            my $hfsize = 0;
+            seek(HFIN, 0, 2);
+            $hfsize = tell(HFIN);
+            seek(HFIN, 0, 0);
+            read HFIN, $hfData, $hfsize;
+            close HFIN;
+            # push (@list, $hf) if(index($hfData, "Q_OBJECT") >= 0); ### fast but doesn't handle //Q_OBJECT
+            if ( $hfData =~ /{([^}]*)Q_OBJECT/s ) {              ## handle " { friend class blah; Q_OBJECT "
+                push (@list, $hf) unless $1 =~ m://[^\n]*Q_OBJECT[^\n]*$:s;  ## handle "// Q_OBJECT"
+            }
+        }
+        # The assoc array of root of headerfile and header filename
+        foreach $hFile (@list)
+        {
+            $hFile =~ /(.*)\.[^\.]*$/;          # Find name minus extension
+            if ($mocFiles{$1})
+            {
+              print STDERR "Warning: Multiple header files found for $1\n";
+              next;                           # Use the first one
+            }
+            $mocFiles{$1} = "$dir\035$hFile";   # Add relative dir
+        }
+    }
+
+    return 0;
+}
+
+#-----------------------------------------------------------------------------
+
+# The programmer has specified a moc list. Prune out the moc candidates
+# list that we found based on looking at the header files. This generates
+# a warning if the programmer gets the list wrong, but this doesn't have
+# to be fatal here.
+sub pruneMocCandidates ($)
+{
+    my %prunedMoc = ();
+    local @mocList = split(' ', $_[0]);
+
+    foreach $mocname (@mocList)
+    {
+        $mocname =~ s/\.moc$//;
+        if ($mocFiles{$mocname})
+        {
+            $prunedMoc{$mocname} = $mocFiles{$mocname};
+        }
+        else
+        {
+            my $print = $makefileDir;
+            $print =~ s/^\Q$topdir\E\\//;
+            # They specified a moc file but we can't find a header that
+            # will generate this moc file. That's possible fatal!
+            print STDERR "Warning: No moc-able header file for $print/$mocname\n";
+        }
+    }
+
+    undef %mocFiles;
+    %mocFiles = %prunedMoc;
+}
+
+#-----------------------------------------------------------------------------
+
+# Finds the cpp files (If they exist).
+# The cpp files get appended to the header file separated by \035
+sub checkMocCandidates ()
+{
+    my @cppFiles;
+    my $cpp2moc;  # which c++ file includes which .moc files
+    my $moc2cpp;  # which moc file is included by which c++ files
+
+    return unless (keys %mocFiles);
+    opendir(THISDIR, ".") || return;
+    @cppFiles = grep { /.+\.$cppExt$/o  && !/.+\.moc\.$cppExt$/o
+                         && !/.+\.all_$cppExt\.$cppExt$/o
+                        && !/^\./  } readdir(THISDIR);
+    closedir THISDIR;
+    return unless (@cppFiles);
+    my $files = join (" ", @cppFiles);
+    $cpp2moc = {};
+    $moc2cpp = {};
+    foreach $cxxf (@cppFiles)
+    {
+      open (CXXFIN, $cxxf) || die "Could not open $cxxf: $!\n";
+      seek(CXXFIN, 0, 2);
+      my $cxxfsize = tell(CXXFIN);
+      seek(CXXFIN, 0, 0);
+      read CXXFIN, $cxxfData, $cxxfsize;
+      close CXXFIN;
+      while(($cxxfData =~ m/^[ \t]*\#include\s*[<\"](.*\.moc)[>\"]/gm)) {
+       $cpp2moc->{$cxxf}->{$1} = 1;
+       $moc2cpp->{$1}->{$cxxf} = 1;
+      }
+    }
+    foreach my $mocFile (keys (%mocFiles))
+    {
+       @cppFiles = keys %{$moc2cpp->{"$mocFile.moc"}};
+        if (@cppFiles == 1) {
+            $mocFiles{$mocFile} .= "\035" . $cppFiles[0];
+           push(@deped, $mocFile);
+        } elsif (@cppFiles == 0) {
+            push (@newObs, $mocFile);           # Produce new object file
+            next    if ($haveAutomocTag);       # This is expected...
+            # But this is an error we can deal with - let them know
+            print STDERR
+                "Warning: No c++ file that includes $mocFile.moc\n";
+        } else {
+            # We can't decide which file to use, so it's fatal. Although as a
+            # guess we could use the mocFile.cpp file if it's in the list???
+            print STDERR
+                "Error: Multiple c++ files that include $mocFile.moc\n";
+            print STDERR "\t",join ("\t", @cppFiles),"\n";
+            $errorflag = 1;
+            delete $mocFiles{$mocFile};
+            # Let's continue and see what happens - They have been told!
+        }
+    }
+}
+
+#-----------------------------------------------------------------------------
+
+# Add the rules for generating moc source from header files
+# For Automoc output *.moc.cpp but normally we'll output *.moc
+# (We must compile *.moc.cpp separately. *.moc files are included
+# in the appropriate *.cpp file by the programmer)
+sub addMocRules ()
+{
+    my $cppFile;
+    my $hFile;
+
+    foreach $mocFile (keys (%mocFiles))
+    {
+        undef $cppFile;
+        ($dir, $hFile, $cppFile) =  split ("\035", $mocFiles{$mocFile}, 3);
+        $dir =~ s#^\.#\$(srcdir)#;
+        if (defined ($cppFile))
+        {
+            $target_adds{"\$(srcdir)/$cppFile"} .= "$mocFile.moc ";
+            appendLines ("$mocFile.moc: $dir/$hFile\n\t\$(MOC) $dir/$hFile -o $mocFile.moc\n");
+            $cleanMoc .= " $mocFile.moc";
+        }
+        else
+        {
+            appendLines ("$mocFile$mocExt: $dir/$hFile\n\t\$(MOC) $dir/$hFile -o $mocFile$mocExt\n");
+            $cleanMoc .= " $mocFile$mocExt";
+        }
+    }
+}
+
+sub make_meta_classes ()
+{
+    return if ($kdeopts{"qtonly"});
+
+    my $cppFile;
+    my $hFile;
+    my $moc_class_headers = "";
+    foreach $program (@programs) {
+       my $mocs = "";
+       my @progsources = split(/[\s\034]+/, $sources{$program});
+       my @depmocs = split(' ', $depedmocs{$program});
+       my %shash = (), %mhash = ();
+       @shash{@progsources} = 1;  # we are only interested in the existence
+       @mhash{@depmocs} = 1;
+
+       print STDOUT "program=$program\n" if ($verbose);
+       print STDOUT "psources=[".join(' ', keys %shash)."]\n" if ($verbose);
+       print STDOUT "depmocs=[".join(' ', keys %mhash)."]\n" if ($verbose);
+       print STDOUT "globalmocs=[".join(' ', keys(%globalmocs))."]\n" if ($verbose);
+       foreach my $mocFile (keys (%globalmocs))
+       {
+           undef $cppFile;
+           ($dir, $hFile, $cppFile) = split ("\035", $globalmocs{$mocFile}, 3);
+           $dir =~ s#^\.#\$(srcdir)#;
+           if (defined ($cppFile))
+           {
+               $mocs .= " $mocFile.moc" if exists $shash{$cppFile};
+           }
+           else
+           {
+               # Bah. This is the case, if no C++ file includes the .moc
+               # file. We make a .moc.cpp file for that. Unfortunately this
+               # is not included in the %sources hash, but rather is mentioned
+               # in %depedmocs. If the user wants to use AUTO he can't just
+               # use an unspecific METAINCLUDES. Instead he must use
+               # program_METAINCLUDES. Anyway, it's not working real nicely.
+               # E.g. Its not clear what happens if user specifies two
+               # METAINCLUDES=AUTO in the same Makefile.am.
+               $mocs .= " $mocFile.moc.$cxxsuffix"
+                   if exists $mhash{$mocFile.".moc.$cxxsuffix"};
+           }
+       }
+       if ($mocs) {
+           print STDOUT "==> mocs=[".$mocs."]\n" if ($verbose);
+           my $sourcename = $program."_meta_unload";
+           my $ext = ($program =~ /_la$/) ? ".lo" : ".o";
+           my $srcfile = $sourcename.".$cxxsuffix";
+           my $objfile = $sourcename.$ext;
+           $moc_class_headers .= " $srcfile";
+           my $appl;
+           $appl  = "$srcfile: $mocs\n";
+           $appl .= "\t\@echo 'creating $srcfile'\n";
+           $appl .= "\t\@-rm -f $srcfile\n";
+           $appl .= "\t\@if test \${kde_qtver} = 2; then \\\n";
+           $appl .= "\t\techo 'static const char * _metalist_$program\[\] = {' > $srcfile ;\\\n";
+           $appl .= "\t\tcat $mocs | grep 'char.*className' | ";
+           $appl .=  "sed -e 's/.*[^A-Za-z0-9_:]\\([A-Za-z0-9_:]*\\)::className.*\$\$/\\\"\\1\\\",/' | sort | uniq >> $srcfile ;\\\n";
+           $appl .= "\t\techo '0};' >> $srcfile ;\\\n";
+           $appl .= "\t\techo '#include <kunload.h>' >> $srcfile ;\\\n";
+           $appl .= "\t\techo '_UNLOAD($program)' >> $srcfile ;\\\n";
+           $appl .= "\telse echo > $srcfile; fi\n";
+           $appl .= "\n";
+           
+           $realObjs{$program} .= " \034" . $objfile . " ";
+           $sources{$program} .= " $srcfile";
+            $sources_changed{$program} = 1;
+            $dep_files .= " \$(DEPDIR)/$sourcename.P" if($dep_files !~/$sourcename.P/);
+           appendLines ($appl);
+       }
+       print STDOUT "\n" if $verbose;
+    }
+    if ($moc_class_headers) {
+        appendLines ("$cleantarget-moc-classes:\n\t-rm -f $moc_class_headers\n");
+        $target_adds{"$cleantarget-am"} .= "$cleantarget-moc-classes ";
+    }
+}
+
+#-----------------------------------------------------------------------------
+
+sub updateMakefile ()
+{
+    return if ($dryrun);
+
+    open (FILEOUT, "> $makefile")
+                        || die "Could not create $makefile: $!\n";
+
+    print FILEOUT "\# $progId - " . '$Revision$ '  . "\n";
+    $MakefileData =~ s/\034/\\\n\t/g;    # Restore continuation lines
+    print FILEOUT $MakefileData;
+    close FILEOUT;
+}
+
+#-----------------------------------------------------------------------------
+
+# The given line needs to be removed from the makefile
+# Do this by adding the special "removed line" comment at the line start.
+sub removeLine ($$)
+{
+    my ($lookup, $old) = @_;
+
+    $old =~ s/\034/\\\n#>- /g;          # Fix continuation lines
+    $MakefileData =~ s/\n$lookup/\n#>\- $old/;
+}
+
+#-----------------------------------------------------------------------------
+
+# Replaces the old line with the new line
+# old line(s) are retained but tagged as removed. The new line(s) have the
+# "added" tag placed before it.
+sub substituteLine ($$)
+{
+    my ($lookup, $new) = @_;
+
+    if ($MakefileData =~ /\n($lookup)/) {
+      $old = $1;
+      $old =~ s/\034/\\\n#>\- /g;         # Fix continuation lines
+      $new =~ s/\034/\\\n\t/g;
+      my $newCount = ($new =~ tr/\n//) + 1;
+      $MakefileData =~ s/\n$lookup/\n#>- $old\n#>\+ $newCount\n$new/;
+    } else {
+      print STDERR "Warning: substitution of \"$lookup\" in $printname failed\n";
+    }
+}
+
+#-----------------------------------------------------------------------------
+
+# Slap new lines on the back of the file.
+sub appendLines ($)
+{
+  my ($new) = @_;
+  $new =~ s/\034/\\\n\t/g;        # Fix continuation lines
+  my $newCount = ($new =~ tr/\n//) + 1;
+  $MakefileData .= "\n#>\+ $newCount\n$new";
+}
+
+#-----------------------------------------------------------------------------
+
+# Restore the Makefile.in to the state it was before we fiddled with it
+sub restoreMakefile ()
+{
+    $MakefileData =~ s/# $progId[^\n\034]*[\n\034]*//g;
+    # Restore removed lines
+    $MakefileData =~ s/([\n\034])#>\- /$1/g;
+    # Remove added lines
+    while ($MakefileData =~ /[\n\034]#>\+ ([^\n\034]*)/)
+    {
+        my $newCount = $1;
+        my $removeLines = "";
+        while ($newCount--) {
+            $removeLines .= "[^\n\034]*([\n\034]|)";
+        }
+        $MakefileData =~ s/[\n\034]#>\+.*[\n\034]$removeLines/\n/;
+    }
+}
+
+#-----------------------------------------------------------------------------
diff --git a/plptools.init b/plptools.init
new file mode 100644 (file)
index 0000000..7be3953
--- /dev/null
@@ -0,0 +1,120 @@
+#!/bin/sh
+#
+# psion        Starts ncpd/plpnfsd.
+#
+# chkconfig: 2345 45 10
+# description: This facility enables connectivity to a Psion series 5.
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+[ -f /usr/sbin/ncpd ] || exit 0
+[ -f /usr/sbin/plpnfsd ] || exit 0
+[ -f /usr/sbin/plpprintd ] || exit 0
+[ -f /etc/sysconfig/psion ] || exit 0
+. /etc/sysconfig/psion
+
+
+start() {
+       RETVAL=0
+       if is_yes "$START_NCPD" ; then
+               if [ ! -f /var/lock/subsys/psion.ncpd ]; then
+                       msg_starting "Psion ncpd"
+                       daemon /usr/sbin/ncpd $NCPD_ARGS
+                       RETVAL=$?
+                       [ $RETVAL -eq 0 ] && touch /var/lock/subsys/psion.ncpd
+               else
+                       msg_already_running "Psion ncpd"
+               fi
+       fi
+       if [ $RETVAL -eq 0 ] ; then
+               RETVAL1=0; RETVAL2=0
+               if is_yes "$START_PLPNFSD" ; then
+                       if [ ! -f /var/lock/subsys/psion.nfsd ]; then
+                               msg_starting "Psion plpnfsd"
+                               daemon /usr/sbin/plpnfsd $PLPNFSD_ARGS
+                               RETVAL1=$?
+                               [ $RETVAL1 -eq 0 ] && touch /var/lock/subsys/psion.nfsd
+                       else
+                               msg_already_running "Psion plpnfsd"
+                       fi
+               fi
+               if is_yes "$START_PLPPRINTD" ; then
+                       if [ ! -f /var/lock/subsys/psion.printd ]; then
+                               msg_starting "Psion plpprintd"
+                               daemon /usr/sbin/plpprintd $PLPPRINTD_ARGS
+                               RETVAL2=$?
+                               [ $RETVAL2 -eq 0 ] && touch /var/lock/subsys/psion.printd
+                       else
+                               msg_already_running "Psion plpprintd"
+                       fi
+               fi
+               RETVAL=$(($RETVAL1+$RETVAL2))
+       fi
+       [ $RETVAL -eq 0 ] && touch /var/lock/subsys/psion
+       return $RETVAL
+}
+
+stop() {
+       RETVAL=0
+       if [ -f /var/lock/subsys/psion.nfsd ]; then
+               msg_stopping "Psion plpnfsd"
+               killproc plpnfsd -HUP
+               WAIT=5
+               while test $WAIT -gt 0 ; do
+                       test -z "`pidofproc plpnfsd`" && break;
+                       sleep 1 # allow plpnfsd flushing it's cache
+                       WAIT=`expr $WAIT - 1`
+               done
+               test -z "`pidofproc plpnfsd`" || killproc plpnfsd
+       else
+               is_yes "$START_PLPNFSD" && msg_not_running "Psion plpnfsd"
+       fi
+       if [ -f /var/lock/subsys/psion.printd ]; then
+               msg_stopping "Psion plpprintd"
+               killproc plpprintd
+       else
+               is_yes "$START_PLPPRINTD" && msg_not_running "Psion plpprintd"
+       fi
+       if [ -f /var/lock/subsys/psion.ncpd ] ; then
+               msg_stopping "Psion ncpd"
+               killproc ncpd
+               RETVAL=$?
+       else
+               is_yes "$START_NCPD" && msg_not_running "Psion ncpd"
+       fi
+       rm -f /var/lock/subsys/psion{,.ncpd,.printd,.nfsd}
+       return $RETVAL
+}
+
+restart() {
+       stop
+       start
+}
+
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
+       ;;
+  status)
+       status ncpd
+       status plpnfsd
+       status plpprintd
+       ;;
+  restart|reload)
+       restart
+       ;;
+  condrestart)
+       test -f /var/lock/subsys/psion && restart || :
+       ;;
+  *)
+       echo "Usage: psion {start|stop|status|restart|reload|condrestart}"
+       exit 1
+esac
+
+exit $?
+
This page took 0.168164 seconds and 4 git commands to generate.