Friday 28 September 2012

Linux packages

I created some time ago the Linux auto installation packages, some people asked me how, so I decide to put all needed files on Github.
Github link is the following: https://github.com/angerangel/Rebol-linux-packages
How to make a Linux package?
It's very simple:
  • first of all you need to create a directory with you package name (for example "rebol")
  • inside this folder you must put the folders that you want to install in pc, the same structure parting from "/" (the roo folder). In my case I needed to copy rebol intepreter in "/usr/bin" and something else in "/usr/share/". So this is my directory structure:
  • As you probably noticed, I also created a "DEBIAN" directory, this is requested by .deb package format. Inside the DEBIAN directory you must put a "control" file. This is my control file:

    Package: rebol
    Version: 2.7.8.4.3
    Architecture: i386
    Installed-Size: 1175
    Section: devel
    Priority: optional
    Homepage: http://www.rebol.com
    Depends: libc6, libstdc++6, libx11-6, libxcb1, libxaw7, libfreetype6, libxext6, libxt6, libxmu6, libgcc1, libsm6, libice6, libxpm4, zlib1g, libxau6, libxdmcp6, libuuid1, xfonts-100dpi, xfonts-75dpi
    postinst: mandb; update-app-install
    Maintainer: Massimiliano Vessi <maxint@tiscali.it>
    Description: REBOL stands for relative expression based object language.
    Software systems have become too complex,
    layers upon layers of complexity, each more brittle and
    vulnerable to failure. In the end software becomes the
    problem, not the solution. We rebel against such complexity,
    fighting back with the most powerful tool available:
    language itself.
    .
    This package contains the REBOL/View 2.7.8.4.3 binary
  • Then I added the man pages
  • Then I added the icon to display in the application menu, in "/usr/share/pixmaps/"
  • Then I wrote the rebol.desktop, a file that add rebol in the application panel like this:
    to obtain this result, I wrote the file this way:
    [Desktop Entry]
    X-AppInstall-Package=rebol
    X-AppInstall-Proprietary=true
    X-AppInstall-Architectures=i386;amd64
    Encoding=UTF-8
    Name=Rebol
    Icon=rebol-icon
    Terminal=true
    Type=Application
    Categories=Application;Development;IDE;
    StartupNotify=true
    MimeType=text/r;
    Exec=rebol
    Comment=Programming is fun again

    terminal=true is important to start rebol from a terminal, or you won't see console.
  •  Now you must have alien installed, in order to convert the debian package in other formats (RPM, tar.gz, etc.)
  • Launch my script (packcreator.sh) and you'll obtain all packages for all linux platforms. My script is very simple:
    #!/bin/bash
    #removing old versions
    rm rebol*.deb
    rm rebol*.tgz
    rm rebol*.rpm
    #creating new ones
    dpkg-deb -b rebol
    dpkg-deb -b rebol_amd64
    sudo alien --to-rpm --to-tgz rebol.deb
    sudo alien --to-rpm rebol_amd64.deb
If you have any question, post a comment!

No comments:

Post a Comment