diff -urN base.old/src/port1.0/Makefile base/src/port1.0/Makefile
--- base.old/src/port1.0/Makefile	Wed May 14 21:12:38 2003
+++ base/src/port1.0/Makefile	Mon May 26 03:11:45 2003
@@ -1,6 +1,10 @@
 INSTALLDIR=	${DESTDIR}${datadir}/darwinports/Tcl/port1.0
 
-SRCS=		port.tcl portchecksum.tcl portconfigure.tcl portextract.tcl portfetch.tcl portmain.tcl portbuild.tcl portpatch.tcl portutil.tcl portinstall.tcl portdepends.tcl portinstall.tcl portuninstall.tcl portdepends.tcl portclean.tcl portpackage.tcl portcontents.tcl portmpkg.tcl
+SRCS= port.tcl portchecksum.tcl portconfigure.tcl portextract.tcl	    \
+	portfetch.tcl portmain.tcl portbuild.tcl portpatch.tcl portutil.tcl \
+	portinstall.tcl portdepends.tcl portinstall.tcl portuninstall.tcl   \
+	portdepends.tcl portclean.tcl portpackage.tcl portcontents.tcl	    \
+	portmpkg.tcl portrpmpackage.tcl
 
 SUBDIR=		resources
 
diff -urN base.old/src/port1.0/port.tcl base/src/port1.0/port.tcl
--- base.old/src/port1.0/port.tcl	Tue Mar 11 14:54:46 2003
+++ base/src/port1.0/port.tcl	Mon May 26 03:12:24 2003
@@ -43,5 +43,6 @@
 package require portuninstall 1.0
 package require portclean 1.0
 package require portpackage 1.0
+package require portrpmpackage 1.0
 package require portcontents 1.0
 package require portmpkg 1.0
diff -urN base.old/src/port1.0/portrpmpackage.tcl base/src/port1.0/portrpmpackage.tcl
--- base.old/src/port1.0/portrpmpackage.tcl	Wed Dec 31 16:00:00 1969
+++ base/src/port1.0/portrpmpackage.tcl	Mon May 26 03:37:39 2003
@@ -0,0 +1,90 @@
+# et:ts=4
+# portrpmpackage.tcl
+#
+# Copyright (c) 2002 - 2003 Apple Computer, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+#    may be used to endorse or promote products derived from this software
+#    without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+package provide portrpmpackage 1.0
+package require portutil 1.0
+
+set com.apple.rpmpackage [target_new com.apple.rpmpackage rpmpackage_main]
+target_runtype ${com.apple.rpmpackage} always
+target_provides ${com.apple.rpmpackage} rpmpackage
+target_requires ${com.apple.rpmpackage} install
+
+# define options
+options rpmpackage.type rpmpackage.destpath
+
+# Set defaults
+default rpmpackage.destpath {${workpath}}
+
+set UI_PREFIX "---> "
+
+proc rpmpackage_main {args} {
+    global portname portversion portrevision rpmpackage.type rpmpackage.destpath UI_PREFIX
+
+    ui_msg "$UI_PREFIX [format [msgcat::mc "Creating RPM package for %s-%s"] ${portname} ${portversion}]"
+
+    return [rpmpackage_pkg $portname $portversion $portrevision]
+}
+
+proc rpmpackage_pkg {portname portversion portrevision} {
+    global portdbpath destpath workpath prefix portresourcepath description rpmpackage.destpath long_description homepage
+
+    set specpath ${workpath}/${portname}.spec
+    write_spec ${specpath} $portname $portversion $portrevision $description $long_description $destpath
+
+    system "rpm -bb -v ${specpath}"
+
+    return 0
+}
+
+
+proc write_spec {specfile portname portversion portrevision description long_description destroot} {
+    set specfd [open ${specfile} w+]
+    puts $specfd "\#Spec file generated by DarwinPorts
+Summary: ${description}
+Name: ${portname}
+Version: ${portversion}
+Release: ${portrevision}
+Group: darwinports
+License: ???
+BuildRoot: ${destroot}
+
+%description
+${long_description}
+%prep
+%build
+echo \"Go DarwinPorts\"
+%install
+%clean
+%files
+/*
+"
+    close $specfd
+}
