Drupal module specfile template

The following templates can be used to create new Drupal module and theme packages. Substitute the name for the Drupal module or theme, in the correct case as used throughout the Drupal web site.

Module template
%global drupalver 6 %{?rhel: %{expand: %%global drupal drupal%%{drupalver}}} %if 0%{?fedora} >= 15 %global drupal drupal%{drupalver} %endif %{!?drupal: %{expand: %%global drupal drupal}} %global drupaldir %{_datadir}/%{drupal} %global modname <<>>
 * 1) e.g. "/usr/share/drupal6"
 * 1) Use upstream name as expressed in URL and tarball

Name:   drupal%{drupalver}-%{modname} Version: <<>> Release: 1%{?dist} Summary: <<>> Group:  Applications/Publishing License: GPLv2+ URL:    http://drupal.org/project/%{modname} Source0: http://ftp.drupal.org/files/projects/%{modname}-%{drupalver}.x-%{version}.tar.gz Source1: %{name}-fedora-README.txt BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: %{drupal} >= 6.0

%description <<>>

%prep %setup -qn %{modname}

%build cp %{SOURCE1}.

%install rm -rf %{buildroot} install -d %{buildroot}%{drupaldir}/modules/%{modname} find. -type f -exec install -m 0644 -D '{}' %{buildroot}%{drupaldir}/modules/%{modname}/'{}' \;

%clean rm -rf %{buildroot}

%files %defattr(-,root,root,-) %doc LICENSE.txt %{name}-fedora-README.txt %exclude %{drupaldir}/modules/%{modname}/LICENSE.txt %exclude %{drupaldir}/modules/%{modname}/%{name}-fedora-README.txt %{drupaldir}/modules/%{modname}
 * 1) Remember to include other documentation text here as well
 * 1) Remember to exclude all documentation texts from above

%changelog

Theme template
It's debatable whether packaging themes is worthwhile, since these tend to be specific to each site. However, the NineSixty (aka 960.gs) theme is available, which can be subthemed for a wide variety of uses.

%global drupalver 6 %{?rhel: %{expand: %%global drupal drupal%%{drupalver}}} %if 0%{?fedora} >= 15 %global drupal drupal%{drupalver} %endif %{!?drupal: %{expand: %%global drupal drupal}} %global drupaldir %{_datadir}/%{drupal} %global themename <<>>
 * 1) e.g. "/usr/share/drupal6"
 * 1) Use upstream name as expressed in URL and tarball

Name:   drupal%{drupalver}-%{themename} Version: <<>> Release: 1%{?dist} Summary: <<>> Group:  Applications/Publishing License: GPLv2+ URL:    http://drupal.org/project/%{themename} Source0: http://ftp.drupal.org/files/projects/%{themename}-%{drupalver}.x-%{version}.tar.gz BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: %{drupal} >= 6.0

%description <<>>

%prep %setup -qn %{themename}

%build
 * 1) Empty.

%install rm -rf %{buildroot} install -d %{buildroot}%{drupaldir}/themes/%{themename} find. -type f -exec install -m 0644 -D '{}' %{buildroot}%{drupaldir}/themes/%{themename}/'{}' \;

%clean rm -rf %{buildroot}

%files %defattr(-,root,root,-) %doc LICENSE.txt %exclude %{drupaldir}/themes/%{themename}/LICENSE.txt %{drupaldir}/themes/%{themename}
 * 1) Remember to include other documentation text here as well
 * 1) Remember to exclude all documentation texts from above

%changelog