WordPress plugins are packaged for Fedora so that the plugin can be used for both and without requiring both.

Requirements for packaging

  • Use the specfile template

  • Set plugin_name and plugin_human_name by appending the first two lines appropriately

    • plugin_name is the short name used in the URL for the plugin’s page on wordpress.org

    • plugin_human_name is the full name of the plugin as displayed on the plugin’s page on wordpress.org

  • Fill in the version of the package as it is displayed in the .zip filename

  • Fill in a package description in both places where it says "Your plugin’s description goes here."

Example

%global plugin_name stats
%global plugin_human_name WordPress.com Stats

Notes

  • The spec must be named wordpress-plugin-%{plugin_name}.spec as per the Packaging:NamingGuidelines[naming guidelines]

  • Remember to enter a changelog entry

Specfile template

%global plugin_name
%global plugin_human_name

Name:       wordpress-plugin-%{plugin_name}
Version:
Release:    1%{?dist}
Summary:    %{plugin_human_name} plugin for WordPress

Group:      Applications/Publishing
# According to http://plugins.trac.wordpress.org/ all plugins are licensed
# under the GPL unless otherwise stated in the plugin source.
License:    GPLv3+
URL:        http://wordpress.org/extend/plugins/%{plugin_name}/
Source0:    http://downloads.wordpress.org/plugin/%{plugin_name}.%{version}.zip
BuildRoot:  %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
Requires:   wordpress
BuildArch:  noarch

%description
Your plugin's description goes here.

This package is built for use with WordPress (wordpress), not WordPress MU. Use
wordpress-mu-plugin-%{plugin_name} for WordPress MU.


%package -n wordpress-mu-plugin-%{plugin_name}
Summary:    %{plugin_human_name} plugin for WordPress MU
Group:      Applications/Publishing
# According to http://plugins.trac.wordpress.org/ all plugins are licensed
# under the GPL unless otherwise stated in the plugin source.
License:    GPLv3+
Requires:   wordpress-mu
BuildArch:  noarch

%description -n wordpress-mu-plugin-%{plugin_name}
Your plugin's description goes here.

This package is built for use with WordPress MU (wordpress-mu), not regular
WordPress. Use wordpress-plugin-%{plugin_name} for regular Wordpress.


%prep
%setup -q -c
echo 'To enable "%{plugin_human_name}", go to the administrative section
of your blog, "Plugins", and enable the plugin there.' > README.fedora
echo 'To allow users to enable "%{plugin_human_name}" for their blogs,
be sure to enable this plugin in the administrative control panel
for your website.' > README.fedora.mu


%build


%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{_datadir}/wordpress/wp-content/plugins/
cp -a %{plugin_name} %{buildroot}%{_datadir}/wordpress/wp-content/plugins/
mkdir -p %{buildroot}%{_datadir}/wordpress-mu/wp-content/plugins/
cp -a %{plugin_name} %{buildroot}%{_datadir}/wordpress-mu/wp-content/plugins/


%clean
rm -rf %{buildroot}


%files
%doc README.fedora
%{_datadir}/wordpress/wp-content/plugins/%{plugin_name}


%files -n wordpress-mu-plugin-%{plugin_name}
%doc README.fedora.mu
%{_datadir}/wordpress-mu/wp-content/plugins/%{plugin_name}


%changelog