In this post, I describe how to convert a Debian i386 .deb package for Shell In A Box into a PowerPC .deb. The instructions also apply to other programs and architectures, where the source code and prebuilt i386 .deb are available, but a prebuilt native .deb is not.
It is sometimes very handy to have a web-based SSH terminal installed on a server, for the times when you need remote shell access from a workstation that doesn't have an SSH client available. Previously I've used Ajaxterm for this purpose, but I've become increasingly dissatisfied with it. Today I decided to switch to Shell In A Box on one of my Debian servers, as I've found it more reliable than Ajaxterm.
The complication was that Shell In A Box is not yet available in the Debian stable repositories, and this server is PowerPC based. The Shell In A Box developers offer prebuilt packages, but only for i386 and x86_64. I decided to figure out how to rebuild an i386 package into a PowerPC package, so I could benefit from the packaging structure, rather than just installing directly from source. A post on the Ubuntu forums set me on the right track. Here are the steps I took:
- Download the current i386 deb from the Shell In A Box downloads page.
- Extract the deb file using Ubuntu's Archive Manager.
- Rename the resulting folder to the target deb filename (in my case this was
shellinabox_2.14-1_ppc
). - Download and extract the latest* source tar.gz of Shell In A Box onto your PowerPC server.
- Change into the resulting directory and run
./configure
followed bymake
. - In the OLD package tree that you extracted earlier:
- Copy the newly compiled
shellinaboxd
binary intousr/bin
. - Edit
usr/share/doc/shellinabox/changelog.Debian.gz
to reflect the version bump. - Edit
DEBIAN/control
with the new version number and architecture (for PowerPC this is "powerpc", not "ppc", andDEBIAN/md5sums
with md5sums from the new binary and Debian changelog.
- Copy the newly compiled
- Open a terminal and change into the directory above the OLD extracted deb directory, e.g. if you extracted the deb to
/home/pete/shellinabox_2.14-1_ppc
, then change to/home/pete
. - Run
dpkg --build shellinabox_2.14-1_ppc
. - Install the resulting
shellinabox_2.14-1_ppc.deb
package on your server by runningdpkg -i shellinabox_2.14-1_ppc.deb
.
* NOTE: At time of writing, the prebuilt deb files of Shell In A Box are version 2.10, while the latest tarball is version 2.14. Version 2.10 will not build on PowerPC (see this bug report for more details), so I used the latest tarball version instead, without any problems.