Artikel mit Tag mediawikiSonntag, 18. Juni 2017Packaging MediaWiki extensionsAs part of the work for the openSUSE wiki upgrade and move, I had to package a bunch of MediaWiki extensions. We'll use the MediaWiki 1.27.x LTS release, which means the extensions need to work with this version. When it comes to packaging, there are three categories of extensions: The GoodThese extensions are hosted on phabricator.wikimedia.org, and you can easily download a tarball matching your MediaWiki version using the "Download snapshot" link on the extension page. Packaging these extensions is easy - just unpack the tarball and copy/package everything to the extension directory. These extensions are standardized enough to use a spec file template - usually I only had to adjust the extension name, tarball name and version. Speaking of the version - most extensions don't have explicit version numbers, so I decided to use the tarball date instead. An example for this category is Auth_remoteuser (extension page, package) which we use to keep the "nice" wiki login form. The BadThese extensions are hosted on GitHub and typically only have a "master" branch. They usually still work with MediaWiki 1.27.x, but there's a small risk that they require features added in newer MediaWiki versions, and this risk will grow over time. On the packaging side, they are as easy as the "good" extensions. An example is the ParamProcessor extension (extension page, package) which is needed by the Maps extension The UglyThese extensions can be hosted on phabricator.mediawiki.org or GitHub, so there are "god ugly" and "bad ugly" extensions ;-) The thing that makes packaging really ugly is that they don't include all the code they need. Instead, you have to download the missing parts with composer. composer works fine in a "real" system, but makes packaging hard. Running it from the spec will obviously fail because OBS doesn't allow network connections while building a package (and even if it's annoying in this case, not having network access during build is a good thing[tm]). My solution is a little script that unpacks the extension tarball and runs "composer install --no-dev" inside the extension directory. The most important part is the "--no-dev" parameter because that avoids lots of superfluous things. Afterwards, I build a tarball from the "vendor" directory and add it to the package. Yeah, I know that's not nice - guess why I named this section "The Ugly" ;-) One of the packages that need a "composer install" run is the GitHub extension (extension page, package including script to run composer). Luckily, "ugly" only applies to packaging. The extensions and their maintainers are for sure not ugly - for example, the maintainer of the GitHub extension was very fast in fixing a bug :-) Sonntag, 18. April 2010MultiBoilerplate: Vorlagen pro NamespaceDie Mediawiki-Extension MultiBoilerplate ermöglicht es, beim Anlegen einer Seite eine oder mehrere Vorlagen zur Auswahl anzubieten. Das ist schonmal gut. Noch besser ist es allerdings, wenn die Vorlagen-Liste je nach Namespace eingestellt werden kann - eine Vorlage für eine neue Seite ist z. B. nicht als Vorlage für eine Hilfeseite geeignet. Die Lösung ist ein kleiner Patch, den ich für MultiBoilerplate geschrieben habe. Dieser ist im Mediawiki Bugtracker verfügbar (und wird hoffentlich in der nächsten MultiBoilerplate-Version aufgenommen ;-) Der Patch enthält auch eine Beschreibung der nötigen Config-Optionen. The Mediawiki-Extension MultiBoilerplate allows to offer one or more boilerplates when creating a new page. That's quite good. It's even better to offer different boilerplates for each namespace - for example, a boilerplate for a new page is not necessarily a good boilerplate for a help page. The solution is a small patch I wrote for MultiBoilerplate. You can download it from the Mediawiki Bugtracker (and will hopefully be included in the next version of MultiBoilerplate ;-) The patch includes a description of the necessary config options. Tags für diesen Artikel: mediawiki, multiboilerplate
(Seite 1 von 1, insgesamt 2 Einträge)
|
ArchiveKategorienBlog abonnierenImpressum |
Kommentare