From Fedora Project Wiki
(Use drupal_release tag more thoroughly) |
(Add theme template) |
||
Line 3: | Line 3: | ||
{{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..}} | {{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..}} | ||
== | == Module template == | ||
<pre> | <pre> | ||
Line 56: | Line 56: | ||
%doc CHANGELOG.txt LICENSE.txt README.txt DEVELOPER.txt UPGRADE.txt | %doc CHANGELOG.txt LICENSE.txt README.txt DEVELOPER.txt UPGRADE.txt | ||
%{drupal_moddir}/%{drupal_modname} | %{drupal_moddir}/%{drupal_modname} | ||
%changelog | |||
</pre> | |||
== Theme template == | |||
<pre> | |||
%global drupal_base %{_datadir}/drupal | |||
%global drupal_themedir %{drupal_base}/themes | |||
%global drupal_themename <<<YOUR_THEME_NAME>>> | |||
# Use 5 for Drupal 5.x themes, 6 for Drupal 6.x themes, etc. | |||
%global drupal_release 6 | |||
Name: drupal-theme-%{drupal_themename}-%{drupal_release}x | |||
Version: 2.6 | |||
Release: 1%{?dist} | |||
Summary: # Use short description from Drupal site for theme | |||
Group: Applications/Publishing | |||
License: GPLv2 | |||
# Use top-level URL from Drupal site for the theme | |||
URL: http://drupal.org/ | |||
Source0: http://ftp.drupal.org/files/projects/%{drupal_themename}-%{drupal_release}.x-%{version}.tar.gz | |||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) | |||
BuildArch: noarch | |||
# | |||
Requires: drupal >= %{drupal_release} | |||
%description | |||
# Use full description from Drupal site for theme | |||
%prep | |||
%setup -qn %{drupal_themename} | |||
# Remove empty index.html and others | |||
find -size 0 | xargs rm -f | |||
%build | |||
%install | |||
rm -rf $RPM_BUILD_ROOT | |||
%{__mkdir} -p $RPM_BUILD_ROOT/%{drupal_themedir}/%{drupal_themename} | |||
cp -pr . $RPM_BUILD_ROOT/%{drupal_themedir}/%{drupal_themename} | |||
rm -rf $RPM_BUILD_ROOT/%{drupal_themedir}/%{drupal_themename}/pndocs | |||
%clean | |||
rm -rf $RPM_BUILD_ROOT | |||
%files | |||
%defattr(-,root,root,-) | |||
%doc CHANGELOG.txt LICENSE.txt README.txt DEVELOPER.txt UPGRADE.txt | |||
%{drupal_themedir}/%{drupal_themename} | |||
%changelog | %changelog | ||
</pre> | </pre> |
Revision as of 21:16, 28 April 2010
The following template can be used to create new Drupal module packages. Substitute the name for the Drupal module, in the correct case as used throughout the Drupal web site, where you see <<<YOUR_MODULE_NAME>>>
.
Module template
%global drupal_base %{_datadir}/drupal %global drupal_moddir %{drupal_base}/modules %global drupal_modname <<<YOUR_MODULE_NAME>>> # Use 5 for Drupal 5.x modules, 6 for Drupal 6.x modules, etc. %global drupal_release 6 Name: drupal-module-%{drupal_modname}-%{drupal_release}x Version: 2.6 Release: 1%{?dist} Summary: # Use short description from Drupal site for module Group: Applications/Publishing License: GPLv2 # Use top-level URL from Drupal site for the module URL: http://drupal.org/ Source0: http://ftp.drupal.org/files/projects/%{drupal_modname}-%{drupal_release}.x-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch # Requires: drupal >= %{drupal_release} %description # Use full description from Drupal site for module %prep %setup -qn %{drupal_modname} # Remove empty index.html and others find -size 0 | xargs rm -f %build %install rm -rf $RPM_BUILD_ROOT %{__mkdir} -p $RPM_BUILD_ROOT/%{drupal_moddir}/%{drupal_modname} cp -pr . $RPM_BUILD_ROOT/%{drupal_moddir}/%{drupal_modname} rm -rf $RPM_BUILD_ROOT/%{drupal_moddir}/%{drupal_modname}/pndocs %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc CHANGELOG.txt LICENSE.txt README.txt DEVELOPER.txt UPGRADE.txt %{drupal_moddir}/%{drupal_modname} %changelog
Theme template
%global drupal_base %{_datadir}/drupal %global drupal_themedir %{drupal_base}/themes %global drupal_themename <<<YOUR_THEME_NAME>>> # Use 5 for Drupal 5.x themes, 6 for Drupal 6.x themes, etc. %global drupal_release 6 Name: drupal-theme-%{drupal_themename}-%{drupal_release}x Version: 2.6 Release: 1%{?dist} Summary: # Use short description from Drupal site for theme Group: Applications/Publishing License: GPLv2 # Use top-level URL from Drupal site for the theme URL: http://drupal.org/ Source0: http://ftp.drupal.org/files/projects/%{drupal_themename}-%{drupal_release}.x-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch # Requires: drupal >= %{drupal_release} %description # Use full description from Drupal site for theme %prep %setup -qn %{drupal_themename} # Remove empty index.html and others find -size 0 | xargs rm -f %build %install rm -rf $RPM_BUILD_ROOT %{__mkdir} -p $RPM_BUILD_ROOT/%{drupal_themedir}/%{drupal_themename} cp -pr . $RPM_BUILD_ROOT/%{drupal_themedir}/%{drupal_themename} rm -rf $RPM_BUILD_ROOT/%{drupal_themedir}/%{drupal_themename}/pndocs %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc CHANGELOG.txt LICENSE.txt README.txt DEVELOPER.txt UPGRADE.txt %{drupal_themedir}/%{drupal_themename} %changelog