From MEPIS Documentation Wiki
Backporting refers generally to the action of taking a later package from upstream, and rebuilding it with older (stable) libraries. This way users of the Debian stable branch can still get the latest versions of applications. In MEPIS Linux, it specifically refers to bring packages in Debian Testing or Unstable back into the Debian Stable on which MEPIS releases are based. This work is carried out by Debian (see the list for Lenny) and by Community packagers for the MEPIS CR.
The following example comes from Community member Brooko working with MEPIS 8. For future reference, "Squeeze" refers to Debian Testing, while "Sid" refers to Debian Unstable.
- Go to the MEPIS CR Package Building Guide, read the complete environment section, do the preconfig and install the base software requirements as shown.
- Get the package source from upstream. I conducted my search here and found that both Squeeze (= Debian Testing) and Sid (= Debian Unstable) have the same version (1.8.3-5). So we'll use the Squeeze version (it's generally easier to use the version in Testing) -- click the link in the page and you get to here.
We want the source files which are listed on the right hand side of the page:
wesnoth-1.8_1.8.3-5.dsc wesnoth-1.8_1.8.3.orig.tar.gz wesnoth-1.8_1.8.3-5.diff.gz
I have a build directory already set-up (called "build") - so I download them to my /build directory.
Open a konsole and change directory to the /build directory where you have your files. All commands are issued as normal user, unless specified.
First we unpack the files and apply any patches:
then hit the tab button to autofill the package name, then hit enter. This automatically creates the build folders from the source files.
Now type cd, add a space, and then tab to autofill and get:
Click Enter. You're now in directory ~/build/wesnoth-1.8-1.8.3/
At this stage I edit the changelog for the repo
then enter, brings up the changelog file in Nano. For me, it shows the following:
wesnoth-1.8 (1:1.8.3-6) unstable; urgency=low * -- Paul Brooks <firstname.lastname@example.org> Fri, 03 Sep 2010 09:22:19 +1200 wesnoth-1.8 (1:1.8.3-5) unstable; urgency=low * Brown paper bag release. * When changing from directory to symlink in wesnoth and wesnoth-core do use wesnoth-1.8-data, not the non-existing wesnoth-data one. Also remove the now potential existing wrong symlink we might have introduced through -4 upgrades. Thanks to my proof reader Julien Cristau again. * Also switch the version comparison to lt-nl instead of le-nl so that the check won't trigger on reinstall, also noticed by Julien. -- Gerfried Fuchs <email@example.com> Thu, 19 Aug 2010 21:18:07 +0200
I edit the top section to read:
wesnoth-1.8 (1:1.8.3-5mlrepo1) mepis; urgency=low * Repackaged For Mepis 8 - added lzma compression -- Paul Brooks <firstname.lastname@example.org> Fri, 03 Sep 2010 09:22:19 +1200
Now I save the file by <CTRL>+x, answer "y" to the prompt and hit enter. This updates the changelog in the debian sub folder.
Now I alter the control file
cd debian && kwrite control && cd ..
This opens the control file in kwrite to allow me to edit it. All I do here is put myself in as the Maintainer for the back port, so this (top 4 lines):
Source: wesnoth-1.8 Section: games Priority: optional Maintainer: Debian Games Team <email@example.com>
Quote:Source: wesnoth-1.8 Section: games Priority: optional Maintainer: Paul Brooks <firstname.lastname@example.org> XSBC-Original-Maintainer: Debian Games Team <email@example.com>
Save and close the file.
The next thing is to edit the rules file and add lzma compression - to make the files smaller:
cd debian && kwrite rules && cd ..
I'm looking for a line that say "dh_builddeb" - it's line 129 in the file. To this I add
-- -Z lzma
so it now reads
dh_builddeb -- -Z lzma
Save and close the file.
Note - if it uses a CDBS file (in control it would specify a dependency on CDBS), we could just add instead
DEB_DH_BUILDDEB_ARGS := -- -Z lzma
This is explained in the Mepis Package Building Guide.
Now we su to root, then issue following command to install required dependencies
All dependencies are available - so there is no need to backport anything else to make this work. The final lines I get are:
Current status: 0 broken [-1] Finished parsing the build-deps
exit back to normal user.
If you have a multicore machine, you can tell the compile to use all cores - set this according to your PC. For a quad core machine:
A dual core would be
OK - this is initial build - I'm building all files including updated source so I use:
dpkg-buildpackage -rfakeroot -sa
This will create updated source files, the debs, and also ask to sign the packages. If you just want to build the debs (no source) and not sign (ie just for your own use) - you'd use:
dpkg-buildpackage -rfakeroot -us -uc
Let the compile complete and at the end, you should have all the debs sitting in your /build directory.