Index: app/Makefile
===================================================================
--- app/Makefile	(revision 10c74af18d1db99b7373ceafcb3c13352fe80320)
+++ app/Makefile	(revision adb4c8d65ba8b406a1703d1c091bcf1af4bdfb3c)
@@ -19,4 +19,5 @@
 export UTT_CONF_DIR=${UTT_DIR}/etc/utt
 # language/encoding specific stuff
+# any extra files for some programs, like: weights.kor, cats.dgc, gram.dgc, etc.
 export UTT_LANG_DIR=${UTT_DIR}/share/utt
 # some files like ser.l.template, terms.m4
@@ -29,5 +30,4 @@
 # list of components to be included in the distribution
 COMPONENTS = compiledic cor dgp fla gph grp gue kon kor kot lem mar rm12 rs12 sen-l sen-nl ser tags tok.l unfla
-# gue nie dziala!
 
 ##############################
@@ -88,5 +88,5 @@
 # ------------------------------------------------------------------
 .PHONY: build
-build: compile build_conf build_lib build_doc
+build: compile build_conf build_share build_lib build_doc
 	@echo "All files builded successfully!"
 
@@ -103,4 +103,7 @@
 	cd $(CUR_DIR)/doc && make && make copy; cd $(CUR_DIR)
 
+.PHONY: build_share
+build_share:
+	cp $(CUR_DIR)/share/* $(UTT_LANG_DIR)/
 
 
Index: app/TODO
===================================================================
--- app/TODO	(revision 6b3be72395bfc594673b8184d6a7624e3800b47d)
+++ app/TODO	(revision adb4c8d65ba8b406a1703d1c091bcf1af4bdfb3c)
@@ -1,6 +1,6 @@
 BARDZO WAZNE:
 
-* w dystrybucji tarball umieszczac pliki w okrelonych miejscach
-* gue SIE NIE KOMPILUJE !!!
+* zawieszanie sie lema dla wyrazow z pola -I (np. kor)
+* komunikaty o nieznalezieniu slownika (lem) [TO]
 
 WAZNE:
Index: app/conf/compiledic.conf
===================================================================
--- app/conf/compiledic.conf	(revision a5fdde96132cd61c3f2e6d56c426c96b741427c8)
+++ app/conf/compiledic.conf	(revision adb4c8d65ba8b406a1703d1c091bcf1af4bdfb3c)
@@ -11,3 +11,3 @@
 # parameter_name [=] value
 #
-symbols = /usr/local/share/utt/pl_PL.ISO-8859-2/pl_PL.ISO-8859-2.sym
+symbols = PATH_PREFIX/share/utt/pl_PL.ISO-8859-2/pl_PL.ISO-8859-2.sym
Index: app/conf/cor.conf
===================================================================
--- app/conf/cor.conf	(revision a5fdde96132cd61c3f2e6d56c426c96b741427c8)
+++ app/conf/cor.conf	(revision adb4c8d65ba8b406a1703d1c091bcf1af4bdfb3c)
@@ -11,4 +11,4 @@
 # parameter_name [=] value
 #
-dictionary-home = /usr/local/share/utt
+dictionary-home = PATH_PREFIX/share/utt
 process = W
Index: app/conf/dgc.conf
===================================================================
--- app/conf/dgc.conf	(revision a5fdde96132cd61c3f2e6d56c426c96b741427c8)
+++ app/conf/dgc.conf	(revision adb4c8d65ba8b406a1703d1c091bcf1af4bdfb3c)
@@ -11,4 +11,4 @@
 # parameter_name [=] value
 #
-categories = /usr/local/lib/utt/cats.dgc
-grammar = /usr/local/lib/utt/gram.dgc
+categories = PATH_PREFIX/share/utt/cats.dgc
+grammar = PATH_PREFIX/share/utt/gram.dgc
Index: app/conf/grp.conf
===================================================================
--- app/conf/grp.conf	(revision a5fdde96132cd61c3f2e6d56c426c96b741427c8)
+++ app/conf/grp.conf	(revision adb4c8d65ba8b406a1703d1c091bcf1af4bdfb3c)
@@ -11,3 +11,3 @@
 # parameter_name [=] value
 #
-macros = /usr/local/lib/utt/terms.m4
+macros = PATH_PREFIX/lib/utt/terms.m4
Index: app/conf/kor.conf
===================================================================
--- app/conf/kor.conf	(revision a5fdde96132cd61c3f2e6d56c426c96b741427c8)
+++ app/conf/kor.conf	(revision adb4c8d65ba8b406a1703d1c091bcf1af4bdfb3c)
@@ -11,5 +11,5 @@
 # parameter_name [=] value
 #
-dictionary-home = /usr/local/share/utt
-weights = /usr/local/lib/utt/weights.kor
+dictionary-home = PATH_PREFIX/share/utt
+weights = PATH_PREFIX/share/utt/weights.kor
 threshold = 1.0
Index: app/conf/lem.conf
===================================================================
--- app/conf/lem.conf	(revision a5fdde96132cd61c3f2e6d56c426c96b741427c8)
+++ app/conf/lem.conf	(revision adb4c8d65ba8b406a1703d1c091bcf1af4bdfb3c)
@@ -11,4 +11,4 @@
 # parameter_name [=] value
 #
-dictionary-home = /usr/local/share/utt
+dictionary-home = PATH_PREFIX/share/utt
 process = W
Index: app/conf/ser.conf
===================================================================
--- app/conf/ser.conf	(revision a5fdde96132cd61c3f2e6d56c426c96b741427c8)
+++ app/conf/ser.conf	(revision adb4c8d65ba8b406a1703d1c091bcf1af4bdfb3c)
@@ -11,4 +11,4 @@
 # parameter_name [=] value
 #
-macros = /usr/local/lib/utt/terms.m4
-flex-template = /usr/local/lib/utt/ser.l.template
+macros = PATH_PREFIX/lib/utt/terms.m4
+flex-template = PATH_PREFIX/lib/utt/ser.l.template
Index: p/dist/common/utt_make_config.pl
===================================================================
--- app/dist/common/utt_make_config.pl	(revision 6b3be72395bfc594673b8184d6a7624e3800b47d)
+++ 	(revision )
@@ -1,250 +1,0 @@
-#!/usr/bin/perl
-#c:\usr\perl\bin\perl.exe
-
-use Cwd 'abs_path';
-use File::Basename;
-use File::HomeDir;
-use File::Spec::Functions;
-use POSIX;
-
-my $sys_home = catdir(dirname(abs_path($0)), "..");
-my $usr_home = catdir(home(), '.utt');
-
-prepareUttUsrHome($usr_home);
-conf_utt(catfile($usr_home, 'utt.conf'), $sys_home);
-
-conf_cor(catfile($usr_home, 'cor.conf'), $sys_home);
-conf_kor(catfile($usr_home, 'kor.conf'), $sys_home);
-conf_compiledic(catfile($usr_home, 'compiledic.conf'), $sys_home);
-conf_grp(catfile($usr_home, 'grp.conf'), $sys_home);
-conf_gue(catfile($usr_home, 'gue.conf'), $sys_home);
-conf_lem(catfile($usr_home, 'lem.conf'), $sys_home);
-conf_mar(catfile($usr_home, 'mar.conf'), $sys_home);
-conf_ser(catfile($usr_home, 'ser.conf'), $sys_home);
-conf_dgc(catfile($usr_home, 'dgc.conf'), $sys_home);
-
-print "UTT user configuration created in $usr_home\n";
-
-
-
-#Kasuje stare configi i tworzy katalog .utt
-sub prepareUttUsrHome() {
-    my $dir = shift;
-
-    print "Preparing user configuration.\n";
-
-    if(-d $dir) {
-	print "Old configuration detected. ";
-	my $cnt = unlink <$dir/*>;
-	print "($cnt files deleted)\n";
-    }
-    else {
-	print "Creating directory $dir\n";
-	if(1 != mkdir $dir) {
-	    die "Unable to create UTT user configuration!\n";
-	}
-    }
-}
-
-# Tworzy naglowek dla wszystkich plikow konfiguracyjnych
-sub makeConfigHeader() {
-  return "# ************************************************************\n".
-  		 "# * This file was created automatically during installation. *\n".
-		 "# * If you don't need do not change it.                      *\n".
-		 "# *                                                          *\n".
-		 "# * UAM Text Tools                                           *\n".
-		 "# * Adam Mickiewicz University, Poland                       *\n".
-		 "# * http://utt.amu.edu.pl                                    *\n".
-		 "# ************************************************************\n".
-		 "#\n".
-		 "# All lines must looks like:\n".
-		 "# parameter_name [=] value\n".
-		 "#\n\n";
-}
-
-sub conf_compiledic() {
-	my $compiledic_file = shift;
-	my $utthome = shift;
-  open(FILE, ">$compiledic_file");
-
-  print FILE makeConfigHeader();
-  my $hm = home();
-  my $lang=`grep language $hm/.utt/utt.conf | cut -d= -f 2`;
-  chomp $lang;
-# powinno byc $utthome/share/utt/pl_PL.ISO-8859-2/pl_PL.ISO-8892-2.sym
-# ale to bez sensu
-  print FILE "symbols=", abs_path("$utthome/share/utt");
-  print FILE "/$lang/$lang.sym\n";
-
-  close FILE;
-}
-
-sub conf_grp() {
-	my $grp_file = shift;
-	my $utthome = shift;
-  open(FILE, ">$grp_file");
-
-  print FILE makeConfigHeader();
-  print FILE "macros=", abs_path("$utthome/lib/utt/terms.m4"), "\n";
-  print FILE "tags=uam\n";
-
-  close FILE;
-}
-
-sub conf_cor() {
-	my $cor_file = shift;
-	my $utthome = shift;
-  open(FILE, ">$cor_file");
-
-  print FILE makeConfigHeader();
-  print FILE "dictionary-home=", abs_path("$utthome/share/utt"), "\n";
-
-  close FILE;
-}
-
-sub conf_kor() {
-	my $kor_file = shift;
-	my $utthome = shift;
-  open(FILE, ">$kor_file");
-
-  print FILE makeConfigHeader();
-  print FILE "dictionary-home=", abs_path("$utthome/share/utt"), "\n";
-  print FILE "weights=", abs_path("$utthome/lib/utt/weights.cor"), "\n";
-  print FILE "threshold=1.0\n";
-
-  close FILE;
-}
-
-sub conf_grp() {
-	my $grp_file = shift;
-	my $utthome = shift;
-  open(FILE, ">$grp_file");
-
-  print FILE makeConfigHeader();
-  print FILE "macros=", abs_path("$utthome/lib/utt/terms.m4"), "\n";
-
-  close FILE;
-}
-
-sub conf_gue() {
-	my $gue_file = shift;
-	my $utthome = shift;
-  open(FILE, ">$gue_file");
-
-  print FILE makeConfigHeader();
-
-  close FILE;
-}
-
-sub conf_lem() {
-	my $lem_file = shift;
-	my $utthome = shift;
-  open(FILE, ">$lem_file");
-
-  print FILE makeConfigHeader();
-  print FILE "dictionary-home=", abs_path("$utthome/share/utt"), "\n";
-
-  close FILE;
-}
-
-sub conf_mar() {
-	my $mar_file = shift;
-	my $utthome = shift;
-  open(FILE, ">$mar_file");
-
-  print FILE makeConfigHeader();
-  print FILE "tags=uam\n";
-
-  close FILE;
-}
-
-sub conf_ser() {
-	my $ser_file = shift;
-	my $utthome = shift;
-  open(FILE, ">$ser_file");
-
-  print FILE makeConfigHeader();
-  print FILE "macros=", abs_path("$utthome/lib/utt/terms.m4"), "\n";
-  print FILE "flex-template=", abs_path("$utthome/lib/utt/ser.l.template"), "\n";
-  print FILE "tags=uam\n";
-
-  close FILE;
-}
-
-sub conf_utt() {
-	my $utt_file = shift;
-	my $utthome = shift;
-
-	my $lang = getUserLanguage(abs_path(catdir($utthome, "share/utt")));
-
-  open(FILE, ">$utt_file");
-
-  print FILE makeConfigHeader();
-  print FILE "# user locale (dictionary)\n";
-  print FILE "language=", $lang, "\n";
-
-  close FILE;
-}
-
-sub getUserLanguage() {
-    my $dict_dir = shift;
-
-    print "Setup dictionaries.\n";
-    
-    opendir(DIR, $dict_dir) || die "Install dictionary first!\n";
-    @files = grep(/[^\.{1,2}]/ && -d "$dict_dir/$_", readdir(DIR));
-    closedir DIR;
-    my $cnt = scalar @files;
-    print "$cnt dictionary(ies) found.\n";
-    if(0 == $cnt) {
-	die("Install dictionary first!\n");
-    }
-
-    foreach my $file (@files) {
-	print "Do you select dictionary $file [yes/no]? ";
-	my $ans = <STDIN>;
-	if($ans =~ /y(es)?/i) {
-	    return $file;
-	}
-    }
-    die "No dictionary selected - setup failed!\n";
-}
-
-# Szuka locali u uzytkownika
-sub findLocale() {
-	$cur_locale = setlocale(LC_CTYPE);
-
-	# we replace Latinx to ISO-8859-x
-	$cur_locale =~ s/(.+?)Latin(.+?)/$1ISO\-8859\-$2/g;
-
-	if($cur_locale =~ /\w+_\w+\.\S+/) {
-	  $best_locale = $cur_locale;
-	}
-	elsif($cur_locale =~ /\w+_\w+/) {
-	  $best_locale = $cur_locale.".UTF-8";
-	}
-	else {
-	  $best_locale = toupper($cur_locale).'_'.tolower($cur_locale).'.UTF-8';
-	}
-	return $best_locale;
-}
-
-sub conf_dgc() {
-	my $dgc_file = shift;
-	my $utthome = shift;
-  open(FILE, ">$dgc_file");
-
-  print FILE makeConfigHeader();
-  print FILE "catfile=", abs_path("$utthome/lib/utt/cats.dgc"), "\n";
-  print FILE "gramfile=", abs_path("$utthome/lib/utt/gram.dgc"), "\n";
-
-  close FILE;
-  
-  
-  open(FILE, ">$utthome/bin/Makefile.go");
-  print FILE "\ngram.dgp: ", abs_path("$utthome/lib/utt/gram.dgc"), "\n";
-  print FILE "\tdgc -c ", abs_path("$utthome/lib/utt/cats.dgc"), " < ", abs_path("$utthome/lib/utt/gram.dgc"), " > gram.dgp\n";
-  close FILE;
-  
-}
-
Index: app/dist/struktura.txt
===================================================================
--- app/dist/struktura.txt	(revision 6b3be72395bfc594673b8184d6a7624e3800b47d)
+++ app/dist/struktura.txt	(revision adb4c8d65ba8b406a1703d1c091bcf1af4bdfb3c)
@@ -22,5 +22,4 @@
 /usr/local/bin/tre.rb
 /usr/local/bin/unfla
-/usr/local/bin/utt-make-config.pl
 /usr/local/bin/ipi.tag2re
 /usr/local/bin/uam.tag2re
@@ -46,9 +45,7 @@
 
 /usr/local/share/utt/weights.kor
-# lokalnie: ~/.local/share/utt/weights.kor
 /usr/local/share/utt/cats.dgc
-# lokalnie: ~/.local/share/utt/cats.dgc
 /usr/local/share/utt/gram.dgc
-# lokalnie: ~/.local/share/utt/gram.dgc
+# lokalnie: wszystkie pliki beda umieszczone w ~/.local/share/utt/
 
 /usr/local/share/utt/pl_PL.ISO-8859-2/pl_PL.ISO-8859-2.sym
@@ -60,11 +57,11 @@
 /usr/local/share/utt/pl_PL.UTF-8/gue.bin
 /usr/local/share/utt/pl_PL.UTF-8/lem.bin
+# lokalnie: wszystkie slowniki beda umieszczone w ~/.local/share/utt/
 
 /usr/local/lib/utt/ser.l.template
 /usr/local/lib/utt/terms.m4
 /usr/local/lib/utt/seg.rb
-# lokalnie: ~/.local/lib/utt/seg.rb   <-- tego nie trzeba tak
 /usr/local/lib/attr.pm
-# lokalnie: ~/.local/lib/utt/attr.pm
+# lokalnie: wszystkie pliki beda umieszczone w ~/.local/lib/utt/
 
 /usr/local/share/doc/utt/FAQ
Index: app/dist/tarball/Makefile
===================================================================
--- app/dist/tarball/Makefile	(revision b2647ded51d1c3f8e4a856396ea16c7afd54b9e6)
+++ app/dist/tarball/Makefile	(revision adb4c8d65ba8b406a1703d1c091bcf1af4bdfb3c)
@@ -33,8 +33,13 @@
 	cp -fr ${UTT_DIST_DIR}/* ${_TARBALL_ROOT}
 	@# we add some extra files
-	cp ../common/utt_make_config.pl ${_TARBALL_ROOT}/bin/
-	chmod 755 ${_TARBALL_ROOT}/bin/utt_make_config.pl
+	@# config files
+	mkdir -p ${_TARBALL_ROOT}/cnf
+	mv ${_TARBALL_ROOT}/etc/utt/*.conf ${_TARBALL_ROOT}/cnf/
+	${DIR}/prepare_conf.sh ${_TARBALL_ROOT}/cnf ${_TARBALL_ROOT}/etc/utt
+	rm -rf ${_TARBALL_ROOT}/cnf
 	cp ./INSTALL ${_TARBALL_ROOT}/
+	cp ./Makefile.tarball ${_TARBALL_ROOT}/Makefile
 	cp ../files/* ${_TARBALL_ROOT}/
+
 
 	tar -czf ${UTT_DIST_OUTPUT}/${_TAR_FILE_NAME} utt*
Index: app/dist/tarball/prepare_conf.sh
===================================================================
--- app/dist/tarball/prepare_conf.sh	(revision adb4c8d65ba8b406a1703d1c091bcf1af4bdfb3c)
+++ app/dist/tarball/prepare_conf.sh	(revision adb4c8d65ba8b406a1703d1c091bcf1af4bdfb3c)
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+for FN in `ls $1/*.conf`
+do
+    BN=`basename ${FN}`
+    sed 's/PATH_PREFIX/~\/.local/g' ${FN} > $2/${BN}
+done
Index: app/src/dgp/canonize
===================================================================
--- app/src/dgp/canonize	(revision 6b3be72395bfc594673b8184d6a7624e3800b47d)
+++ app/src/dgp/canonize	(revision adb4c8d65ba8b406a1703d1c091bcf1af4bdfb3c)
@@ -7,5 +7,5 @@
 
 use lib "/usr/local/lib/utt";
-use lib "ENV{HOME}/.local/lib/utt";
+use lib "$ENV{'HOME'}/.local/lib/utt";
 
 use strict;
Index: app/src/dgp/dgc
===================================================================
--- app/src/dgp/dgc	(revision 6b3be72395bfc594673b8184d6a7624e3800b47d)
+++ app/src/dgp/dgc	(revision adb4c8d65ba8b406a1703d1c091bcf1af4bdfb3c)
@@ -8,5 +8,5 @@
 # wymaga niejawnie programu canonize!!!!
 use lib "/usr/local/lib/utt";
-use lib "ENV{HOME}/.local/lib/utt";
+use lib "$ENV{'HOME'}/.local/lib/utt";
 
 use strict;
Index: app/src/dgp/tre.rb
===================================================================
--- app/src/dgp/tre.rb	(revision 6b3be72395bfc594673b8184d6a7624e3800b47d)
+++ app/src/dgp/tre.rb	(revision adb4c8d65ba8b406a1703d1c091bcf1af4bdfb3c)
@@ -1,3 +1,3 @@
-#!/usr/bin/ruby -I /usr/local/lib/utt -I ~/.local/lib/utt
+#!/usr/bin/ruby -I /usr/local/lib/utt -I $HOME/.local/lib/utt
 
 require 'getoptlong'
@@ -61,6 +61,6 @@
 end
 
-require File.expand_path(File.dirname(__FILE__) + "../lib/utt/seg.rb")
-#require 'seg.rb'
+#require File.expand_path(File.dirname(__FILE__) + "../lib/utt/seg.rb")
+require 'seg.rb'
 
 $dgpsep=';'
Index: app/src/mar/mar
===================================================================
--- app/src/mar/mar	(revision 6b3be72395bfc594673b8184d6a7624e3800b47d)
+++ app/src/mar/mar	(revision adb4c8d65ba8b406a1703d1c091bcf1af4bdfb3c)
@@ -12,5 +12,5 @@
 
 use lib "/usr/local/lib/utt";
-use lib "ENV{HOME}/.local/lib/utt";
+use lib "$ENV{'HOME'}/.local/lib/utt";
 
 use strict;
