source: live-build/trunk/fuentes/scripts/build/lb_binary_zsync @ 900

Last change on this file since 900 was 900, checked in by kbut, 3 years ago

add original source

  • Property svn:executable set to *
File size: 2.2 KB
Line 
1#!/bin/sh
2
3## live-build(7) - System Build Scripts
4## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
5##
6## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
7## This is free software, and you are welcome to redistribute it
8## under certain conditions; see COPYING for details.
9
10
11set -e
12
13# Including common functions
14( . "${LIVE_BUILD}/scripts/build.sh" > /dev/null 2>&1 || true ) || . /usr/lib/live/build.sh
15
16# Setting static variables
17DESCRIPTION="$(Echo 'build zsync control files')"
18HELP=""
19USAGE="${PROGRAM} [--force]"
20
21Arguments "${@}"
22
23# Reading configuration files
24Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
25Set_defaults
26
27if [ "${LB_ZSYNC}" != "true" ]
28then
29        exit 0
30fi
31
32Echo_message "Begin building zsync control files..."
33
34# Requiring stage file
35Require_stagefile .build/config .build/bootstrap
36
37# Checking stage file
38Check_stagefile .build/binary_zsync
39
40# Checking lock file
41Check_lockfile .lock
42
43# Creating lock file
44Create_lockfile .lock
45
46# Checking depends
47Check_package chroot/usr/bin/zsyncmake zsync
48
49# Restoring cache
50Restore_cache cache/packages.binary
51
52# Installing depends
53Install_package
54
55case "${LB_BINARY_IMAGES}" in
56        iso)
57                _IMAGES="binary.iso"
58                ;;
59
60        iso-hybrid)
61                _IMAGES="binary.hybrid.iso"
62                ;;
63
64        hdd)
65                _IMAGES="binary.img"
66                ;;
67
68        net)
69                _IMAGES="binary.netboot.tar*"
70                ;;
71
72        tar)
73                _IMAGES="binary.tar*"
74                ;;
75esac
76
77for _IMAGE in ${_IMAGES}
78do
79        if [ -e "${_IMAGE}" ]
80        then
81                case "${LB_BUILD_WITH_CHROOT}" in
82                        true)
83                                mv ${_IMAGE} chroot
84                                Chroot chroot "zsyncmake -C -b 2048 -u ${_IMAGE} ${_IMAGE}"
85                                mv chroot/${_IMAGE} chroot/${_IMAGE}.zsync ./
86                                ;;
87
88                        false)
89                                zsyncmake -C -b 2048 -u "${_IMAGE}" "${_IMAGE}"
90                                ;;
91                esac
92
93                case "${LB_COMPRESSION}" in
94                        bzip2)
95                                bzip2 ${BZIP2_OPTIONS} ${_IMAGE}.zsync
96                                ;;
97
98                        gzip)
99                                gzip ${GZIP_OPTIONS} ${_IMAGE}.zsync
100                                ;;
101
102                        lzip)
103                                lzip ${LZIP_OPTIONS} ${_IMAGE}.zsync
104                                ;;
105
106                        xz)
107                                xz ${XZ_OPTIONS} ${_IMAGE}.zsync
108                                ;;
109
110                        none)
111                                ;;
112                esac
113        fi
114done
115
116#CHECKSUMS
117
118# Saving cache
119Save_cache cache/packages.binary
120
121# Removing depends
122Remove_package
123
124# Creating stage file
125Create_stagefile .build/binary_zsync
Note: See TracBrowser for help on using the repository browser.