Page 1 of 3 123 LastLast
Results 1 to 10 of 28

Thread: Linux Dependencies

  1. #1
    Senior Member comtux's Avatar
    Join Date
    Sep 2004
    Location
    Wilkes Barre Pa
    Posts
    342

    Linux Dependencies

    Building a custom packageing system.

    First of let's look at how to build a binary package.

    Example-1.0.tar.gz

    mkdir Example
    tar -xvzf Example-1.0.tar.gz
    cd Example-1.0
    ./configure --prefix=/Example
    make
    make install

    We make or temp build directory.
    Then we take the package called Example-1.0.tar.gz
    and extract it.
    Then we cd to Example-1.0 as you can see.
    Then useing ( ../configure --prefix=/install )
    we tell the package were to install it's self.
    .
    Example <--------------------- Example is our directory
    bin
    include
    man
    lib

    Useing the command below we can compress our packages to a directory less folder .

    tar cvf - bin include lib man | gzip > Example-1.0.tar.gz

    or
    -------------------------------------jro posted------------------------------------

    tar -czvf Example-1.0.tar.gz bin include lib man

    The 'z' option compresses the tar with gzip, alternately you can use the 'j' option to compress the tar with bzip. You can use those same options when opening a compressed archive too. Again, nothing right or wrong with either way, just another way to do it. This is using 'tar (GNU tar) 1.14'.
    ------------------------------------------------------------------------------------

    We now have a precompiled binary package named ( Example-1.0.tar.gz )

    Then the command to unpack.
    The trick is that the file will be unpacked to the directory you're in when issuing the command. In this case - to /
    cd /
    tar zxf /root/Example/Example-1.0.tar.gz

    Thats about it for now on creating binary packages.


    -------------------------------------------------------------------------------------------------

    Building a basic ports system with dep checking.

    -------------------------------------------------------------------------------------------------



    #!/usr/local/bin/ruby
    # Description: An Example File To Install
    # URL: http://www.example.com
    # Maintainer: Comtux <comtux@spymac.com>


    #Search for file in our port's dir.
    f = File.open "/var/lib/ports/example/example.rb

    #If file is allready installed.
    if f == true
    test
    end

    #If file isn't allready installed.
    if f == false

    #Here we download our target package.
    main = system("wget www.example.com/example/example-1.0.tar.gz")
    main

    #We will find our selfs here if the above fail's.
    if main == false
    puts " Something is wrong i couldn't download the package."
    end

    #Here we cd /
    if main == true
    Dir::chdir("/")
    end

    #Here we extract & install or target package.
    tar = system("tar -xvzf /var/lib/ports/example-1.0.tar.gz")
    tar


    #We will find our self's here if the above fail's.
    if tar == false
    then puts " Something is wrong i couldn't install the package"
    end

    #Here we test to see if our package was installed properly.
    if tar == true
    then test = system("example")
    test
    end

    #We will find our self's here if they above fail's.
    if test == false
    puts " Something is wrong i couldn't exacute the package"

    #This is where our dep checking begin's
    puts " I will now start checking dep's.
    dep = system("/var/lib/ports/example/dep/dep.rb")
    end

    if dep == false
    puts " Something is wrong i couldn't exacute dep checking"
    end

    #This is the final result to the install process.
    if test == true
    puts "Every thing seem's to have installed properly"
    end

    -------------------------------------------------------------------------------------------------

    This ruby script will.

    1. Search for the package in question.
    2. If the file is allready installed it will test the package.
    3. If the file is not allready installed it will be downloaded.
    4. Basic Error checking.
    5. Install the binary that we downloaded.
    6. Then test the installed package.
    7. If the installed package return's a error then the script will start dep checking.

    dep.rb is the same as above except for the fact that it is a dep.
    So when we exacute this script it will go right on down the line exacuteing every dep.rb script untill the package is installed properly.
    This is just a very basic example of how to build a ports system with dep checking as i go i will add more advanced feature's.
    --------------------------------------------------------------------------------------------

  2. #2
    Mentor
    Join Date
    May 2004
    Location
    Louisiana
    Posts
    1,206

    Re: Linux Dependencies

    Sticky this dude. This should be saved in perpetuity. Another great post by whats-his-name!

  3. #3
    Senior Member
    Join Date
    Apr 2004
    Location
    Indiana?... We named the dog Indiana!
    Posts
    488

    Re: Linux Dependencies

    Quote Originally Posted by comtux";p="4250
    ...

    Now lets say when you double click on your package
    What should happen?

    1. The Shell script is called and exacutes our basic gambas installer gui.
    2. Then the gambas installer gui is linked up with our Dep check rb.script..
    3. Wich in turn the rb.script reads the Dep list.txt contained in package we wish to install.
    4. Looks for the apps on the installers system containded in the list.txt
    5. Out puts a seperate list1.txt file wich in turn the rb.script reads and download what we are missing.

    ...
    Not to dump all over your post, but... Apt already does all that. RPM is supposed to do it also, but I think it doesn't do as good a job, from all I've seen and heard/read. This does sound like a good excercise for script coding though. As we've learned in another thread (ahem :roll: ), doing things over and over again can lead to a better way of doing things .
    Steve

  4. #4
    Senior Member comtux's Avatar
    Join Date
    Sep 2004
    Location
    Wilkes Barre Pa
    Posts
    342
    Think of FreeBSD packageing system optimized for your hardware with the ability to install appts with a single click
    of a gui installer 2 options of package installs binarys or src packages.
    This is a package & ports system for src & Binary packageing system.
    With Dep Checking.

  5. #5
    Advisor
    Join Date
    Apr 2004
    Location
    orlando
    Posts
    608
    Quote Originally Posted by snct";p="4252
    Quote Originally Posted by comtux";p="4250
    ...

    Now lets say when you double click on your package
    What should happen?

    1. The Shell script is called and exacutes our basic gambas installer gui.
    2. Then the gambas installer gui is linked up with our Dep check rb.script..
    3. Wich in turn the rb.script reads the Dep list.txt contained in package we wish to install.
    4. Looks for the apps on the installers system containded in the list.txt
    5. Out puts a seperate list1.txt file wich in turn the rb.script reads and download what we are missing.

    ...
    Not to dump all over your post, but... Apt already does all that. RPM is supposed to do it also, but I think it doesn't do as good a job, from all I've seen and heard/read. This does sound like a good excercise for script coding though. As we've learned in another thread (ahem :roll: ), doing things over and over again can lead to a better way of doing things .
    rpm is _not_ supposed to 'handle dependancies' only fail when they are not installed.

    debs do handle them though (by way of apt-get)

  6. #6
    Senior Member
    Join Date
    Apr 2004
    Location
    Atlanta GA
    Posts
    373
    Ahhhh, this is exactly why I love Gentoo =)

  7. #7
    Advisor
    Join Date
    Apr 2004
    Location
    orlando
    Posts
    608
    Quote Originally Posted by ZennouRyuu";p="4289
    Ahhhh, this is exactly why I love Gentoo =)
    because apt-get handles your deps for you without making you wait 18 billion fucking hours just to install a program?

    the fact that you managed to turn this thread into a chance to advertise gentoo is exactly why i fucking hate gentoo or at least the mindset of it's users.

  8. #8
    Guest
    Quote Originally Posted by maccorin";p="4291
    Quote Originally Posted by ZennouRyuu";p="4289
    Ahhhh, this is exactly why I love Gentoo =)
    because apt-get handles your deps for you without making you wait 18 billion fucking hours just to install a program?

    the fact that you managed to turn this thread into a chance to advertise gentoo is exactly why i fucking hate gentoo or at least the mindset of it's users.
    39% of all gentoo users promote gentoo when its uncalled for. You nazi kitten killer.

    (posting like a wanker is fun)

  9. #9
    Mentor jro's Avatar
    Join Date
    May 2004
    Location
    Pennsylvania, USA
    Posts
    1,206
    Quote Originally Posted by mcangeli";p="4295
    39% of all gentoo users promote gentoo when its uncalled for. You nazi kitten killer.

    (posting like a wanker is fun)
    :shock: Bwahahahahahaha!
    jro - http://jeff.robbins.ws
    Linux counter#:213782
    GnuPG ID: 406238E7

  10. #10
    Senior Member comtux's Avatar
    Join Date
    Sep 2004
    Location
    Wilkes Barre Pa
    Posts
    342
    WTF people this isn't about Gentoo Rpm Deb's Or Tgz
    they all suck untill you grasp the idea of developing your own system based on your own idea's then your nothing more than a blind follower who never question's.
    I hope your master's lead you to the snake pit.
    Now eather post a question or idea about this post or be a good little boy or girl and sit in the back and be quiet.

Similar Threads

  1. dependencies
    By elovkoff in forum Linux - General Topics
    Replies: 3
    Last Post: 03-19-2003, 01:02 AM
  2. failed dependencies
    By ohnoitselton in forum Linux - Software, Applications & Programming
    Replies: 2
    Last Post: 02-04-2003, 01:33 AM
  3. compiler dependencies
    By trickster in forum Linux - Software, Applications & Programming
    Replies: 4
    Last Post: 10-06-2002, 10:37 PM
  4. kde3 - dependencies question
    By Mikie in forum Linux - Software, Applications & Programming
    Replies: 4
    Last Post: 09-28-2002, 02:59 AM
  5. Solving dependencies
    By rreed in forum Linux - Software, Applications & Programming
    Replies: 2
    Last Post: 09-21-2002, 02:40 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •