From Fedora Project Wiki
No edit summary |
(Make a conditional that works with older Fedora too) |
||
Line 4: | Line 4: | ||
{{admon/warning | Look for dependencies | Before you submit a package, you ''must'' go through the source and ensure that all dependency libraries are separately packaged in Fedora, ''and'' eliminated from the Drupal module package. Also, be sure to check the <tt>.info</tt> file for dependency information!}} | {{admon/warning | Look for dependencies | Before you submit a package, you ''must'' go through the source and ensure that all dependency libraries are separately packaged in Fedora, ''and'' eliminated from the Drupal module package. Also, be sure to check the <tt>.info</tt> file for dependency information!}} | ||
== Module template == | == Module template == | ||
Line 11: | Line 9: | ||
<pre> | <pre> | ||
%global drupalver 6 | %global drupalver 6 | ||
%if 0%{?fedora} <= 14 | |||
%global drupal drupal | |||
%else | |||
# e.g. "drupal6" | # e.g. "drupal6" | ||
%global drupal drupal%{drupalver} | %global drupal drupal%{drupalver} | ||
%endif | |||
# e.g. "/usr/share/drupal6" | # e.g. "/usr/share/drupal6" | ||
%global drupaldir %{_datadir}/%{drupal} | %global drupaldir %{_datadir}/%{drupal} | ||
Line 64: | Line 66: | ||
<pre> | <pre> | ||
%global drupalver 6 | %global drupalver 6 | ||
%if 0%{?fedora} <= 14 | |||
%global drupal drupal | |||
%else | |||
# e.g. "drupal6" | # e.g. "drupal6" | ||
%global drupal drupal%{drupalver} | %global drupal drupal%{drupalver} | ||
%endif | |||
# e.g. "/usr/share/drupal6" | # e.g. "/usr/share/drupal6" | ||
%global drupaldir %{_datadir}/%{drupal} | %global drupaldir %{_datadir}/%{drupal} |
Revision as of 00:35, 4 March 2011
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 %if 0%{?fedora} <= 14 %global drupal drupal %else # e.g. "drupal6" %global drupal drupal%{drupalver} %endif # e.g. "/usr/share/drupal6" %global drupaldir %{_datadir}/%{drupal} # Use upstream name as expressed in URL and tarball %global modname <<<MODULE_NAME>>> Name: %{drupal}-%{modname} Version: <<<MODULE_VERSION>>> Release: 1%{?dist} Summary: <<<MODULE_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 <<<MODULE_DESCRIPTION - use upstream text wherever possible>>> %prep %setup -qn %{modname} %build cp %{SOURCE1} . %install rm -rf %{buildroot} install -d %{buildroot}%{drupaldir}/modules/%{modname} cp -pr * %{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} %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 %if 0%{?fedora} <= 14 %global drupal drupal %else # e.g. "drupal6" %global drupal drupal%{drupalver} %endif # e.g. "/usr/share/drupal6" %global drupaldir %{_datadir}/%{drupal} # Use upstream name as expressed in URL and tarball %global themename <<<THEME_NAME>>> Name: %{drupal}-%{themename} Version: <<<THEME_VERSION>>> Release: 1%{?dist} Summary: <<<THEME_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 <<<THEME_DESCRIPTION - use upstream text wherever possible>>> %prep %setup -qn %{themename} %build # Empty. %install rm -rf %{buildroot} install -d %{buildroot}%{drupaldir}/themes/%{themename} cp -pr * %{buildroot}%{drupaldir}/themes/%{themename} %clean rm -rf %{buildroot} %files %defattr(-,root,root,-) %doc LICENSE.txt %exclude %{drupaldir}/themes/%{themename}/LICENSE.txt %{drupaldir}/themes/%{themename} %changelog