From 4c7418154459748105c861ca4f9cee3559ca1169 Mon Sep 17 00:00:00 2001
From: rmax <rmax>
Date: Thu, 23 Mar 2006 16:39:18 +0000
Subject: * unix/tcl.spec: Cleaned up and completed the spec file. 	
  An RPM can now be built from the tcl source 		 distribution with
 "rpmbuild -tb <tarball>".

---
 ChangeLog     |  6 ++++++
 unix/tcl.spec | 50 +++++++++++++++++++++++++-------------------------
 2 files changed, 31 insertions(+), 25 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e7e8fd6..9a4ab38 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-03-23  Reinhard Max  <max@suse.de>
+
+	* unix/tcl.spec: Cleaned up and completed the spec file.
+			 An RPM can now be built from the tcl source
+			 distribution with "rpmbuild -tb <tarball>".
+
 2006-03-22  Reinhard Max  <max@suse.de>
 
 	* tests/stack.test: Run the stack tests in subshells, so that they
diff --git a/unix/tcl.spec b/unix/tcl.spec
index 3d1fe48..87d7525 100644
--- a/unix/tcl.spec
+++ b/unix/tcl.spec
@@ -1,19 +1,17 @@
-# $Id: tcl.spec,v 1.23 2005/06/07 14:03:53 dkf Exp $
+# $Id: tcl.spec,v 1.24 2006/03/23 16:39:19 rmax Exp $
 # This file is the basis for a binary Tcl RPM for Linux.
 
-%define version 8.5a4
-%define directory /usr/local
+%{!?directory:%define directory /usr/local}
 
-Summary: Tcl scripting language development environment
-Name: tcl
-Version: %{version}
-Release: 1
-Copyright: BSD
-Group: Development/Languages
-Source: http://prdownloads.sourceforge.net/tcl/tcl%{version}-src.tar.gz
-URL: http://www.tcl.tk/
-Packager: Carina
-Buildroot: /var/tmp/%{name}%{version}
+Name:          tcl
+Summary:       Tcl scripting language development environment
+Version:       8.5a4
+Release:       2
+License:       BSD
+Group:         Development/Languages
+Source:        http://prdownloads.sourceforge.net/tcl/tcl%{version}-src.tar.gz
+URL:           http://www.tcl.tk/
+Buildroot:     /var/tmp/%{name}%{version}
 
 %description
 The Tcl (Tool Command Language) provides a powerful platform for
@@ -25,26 +23,28 @@ can also be used for a variety of web-related tasks and for creating
 powerful command languages for applications.
 
 %prep
+%setup -q -n %{name}%{version}
 
 %build
-./configure --prefix %{directory} --exec-prefix %{directory}
-make CFLAGS=$RPM_OPT_FLAGS
+cd unix
+CFLAGS="%optflags" ./configure \
+	--prefix=%{directory} \
+	--exec-prefix=%{directory} \
+	--libdir=%{directory}/%{_lib}
+make 
 
 %install
-rm -rf $RPM_BUILD_ROOT
-make INSTALL_ROOT=$RPM_BUILD_ROOT install
+cd unix
+make INSTALL_ROOT=%{buildroot} install
 
 %clean
-rm -rf $RPM_BUILD_ROOT
-
-# to create the tcl files list, comment out tk in the install section above,
-# then run "rpm -bi" then do a find from the build root directory,
-# and remove the files in specific directories which suffice by themselves,
-# then to create the files list for tk, uncomment tk, comment out tcl,
-# then rm -rf $RPM_BUILD_ROOT then rpm --short-circuit -bi then redo a find,
-# and remove the files in specific directories which suffice by themselves.
+rm -rf %buildroot
+
 %files
 %defattr(-,root,root)
+%if %{_lib} != lib
+%{directory}/%{_lib}
+%endif
 %{directory}/lib
 %{directory}/bin
 %{directory}/include
-- 
cgit v0.12

