RPM spec-файл - это текстовый файл, содержащий структурированную информацию. Использование XML для хранения такой информации - естественный шаг вперед. В качестве экспериментальной возможности поддерживается анализ spec-файла в формате XML. Утилита rpmxmlbuild соберет rpm-пакет, используя такой файл. 
Пример XML spec-файла показан ниже:
| 
 <?xml version="1.0"?> 
  
<spec distribution="RPM Test" vendor="rpm.org" 
name="bash" version="2.05a" release="02test" 
copyright="GPL" 
url="http://www.gnu.org/software/bash/bash.html"> 
  
<source name="%{name}-%{version}.tar.bz2" 
size="1434025" md5="c29b50db808003e39558a0f6354f4cad" 
path="%{name}-%{version}"> 
  
</source> 
  
<buildrequires> 
  
<require name="bash" /> 
  
<require name="gcc" /> 
  
<require name="make" /> 
  
</buildrequires> 
  
<!-- packages --> 
  
<package group="System/Base" autoreqprov="no"> 
  
<requires> 
  
<require name="glibc" /> 
  
</requires> 
  
<summary>The Bash package contains the bash program.</summary>
  
<description>%{summary} 
Bash is the Bourne-Again SHell, which is a widely used command interpreter on Unix systems. Bash is a program that reads from standard input, the keyboard. A user types something and the program will evaluate what he has typed and do something with it, like running a program. 
</description> 
  
<files list="%{name}.files.lst" /> 
  
</package> 
  
<package name="bash-doc" group="Documentation/System/Base" autoreqprov="no"> 
  
<requires> 
  
<require name="%{name}" /> 
  
</requires> 
  
<summary>Documentation for the bash package.</summary> 
  
<description>%{summary}</description> 
  
<pre script="%{name}-doc.pre.sh" /> 
  
<files list="%{name}-doc.files.lst" /> 
  
</package> 
  
<!-- scripts to create the package --> 
  
<prep script="%{name}.prep.sh"> 
  
<setup /> 
  
<script>echo "Prep completed"</script> 
  
</prep> 
  
<build script="%{name}.build.sh" /> 
  
<install script="%{name}.install.sh" /> 
  
<clean script="%{name}.clean.sh" /> 
  
<!-- changelog --> 
  
<changelog> 
  
<changes date="Mon Aug 26 2002" version="2.05a-02test" 
author="" author-email=""> 
  
<change>Added setup macro to extract files</change> 
  
<change>Initial version ready for jbj</change> 
  
</changes> 
  
</changelog> 
  
</spec> 
  
 | 
 Далее - Раздел 10. Расширенные возможности RPM 
 Назад - Параметры макросов 
 Содержание