Esquema de Nombramiento
Cada paquete DEBE ser nombrado +drupal7-+`
+<drupal_machibne_name++>`. El mismo Drupal fuerza nombres de máquina únicos por cada uno de sus proyectos y hay un espacio de nombres único para todos los módulos, temas, y distribuciones/perfiles. El __`<drupal_machine_name+
+>` *DEBE* coincidir con el nombre del proyecto de drupal.org (p.ej., drupal.org/proyect/__`<drupal_machine_name+
+>+`).
Macros y Scriptlets
Macros proporcionados por el paquete drupal7-rpmbuild
:
Macro | Valor | Descripción |
---|---|---|
|
|
Directorio base Drupal 7 |
|
|
Directorio de módulos Drupal 7 |
|
|
Directorio de temas Drupal 7 |
|
|
Directorio de bibliotecas de Drupal 7 |
|
Fedora:
|
Fedora:
Macro no-op para permitir compatibilidad de spec con RPM < 4.9 (no fileattrs) |
File Placement
-
Modules: A module package MUST be placed in the
%drupal7_modules
directory -
Themes: A theme package MUST be placed in the
%drupal7_themes
directory -
Libraries: A library package MUST be placed in the
%drupal7_libraries
directory
Requires and Provides
-
Every package MUST require “drupal7(``)” virtual resources instead of “drupal7-” packages.
-
Every package MUST include the following in its' spec:
-
The
drupal7-rpmbuild
package automatically requiresdrupal7(core)
and scans files for provides (from *.info files) and automatically adds them to the package during build time as “drupal7(``)” 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.BuildRequires: drupal7-rpmbuild >= 7.23-3
-
For compatibility with RPM < 4.9 (i.e. EPEL 5/6):
%{?drupal7_find_provides_and_requires}
-
-
Every package MUST NOT:
-
requiere explícitamente “drupal7” o “drupal7(core)” (a no ser que es requerida una versión core específica) porque
drupal7-rpmbuild
auto-requiere “drupal7(core)” -
proporciona explícitamente “drupal7(
`)” recursos virtuales `drupal7-rpmbuild
auto-proporciona estos
-
Otros Paquetes
Consulte PHP packaging guidelines.
Extensiones PHP
Consulte PHP packaging guidelines.
To get a list of required PHP extensions, use PHP_CompatInfo (phpcompatinfo):
phpcompatinfo print --recursive --report=extension unpacked_package_source_directory
To install PHP_CompatInfo (phpcompatinfo), run “yum install php-bartlett-PHP-CompatInfo”.
Requiring a Minimum PHP Version
See PHP packaging guidelines but note that this should not normally be required by most packages (see 1).
Common Issues
-
On RHEL 5/6 there is an issue with the standard auto-requires script (
/usr/lib/rpm/find-requires
). When there is no “#!” (she-bang) line at the beginning of an executable PHP file, the script tries to add an invalid "+ " as a dependency. Rpmbuild then errors out with something similar to the following:
RPM build errors: line 53: Dependency tokens must begin with alpha-numeric, '_' or '/': -
+
To fix this issue, find the files that incorrectly have their executable bit set and remove the executable bit in the spec’s %prep
section. If there should be no executable files in the package then the following could be added to the spec’s %prep
section:
+
find . -type f -executable -print0 | xargs -0 chmod -x
+
Additional Hints
-
Every module package SHOULD list the Drupal modules it provides in its description:
This package provides the following Drupal module(s): * %{module}
For example, the
drupal7-domain
package contains the following in its description:Este paquete proporcionar los módulos Drupal siguientes: * %{module} * %{module}_alias * %{module}_conf * %{module}_content * %{module}_nav * %{module}_settings * %{module}_source * %{module}_strict * %{module}_theme
== Plantillas
RPM README
Tras la instalación, debe habilitar este módulo desde la página de administración de Drupal. Si actualiza este módulo separadamente desde el paquete Core de Drupal, asegúrese ejecutar el guion https://hostname/drupal7/upgrade.php tras este RPM sea modernizado.
Módulo
%{?drupal7_find_provides_and_requires} %global módulo __MODULE__ Nombre: drupal7-%{module} Versión: __VERSION__ Lanzamiento: 1%{?dist} Sumario: __SUMMARY__ Grupo: Applications/Publishing Licencia: GPL-2.0-or-later URL: https://drupal.org/project/%{module} Origen: https://ftp.drupal.org/files/projects/%{module}-7.x-%{version}.tar.gz Origen1: %{name}-RPM-README.txt BuildArch: noarch BuildRequires: drupal7-rpmbuild >= 7.23-3 # phpcompatinfo (calculado desde versión __VERSION__) #Requiere: php- %description __DESCRIPTION__ Este paquete proporciona los módulos siguientes de Drupal: * %{module} %prep %setup -qn %{module} cp -p %{SOURCE1} . %build # Sección vacía de compilación, nada a compilar %install mkdir -pm 0755 %{buildroot}%{drupal7_modules}/%{module} cp -pr * %{buildroot}%{drupal7_modules}/%{module}/ %files %doc *.txt %{drupal7_modules}/%{module} %exclude %{drupal7_modules}/%{module}/*.txt %changelog * ddd MMM DD YYYY __NAME__ <__EMAIL__> __VERSION__-1 - Paquete inicial
Tema
%{?drupal7_find_provides_and_requires} %global theme __THEME__ Nombre: drupal7-%{theme} Versión: __VERSION__ Liberación: 1%{?dist} Sumario: __SUMMARY__ Grupo: Applications/Publishing Licencia: GPL-2.0-or-later URL: https://drupal.org/project/%{theme} Origen: https://ftp.drupal.org/files/projects/%{theme}-7.x-%{version}.tar.gz Origen1: %{name}-RPM-README.txt BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: drupal7-rpmbuild >= 7.23-3 # phpcompatinfo (calculado desde versión __VERSION__) #Requiere: php- %description __DESCRIPTION__ %prep %setup -qn %{theme} cp -p %{SOURCE1} . %build # Sección vacía de compilación, nada a compilar %install mkdir -pm 0755 %{buildroot}%{drupal7_themes}/%{theme} cp -pr * %{buildroot}%{drupal7_themes}/%{theme}/ %files %doc *.txt %{drupal7_themes}/%{theme} %exclude %{drupal7_themes}/%{theme}/*.txt %changelog * ddd MMM DD YYYY __NAME__ <__EMAIL__> __VERSION__-1 - Paquete inicial
Want to help? Learn how to contribute to Fedora Docs ›