Sonntag, 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 :-)
(Seite 1 von 1, insgesamt 1 Einträge)
|
ArchiveKategorienBlog abonnierenImpressum |
Kommentare