Archive for the 'Ubuntu' Category

Build MinGW Cross Compiling Environment under Debian Lenny

My environment is 32-bit Debian 5.0.5(2.6.26-2-686), a guest installed on VirtualBox.
The job refers to the tutorial of MinGW cross compiling environment.

1. Prepare Requirements,

aptitude install -R autoconf automake bash bison bzip2 \
cmake flex g++ intltool make sed \
libtool libltdl-dev openssl libssl-dev \
libxml-parser-perl patch perl \
pkg-config scons unzip wget \
xz-utils yasm

but I can not find xz-utils, so I compile and install it from source code,

wget http://tukaani.org/xz/xz-5.0.1.tar.gz
tar zxf xz-5.0.1.tar.gz
cd xz-5.0.1
./configure --prefix /usr
make
make install

2. Download and Unpack
wget https://bitbucket.org/vog/mingw-cross-env/downloads/mingw-cross-env-2.19.tar.gz
tar zxf mingw-cross-env-2.19.tar.gz
3.System-wide Installation
mv mingw-cross-env-2.19 /opt/mingw
cd /opt/mingw

4.Build mingw-cross-env
I got some error when do the building job,

1>, Autoconf need 2.62, but the version I installed is 2.61, so I have to install autoconf from source code.

wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.68.tar.bz2
tar jxf autoconf-2.68.tar.bz2
cd autoconf-2.68
./configure --prefix=/usr
make
make install

2> when compile glib, I got the following error,

./configure: line 10181: syntax error near unexpected token `2.2′
./configure: line 10181: `LT_PREREQ(2.2)’
make[1]: *** [build-only-glib] Error 2

after searched, I got the version of Libtool needs at least 2.2, but the version what I have installed is 1.5.26-4, I had to install it from source


wget http://ftp.gnu.org/gnu/libtool/libtool-2.4.tar.gz
tar zxf libtool-2.4.tar.gz
cd libtool-2.4
./configure --prefix=/usr
make
make install

can not access http://www.libgd.org/

[download] gd

Wrong checksum of package gd!
————————————————————
–2011-03-22 22:04:43– http://www.libgd.org/releases/gd-2.0.35.tar.bz2
Resolving www.libgd.org… 213.251.181.15
Connecting to www.libgd.org|213.251.181.15|:80… failed: Connection refused.
–2011-03-22 22:04:43– http://www.libgd.org/releases/oldreleases/gd-2.0.35.tar.bz2
Resolving www.libgd.org… 213.251.181.15
Connecting to www.libgd.org|213.251.181.15|:80… failed: Connection refused.
————————————————————
[log] /opt/mingw/log/gd-download

make: *** [/opt/mingw/usr/installed/gd] Error 1

After search, I got another download location, so I downloaded it and saved it in the pkg folder

wget http://jaist.dl.sourceforge.net/project/buluoos/0.1/src/gd-2.0.35.tar.bz2 -O /opt/mingw/pkg/gd-2.0.35.tar.bz2

then continue the make

Failed to build package openal!
————————————————————
make[3]: *** [CMakeFiles/openal-info.dir/all] Error 2
make[3]: Leaving directory `/opt/mingw/tmp-openal/openal-soft-1.13/build’
make[2]: *** [all] Error 2
make[2]: Leaving directory `/opt/mingw/tmp-openal/openal-soft-1.13/build’
make[1]: *** [build-only-openal] Error 2
make[1]: Leaving directory `/opt/mingw’
real 0m27.641s
user 0m10.549s
sys 0m16.785s
————————————————————
[log] /opt/mingw/log/openal

make: *** [/opt/mingw/usr/installed/openal] Error 1

After manually build OpenAL32, I got the following error,

[ 96%] Built target OpenAL32
Linking C executable openal-info.exe
libOpenAL32.a(dsound.obj):dsound.c:(.text+0×9e0): undefined reference to `_GUID_NULL’
libOpenAL32.a(dsound.obj):dsound.c:(.text+0xa00): undefined reference to `_GUID_NULL’
libOpenAL32.a(dsound.obj):dsound.c:(.text+0xa09): undefined reference to `_GUID_NULL’
libOpenAL32.a(dsound.obj):dsound.c:(.text+0xa12): undefined reference to `_GUID_NULL’
collect2: ld returned 1 exit status
make[2]: *** [openal-info.exe] Error 1
make[1]: *** [CMakeFiles/openal-info.dir/all] Error 2
make: *** [all] Error 2

need modify tmp-openal/openal-soft-1.13/build/CMakeFiles/openal-info.dir/link.txt and add -luuid (seems it is bug, I noticed it patched openal-1-luuid-pkg-config.patch, but no use.).

In fact, if you just want a MinGW cross compile environment, please do not directly execute make, because it has 169 packages, and most of them maybe you do not need at all.
finally, I compiled all 169 packages, and the usr folder is about 2.2G, after the created tar also 580.76M(I use tar cjf i686-pc-mingw32.tar.bz2 usr)

Share and Enjoy:
  • Digg
  • del.icio.us
  • Netvouz
  • DZone
  • ThisNext
  • MisterWong
  • Wists
  • BlinkList
  • blogmarks
  • blogtercimlap
  • connotea
  • DotNetKicks
  • Fark
  • Fleck
  • Gwar
  • Haohao
  • IndianPad
  • Internetmedia
  • LinkaGoGo
  • MyShare
  • Netscape
  • NewsVine
  • Rec6
  • Reddit
  • Scoopeo
  • Slashdot
  • StumbleUpon
  • Technorati
  • Webride

pdfsizeopt-a Free and Open Source PDF Manipulation Tool to Reduce PDF File Size

pdfsizeopt is open source project hosting on Google Code, the main feature is PDF file size optimizer.

About

pdfsizeopt is a collection of best practices and scripts for Unix to optimize the size of PDF files, with focus on PDFs created from TeX and LaTeX documents. pdfsizeopt is developed on a Linux system, and it depends on existing tools such as Python 2.4, Ghostscript 8.50, jbig2enc (optional), sam2p, pngtopnm, pngout (optional), and the Multivalent PDF compressor (optional) written in Java.

The author says it is A Linux solution, and I have test it on my DreamHost, it works. I have tried a PDF, the original PDF is 5.6M, and the optimized/converted PDF is 4.4M, great!

Another great thing, I am working on port it to windows, and all tools needed are ready(some download from website, some compiled by myself, for example jbig2), and have successfully modified pdfsizeopt.py to let it work under windows now, though it still has many bugs(I have submit them to the author) and I will release it later.

Installation instructions

Please note that not all the software mentioned in the instructions below is free software (if we consider freedom). Details:

  • pdfsizeopt: free
  • Python: free
  • Ghostscript: free version available
  • Java: free version available (OpenJDK)
  • sam2p: free
  • jbig2: free (http://github.com/agl/jbig2enc/tree/master)
  • png22pnm: free
  • pngtopnm: free
  • Multivalent.jar: not free software, but you don’t have to pay for using it, and you can download it from the official web site without having to pay
  • PNGOUT: not free software, but you don’t have to pay for using it, and you can download it from the official web site without having to pay

Necessary:

  1. A Unix system is needed, Linux is recommended. The following instructions have been tested on Debian Etch and Ubuntu Hardy.
  2. Install Python 2.4, Python 2.5 or Python 2.6 from package. Earlier or later versions won’t work.
  3. Install Ghostscript 8.61 or later. (You may try pdfsizeopt with Ghostscript 8.54 as well, but 8.54 has some known font conversion problems, so it will produce an error for some PDF files.) Earlier versions won’t work. Make sure the command gs is on your $PATH.
  4. Create a directory named pdfsizeopt.
  5. Check out the source code at http://code.google.com/p/pdfsizeopt/source/checkout , or just download http://pdfsizeopt.googlecode.com/svn/trunk/pdfsizeopt.py as pdfsizeopt/pdfsizeopt.py.
  6. Install a recent sam2p and copy the binary to pdfsizeopt/sam2p. For Linux, the recommended binary is http://pdfsizeopt.googlecode.com/files/sam2p . Please note that the sam2p in Ubuntu Intrepid and Debian Etch is too old. Either compile it yourself, or use the recommended download above.
  7. Install pngtopnm from package, or download the Linux binary from http://pdfsizeopt.googlecode.com/files/png22pnm to pdfsizeopt/png22pnm.

Optional, but strongly recommended:

  1. Install Java 1.5 or newer from package. javac is not necessary. Sun’s Java and OpenJDK are OK, gcj and gij won’t work. Make sure that java -version works and prints something at least 1.5.
  2. Download Multivalent*.jar from http://sourceforge.net/project/showfiles.php?group_id=44509&package_id=37068 (example: Multivalent20060102.jar), and copy it to pdfsizeopt/Multivalent.jar.
  3. Compile jbig2 for yourself, or download the Linux binary from http://pdfsizeopt.googlecode.com/files/jbig2 to pdfsizeopt/jbig2.

Optional, but recommended:

  1. Download the PNGOUT binary for your system. Recommended for Linux: the http://static.jonof.id.au/dl/kenutils/pngout-20070430-linux-static.tar.gz archive on http://www.jonof.id.au/kenutils . For other PNGOUT downloads, visit http://advsys.net/ken/utils.htm . Copy the file pngout-*-linux-static to pdfsizeopt/pngout.

Try it:

  1. Create a file test.pdf, and run pdfsizeopt.py --use-pngout=true --use-jbig2=true --use-multivalent=true test.pdf. The output file will be test.pso.pdf.
  2. If you haven’t installed some of the tools above, try changing =true to =false in the command line.

references,
pdfsizeopt home page
Convert JBIG2 to PDF with free and open source software agl’s jbig2enc
Windows version JBIG2 Encoder-Jbig2.exe

Share and Enjoy:
  • Digg
  • del.icio.us
  • Netvouz
  • DZone
  • ThisNext
  • MisterWong
  • Wists
  • BlinkList
  • blogmarks
  • blogtercimlap
  • connotea
  • DotNetKicks
  • Fark
  • Fleck
  • Gwar
  • Haohao
  • IndianPad
  • Internetmedia
  • LinkaGoGo
  • MyShare
  • Netscape
  • NewsVine
  • Rec6
  • Reddit
  • Scoopeo
  • Slashdot
  • StumbleUpon
  • Technorati
  • Webride

Installing FreeNX in Ubuntu 8.10 Intrepid Ibex

FreeNX is a system that allows you to access your desktop from another machine over the internet. You can use this to login graphically to your desktop from a remote location. One example of its use would be to have a FreeNX server set up on your home computer, and graphically logging in to the home computer from your work computer, using a FreeNX client.
It’s Open Source, secure (SSH based), fast and versatile!
NX means “Next Generation Remote Display“, is an exciting new technology for remote display. It provides near local speed application responsiveness over high latency, low bandwidth links. The core libraries for NX are provided by NoMachine under the GPL. FreeNX is a GPL implementation of the NX Server and NX Client Components.

Here is a easy tutorial that I used to install FreeNX and NX Client.
1.Add the repository in the source file(/etc/apt/sources.list)
# Ubuntu FreeNX Repository for Intrepid
deb http://ppa.launchpad.net/marceloshima/ubuntu intrepid main
deb-src http://ppa.launchpad.net/marceloshima/ubuntu intrepid main
deb http://ppa.launchpad.net/freenx-team/ubuntu intrepid main
deb-src http://ppa.launchpad.net/freenx-team/ubuntu intrepid main

2>update and install freeNX
apt-get update
apt-get install freenx-server

3.install NX client,
windows user, please download NX Client for Windows
ubuntu/Linux user, use nxclient
apt-get insall nxclient

Reference,
https://help.ubuntu.com/community/FreeNX
FreeNX: Free Software (GPL) Implementation of the NX Server
Installing FreeNX in Ubuntu 8.04 Hardy & 8.10 Intrepid Ibex

P.S. NX vs VNC
NX is much faster than VNC. However, with NX you cannot share a desktop. You can only create new
sessions. That’s why we still use VNC, e.g. for training purposes.
NX bases on X windows, so there is no NX server solution for windows.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Netvouz
  • DZone
  • ThisNext
  • MisterWong
  • Wists
  • BlinkList
  • blogmarks
  • blogtercimlap
  • connotea
  • DotNetKicks
  • Fark
  • Fleck
  • Gwar
  • Haohao
  • IndianPad
  • Internetmedia
  • LinkaGoGo
  • MyShare
  • Netscape
  • NewsVine
  • Rec6
  • Reddit
  • Scoopeo
  • Slashdot
  • StumbleUpon
  • Technorati
  • Webride