Notices


Reply
Thread Tools
Posts: 62 | Thanked: 18 times | Joined on Dec 2009 @ Missouri, USA
#41
@TA-t3:
Thanks a lot for repackaging the maemotex deb. It seems to works great.

I have been reading this thread http://talk.maemo.org/showthread.php?t=33362 and other similar ones about the usage of the rootfs partition.

It seems that the maemotex package is not "optified" and it all gets installed in /usr/local/maemotex taking a lot of space in the rootfs partition. The whole of maemotex is about 16MB and my rootfs usage is now at 81%, with only a handful of other applications installed.

How one would go about "optfying" maemotex and repackaging to install it to /opt ? I don't have any idea of how to repackage deb files in the first place, but I would like to learn.
 
Posts: 3,841 | Thanked: 1,079 times | Joined on Nov 2006
#42
It should be possible to repackage it to use /opt more. I may take a stab at that in a few days (newyear's eve holiday).

I unpack and repack on my Linux desktop computer, which is Debian-based and thus has all the required tools.

The important ones are 'fakeroot' and 'dpkg-deb'. The latter is available also on the N900 itself, but the former is not. It may be possible to avoid needing it by actually being root while repackaging, but I haven't tried this. In any case, if you try this on the N900 itself (e.g. because of lack of a Debian Linux desktop/laptop environment) then you should do this on an ext3 partition, not vfat, otherwise the package will not be repackaged correctly. Oh, and remotely logging in to the N900 with a proper keyboard and screen would make it easier.

Anyway, I do this on a desktop computer.

I list the content of the original .deb with
dpkg-deb -c filename.deb

I unpack the content of the original .deb with
dpkg-deb -x filename.deb tmp

I unpack the control files of the original .deb with
dpkg-deb -e filename.deb tmp/DEBIAN

I edit the stuff in tmp/DEBIAN/control (and postinstall and md5sums, as needed). E.g. version number.

I move around stuff in tmp/usr and etc as needed.

Then I repack with
fakeroot dpkg-deb -b tmp filename.deb
where filename.deb is the full filename of the package, with correction version number etc. etc.

I inspect the result with
dpkg-deb -c filename.deb

Then I copy to the N900 and install with dpkg -i filename.deb

However, there may be a much easier shortcut for pseudo-optifying this particular package:

1: Remove the installation: dpkg --remove maemotex
2: Make sure there's nothing left in /usr/local
3: Remove the original, leftover /usr/local: rmdir /usr/local
(NB: dpkg --remove may have removed it already.)
4: Make a symlink into /opt, like so:
Code:
mkdir /opt/local
cd /usr
ln -s local /opt/local
5: Re-install maemotex.

Now it'll still unpack and install in /usr/local, but that just happens to really be /opt/local.
__________________
N800/OS2007|N900/Maemo5
-- Metalayer-crawler delenda est.
-- Current state: Fed up with everything MeeGo.
 

The Following 2 Users Say Thank You to TA-t3 For This Useful Post:
Posts: 62 | Thanked: 18 times | Joined on Dec 2009 @ Missouri, USA
#43
Originally Posted by TA-t3 View Post
It should be possible to repackage it to use /opt more. I may take a stab at that in a few days (newyear's eve holiday).

I unpack and repack on my Linux desktop computer, which is Debian-based and thus has all the required tools.

The important ones are 'fakeroot' and 'dpkg-deb'. The latter is available also on the N900 itself, but the former is not. It may be possible to avoid needing it by actually being root while repackaging, but I haven't tried this. In any case, if you try this on the N900 itself (e.g. because of lack of a Debian Linux desktop/laptop environment) then you should do this on an ext3 partition, not vfat, otherwise the package will not be repackaged correctly. Oh, and remotely logging in to the N900 with a proper keyboard and screen would make it easier.
...
@TA-t3:
I actually have Ubuntu for desktop. Should I install the SDK to get fakeroot and try all this instead of on the N900 directly?
I would like to try this and learn.
Thanks,
 
Posts: 62 | Thanked: 18 times | Joined on Dec 2009 @ Missouri, USA
#44
Editors for compiling .tex files with maemotex.

I came across a set of macros and shortcuts for working with LaTeX in vim, http://vim-latex.sourceforge.net, and it looks like it might be a great choice for compiling on the N900 directly, especially with the syntax highlighting option enabled and the keyboard shortcuts provided by vim-latex, e.g. for greek letters: http://vim-latex.sourceforge.net/doc...-mappings.html.

I just intalled it downloading all the package in /home/user/MyDocs/.vim and creating a symlink in
/home/user/.vim. The /home/user/.vimrc file has to be edited as well per the installation suggestions.

Finally, vim-latex assumes latex as the default engine, but maemotex only provides pdflatex, so the option has to be changed in the following file
/home/user/MyDocs/.vim/ftplugin/latex-suite/texrc .

The pdflatex engine can then be called from within vim with the following key sequence \ll .

In principle the latex-suite also allows you to define a pdf viewer to be called while editing your document, but I don't know how to call the n900's pdf viewer from the command line.

Another cool thing provided by vim-latex is the autofolding of the .tex file by sections and elements in environments that use \item. There's also keyboard shortcuts for environments and a bunch of other things.
 

The Following User Says Thank You to DojwqIO For This Useful Post:
Posts: 3,841 | Thanked: 1,079 times | Joined on Nov 2006
#45
Originally Posted by DojwqIO View Post
@TA-t3:
I actually have Ubuntu for desktop. Should I install the SDK to get fakeroot and try all this instead of on the N900 directly?
I would like to try this and learn.
Thanks,
If you mean the Maemo SDK then no, you won't need that at all. Just do what you want directly in Ubuntu. I'm sure Ubuntu has fakeroot and dpkg-deb, just as regular Debian. As you're only unpacking/packing, moving files, possibly editing ascii files there's nothing that needs the Maemo SDK there. It's simple.

Edit:
About fakeroot: Fakeroot is so that you can be logged in as yourself, and not root, and still be able to create an archive file (in this case the .deb) where the files in the archive are owned by root.root and not the user you're logged in as.

E.g.
dpkg-deb -b <blablabla>
would create a .deb with files owned by you.yourself (as can be checked with dpkg-deb -c filename.deb), just prepending the command with the 'fakeroot' command will fix it so that the files in the .deb archive are owned by root.root:
fakeroot dpkg-deb -b <blablabla>
This makes working with .e.g. .deb files simple and any non-privileged user can do it.
__________________
N800/OS2007|N900/Maemo5
-- Metalayer-crawler delenda est.
-- Current state: Fed up with everything MeeGo.

Last edited by TA-t3; 2009-12-30 at 17:16.
 
Posts: 3,841 | Thanked: 1,079 times | Joined on Nov 2006
#46
Originally Posted by DojwqIO View Post
In principle the latex-suite also allows you to define a pdf viewer to be called while editing your document, but I don't know how to call the n900's pdf viewer from the command line.
Well, starting it from the command line is easy:

osso_pdfviewer
or
/usr/bin/osso_pdfviewer

but I don't know how to pass a .pdf filename to it. It certainly dosn't take one as a command line parameter. It just starts and then you'll have to click 'open'.
__________________
N800/OS2007|N900/Maemo5
-- Metalayer-crawler delenda est.
-- Current state: Fed up with everything MeeGo.
 
Posts: 62 | Thanked: 18 times | Joined on Dec 2009 @ Missouri, USA
#47
Originally Posted by TA-t3 View Post
However, there may be a much easier shortcut for pseudo-optifying this particular package:

1: Remove the installation: dpkg --remove maemotex
2: Make sure there's nothing left in /usr/local
3: Remove the original, leftover /usr/local: rmdir /usr/local
(NB: dpkg --remove may have removed it already.)
4: Make a symlink into /opt, like so:
Code:
mkdir /opt/local
cd /usr
ln -s local /opt/local
5: Re-install maemotex.

Now it'll still unpack and install in /usr/local, but that just happens to really be /opt/local.
I seem to have some other folders already in /usr/local in addition to maemotex with chwon root:staff and permissions drwxrwsr-x, such as bin, games, include, lib, etc. So I wouldn't want to blow them.

Can the files in the maemotex package be moved from tmp/usr to a new folder tmp/opt, delete tmp/usr and edit the files in tmp/DEBIAN to change instances of usr/local to opt/local and then repackage?

Thanks,
 
Posts: 3,841 | Thanked: 1,079 times | Joined on Nov 2006
#48
Originally Posted by DojwqIO View Post
Can the files in the maemotex package be moved from tmp/usr to a new folder tmp/opt, delete tmp/usr and edit the files in tmp/DEBIAN to change instances of usr/local to opt/local and then repackage?
Yes. Note, though, the part in the original package with the .path file which my original description said to copy to your /home/user/.profile file. You will want to edit and update that file (it's currently in usr/local/teTeX/) to make the setup consistent. And if you do, generate a new MD5sum and update DEBIAN/md5sums (actually, you will want to re-generate that file altogether because all the paths will be changed).

And finally, edit DEBIAN/postinstall

And be aware of potential issues with a re-installed version of your repackaged file, e.g. your existing edit of your .profile.
__________________
N800/OS2007|N900/Maemo5
-- Metalayer-crawler delenda est.
-- Current state: Fed up with everything MeeGo.
 
Posts: 62 | Thanked: 18 times | Joined on Dec 2009 @ Missouri, USA
#49
Originally Posted by TA-t3 View Post
Yes. Note, though, the part in the original package with the .path file which my original description said to copy to your /home/user/.profile file. You will want to edit and update that file (it's currently in usr/local/teTeX/) to make the setup consistent. And if you do, generate a new MD5sum and update DEBIAN/md5sums (actually, you will want to re-generate that file altogether because all the paths will be changed).

And finally, edit DEBIAN/postinstall

And be aware of potential issues with a re-installed version of your repackaged file, e.g. your existing edit of your .profile.
How do I generate new md5sums? You mean using the command md5sum on the updated tree tmp/ ? I will read the man pages for md5sum.


Also, in tmp/opt/local/teTeX there is symlink called share that points to /usr/local/meamotex/070802. I guess I should update that and updated it.

Thanks,
 
Posts: 3,841 | Thanked: 1,079 times | Joined on Nov 2006
#50
Originally Posted by DojwqIO View Post
How do I generate new md5sums?
The original DEBIAN/md5sums can be re-generated this way:

cd tmp (if you unpacked in a 'tmp' directory)
md5sum `find etc usr -type f -print` > DEBIAN/md5sums

Also, in tmp/opt/local/teTeX there is symlink called share that points to /usr/local/meamotex/070802. I guess I should update that and updated it.
Yup. After you re-build the package with dpkg-deb -b you can check it with dpkg-deb -c, you should see all the files as well as symlinks (you don't see the control files though).

(p.s. it's a good idea to update the version number too, you can just do as I did and keep the original number, just appending -a3 or something else (a4 a5.. b1..), see DEBIAN/control, and the name of the package you generate).
__________________
N800/OS2007|N900/Maemo5
-- Metalayer-crawler delenda est.
-- Current state: Fed up with everything MeeGo.
 
Reply


 
Forum Jump


All times are GMT. The time now is 16:36.