Blame README

ec013d
Install:
e14835
ec013d
run all commands from root (as superuser)
e14835
e14835
ec013d
install dependency packages:
850862
    you need: bash sudo uuid-runtime aufs-tools fuse genisoimage mutt
c247e0
    for apt based OS use command:
850862
        apt-get install bash sudo uuid-runtime aufs-tools fuse genisoimage mutt
e14835
e14835
ec013d
create and edit config file:
ec013d
    use config.sh.blank as a base:
ec013d
        cp config.sh.blank config.sh
ec013d
ec013d
    we use config (some_path is a fake):
ec013d
        PACKET_BUILD_DIR=/some_path/builder-packet
ec013d
        chrooter() {
ec013d
            export CHROOTER_PREFIX="/some_path_to_mount"
ec013d
            $BASE_DIR/chrooter/chrooter.sh $@
ec013d
        }
ec013d
        OPENTOONZ_TESTING_TAG="morevna"
850862
        export EMAIL_FAILED="e@mail.org"
850862
        export EMAIL_SUCCESS="$EMAIL_FAILED"
850862
        export EMAIL_SUBJECT="builder task finished"
850862
850862
    for emails configure ~/.muttrc, for example:
850862
        set smtp_url=smtps://login:password@server.org
850862
        set from=e@mail.org
850862
        set record=
850862
    see "background tasks" below
ec013d
ec013d
ec013d
download virtual environment:
root 343dc6
    you may download our (we are Morevna Project team) os images from:
root 343dc6
        https://coolbug.org/downloads/morevna/builder-images/
ec013d
ec013d
    you need two files:
9a8dee
        https://coolbug.org/downloads/morevna/builder-images/morevnaproject_build-debian-7-32.iso
9a8dee
        https://coolbug.org/downloads/morevna/builder-images/morevnaproject_build-debian-7-64.iso
ec013d
    approximate 6.5Gb, place both into chrooter/images/
ec013d
ec013d
ec013d
build virtual environment:
ec013d
    if you does not want to download os images you can build it
ec013d
5df1de
    before begin you may configure debian mirror in files:
5df1de
        env/debian-7-32bit/files/sources.list
5df1de
        env/debian-7-64bit/files/sources.list
9a8dee
        env/debian-7-32bit/build-iso.sh into variable apt_mirror
9a8dee
        env/debian-7-64bit/build-iso.sh into variable apt_mirror
ec013d
ec013d
    here you still can download a base debian images from:
9a8dee
        https://coolbug.org/downloads/morevna/builder-images/debian-wheezy-i386.iso
9a8dee
        https://coolbug.org/downloads/morevna/builder-images/debian-wheezy-amd64.iso
ec013d
    approximate 500Mb, place first into env/debian-7-32bit and second into env/debian-7-64bit
ec013d
ec013d
    or build these images from scratch by debootstrap
9a8dee
    install debootstarp:
9a8dee
        apt-get install debootstrap
ec013d
    and build base debian images
ec013d
        cd env/debian-7-32bit # go to env/debian-7-32bit
9a8dee
        ./build-iso.sh
ec013d
        cd ../debian-7-64bit  # go to env/debian-7-64bit
9a8dee
        ./build-iso.sh
ec013d
        cd ../..              # go back
9a8dee
    after that will appear two new files:
9a8dee
        env/debian-7-32bit/debian-wheezy-i386.iso
9a8dee
        env/debian-7-64bit/debian-wheezy-amd64.iso
9a8dee
ec013d
9a8dee
    now when you have files debian-wheezy-XXXX.iso you can build os images for builder
ec013d
    it's a long process because it will build GCC and MinGW from scratch
ec013d
    run commands:
ec013d
        cd env/debian-7-32bit # go to env/debian-7-32bit
ec013d
        ./build-base.sh       # just to copy base os image into chrooter/images
ec013d
        ./build.sh            # a long build process
ec013d
        cd ../debian-7-64bit  # go to env/debian-7-64bit
ec013d
        ./build-base.sh       # just to copy base os image into chrooter/images
ec013d
        ./build.sh            # a long build process
ec013d
        cd ../..              # go back
ec013d
ec013d
    build environment ready
ec013d
ec013d
ec013d
installation done
ec013d
ec013d
7653a6
also you may download full backets build data made by us:
7653a6
    https://coolbug.org/downloads/morevna/builder-images/
7653a6
    https://coolbug.org/downloads/morevna/builder-images/builder-packets--YYYY-MM-DD.tar.gz
c247e0
approximate 20Gb compressed and 75Gb after decompress
c247e0
NB: build data contains a lot of hardlinks so make sure that you unpack it properly (tar -xf)
ec013d
7653a6
7653a6
7653a6
Let's build something:
ec013d
ec013d
ec013d
now you may build packages by macro script:
ec013d
    see files ./build-*.sh
ec013d
ec013d
also you can add hooks to publish built packages:
ec013d
    for example create file publish/publish-synfigstudio.sh with content:
ec013d
        #!/bin/bash
ec013d
        cp "$1" /var/www/public/downloads/
ec013d
    when build is done new synfigstudio packge will placed into web-site directory
ec013d
    you may look file publish/publish.sh for more info
ec013d
ec013d
run internal builder commands in virtual environment:
ec013d
    cd env
ec013d
    ./run.sh some_command
ec013d
ec013d
also you may use:
ec013d
    env/debian-7-32bit/run.sh
ec013d
    env/debian-7-64bit/run.sh
ec013d
    env/debian-7-64bit/win32.sh
ec013d
    env/debian-7-64bit/win64.sh
ec013d
ec013d
run build commands in native environment
ec013d
    ./run-native.sh some_command
ec013d
ec013d
build a selected package:
ec013d
    cd env
ec013d
    ./run.sh env_release MEGAPROGRAM-1.0.0
ec013d
ec013d
take files from directory
ec013d
    env-builder-data/build/packet/linux-x64/MEGAPROGRAM-1.0.0/env_release
ec013d
or
ec013d
    your_build_path/packet/linux-x64/MEGAPROGRAM-1.0.0/env_release
e14835
e14835
e14835
"dry_run" option for paranoics:
ec013d
    ./run.sh dry_run with_deps unpack MEGAPROGRAM-1.0.0 
0e38dd
0e38dd
List of commands
ec013d
    <action> <packet></packet></action>
ec013d
        do <action> for <packet></packet></action>
ec013d
        List of actions:
ec013d
        - download
ec013d
        - unpack
ec013d
        - build
ec013d
        - install
ec013d
        - install_release
ec013d
        - envdeps
ec013d
        - envdeps_release
ec013d
        - env
ec013d
        - env_release
ec013d
ec013d
    dry_run <any command="" other=""></any>
ec013d
        - simulate activity
ec013d
ec013d
    with_deps <command> <packet></packet>
ec013d
        - execute <command> for <packet> and all deps</packet>
5691c3
          for example, you can call download for all deps without build:
5691c3
                run.sh with_deps download mypacket
ec013d
ec013d
    clean_ACTION <packet></packet>
ec013d
        - remove all data of completed ACTION for <packet></packet>
ec013d
        ex.: clean_unpack MEGAPROGRAM-1.0.0
ec013d
ec013d
    clean_all_unpack <packet></packet>
ec013d
        - cleans download and unpack
ec013d
        see: clean_ACTION <packet></packet>
ec013d
ec013d
    clean_all_env <packet></packet>
ec013d
        - cleans install, install_release, envdeps, envdeps_release, env and env_release
ec013d
        see: clean_ACTION <packet></packet>
ec013d
ec013d
    clean_all_install <packet></packet>
ec013d
        - cleans all env and build
ec013d
        see: clean_all_env <packet>, clean_ACTION <packet></packet></packet>
ec013d
ec013d
    clean_all <packet></packet>
ec013d
        - remove all data of all completed actions for <packet></packet>
ec013d
ec013d
    set_undone_ACTION <packet></packet>
ec013d
    set_undone_all_unpack <packet></packet>
ec013d
    set_undone_all_env <packet></packet>
ec013d
    set_undone_all_install <packet></packet>
ec013d
    set_undone_all <packet></packet>
ec013d
        - mark ACTION incomplete for <packet>, but keep action data</packet>
ec013d
        see: clean_* comands
ec013d
ec013d
    shell <packet></packet>
ec013d
        - run shell in environment of <packet></packet>
ec013d
ec013d
    chain <command> chain <other_command> ...</other_command>
ec013d
        - run several command sequentially wihtout remounting of environment to increase speed
ec013d
ec013d
see also
ec013d
    env-builder-data/build/script/common/manager.sh
ec013d
ec013d
850862
Background tasks:
850862
    to call task in background use:
850862
        backgrouns.sh some_command
850862
    command will run in background and result will be sent to email (see config.sh)
850862
    if you do not want to receive emai about success result (look only errors), call:
850862
        backgrouns.sh -q some_command
850862
    logs stored in log/background.log
850862
850862
ec013d
Troubles:
ec013d
    sometimes virtual environmens does not unmounted properly
ec013d
    to clear this you need to unmount all mounts for */chrooter-*
ec013d
    look mounts list by command:
ec013d
        mount
ec013d
ec013d
    unmount by command:
ec013d
        umount "/some_path/chrooter-SOME_UUID"
ec013d
    or with "force" option
ec013d
        umount -f "/some_path/chrooter-SOME_UUID" 
850862
    or with "lazy" option
850862
        umount -l "/some_path/chrooter-SOME_UUID" 
850862
    and check againt with
850862
        mount
ec013d
ec013d
    after that remove the files
ec013d
    you MUST do unmount before, if some dir are still mounted you can remove some system files
ec013d
    we recommend to check content of directories before remove
ec013d
    option "--one-file-system" for additional protection but anyway BE CAREFULL!!
ec013d
    command:
ec013d
        rm -rf --one-file-system /some_path/chrooter-*