Brenton Horne writes:
How the existing 1.19 version does it? Yes, users @ Ask Ubuntu suggested I do this, but as I am not really a developer or programmer I didn't really understand what I found by extracting the Debian package. I asked them for help but suffice it to say they weren't exactly helpful.
So, I've done several debian packages in the past. As a sysadmin, I would prefer a packaged piece of software to an unpackaged one and even created my own packages to keep the root file system "clean" (from unpackaged software).
The first thing to try to get the source for a Debian package, is:
apt-get source PACKAGE-NAME
For mediawiki this results in a directory (mediawiki-1.19.20+dfsg) which is created from the debian.tar.?? and .orig.tar.?? files that this downloads.
Look in mediawiki-1.19.20+dfsg/debian/rules for the shell file (a makefile in this case) that creates the package. To use this file to create a package you would run "debuild" in the top-level (mediawiki-1.19.20+dfsg) directory. It will probably complain about build dependencies (these are listed in the first stanza of debian/control), so to install those, use "apt-get build-dep mediawiki".
You'll modify the debian/rules file as well as the debian/control file to build a package that can be used for an updated version of mediawiki.
If you want to contribute your changes back to Debian, you'll probably want to use the VCS repository. This was printed out when you ran "apt-get source ..." but I've outlined an alternative method here:
To get the source for any debian package, go to http://packages.debian.org/PACKAGE-NAME
This will take you to a page that list the possible packages. Following on the one for sid (unstable), we'll end up on this page (when we use mediawiki for PACKAGE-NAME): https://packages.debian.org/sid/mediawiki
On the right hand side of that page, you can see a link to "Developer Information (PTS)". Follow it and you'll get https://packages.qa.debian.org/m/mediawiki.html
Here, we can see that the VCS link points to a Subversion repository: svn://anonscm.debian.org/pkg-mediawiki/mediawiki/trunk/
Since I've grown to appreciate git, I have git-svn installed for just such a circumstance and I can get the SVN repo and all its history with the following command:
$ svn clone svn://anonscm.debian.org/pkg-mediawiki/mediawiki/trunk/ mediawiki-deb
This creates a directory called mediawiki-deb directory with a debian subdirectory.
In mediawiki-deb directory, you can use "debuild" to create the package(s), providing you have all the dependencies listed on the "Build-Depends:" line.
The only thing left is the source package. To get that, you can use "apt-get source" from above.
Let me know if I can be of further help. I'm not a Debian Developer, but I know a bit about package creation.
Mark.
-- Mark A. Hershberger NicheWork LLC 717-271-1084