Index: xsl/fedora-spec.xsl
===================================================================
--- xsl/fedora-spec.xsl	(revision 0)
+++ xsl/fedora-spec.xsl	(revision 0)
@@ -0,0 +1,75 @@
+<?xml version='1.0'?>
+ 
+<!--
+	Copyright 2009 Red Hat, Inc.
+	License: GPL
+	Author: Jeff Fearn <jfearn@redhat.com>
+-->
+<!-- Transform bookinfo.xml into a SPEC File -->
+<xsl:stylesheet version="1.0" xml:space="preserve" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+  <xsl:output encoding="UTF-8" indent="no" method="text" omit-xml-declaration="no" standalone="no" version="1.0"/>
+<!-- Note: do not indent this file!  Any whitespace here
+     will be reproduced in the output -->
+<xsl:template match="/"># Documentation Specfile
+
+%define archivename <xsl:value-of select="$archivename"/>
+
+Name:		<xsl:value-of select="$rpmname"/>
+Version:	<xsl:value-of select="$rpmver"/>
+Release:	<xsl:value-of select="$rpmrel"/>%{?dist}
+Summary:	<xsl:value-of select="/bookinfo/subtitle"/><xsl:value-of select="/setinfo/subtitle"/><xsl:value-of select="/articleinfo/subtitle"/>
+Group:		Documentation
+License:	<xsl:value-of select="$license"/>
+URL:		<xsl:value-of select="$url"/>
+Source:		<xsl:value-of select="$src_url"/>%{archivename}.tgz
+BuildArch:	noarch
+BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+BuildRequires:	publican
+<xsl:if test="$brand != 'publican-common'">
+BuildRequires:	<xsl:value-of select="$brand"/>
+</xsl:if>
+BuildRequires:	desktop-file-utils
+Requires:	xdg-utils
+
+
+%description
+<xsl:value-of select="/bookinfo/abstract/para" /><xsl:value-of select="/setinfo/abstract/para" /><xsl:value-of select="/articleinfo/abstract/para" />
+
+%prep
+%setup -q -n %{archivename}
+
+%build
+%{__make} html-desktop-<xsl:value-of select="$book-lang"/>
+
+%install
+rm -rf $RPM_BUILD_ROOT
+mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
+
+cat > %{name}.desktop &lt;&lt;'EOF'
+[Desktop Entry]
+Name=<xsl:value-of select="/bookinfo/productname" /><xsl:value-of select="/setinfo/productname" /><xsl:value-of select="/articleinfo/productname"/> <xsl:value-of select="/bookinfo/productnumber" /><xsl:value-of select="/setinfo/productnumber" /><xsl:value-of select="/articleinfo/productnumber"/>: <xsl:value-of select="/bookinfo/title" /><xsl:value-of select="/setinfo/title" /><xsl:value-of select="/articleinfo/title"/>
+Comment=<xsl:value-of select="/bookinfo/subtitle"/><xsl:value-of select="/setinfo/subtitle"/><xsl:value-of select="/articleinfo/subtitle"/>
+Exec=xdg-open %{_docdir}/%{name}-%{version}/index.html
+Icon=%{_docdir}/%{name}-%{version}/images/icon.svg
+Categories=Documentation;
+Type=Application
+Encoding=UTF-8
+Terminal=false
+EOF
+
+desktop-file-install --dir=${RPM_BUILD_ROOT}%{_datadir}/applications %{name}.desktop
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root,-)
+%doc tmp/<xsl:value-of select="$book-lang"/>/html-desktop/*
+%{_datadir}/applications/%{name}.desktop
+
+%changelog<xsl:value-of select="$log"/>
+
+</xsl:template>
+
+</xsl:stylesheet>
+
Index: xsl/dt_xml_spec.xsl
===================================================================
--- xsl/dt_xml_spec.xsl	(revision 724)
+++ xsl/dt_xml_spec.xsl	(working copy)
@@ -11,23 +11,26 @@
 <!-- Note: do not indent this file!  Any whitespace here
      will be reproduced in the output -->
 <xsl:template match="/"># Red Hat Documentation Specfile
-Name:           <xsl:value-of select="$book-title"/>-<xsl:value-of select="$book-lang"/>
+
+%define archivename <xsl:value-of select="$archivename"/>
+
+Name:           <xsl:value-of select="$rpmname"/>
 Version:        <xsl:value-of select="$rpmver"/>
 Release:        <xsl:value-of select="$rpmrel"/>
 Summary:        <xsl:value-of select="/bookinfo/subtitle"/><xsl:value-of select="/setinfo/subtitle"/><xsl:value-of select="/articleinfo/subtitle"/>
 Group:          Documentation
 License:        OPL + Restrictions
 URL:            http://www.redhat.com/docs
-Source0:         %{name}-%{version}.tgz
+Source0:        %{archivename}.tgz
 BuildArch:      noarch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-Requires: yelp
+Requires:       yelp
 
 %description
 <xsl:value-of select="/bookinfo/abstract/para" /><xsl:value-of select="/setinfo/abstract/para" /><xsl:value-of select="/articleinfo/abstract/para" />
 
 %prep
-%setup -q
+%setup -q -n %{archivename}
 
 %build
 
Index: xsl/web-spec.xsl
===================================================================
--- xsl/web-spec.xsl	(revision 724)
+++ xsl/web-spec.xsl	(working copy)
@@ -20,14 +20,16 @@
 %define vendoropt  --vendor='redhat'
 %endif
 
-Name:		<xsl:value-of select="$book-title"/>-web-<xsl:value-of select="$lang"/>
+%define archivename <xsl:value-of select="$archivename"/>
+
+Name:		<xsl:value-of select="$pkgname"/>
 Version:	<xsl:value-of select="$rpmver"/>
 Release:	<xsl:value-of select="$rpmrel"/>%{?dist}
 Summary:	<xsl:value-of select="/bookinfo/subtitle"/><xsl:value-of select="/setinfo/subtitle"/><xsl:value-of select="/articleinfo/subtitle"/>
 Group:		Documentation
 License:	<xsl:value-of select="$license"/>
 URL:		<xsl:value-of select="$url"/>
-Source:		<xsl:value-of select="$src_url"/>%{name}-%{version}-<xsl:value-of select="$rpmrel"/>.tgz
+Source:		<xsl:value-of select="$src_url"/>%{archivename}.tgz
 BuildArch:	noarch
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires:	publican
@@ -40,7 +42,7 @@
 %description
 <xsl:value-of select="/bookinfo/abstract/para" /><xsl:value-of select="/setinfo/abstract/para" /><xsl:value-of select="/articleinfo/abstract/para" />
 
-%package -n <xsl:value-of select="$book-title"/>-<xsl:value-of select="$lang"/>
+%package -n <xsl:value-of select="$rpmname"/>
 Summary:	<xsl:value-of select="/bookinfo/subtitle"/><xsl:value-of select="/setinfo/subtitle"/><xsl:value-of select="/articleinfo/subtitle"/>
 Group:		Documentation
 %if %{HTMLVIEW}
@@ -50,11 +52,11 @@
 %endif
 <xsl:if test="$dt_obsoletes != ''">Obsoletes:	<xsl:value-of select="$dt_obsoletes"/></xsl:if>
 
-%description  -n <xsl:value-of select="$book-title"/>-<xsl:value-of select="$lang"/>
+%description  -n <xsl:value-of select="$rpmname"/>
 <xsl:value-of select="/bookinfo/abstract/para" /><xsl:value-of select="/setinfo/abstract/para" /><xsl:value-of select="/articleinfo/abstract/para" />
 
 %prep
-%setup -q
+%setup -q -n %{archivename}
 
 %build
 export CLASSPATH=$CLASSPATH:%{_javadir}/ant/ant-trax-1.7.0.jar:%{_javadir}/xmlgraphics-commons.jar:%{_javadir}/batik-all.jar:%{_javadir}/xml-commons-apis.jar:%{_javadir}/xml-commons-apis-ext.jar
@@ -66,26 +68,26 @@
 mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
 cp -rf publish/<xsl:value-of select="$lang"/> $RPM_BUILD_ROOT/%{prefix}/.
 
-cat > <xsl:value-of select="$book-title"/>-<xsl:value-of select="$lang"/>-<xsl:value-of select="$rpmver"/>.desktop &lt;&lt;'EOF'
+cat > <xsl:value-of select="$rpmname"/>-<xsl:value-of select="$rpmver"/>.desktop &lt;&lt;'EOF'
 [Desktop Entry]
 Name=<xsl:value-of select="/bookinfo/productname" /><xsl:value-of select="/setinfo/productname" /><xsl:value-of select="/articleinfo/productname"/> <xsl:value-of select="/bookinfo/productnumber" /><xsl:value-of select="/setinfo/productnumber" /><xsl:value-of select="/articleinfo/productnumber"/>: <xsl:value-of select="/bookinfo/title" /><xsl:value-of select="/setinfo/title" /><xsl:value-of select="/articleinfo/title"/>
 Comment=<xsl:value-of select="/bookinfo/subtitle"/><xsl:value-of select="/setinfo/subtitle"/><xsl:value-of select="/articleinfo/subtitle"/>
-Exec=%{viewer} %{_docdir}/<xsl:value-of select="$book-title"/>-<xsl:value-of select="$lang"/>-%{version}/index.html
-Icon=%{_docdir}/<xsl:value-of select="$book-title"/>-<xsl:value-of select="$lang"/>-%{version}/images/icon.svg
+Exec=%{viewer} %{_docdir}/<xsl:value-of select="$rpmname"/>-%{version}/index.html
+Icon=%{_docdir}/<xsl:value-of select="$rpmname"/>-%{version}/images/icon.svg
 Categories=Documentation;X-Red-Hat-Base;
 Type=Application
 Encoding=UTF-8
 Terminal=false
 EOF
 
-desktop-file-install %{?vendoropt} --dir=${RPM_BUILD_ROOT}%{_datadir}/applications <xsl:value-of select="$book-title"/>-<xsl:value-of select="$lang"/>-<xsl:value-of select="$rpmver"/>.desktop
+desktop-file-install %{?vendoropt} --dir=${RPM_BUILD_ROOT}%{_datadir}/applications <xsl:value-of select="$rpmname"/>-<xsl:value-of select="$rpmver"/>.desktop
 
-%preun -n <xsl:value-of select="$book-title"/>-web-<xsl:value-of select="$lang"/>
+%preun -n <xsl:value-of select="$pkgname"/>
 if [ "$1" = "0" ] ; then # last uninstall
 %{__perl} -e 'if (eval {require Publican::WebSite}) { my @formats = ("html", "pdf", "html-single"); my $ws = Publican::WebSite->new(); foreach my $format (@formats) { $ws->del_entry({ language => "<xsl:value-of select="$lang"/>", product => "<xsl:value-of select="$prod" />", version => "<xsl:value-of select="$prodver" />", name => "<xsl:value-of select="$docname" />", format => "$format"} ); } $ws->regen_all_toc();}';
 fi
 
-%post -n <xsl:value-of select="$book-title"/>-web-<xsl:value-of select="$lang"/>
+%post -n <xsl:value-of select="$pkgname"/>
 %{__perl} -e 'use Publican::WebSite; my @formats = ("html", "pdf", "html-single"); my $ws = Publican::WebSite->new(); foreach my $format (@formats) { $ws->add_entry( { language => "<xsl:value-of select="$lang"/>", product => "<xsl:value-of select="$prod" />", version => "<xsl:value-of select="$prodver" />", name => "<xsl:value-of select="$docname" />", format => "$format" }); } $ws->regen_all_toc();'
 
 %clean
@@ -95,10 +97,10 @@
 %defattr(-,root,root,-)
 %{prefix}/<xsl:value-of select="$lang"/>
 
-%files -n <xsl:value-of select="$book-title"/>-<xsl:value-of select="$lang"/>
+%files -n <xsl:value-of select="$rpmname"/>
 %defattr(-,root,root,-)
 %doc tmp/<xsl:value-of select="$lang"/>/html-desktop/*
-%{_datadir}/applications/%{?vendor}<xsl:value-of select="$book-title"/>-<xsl:value-of select="$lang"/>-<xsl:value-of select="$rpmver"/>.desktop
+%{_datadir}/applications/%{?vendor}<xsl:value-of select="$rpmname"/>-<xsl:value-of select="$rpmver"/>.desktop
 
 %changelog<xsl:value-of select="$log"/>
 
Index: xsl/dt_htmlsingle_spec.xsl
===================================================================
--- xsl/dt_htmlsingle_spec.xsl	(revision 724)
+++ xsl/dt_htmlsingle_spec.xsl	(working copy)
@@ -21,14 +21,16 @@
 %define vendoropt --vendor="redhat"
 %endif
 
-Name:	<xsl:value-of select="$book-title"/>-<xsl:value-of select="$book-lang"/>
+%define archivename <xsl:value-of select="$archivename"/>
+
+Name:		<xsl:value-of select="$rpmname"/>
 Version:	<xsl:value-of select="$rpmver"/>
 Release:	<xsl:value-of select="$rpmrel"/>%{?dist}
 Summary:	<xsl:value-of select="/bookinfo/subtitle"/><xsl:value-of select="/setinfo/subtitle"/><xsl:value-of select="/articleinfo/subtitle"/>
 Group:		Documentation
 License:	<xsl:value-of select="$license"/>
 URL:		<xsl:value-of select="$url"/>
-Source:		<xsl:value-of select="$src_url"/>%{name}-%{version}.tgz
+Source:		<xsl:value-of select="$src_url"/>%{archivename}.tgz
 BuildArch:	noarch
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires:	publican
@@ -45,7 +47,7 @@
 <xsl:value-of select="/bookinfo/abstract/para" /><xsl:value-of select="/setinfo/abstract/para" /><xsl:value-of select="/articleinfo/abstract/para" />
 
 %prep
-%setup -q
+%setup -q -n %{archivename}
 
 %build
 %{__make} html-desktop-<xsl:value-of select="$book-lang"/>
Index: make/Makefile.common
===================================================================
--- make/Makefile.common	(revision 724)
+++ make/Makefile.common	(working copy)
@@ -23,6 +23,7 @@
 DOC_TYPE	?= Book
 CONFIDENTIAL	?= 0
 BREW_DIST	?= dist-5E-qu-candidate
+KOJI_DIST	?= dist-f12
 WEB_BREW_DIST	?= docs-5E
 EXTRA_DIRS	?= $(shell find $(XML_LANG) -type d | grep -vw CVS | grep -vw '.svn' | grep -vw images | sed -e 's/$(XML_LANG)//g'| sed -e 's/^\///g')
 
@@ -30,6 +31,7 @@
 DOCNAME		= $(shell grep -m1 '<title' $(XML_LANG)/$(DOC_TYPE)_Info.xml  | sed -e 's/<[/]*title>//g' | sed -e 's/^\s*//'  | sed -e 's/\s/_/g')
 PRODUCT		= $(shell grep -m1 '<productname' $(XML_LANG)/$(DOC_TYPE)_Info.xml  | sed -e 's/<[/]*productname>//g' | sed -e 's/^\s*//'  | sed -e 's/\s/_/g')
 PROD_VERSION	= $(shell awk '/<productnumber>(.*)<\/productnumber>/ { print $$1 }' $(XML_LANG)/$(DOC_TYPE)_Info.xml | sed -e 's/<[/]*productnumber>//g')
+RPM_NAME	?= $(PRODUCT)-$(DOCNAME)
 RPM_VERSION	= $(shell awk '/<edition>(.*)<\/edition>/ { print $$1 }' $(XML_LANG)/$(DOC_TYPE)_Info.xml | sed -e 's/<[/]*edition>//g')
 RPM_RELEASE	= $(shell awk '/<pubsnumber>(.*)<\/pubsnumber>/ { print $$1 }' $(XML_LANG)/$(DOC_TYPE)_Info.xml | sed -e 's/<[/]*pubsnumber>//g')
 XSLTPROC	= xsltproc
@@ -89,7 +91,7 @@
 ###############################################################################
 ######### SPEC File Vars ##############
 ###############################################################################
-SPEC_NAME	?= $(PRODUCT)-$(DOCNAME)
+SPEC_NAME	?= $(RPM_NAME)
 ifdef XML_DESKTOP
 SPEC_XSL	= $(COMMON_CONFIG)/xsl/dt_xml_spec.xsl
 SUB_SPEC_XSL	= $(COMMON_CONFIG)/xsl/sub_package_xml.xsl
@@ -98,7 +100,8 @@
 SUB_SPEC_XSL	= $(COMMON_CONFIG)/xsl/sub_package_htmlsingle.xsl
 endif
 
-TAR_NAME	= $(PRODUCT)-$(DOCNAME)-$(PROD_VERSION)
+PKG_NAME	= $(RPM_NAME)-$(PROD_VERSION)
+TAR_NAME	= $(PKG_NAME)-$(RPM_VERSION)
 
 
 include $(COMMON_CONFIG)/make/Makefile.templates
@@ -271,6 +274,15 @@
 web-brew-all:: $(foreach L,$(TRANSLATIONS), web-brew-${L})
 
 ###############################################################################
+### Fedora Desktop rpm  ###
+###############################################################################
+$(foreach L,$(TRANSLATIONS), $(eval $(call Fedora_SPEC_Template,${L})))
+$(foreach L,$(TRANSLATIONS), $(eval $(call Fedora_SRPM_Template,${L})))
+$(foreach L,$(TRANSLATIONS), $(eval $(call Koji_Template,${L})))
+$(foreach L,$(TRANSLATIONS), $(eval $(call Koji_Scratch_Template,${L})))
+
+
+###############################################################################
 # SECTION: PO FILES 
 ###############################################################################
 
@@ -503,6 +515,8 @@
 	@echo "IGNORED_TRANSLATIONS: When building replace any languages in this list with the source langauge text"
 	@echo "	This allows you to work on translations without shipping incomplete translations. Currently: $(IGNORED_TRANSLATIONS)"
 	@echo
+	@echo "KOJI_DIST: koji tag for fedora rpms. Currently: $(KOJI_DIST)"
+	@echo
 	@echo "OTHER_LANGS:  space seperated list of language locales. Currently: $(OTHER_LANGS)"
 	@echo
 	@echo "PRODUCT: Product this book is associated with. Currently: $(PRODUCT)"
@@ -547,10 +561,14 @@
 	@echo
 	@echo "OTHER_LANGS_C: Comma seperated list of non-source languages."
 	@echo
+	@echo "PKG_NAME: Shortcut for the PACKAGE name. Currently: $(PKG_NAME)"
+	@echo
 	@echo "PWD: present working directory."
 	@echo
 	@echo "PROD_VERSION: Version of the PRODUCT, retrieved from productnumber tag in Info file. Currently: $(PROD_VERSION)"
 	@echo
+	@echo "RPM_NAME: RPM package base name. Currently: $(RPM_NAME)"
+	@echo
 	@echo "RPM_VERSION: Edition number of this book, fetched from edition in Info file. Currently: $(RPM_VERSION)"
 	@echo
 	@echo "RPM_RELEASE: release number of this book, fetched from pubsnumber in Info file. Currently: $(RPM_RELEASE)"
@@ -617,6 +635,12 @@
 	@echo "clean_set_books"
 	@echo "	For Sets of Books, this will run 'make clean' for all the Books."
 	@echo
+	@echo "fedora-spec-<LANG>-<LOC>"
+	@echo "	Generate the fedora RPM Spec file for the given language."
+	@echo
+	@echo "fedora-srpm-<LANG>-<LOC>"
+	@echo "	Creates the fedora SRPM for the supplied language."
+	@echo
 	@echo "help"
 	@echo "	Display this help message."
 	@echo
@@ -626,6 +650,14 @@
 	@echo "help_internals"
 	@echo "	Display information about parameters that can NOT be set in the Books Makefile."
 	@echo
+	@echo "koji-<LANG>-<LOC>"
+	@echo "	Build the fedora SRPM for the given langauge and then push it to Koji."
+	@echo "	Current Koji tag is: $(KOJI_DIST)"
+	@echo
+	@echo "koji-scratch-<LANG>-<LOC>"
+	@echo "	Build the fedora SRPM for the given langauge and then push it to Koji as a scratch build."
+	@echo "	Current Koji tag is: $(KOJI_DIST)"
+	@echo
 	@echo "pom"
 	@echo "	Create a pom.xml file for use with maven."
 	@echo
Index: make/Makefile.templates
===================================================================
--- make/Makefile.templates	(revision 724)
+++ make/Makefile.templates	(working copy)
@@ -338,7 +338,7 @@
 				chunk.section.depth="$(CHUNK_SECTION_DEPTH)" confidential=${CONFIDENTIAL} profile.lang="$$(GENLANG)" \
 				l10n.gentext.language="$$(GENLANG)" show.comments=$(SHOW_REMARKS) embedtoc=$$(EMBEDTOC) \
 				chunk.first.sections="$(CHUNK_FIRST)" generate.section.toc.level=$(GENERATE_SECTION_TOC_LEVEL) \
-				tablecolumns.extension=1 package=$(TAR_NAME)-${2}-$(RPM_VERSION)-$(${2}_RPM_RELEASE) highlight.source=$(XSLTHL); \
+				tablecolumns.extension=1 package=$(PKG_NAME)-${2}-$(RPM_VERSION)-$(${2}_RPM_RELEASE) highlight.source=$(XSLTHL); \
 			rm tmppoofu.html; \
 		else \
 			echo "Running xsltproc on $$$$xsl_file"; \
@@ -346,7 +346,7 @@
 				--stringparam chunk.section.depth "$(CHUNK_SECTION_DEPTH)" --stringparam confidential "${CONFIDENTIAL}" --stringparam profile.lang "$$(GENLANG)" \
 				--stringparam l10n.gentext.language "$$(GENLANG)" --stringparam show.comments $(SHOW_REMARKS) --stringparam embedtoc $$(EMBEDTOC) \
 				--stringparam chunk.first.sections "$(CHUNK_FIRST)" --stringparam generate.section.toc.level $(GENERATE_SECTION_TOC_LEVEL) \
-				--stringparam package "$(TAR_NAME)-${2}-$(RPM_VERSION)-$(${2}_RPM_RELEASE)" --xinclude $$$$xsl_file ../xml/$(DOCNAME).xml; \
+				--stringparam package "$(PKG_NAME)-${2}-$(RPM_VERSION)-$(${2}_RPM_RELEASE)" --xinclude $$$$xsl_file ../xml/$(DOCNAME).xml; \
 		fi;
 # copy files
 	@if [ -d $(XML_LANG)/files ]; then cp -rf $(XML_LANG)/files tmp/${2}/${1}/.; fi
@@ -499,19 +499,19 @@
 .PHONY:	tardir-${1}
 tardir-${1}:: xml-${1} test-${1}
 	@echo "START: tardir-${1} `date`"
-	@mkdir -p tmp/tar/$(TAR_NAME)-${1}-$(RPM_VERSION)
-	@cp -rf tmp/${1}/xml tmp/tar/$(TAR_NAME)-${1}-$(RPM_VERSION)/${1}
-	@if [ -d $(XML_LANG)/files ]; then cp -rf $(XML_LANG)/files tmp/tar/$(TAR_NAME)-${1}-$(RPM_VERSION)/${1}/.; fi
-	@if [ -d ${1}/files ]; then cp -rf ${1}/files tmp/tar/$(TAR_NAME)-${1}-$(RPM_VERSION)/${1}/.; fi
-	@rm -rf tmp/tar/$(TAR_NAME)-${1}-$(RPM_VERSION)/${1}/Common_Content
-	@cp Makefile tmp/tar/$(TAR_NAME)-${1}-$(RPM_VERSION)/.
-	@sed -i -e 's/^XML_LANG.*$$$$/XML_LANG = ${1}/' tmp/tar/$(TAR_NAME)-${1}-$(RPM_VERSION)/Makefile
-	@sed -i -e 's/^IGNORED_TRANSLATIONS.*$$$$//' tmp/tar/$(TAR_NAME)-${1}-$(RPM_VERSION)/Makefile
-	@sed -i -e 's/^XML_LANG/T_DOCNAME = $(DOCNAME)\nXML_LANG/' tmp/tar/$(TAR_NAME)-${1}-$(RPM_VERSION)/Makefile
-	@sed -i -e 's/^XML_LANG/T_PRODUCT = $(PRODUCT)\nXML_LANG/' tmp/tar/$(TAR_NAME)-${1}-$(RPM_VERSION)/Makefile
-	@sed -i -e 's/^XML_LANG/T_PROD_VERSION = $(PROD_VERSION)\nXML_LANG/' tmp/tar/$(TAR_NAME)-${1}-$(RPM_VERSION)/Makefile
-	@sed -i -e 's/^XML_LANG/T_RPM_RELEASE = $(RPM_RELEASE)\nXML_LANG/' tmp/tar/$(TAR_NAME)-${1}-$(RPM_VERSION)/Makefile
-	@sed -i -e 's/^XML_LANG/${1}_RPM_RELEASE = $(${1}_RPM_RELEASE)\nXML_LANG/' tmp/tar/$(TAR_NAME)-${1}-$(RPM_VERSION)/Makefile
+	@mkdir -p tmp/tar/$(TAR_NAME)-${1}
+	@cp -rf tmp/${1}/xml tmp/tar/$(TAR_NAME)-${1}/${1}
+	@if [ -d $(XML_LANG)/files ]; then cp -rf $(XML_LANG)/files tmp/tar/$(TAR_NAME)-${1}/${1}/.; fi
+	@if [ -d ${1}/files ]; then cp -rf ${1}/files tmp/tar/$(TAR_NAME)-${1}/${1}/.; fi
+	@rm -rf tmp/tar/$(TAR_NAME)-${1}/${1}/Common_Content
+	@cp Makefile tmp/tar/$(TAR_NAME)-${1}/.
+	@sed -i -e 's/^XML_LANG.*$$$$/XML_LANG = ${1}/' tmp/tar/$(TAR_NAME)-${1}/Makefile
+	@sed -i -e 's/^IGNORED_TRANSLATIONS.*$$$$//' tmp/tar/$(TAR_NAME)-${1}/Makefile
+	@sed -i -e 's/^XML_LANG/T_DOCNAME = $(DOCNAME)\nXML_LANG/' tmp/tar/$(TAR_NAME)-${1}/Makefile
+	@sed -i -e 's/^XML_LANG/T_PRODUCT = $(PRODUCT)\nXML_LANG/' tmp/tar/$(TAR_NAME)-${1}/Makefile
+	@sed -i -e 's/^XML_LANG/T_PROD_VERSION = $(PROD_VERSION)\nXML_LANG/' tmp/tar/$(TAR_NAME)-${1}/Makefile
+	@sed -i -e 's/^XML_LANG/T_RPM_RELEASE = $(RPM_RELEASE)\nXML_LANG/' tmp/tar/$(TAR_NAME)-${1}/Makefile
+	@sed -i -e 's/^XML_LANG/${1}_RPM_RELEASE = $(${1}_RPM_RELEASE)\nXML_LANG/' tmp/tar/$(TAR_NAME)-${1}/Makefile
 	@echo "END: tardir-${1} `date`"
 endef
 
@@ -519,8 +519,8 @@
 .PHONY:	tar-${1}
 tar-${1}:: tardir-${1}
 	@echo "START: tar-${1} `date`"
-	@cd tmp/tar && tar --create --gzip --exclude-from=$(COMMON_CONFIG)/make/tar-excludes --file $(TAR_NAME)-${1}-$(RPM_VERSION).tgz $(TAR_NAME)-${1}-$(RPM_VERSION)
-	@echo "The archive is in tmp/tar/$(TAR_NAME)-${1}-$(RPM_VERSION).tgz"
+	@cd tmp/tar && tar --create --gzip --exclude-from=$(COMMON_CONFIG)/make/tar-excludes --file $(TAR_NAME)-${1}.tgz $(TAR_NAME)-${1}
+	@echo "The archive is in tmp/tar/$(TAR_NAME)-${1}.tgz"
 	@echo "END: tar-${1} `date`"
 endef
 
@@ -538,9 +538,11 @@
 			exit 5; \
 		fi; \
 		$(CATALOGS) $(XSLTPROC) $(COMMON_CONFIG)/xsl/changelog.xsl tmp/${1}/xml/$$$$rev_file > tmp/changelog.txt
-	$(CATALOGS) $(XSLTPROC) --path "$(PWD)" --stringparam book-title "$(TAR_NAME)" \
+	$(CATALOGS) $(XSLTPROC) --path "$(PWD)" \
 		--stringparam main-file "$(DOCNAME).xml" \
 		--stringparam book-lang "${1}" \
+		--stringparam archivename "$(TAR_NAME)-${1}" \
+		--stringparam rpmname "$(PKG_NAME)-${1}" \
 		--stringparam rpmver "$(RPM_VERSION)" \
 		--stringparam rpmrel "$(${1}_RPM_RELEASE)" \
 		--stringparam license "$(LICENSE)" \
@@ -548,7 +550,7 @@
 		--stringparam src_url "$(SRC_URL)" \
 		--stringparam brand "publican-$(LC_BRAND)" \
 		--stringparam log "$$$$(<tmp/changelog.txt)" \
-		-o tmp/rpm/SPECS/$(TAR_NAME)-${1}.spec \
+		-o tmp/rpm/SPECS/$(RPM_NAME)-${1}.spec \
 		$(SPEC_XSL) tmp/${1}/xml/$(DOC_TYPE)_Info.xml
 	@echo "END: spec-${1} `date`"
 endef
@@ -557,8 +559,8 @@
 .PHONY:	srpm-${1}
 srpm-${1}:: clean spec-${1}
 	@echo "START: srpm-${1} `date`"
-	@cp tmp/tar/$(TAR_NAME)-${1}-$(RPM_VERSION).tgz tmp/rpm/SOURCES/.
-	@rpmbuild --define "_topdir $(PWD)/tmp/rpm" --define "dist .$(OS_VER)" -bs tmp/rpm/SPECS/$(TAR_NAME)-${1}.spec
+	@cp tmp/tar/$(TAR_NAME)-${1}.tgz tmp/rpm/SOURCES/.
+	@rpmbuild --define "_topdir $(PWD)/tmp/rpm" --define "dist .$(OS_VER)" -bs tmp/rpm/SPECS/$(RPM_NAME)-${1}.spec
 	@echo "END: srpm-${1} `date`"
 endef
 
@@ -566,7 +568,7 @@
 .PHONY:	brew-${1}
 brew-${1}:: srpm-${1}
 	@echo "START: brew-${1} `date`"
-	@brew build --nowait $(BREW_DIST) tmp/rpm/SRPMS/$(TAR_NAME)-${1}-$(RPM_VERSION)-$(${1}_RPM_RELEASE).$(OS_VER).src.rpm
+	@brew build --nowait $(BREW_DIST) tmp/rpm/SRPMS/$(PKG_NAME)-${1}-$(RPM_VERSION)-$(${1}_RPM_RELEASE).$(OS_VER).src.rpm
 	@echo "END: brew-${1} `date`"
 endef
 
@@ -574,7 +576,7 @@
 .PHONY:	brew-scratch-${1}
 brew-scratch-${1}:: srpm-${1}
 	@echo "START: brew-scratch-${1} `date`"
-	@brew build --scratch $(BREW_DIST) tmp/rpm/SRPMS/$(TAR_NAME)-${1}-$(RPM_VERSION)-$(${1}_RPM_RELEASE).$(OS_VER).src.rpm
+	@brew build --scratch $(BREW_DIST) tmp/rpm/SRPMS/$(PKG_NAME)-${1}-$(RPM_VERSION)-$(${1}_RPM_RELEASE).$(OS_VER).src.rpm
 	@echo "END: brew-scratch-${1} `date`"
 endef
 
@@ -586,6 +588,62 @@
 	@echo "END: brew-report-${1} `date`"
 endef
 
+define	Fedora_SPEC_Template
+.PHONY:	fedora-spec-${1}
+fedora-spec-${1}:: tar-${1}
+	@echo "START: fedora-spec-${1} `date`"
+	@rm -f tmp/subpackages.txt tmp/titles.txt tmp/changelog.txt
+	@mkdir -p tmp/rpm/SPECS tmp/rpm/SOURCES tmp/rpm/SRPMS
+	@rev_file=`grep -l '<revhistory' $(XML_LANG)/*.xml | head -n 1 | sed -e 's/$(XML_LANG)\///g'`; \
+		if [ ! -f "$(XML_LANG)/$$$$rev_file" ]; then \
+			echo; \
+			echo "*ERROR: No revhistory found*"; \
+			echo "You need a correctly formatted Revision History to build RPMS"; \
+			exit 5; \
+		fi; \
+		$(CATALOGS) $(XSLTPROC) $(COMMON_CONFIG)/xsl/changelog.xsl tmp/${1}/xml/$$$$rev_file > tmp/changelog.txt
+	$(CATALOGS) $(XSLTPROC) --path "$(PWD)" \
+		--stringparam main-file "$(DOCNAME).xml" \
+		--stringparam book-lang "${1}" \
+		--stringparam archivename "$(TAR_NAME)-${1}" \
+		--stringparam rpmname "$(RPM_NAME)-${1}" \
+		--stringparam rpmver "$(RPM_VERSION)" \
+		--stringparam rpmrel "$(${1}_RPM_RELEASE)" \
+		--stringparam license "$(LICENSE)" \
+		--stringparam url "$(DOC_URL)" \
+		--stringparam src_url "$(SRC_URL)" \
+		--stringparam brand "publican-$(LC_BRAND)" \
+		--stringparam log "$$$$(<tmp/changelog.txt)" \
+		-o tmp/rpm/SPECS/$(RPM_NAME)-${1}.spec \
+		$(COMMON_CONFIG)/xsl/fedora-spec.xsl tmp/${1}/xml/$(DOC_TYPE)_Info.xml
+	@echo "END: fedora-spec-${1} `date`"
+endef
+
+define	Fedora_SRPM_Template
+.PHONY:	fedora-srpm-${1}
+fedora-srpm-${1}:: clean fedora-spec-${1}
+	@echo "START: fedora-srpm-${1} `date`"
+	@cp tmp/tar/$(TAR_NAME)-${1}.tgz tmp/rpm/SOURCES/.
+	@rpmbuild --define "_topdir $(PWD)/tmp/rpm" --define "dist .$(OS_VER)" -bs tmp/rpm/SPECS/$(RPM_NAME)-${1}.spec
+	@echo "END: fedora-srpm-${1} `date`"
+endef
+
+define	Koji_Template
+.PHONY:	brew-${1}
+koji-${1}:: fedora-srpm-${1}
+	@echo "START: koji-${1} `date`"
+	@koji build --nowait $(BREW_DIST) tmp/rpm/SRPMS/$(RPM_NAME)-${1}-$(RPM_VERSION)-$(${1}_RPM_RELEASE).$(OS_VER).src.rpm
+	@echo "END: koji-${1} `date`"
+endef
+
+define	Koji_Scratch_Template
+.PHONY:	koji-scratch-${1}
+koji-scratch-${1}:: fedora-srpm-${1}
+	@echo "START: koji-scratch-${1} `date`"
+	@koji build --scratch $(KOJI_DIST) tmp/rpm/SRPMS/$(RPM_NAME)-${1}-$(RPM_VERSION)-$(${1}_RPM_RELEASE).$(OS_VER).src.rpm
+	@echo "END: koji-scratch-${1} `date`"
+endef
+
 ###############################################################################
 # Template for Web SRPMS
 #
@@ -598,12 +656,10 @@
 
 define	WEB_SRPM_Template
 .PHONY:	web-srpm-${1}
-web-srpm-${1}:: clean tardir-${1}
+web-srpm-${1}:: clean tar-${1}
 	@echo "START: web-srpm-${1}: `date`"
-	@mv tmp/tar/$(TAR_NAME)-${1}-$(RPM_VERSION) tmp/tar/$(TAR_NAME)-web-${1}-$(RPM_VERSION)
-	@cd tmp/tar && tar --create --gzip --exclude-from=$(COMMON_CONFIG)/make/tar-excludes --file $(TAR_NAME)-web-${1}-$(RPM_VERSION)-$(${1}_RPM_RELEASE).tgz $(TAR_NAME)-web-${1}-$(RPM_VERSION)
 	@mkdir -p tmp/rpm/SPECS tmp/rpm/SOURCES tmp/rpm/SRPMS
-	@cp tmp/tar/$(TAR_NAME)-web-${1}-$(RPM_VERSION)-$(${1}_RPM_RELEASE).tgz tmp/rpm/SOURCES/.
+	@cp tmp/tar/$(TAR_NAME)-${1}.tgz tmp/rpm/SOURCES/.
 	@rev_file=`grep -l '<revhistory' $(XML_LANG)/*| head -n 1 | sed -e 's/$(XML_LANG)\///g'`; \
 		if [ ! -f "$(XML_LANG)/$$$$rev_file" ]; then \
 			echo; \
@@ -612,10 +668,13 @@
 			exit 5; \
 		fi; \
 		$(CATALOGS) $(XSLTPROC) $(COMMON_CONFIG)/xsl/changelog.xsl tmp/${1}/xml/$$$$rev_file > tmp/changelog.txt
-	@$(CATALOGS) $(XSLTPROC)  --path "$(PWD)" --stringparam book-title "$(TAR_NAME)" \
+	@$(CATALOGS) $(XSLTPROC)  --path "$(PWD)" \
 		--stringparam lang "${1}" \
 		--stringparam prod "$(PRODUCT)" \
 		--stringparam prodver "$(PROD_VERSION)" \
+		--stringparam archivename "$(TAR_NAME)-${1}" \
+		--stringparam pkgname "$(PKG_NAME)-web-${1}" \
+		--stringparam rpmname "$(PKG_NAME)-${1}" \
 		--stringparam rpmver "$(RPM_VERSION)" \
 		--stringparam rpmrel "$(${1}_RPM_RELEASE)" \
 		--stringparam docname "$(DOCNAME)" \
@@ -626,9 +685,9 @@
 		--stringparam log "$$$$(<tmp/changelog.txt)" \
 		--stringparam dt_obsoletes "$(DT_OBSOLETES)" \
 		--stringparam web_obsoletes "$(WEB_OBSOLETES)" \
-		-o tmp/rpm/SPECS/$(PRODUCT)-$(DOCNAME)-$(PROD_VERSION)-web-${1}.spec \
+		-o tmp/rpm/SPECS/$(RPM_NAME)-${1}.spec \
 		$(COMMON_CONFIG)/xsl/web-spec.xsl tmp/${1}/xml/$(DOC_TYPE)_Info.xml
-	rpmbuild --define "_topdir $(PWD)/tmp/rpm" --define "dist .$(OS_VER)" -bs tmp/rpm/SPECS/$(TAR_NAME)-web-${1}.spec
+	rpmbuild --define "_topdir $(PWD)/tmp/rpm" --define "dist .$(OS_VER)" -bs tmp/rpm/SPECS/$(RPM_NAME)-${1}.spec
 	@echo "END: web-srpm-${1}: `date`"
 endef
 
@@ -642,7 +701,7 @@
 .PHONY:	web-brew-${1}
 web-brew-${1}:: web-srpm-${1}
 	@echo "START: web-brew-${1} `date`"
-	@brew build --nowait $(WEB_BREW_DIST) tmp/rpm/SRPMS/$(TAR_NAME)-web-${1}-$(RPM_VERSION)-$(${1}_RPM_RELEASE).$(OS_VER).src.rpm
+	@brew build --nowait $(WEB_BREW_DIST) tmp/rpm/SRPMS/$(PKG_NAME)-web-${1}-$(RPM_VERSION)-$(${1}_RPM_RELEASE).$(OS_VER).src.rpm
 	@echo "END: brew-${1} `date`"
 endef
 
@@ -650,7 +709,7 @@
 .PHONY:	web-brew-scratch-${1}
 web-brew-scratch-${1}:: web-srpm-${1}
 	@echo "START: web-brew-scratch-${1} `date`"
-	@brew build --scratch $(WEB_BREW_DIST) tmp/rpm/SRPMS/$(TAR_NAME)-web-${1}-$(RPM_VERSION)-$(${1}_RPM_RELEASE).$(OS_VER).src.rpm
+	@brew build --scratch $(WEB_BREW_DIST) tmp/rpm/SRPMS/$(PKG_NAME)-web-${1}-$(RPM_VERSION)-$(${1}_RPM_RELEASE).$(OS_VER).src.rpm
 	@echo "END: brew-scratch-${1} `date`"
 endef
 
@@ -659,7 +718,7 @@
 .PHONY:	web-brew-report-${1}
 web-brew-report-${1}::
 	@echo "START: web-brew-report-${1} `date`"
-	@brew latest-pkg $(WEB_BREW_DIST) $(TAR_NAME)-web-${1}
+	@brew latest-pkg $(WEB_BREW_DIST) $(PKG_NAME)-web-${1}
 	@echo "END: brew-report-${1} `date`"
 endef
 
