Packaging Plugins
In order to make it easier for users of plugins to install and maintain Movable Type Plugin software, the following best practices have been defined to help developers package and structure their plugins consistently.
Best Practices
- Plugins should be packaged in a file that reflects the version number of the plugin being installed, for example “MyPlugin-1.0.zip”.
- A
PLUGIN_NAME-README.txt
file should be placed in the root of your plugin’s archive that provides adequate documentation on the installation and usage of your plugin. - A
PLUGIN_NAME-LICENSE.txt
file should be placed in the root of your plugin’s archive that contains the text or a reference to the license associated with your plugin. - Static files should be placed in:
mt-static/plugins/PluginName
- Developers are strongly encouraged to not use the “MT” prefix in their plugin names. For example, “Plugin Name” is preferred to “MT-Plugin Name”.
A complete list of Plugin Best Practices can be found on wiki.movabletype.org.
Packaging
Sample Makefile
Unix users might be familiar with the program called make
which is a program commonly used to automate the build and compilation process for software. It has been used by Movable Type plugin developers to automate the process of creating tar and zip files for their plugins. Below is a sample Makefile used with the Media Manager plugin:
# Sample Makefile for packaging MT plugins
VERSION=2.0
SVN=http://code.sixapart.com/svn/mtplugins/trunk/MediaManager/branches/4.x
PACKAGE=MediaManager-$(VERSION)
package:
svn export $(SVN) $(PACKAGE)
tar --exclude="*.svn" --exclude="*~" --exclude="build" --exclude="#*" -zcvf $(PACKAGE).tar.gz $(PACKAGE)
zip -r $(PACKAGE).zip $(PACKAGE) -x $(PACKAGE)/build
rm -rf MediaManager-$(VERSION)
clean:
rm -rf MediaManager-$(VERSION)
rm -f *~
real-clean: clean
rm -f *.tar.gz
rm -f *.zip
Mark Carey on August 28, 2007, 3:59 a.m. Reply
Byrne, a complete example of how to use a makefile would be helpful for those who are not “make” experts. For example, explaining the file line-by-line would help, and then telling people how the actually gets used would also help. Finally, does this approach require svn?