From Fedora Project Wiki
(add Drupal module template) |
|||
Line 1: | Line 1: | ||
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 <code><<<YOUR_MODULE_NAME>>></code>. | |||
{{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..}} | |||
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 <code><<<YOUR_MODULE_NAME>>></code>. | 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 <code><<<YOUR_MODULE_NAME>>></code>. | ||
Line 9: | Line 13: | ||
%global drupal_moddir %{drupal_base}/modules | %global drupal_moddir %{drupal_base}/modules | ||
%global drupal_modname <<<YOUR_MODULE_NAME>>> | %global drupal_modname <<<YOUR_MODULE_NAME>>> | ||
# Use 6.x for Drupal 6.x modules, 5.x for Drupal 5.x modules. | |||
%global drupal_release 6.x | |||
Name: drupal-module-%{drupal_modname}-%{drupal_release} | |||
Name: drupal-module-%{ | |||
Version: 2.6 | Version: 2.6 | ||
Release: 1%{?dist} | Release: 1%{?dist} | ||
Line 20: | Line 25: | ||
# Use top-level URL from Drupal site for the module | # Use top-level URL from Drupal site for the module | ||
URL: http://drupal.org/ | URL: http://drupal.org/ | ||
Source0: http://ftp.drupal.org/files/projects/ | Source0: http://ftp.drupal.org/files/projects/%{drupal_modname}-%{drupal_release}-%{version}.tar.gz | ||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) | ||
BuildArch: noarch | BuildArch: noarch | ||
Line 31: | Line 36: | ||
%prep | %prep | ||
%setup -qn | %setup -qn %{drupal_modname} | ||
# Remove empty index.html and others | # Remove empty index.html and others | ||
find -size 0 | xargs rm -f | find -size 0 | xargs rm -f | ||
Line 41: | Line 46: | ||
%install | %install | ||
rm -rf $RPM_BUILD_ROOT | rm -rf $RPM_BUILD_ROOT | ||
%{__mkdir} -p $RPM_BUILD_ROOT/%{ | %{__mkdir} -p $RPM_BUILD_ROOT/%{drupal_moddir}/%{drupal_modname} | ||
cp -pr . $RPM_BUILD_ROOT/%{ | cp -pr . $RPM_BUILD_ROOT/%{drupal_moddir}/%{drupal_modname} | ||
rm -rf $RPM_BUILD_ROOT/%{ | rm -rf $RPM_BUILD_ROOT/%{drupal_moddir}/%{drupal_modname}/pndocs | ||
Line 52: | Line 57: | ||
%files | %files | ||
%defattr(-,root,root,-) | %defattr(-,root,root,-) | ||
%doc CHANGELOG.txt LICENSE.txt | %doc CHANGELOG.txt LICENSE.txt README.txt DEVELOPER.txt UPGRADE.txt | ||
%{ | %{drupal_moddir}/%{drupal_modname} | ||
%changelog | %changelog | ||
</pre> | </pre> |
Revision as of 00:01, 26 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>>>
.
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>>>
.
Template
%global drupal_base %{_datadir}/drupal %global drupal_moddir %{drupal_base}/modules %global drupal_modname <<<YOUR_MODULE_NAME>>> # Use 6.x for Drupal 6.x modules, 5.x for Drupal 5.x modules. %global drupal_release 6.x Name: drupal-module-%{drupal_modname}-%{drupal_release} 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}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch #BuildRequires: Requires: drupal %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