(Created page with "{{admon/warning|This is only a DRAFT!}} = Guidelines for packaging Drupal 7 modules, themes, and profiles = == Different Kinds of Packages == * '''[https://drupal.org/projec...") |
No edit summary |
||
Line 17: | Line 17: | ||
== Requires and Provides == | == Requires and Provides == | ||
Every package '''MUST''' include the following in its' spec: | * Every package '''SHOULD''' require "<code>drupal7(<drupal_machine_name>)</code>" virtual resources instead of "<code>drupal7-<drupal_machine_name></code>" packages. | ||
* Every package '''MUST''' include the following in its' spec: | |||
<pre>%{?drupal7_find_provides_and_requires}</pre> | <pre>%{?drupal7_find_provides_and_requires}</pre> | ||
This is for compatibility with RPM < 4.9 (i.e. EPEL 5/6). | |||
<pre>BuildRequires: drupal7-rpmbuild >= 7.22-5</pre> | <pre>BuildRequires: drupal7-rpmbuild >= 7.22-5</pre> | ||
The <code>drupal7-rpmbuild</code> package automatically requires <code>drupal7(core)</code> and scans files for provides (from *.info files) and automatically adds them to the package during build time as "<code>drupal7(<drupal_machine_name>)</code>" virtual resources. [https://drupal.org/node/542202#hidden Hidden projects] are ignored. The use of virtual provides and requires helps alleviate the confusion of sub-modules and which modules actually provide those sub-modules. They also help simplify spec files. | The <code>drupal7-rpmbuild</code> package automatically requires <code>drupal7(core)</code> and scans files for provides (from *.info files) and automatically adds them to the package during build time as "<code>drupal7(<drupal_machine_name>)</code>" virtual resources. [https://drupal.org/node/542202#hidden Hidden projects] are ignored. The use of virtual provides and requires helps alleviate the confusion of sub-modules and which modules actually provide those sub-modules. They also help simplify spec files. | ||
* Every package '''MUST NOT''': | |||
** explicitly require "<code>drupal7</code>" or "<code>drupal7(core)</code>" ('''unless''' a specific core version is required) because <code>drupal7-rpmbuild</code> auro-requires "<code>drupal7(core)</code>" | |||
** explicitly provide "<code>drupal7(<drupal_machine_name>)</code>" virtual resources because <code>drupal7-rpmbuild</code> auto-provides these | |||
=== Other Packages === | === Other Packages === |
Revision as of 21:46, 17 June 2013
Guidelines for packaging Drupal 7 modules, themes, and profiles
Different Kinds of Packages
- Modules: Modules extend and customize Drupal functionality.
- Themes: Themes allow users to change the look and feel of their Drupal site.
Naming Scheme
Every package MUST be named drupal7-<drupal_machine_name>
. Drupal itself enforces unique machine names for each of its' projects and there is a single namespace for all modules, themes, and distributions/profiles. The <drupal_machine_name>
MUST match the drupal.org project name (i.e. drupal.org/project/<drupal_machine_name>
).
File Placement
- Modules: A module package MUST be placed in the
%drupal7_modules
directory (base "modules/
" directory) - Themes: A theme package MUST be placed in the
%drupal7_themes
directory (base "themes/
" directory) - Libraries: A library package MUST be placed in the
%drupal7_libraries
directory (base "libraries/
" directory)
Requires and Provides
- Every package SHOULD require "
drupal7(<drupal_machine_name>)
" virtual resources instead of "drupal7-<drupal_machine_name>
" packages. - Every package MUST include the following in its' spec:
%{?drupal7_find_provides_and_requires}
This is for compatibility with RPM < 4.9 (i.e. EPEL 5/6).
BuildRequires: drupal7-rpmbuild >= 7.22-5
The drupal7-rpmbuild
package automatically requires drupal7(core)
and scans files for provides (from *.info files) and automatically adds them to the package during build time as "drupal7(<drupal_machine_name>)
" virtual resources. Hidden projects are ignored. The use of virtual provides and requires helps alleviate the confusion of sub-modules and which modules actually provide those sub-modules. They also help simplify spec files.
- Every package MUST NOT:
- explicitly require "
drupal7
" or "drupal7(core)
" (unless a specific core version is required) becausedrupal7-rpmbuild
auro-requires "drupal7(core)
" - explicitly provide "
drupal7(<drupal_machine_name>)
" virtual resources becausedrupal7-rpmbuild
auto-provides these
- explicitly require "
Other Packages
PHP Extensions
Requiring a Minimum PHP Version
See PHP packaging guidelines but note that this should not normally be required by most packages (see [1]).
Macros and Scriptlets
Macros provided by the drupal7-rpmbuild
package:
Macro | Value | Description |
---|---|---|
%drupal7 |
%{_datadir}/drupal7 |
Drupal 7 base directory |
%drupal7_modules |
%{drupal7}/modules |
Drupal 7 modules directory |
%drupal7_themes |
%{drupal7}/themes |
Drupal 7 themes directory |
%drupal7_libraries |
%{_sysconfdir}/drupal7/all/libraries |
Drupal 7 libraries directory |