Index: app/dist/Makefile
===================================================================
--- app/dist/Makefile	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ app/dist/Makefile	(revision b2647ded51d1c3f8e4a856396ea16c7afd54b9e6)
@@ -1,13 +1,12 @@
-# compile task doesn't compile sources, but just copy some files
-# this should be changed
-#
 
-# I put here some variables
+# some variables
 
-# path, where binaries are placed 
+# path, where all nessesary files are placed 
 # (they will be processed for making distribution)
-export _UTT_DIST_DIR=$(shell pwd)/bin
-# path, where distribution file should be placed
-export _UTT_DIST_OUTPUT=$(shell pwd)
+export UTT_DIST_DIR=$(UTT_DIR)
+# path, where distribution package will be placed
+export UTT_DIST_OUTPUT=$(UTT_DIR)/..
+#temp path for making distribution
+export UTT_DIST_TMP=$(shell pwd)/dist_tmp
 
 
@@ -16,19 +15,5 @@
 .PHONY: default
 defaul:
-	@echo "Using: make compile|tarball|rpm|deb"
-
-
-# -----------------------------------------------------------
-# -----------------------------------------------------------
-# this task should compile utt application
-.PHONY: compile
-compile:
-	if test -d ${_UTT_DIST_DIR}; then rm -fr ${_UTT_DIST_DIR}; fi
-	mkdir -p ${_UTT_DIST_DIR}
-	@# fake compilation
-	cp -r ../utt-0.9/* ${_UTT_DIST_DIR}/
-	@# we add some extra file (required during instalation)
-	cp common/create_utt_config.pl ${_UTT_DIST_DIR}/
-	chmod 700 ${_UTT_DIST_DIR}/create_utt_config.pl
+	@echo "Using: make tarball|rpm|deb"
 
 
@@ -36,5 +21,5 @@
 # this task should compile utt (if nesessery) and create tar.gz version
 .PHONY: tarball
-tarball: compile
+tarball:
 	cd tarball && make
 
@@ -42,5 +27,5 @@
 # this task should compile utt (if nesessery) and create rpm version
 .PHONY: rpm
-rpm: compile
+rpm:
 	@#we build rpm (see spec/README for details)
 	cd spec && make
@@ -49,5 +34,5 @@
 # this task should compile utt (if nesessery) and create deb version
 .PHONY: deb
-deb: compile
+deb:
 	@#we build deb (see deb/README for details)
 	cd deb && make
@@ -58,4 +43,4 @@
 clean:
 	# finally the line below should be uncomment
-	rm -fr ${_UTT_DIST_DIR}
+	rm -fr ${UTT_DIST_TMP}
 
Index: app/dist/spec/Makefile
===================================================================
--- app/dist/spec/Makefile	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ app/dist/spec/Makefile	(revision b2647ded51d1c3f8e4a856396ea16c7afd54b9e6)
@@ -3,13 +3,21 @@
 DIR=$(shell pwd)
 
-ifndef _UTT_DIST_DIR
-	_UTT_DIST_DIR=${DIR}
+ifndef UTT_DIST_DIR
+	UTT_DIST_DIR=${DIR}
 endif
 
-
+_RPM_FROOT=${DIR}/rmp_root
+_UTT_ROOT=${_RPM_FROOT}/usr/local
 # default task
 .PHONY: rpm
 rpm:
-	cd ${_UTT_DIST_DIR}; rpmbuild -bb ${DIR}/utt.spec
+	if test -d ${_RPM_FROOT}; then rm -fr ${_RMP_FROOT}; fi
+	mkdir -p ${_UTT_ROOT}
+	cp -rf ${UTT_DIST_DIR}/* ${_UTT_ROOT}/
+	cp ../common/utt_make_config.pl ${_UTT_ROOT}/bin/
+	chmod 755 ${_UTT_ROOT}/bin/utt_make_config.pl
+	cp ../files/* ${_UTT_ROOT}/
+	cd ${_RPM_FROOT}; rpmbuild -bb ${DIR}/utt.spec
 	
-
+	rm -rf ${_RPM_FROOT}
+	
Index: app/dist/spec/utt.spec
===================================================================
--- app/dist/spec/utt.spec	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ app/dist/spec/utt.spec	(revision b2647ded51d1c3f8e4a856396ea16c7afd54b9e6)
@@ -11,17 +11,7 @@
 %define _this_summary	  Some tools for text processing
 %define _this_name        utt
-%define _this_version	  %(cat ../common/version.def)
-%define _this_release	  %(cat ../common/release.def)
+%define _this_version	  %(cat ../../common/version.def)
+%define _this_release	  %(cat ../../common/release.def)
 %define _this_copyright   Adam Mickiewicz University, Poland
-
-#
-# We need some paths
-#
-# Directory with utt binaries
-%define _UTT_DIST_DIR	%(pwd)
-#Root directory in which utt will be installed
-%define _UTT_DIR		/usr/local/%_this_name
-#Directory for rpm
-%define _RPM_ROOT	%_UTT_DIST_DIR/../rpm_root
 
 #
@@ -40,5 +30,5 @@
 URL:         http://utt.amu.edu.pl
 Vendor:      Adam Mickiewicz University
-BuildRoot:   %_RPM_ROOT
+BuildRoot:	%(pwd)
 #BuildArch: 	 i586
 # requirements for utt application
@@ -53,8 +43,8 @@
 
 %description
-%(cat ../common/description.def)
+%(cat ../../common/description.def)
 
 %description -l pl
-%(cat ../common/description.pl.def)
+%(cat ../../common/description.pl.def)
 
 
@@ -68,11 +58,7 @@
 # rpm building
 %install
-%__mkdir_p $RPM_BUILD_ROOT%_UTT_DIR
-cp -fr %_UTT_DIST_DIR/* $RPM_BUILD_ROOT%_UTT_DIR/
-
 
 # cleaning after rpm build
 %clean
-rm -rf $RPM_BUILD_ROOT
 
 # -------------------------------------------------------------
@@ -80,24 +66,13 @@
 %pre
 
-
 #after installation
 %post
 # we need to create utt.conf file
-%_UTT_DIR/create_utt_config.pl
-rm -f %_UTT_DIR/create_utt_config.pl
-# we need to create links in /usr/local/bin
-find %_UTT_DIR/bin/ -type f -exec ln -f {} /usr/local/bin \;
-
 
 #before uninstallation
 %preun
-# we delete links from /usr/local/bin
-for fn in `find %_UTT_DIR/bin/ -type f -exec basename {} \;`; do rm -f /usr/local/bin/$fn; done
-
 
 #after uninstallation
 %postun
-# we remove all extra files
-rm -fr %_UTT_DIR
 
 # -------------------------------------------------------------
Index: app/dist/tarball/Makefile
===================================================================
--- app/dist/tarball/Makefile	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ app/dist/tarball/Makefile	(revision b2647ded51d1c3f8e4a856396ea16c7afd54b9e6)
@@ -5,12 +5,14 @@
 #
 
+DIR=$(shell pwd)
+
 # Directory with utt binaries
-ifndef _UTT_DIST_DIR
-	_UTT_DIST_DIR=${DIR}
+ifndef UTT_DIST_DIR
+	UTT_DIST_DIR=${DIR}
 endif
 
 # Where put result
-ifndef _UTT_DIST_OUTPUT
-	_UTT_DIST_OUTPUT=${DIR}
+ifndef UTT_DIST_OUTPUT
+	UTT_DIST_OUTPUT=${DIR}
 endif
 
@@ -20,6 +22,5 @@
 
 # Temp vars
-DIR=$(shell pwd)
-_TARBALL_ROOT=$(DIR)/utt_$(_UTT_VER)-$(_UTT_REL)
+_TARBALL_ROOT=$(DIR)/utt-$(_UTT_VER).$(_UTT_REL)
 _TAR_FILE_NAME=utt.$(_UTT_VER)_$(_UTT_REL).tar.gz
 
@@ -27,12 +28,16 @@
 .PHONY: default
 default:
-	@echo Build dir is ${_UTT_DIST_DIR}
-	@echo Change output for tarball as ${_UTT_DIST_OUTPUT}
+	@echo Build directory: ${UTT_DIST_DIR}
+	@echo Output directory for tarball: ${UTT_DIST_OUTPUT}
 	mkdir -p ${_TARBALL_ROOT}
-	cp -fr ${_UTT_DIST_DIR}/* ${_TARBALL_ROOT}
+	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
 	cp ./INSTALL ${_TARBALL_ROOT}/
+	cp ../files/* ${_TARBALL_ROOT}/
 
-	tar -czf ${_UTT_DIST_OUTPUT}/${_TAR_FILE_NAME} utt*
+	tar -czf ${UTT_DIST_OUTPUT}/${_TAR_FILE_NAME} utt*
 
 	rm -rf ${_TARBALL_ROOT}
+
