From Fedora Project Wiki

< User:Siwinski

Revision as of 21:28, 17 June 2013 by Siwinski (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Warning.png
This is only a DRAFT!

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 MUST include the following in its' spec:

%{?drupal7_find_provides_and_requires}
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.

[1] From *.info files

Other Packages

See PHP packaging guidelines.

PHP Extensions

See PHP packaging guidelines.

Requiring a Minimum PHP Version

See PHP packaging guidelines but note that this should not normally be required by most packages (see [1]).

Important.png
This needs to be added to the drupal7-rpmbuild package so it is automatic.

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

Additional Hints

Templates

Module

Theme

Distribution/Profile