diff options
Diffstat (limited to 'debian')
-rw-r--r-- | debian/control | 9 | ||||
-rw-r--r-- | debian/live-build-cron.config | 78 | ||||
-rw-r--r-- | debian/live-build-cron.postinst | 176 | ||||
-rw-r--r-- | debian/live-build-cron.postrm | 31 | ||||
-rw-r--r-- | debian/live-build-cron.templates | 82 | ||||
-rw-r--r-- | debian/po/POTFILES.in | 1 | ||||
-rw-r--r-- | debian/po/templates.pot | 208 | ||||
-rwxr-xr-x | debian/rules | 6 | ||||
-rw-r--r-- | debian/tmp/live-build-cron-manual.config | 50 | ||||
-rw-r--r-- | debian/tmp/live-build-cron-manual.postinst | 111 | ||||
-rw-r--r-- | debian/tmp/live-build-cron-manual.postrm | 37 | ||||
-rw-r--r-- | debian/tmp/live-build-cron-manual.templates | 29 |
12 files changed, 817 insertions, 1 deletions
diff --git a/debian/control b/debian/control index facc93032..a720934dd 100644 --- a/debian/control +++ b/debian/control @@ -33,3 +33,12 @@ Description: Debian Live - System Build Scripts (cgi frontend) configuration directory. . This package contains the cgi frontend. + +Package: live-build-cron +Architecture: all +Depends: ${misc:Depends}, live-build (= ${source:Version}), cron +Description: Debian Live - System Build Scripts (cron autobuilder) + live-build contains the scripts that build a Debian Live system image from a + configuration directory. + . + This package contains the cron autobuilder. diff --git a/debian/live-build-cron.config b/debian/live-build-cron.config new file mode 100644 index 000000000..b47922de0 --- /dev/null +++ b/debian/live-build-cron.config @@ -0,0 +1,78 @@ +#!/bin/sh + +set -e + +. /usr/share/debconf/confmodule + +_FILES="/etc/live/build-cron.conf /etc/live/build-cron.d/*" + +for _FILE in "${_FILES}" +do + if [ -e "${_FILE}" ] + then + _DEBCONF="true" + + . "${_FILE}" || true + fi +done + +if [ "${_DEBCONF}" = "true" ] +then + db_set live-build-cron-images/enable "${LIVE_BUILD_CRON_IMAGES}" + db_set live-build-cron-images/directory "${LIVE_BUILD_CRON_IMAGES_DIRECTORY}" + db_set live-build-cron-images/build "${LIVE_BUILD_CRON_IMAGES_BUILD}" + + db_set live-build-cron-images/daily-distributions "${LIVE_BUILD_CRON_IMAGES_DAILY_DISTRIBUTIONS}" + db_set live-build-cron-images/daily-flavours "${LIVE_BUILD_CRON_IMAGES_DAILY_FLAVOURS}" + + db_set live-build-cron-images/weekly-distributions "${LIVE_BUILD_CRON_IMAGES_WEEKLY_DISTRIBUTIONS}" + db_set live-build-cron-images/weekly-flavours "${LIVE_BUILD_CRON_IMAGES_WEEKLY_FLAVOURS}" + + db_set live-build-cron-images/monthly-distributions "${LIVE_BUILD_CRON_IMAGES_MONTHLY_DISTRIBUTIONS}" + db_set live-build-cron-images/monthly-flavours "${LIVE_BUILD_CRON_IMAGES_MONTHLY_FLAVOURS}" + + db_set live-build-cron-images/source "${LIVE_BUILD_CRON_IMAGES_SOURCE}" +fi + +db_settitle live-build-cron-images/title +db_input high live-build-cron-images/enable || true +db_go + +db_get live-build-cron-images/enable +LIVE_BUILD_CRON_IMAGES="${RET}" + +if [ "${LIVE_BUILD_CRON_IMAGES}" != "true" ] +then + db_stop + + exit 0 +fi + +db_settitle live-build-cron-images/title +db_input low live-build-cron-images/directory || true +db_go + +db_settitle live-build-cron-images/title +db_input low live-build-cron-images/build || true +db_go + +for _BUILDS in daily weekly monthly +do + db_settitle live-build-cron-images/title + db_input low live-build-cron-images/${_BUILDS}-distributions || true + db_go + + db_settitle live-build-cron-images/title + db_input low live-build-cron-images/${_BUILDS}-flavours || true + db_go +done + +db_settitle live-build-cron-images/title +db_input low live-build-cron-images/source || true +db_go + +db_settitle live-build-cron-images/title +db_input low live-build-cron-images/cron || true +db_go + +db_stop diff --git a/debian/live-build-cron.postinst b/debian/live-build-cron.postinst new file mode 100644 index 000000000..837d992db --- /dev/null +++ b/debian/live-build-cron.postinst @@ -0,0 +1,176 @@ +#!/bin/sh + +set -e + +. /usr/share/debconf/confmodule + +_FILE="/etc/live/build-cron.d/images.conf" + +case "${1}" in + configure) + db_get live-build-cron-images/enable + LIVE_BUILD_CRON_IMAGES="${RET}" # boolean + + db_get live-build-cron-images/directory + LIVE_BUILD_CRON_IMAGES_DIRECTORY="${RET:-/srv/debian.net/live/cdimage}" # string (w/o empty) + + db_get live-build-cron-images/build + LIVE_BUILD_CRON_IMAGES_BUILD="${RET}" # select + + db_get live-build-cron-images/daily-distributions + LIVE_BUILD_CRON_IMAGES_DAILY_DISTRIBUTIONS="$(echo ${RET} | sed -e 's|,||g')" # multiselect + + db_get live-build-cron-images/daily-flavours + LIVE_BUILD_CRON_IMAGES_DAILY_FLAVOURS="$(echo ${RET} | sed -e 's|,||g')" # multiselect + + db_get live-build-cron-images/weekly-distributions + LIVE_BUILD_CRON_IMAGES_WEEKLY_DISTRIBUTIONS="$(echo ${RET} | sed -e 's|,||g')" # multiselect + + db_get live-build-cron-images/weekly-flavours + LIVE_BUILD_CRON_IMAGES_WEEKLY_FLAVOURS="$(echo ${RET} | sed -e 's|,||g')" # multiselect + + db_get live-build-cron-images/monthly-distributions + LIVE_BUILD_CRON_IMAGES_MONTHLY_DISTRIBUTIONS="$(echo ${RET} | sed -e 's|,||g')" # multiselect + + db_get live-build-cron-images/monthly-flavours + LIVE_BUILD_CRON_IMAGES_MONTHLY_FLAVOURS="$(echo ${RET} | sed -e 's|,||g')" # multiselect + + db_get live-build-cron-images/source + LIVE_BUILD_CRON_IMAGES_SOURCE="${RET}" # boolean + + db_get live-build-cron-images/cron + _CRON="${RET}" # string (w empty) + + db_stop + + if [ ! -e "${_FILE}" ] + then + + mkdir -p "$(dirname ${_FILE})" + +cat > "${_FILE}" << EOF +# /etc/live/build-cron.d/images.conf + +LIVE_BUILD_CRON_IMAGES="${LIVE_BUILD_CRON_IMAGES}" +LIVE_BUILD_CRON_IMAGES_DIRECTORY="${LIVE_BUILD_CRON_IMAGES_DIRECTORY}" +LIVE_BUILD_CRON_IMAGES_BUILD="${LIVE_BUILD_CRON_IMAGES_BUILD}" + +LIVE_BUILD_CRON_IMAGES_DAILY_DISTRIBUTIONS="${LIVE_BUILD_CRON_IMAGES_DAILY_DISTRIBUTIONS}" +LIVE_BUILD_CRON_IMAGES_DAILY_FLAVOURS="${LIVE_BUILD_CRON_IMAGES_DAILY_FLAVOURS}" + +LIVE_BUILD_CRON_IMAGES_WEEKLY_DISTRIBUTIONS="${LIVE_BUILD_CRON_IMAGES_WEEKLY_DISTRIBUTIONS}" +LIVE_BUILD_CRON_IMAGES_WEEKLY_FLAVOURS="${LIVE_BUILD_CRON_IMAGES_WEEKLY_FLAVOURS}" + +LIVE_BUILD_CRON_IMAGES_MONTHLY_DISTRIBUTIONS="${LIVE_BUILD_CRON_IMAGES_MONTHLY_DISTRIBUTIONS}" +LIVE_BUILD_CRON_IMAGES_MONTHLY_FLAVOURS="${LIVE_BUILD_CRON_IMAGES_MONTHLY_FLAVOURS}" + +export LIVE_BUILD_CRON_IMAGES LIVE_BUILD_CRON_IMAGES_DIRECTORY +export LIVE_BUILD_CRON_IMAGES_DAILY_DISTRIBUTIONS LIVE_BUILD_CRON_IMAGES_DAILY_FLAVOURS +export LIVE_BUILD_CRON_IMAGES_WEEKLY_DISTRIBUTIONS LIVE_BUILD_CRON_IMAGES_WEEKLY_FLAVOURS +export LIVE_BUILD_CRON_IMAGES_MONTHLY_DISTRIBUTIONS LIVE_BUILD_CRON_IMAGES_MONTHLY_FLAVOURS +export LIVE_BUILD_CRON_IMAGES_SOURCE +EOF + + fi + + cp -a -f "${_FILE}" "${_FILE}.tmp" + + # If the admin deleted or commented some variables but then set + # them via debconf, (re-)add them to the config file. + + test -z "${LIVE_BUILD_CRON_IMAGES}" || \ + grep -Eq '^ *LIVE_BUILD_CRON_IMAGES=' "${_FILE}" || \ + echo "LIVE_BUILD_CRON_IMAGES=" >> "${_FILE}" + + test -z "${LIVE_BUILD_CRON_IMAGES_DIRECTORY}" || \ + grep -Eq '^ *LIVE_BUILD_CRON_IMAGES_DIRECTORY=' "${_FILE}" || \ + echo "LIVE_BUILD_CRON_IMAGES_DIRECTORY=" >> "${_FILE}" + + test -z "${LIVE_BUILD_CRON_IMAGES_BUILD}" || \ + grep -Eq '^ *LIVE_BUILD_CRON_IMAGES_BUILD=' "${_FILE}" || \ + echo "LIVE_BUILD_CRON_IMAGES_BUILD=" >> "${_FILE}" + + test -z "${LIVE_BUILD_CRON_IMAGES_DAILY_DISTRIBUTIONS}" || \ + grep -Eq '^ *LIVE_BUILD_CRON_IMAGES_DAILY_DISTRIBUTIONS=' "${_FILE}" || \ + echo "LIVE_BUILD_CRON_IMAGES_DAILY_DISTRIBUTIONS=" >> "${_FILE}" + + test -z "${LIVE_BUILD_CRON_IMAGES_DAILY_FLAVOURS}" || \ + grep -Eq '^ *LIVE_BUILD_CRON_IMAGES_DAILY_FLAVOURS=' "${_FILE}" || \ + echo "LIVE_BUILD_CRON_IMAGES_DAILY_FLAVOURS=" >> "${_FILE}" + + test -z "${LIVE_BUILD_CRON_IMAGES_WEEKLY_DISTRIBUTIONS}" || \ + grep -Eq '^ *LIVE_BUILD_CRON_IMAGES_WEEKLY_DISTRIBUTIONS=' "${_FILE}" || \ + echo "LIVE_BUILD_CRON_IMAGES_WEEKLY_DISTRIBUTIONS=" >> "${_FILE}" + + test -z "${LIVE_BUILD_CRON_IMAGES_WEEKLY_FLAVOURS}" || \ + grep -Eq '^ *LIVE_BUILD_CRON_IMAGES_WEEKLY_FLAVOURS=' "${_FILE}" || \ + echo "LIVE_BUILD_CRON_IMAGES_WEEKLY_FLAVOURS=" >> "${_FILE}" + + test -z "${LIVE_BUILD_CRON_IMAGES_MONTHLY_DISTRIBUTIONS}" || \ + grep -Eq '^ *LIVE_BUILD_CRON_IMAGES_MONTHLY_DISTRIBUTIONS=' "${_FILE}" || \ + echo "LIVE_BUILD_CRON_IMAGES_MONTHLY_DISTRIBUTIONS=" >> "${_FILE}" + + test -z "${LIVE_BUILD_CRON_IMAGES_MONTHLY_FLAVOURS}" || \ + grep -Eq '^ *LIVE_BUILD_CRON_IMAGES_MONTHLY_FLAVOURS=' "${_FILE}" || \ + echo "LIVE_BUILD_CRON_IMAGES_MONTHLY_FLAVOURS=" >> "${_FILE}" + + test -z "${LIVE_BUILD_CRON_IMAGES_SOURCE}" || \ + grep -Eq '^ *LIVE_BUILD_CRON_IMAGES_SOURCE=' "${_FILE}" || \ + echo "LIVE_BUILD_CRON_IMAGES_SOURCE=" >> "${_FILE}" + + sed -e "s|^ *LIVE_BUILD_CRON_IMAGES=.*|LIVE_BUILD_CRON_IMAGES=\"${LIVE_BUILD_CRON_IMAGES}\"|" \ + -e "s|^ *LIVE_BUILD_CRON_IMAGES_DIRECTORY=.*|LIVE_BUILD_CRON_IMAGES_DIRECTORY=\"${LIVE_BUILD_CRON_IMAGES_DIRECTORY}\"|" \ + -e "s|^ *LIVE_BUILD_CRON_IMAGES_BUILD=.*|LIVE_BUILD_CRON_IMAGES_BUILD=\"${LIVE_BUILD_CRON_IMAGES_BUILD}\"|" \ + -e "s|^ *LIVE_BUILD_CRON_IMAGES_DAILY_DISTRIBUTIONS=.*|LIVE_BUILD_CRON_IMAGES_DAILY_DISTRIBUTIONS=\"${LIVE_BUILD_CRON_IMAGES_DAILY_DISTRIBUTIONS}\"|" \ + -e "s|^ *LIVE_BUILD_CRON_IMAGES_DAILY_FLAVOURS=.*|LIVE_BUILD_CRON_IMAGES_DAILY_FLAVOURS=\"${LIVE_BUILD_CRON_IMAGES_DAILY_FLAVOURS}\"|" \ + -e "s|^ *LIVE_BUILD_CRON_IMAGES_WEEKLY_DISTRIBUTIONS=.*|LIVE_BUILD_CRON_IMAGES_WEEKLY_DISTRIBUTIONS=\"${LIVE_BUILD_CRON_IMAGES_WEEKLY_DISTRIBUTIONS}\"|" \ + -e "s|^ *LIVE_BUILD_CRON_IMAGES_WEEKLY_FLAVOURS=.*|LIVE_BUILD_CRON_IMAGES_WEEKLY_FLAVOURS=\"${LIVE_BUILD_CRON_IMAGES_WEEKLY_FLAVOURS}\"|" \ + -e "s|^ *LIVE_BUILD_CRON_IMAGES_MONTHLY_DISTRIBUTIONS=.*|LIVE_BUILD_CRON_IMAGES_MONTHLY_DISTRIBUTIONS=\"${LIVE_BUILD_CRON_IMAGES_MONTHLY_DISTRIBUTIONS}\"|" \ + -e "s|^ *LIVE_BUILD_CRON_IMAGES_MONTHLY_FLAVOURS=.*|LIVE_BUILD_CRON_IMAGES_MONTHLY_FLAVOURS=\"${LIVE_BUILD_CRON_IMAGES_MONTHLY_FLAVOURS}\"|" \ + -e "s|^ *LIVE_BUILD_CRON_IMAGES_SOURCE=.*|LIVE_BUILD_CRON_IMAGES_SOURCE=\"${LIVE_BUILD_CRON_IMAGES_SOURCE}\"|" \ + "${_FILE}" > "${_FILE}.tmp" + + mv -f "${_FILE}.tmp" "${_FILE}" + + mkdir -p "${LIVE_BUILD_CRON_IMAGES_DIRECTORY}" + + if [ -n "${_CRON}" ] + then + +cat > /etc/cron.d/live-build-cron-images << EOF +# /etc/cron.d/live-build-cron-images + +PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + +# m h dom mon dow user command +${_CRON} root /usr/bin/live-build-cron-images +EOF + + else + rm -f /etc/cron.d/live-build-cron-images + fi + + if [ -x "/etc/init.d/cron" ] + then + if [ -x "$(which invoke-rc.d 2>/dev/null)" ] + then + invoke-rc.d cron restart || exit ${?} + else + /etc/init.d/cron restart || exit ${?} + fi + fi + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst called with unknown argument \`${1}'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/live-build-cron.postrm b/debian/live-build-cron.postrm new file mode 100644 index 000000000..f38627677 --- /dev/null +++ b/debian/live-build-cron.postrm @@ -0,0 +1,31 @@ +#!/bin/sh + +set -e + +_DIRECTORY="/srv/debian.net/live-manual" + +case "${1}" in + remove) + if [ -d "${_DIRECTORY}" ] + then + rmdir --ignore-fail-on-non-empty "${_DIRECTORY}" || true + fi + ;; + + purge) + #rm -rf "${_DIRECTORY}" + ;; + + upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + + ;; + + *) + echo "postrm called with unknown argument \`${1}'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/live-build-cron.templates b/debian/live-build-cron.templates new file mode 100644 index 000000000..8e689c199 --- /dev/null +++ b/debian/live-build-cron.templates @@ -0,0 +1,82 @@ +Template: live-build-cron-images/title +Type: title +_Description: Debian Live - System Build Scripts + +Template: live-build-cron-images/enable +Type: boolean +Default: false +_Description: Enable live-build-cron-images? + Do you want to enable live-build-cron-images? + . + If unsure, use 'no' (default). + +Template: live-build-cron-images/directory +Type: string +_Default: /srv/debian.net/live-cdimage +_Description: What directory to put builds to? + Enter the directory where the images should be stored in. + +Template: live-build-cron-images/build +Type: select +_Choices: git, host, release +Default: host +_Description: Which version of live-build to use? + Select the version of live-build to use. + . + If you choose git, the current version of live-build from git will be + used. host will use the live-build from the host system, and release will + use the last released version. + +Template: live-build-cron-images/daily-distributions +Type: multiselect +_Choices: squeeze, wheezy, sid +Default: sid +_Description: What distributions to build for daily images? + Select the distributions you would like to build for daily-images. + +Template: live-build-cron-images/daily-flavours +Type: multiselect +_Choices: standard, rescue, gnome-desktop, kde-desktop, lxde-desktop, xfce-desktop +Default: standard +_Description: What flavours to build for daily images? + Select the flavours you would like to build for daily-images. + +Template: live-build-cron-images/weekly-distributions +Type: multiselect +_Choices: squeeze, wheezy, sid +Default: wheezy +_Description: What distributions to build for weekly images? + Select the distributions you would like to build for weekly-images. + +Template: live-build-cron-images/weekly-flavours +Type: multiselect +_Choices: standard, rescue, gnome-desktop, kde-desktop, lxde-desktop, xfce-desktop +Default: standard +_Description: What flavours to build for weekly images? + Select the flavours you would like to build for weekly-images. + +Template: live-build-cron-images/monthly-distributions +Type: multiselect +_Choices: squeeze, wheezy, sid +Default: squeeze +_Description: What distributions to build for monthly images? + Select the distributions you would like to build for monthly-images. + +Template: live-build-cron-images/monthly-flavours +Type: multiselect +_Choices: standard, rescue, gnome-desktop, kde-desktop, lxde-desktop, xfce-desktop +Default: standard +_Description: What flavours to build for monthly images? + Select the flavours you would like to build for monthly-images. + +Template: live-build-cron-images/source +Type: boolean +Default: false +_Description: Enable source for live-build-cron-images? + Do you sources for live-build-cron-images? + +Template: live-build-cron-images/cron +Type: string +_Default: 0 0 * * * +_Description: What directory to put builds to? + Enter the cron times where the images should be build. diff --git a/debian/po/POTFILES.in b/debian/po/POTFILES.in new file mode 100644 index 000000000..e4c8a55eb --- /dev/null +++ b/debian/po/POTFILES.in @@ -0,0 +1 @@ +[type: gettext/rfc822deb] live-build-cron.templates diff --git a/debian/po/templates.pot b/debian/po/templates.pot new file mode 100644 index 000000000..cc035b762 --- /dev/null +++ b/debian/po/templates.pot @@ -0,0 +1,208 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: live-build@packages.debian.org\n" +"POT-Creation-Date: 2011-07-15 20:31+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: title +#. Description +#: ../live-build-cron.templates:1001 +msgid "Debian Live - System Build Scripts" +msgstr "" + +#. Type: boolean +#. Description +#: ../live-build-cron.templates:2001 +msgid "Enable live-build-cron-images?" +msgstr "" + +#. Type: boolean +#. Description +#: ../live-build-cron.templates:2001 +msgid "Do you want to enable live-build-cron-images?" +msgstr "" + +#. Type: boolean +#. Description +#: ../live-build-cron.templates:2001 +msgid "If unsure, use 'no' (default)." +msgstr "" + +#. Type: string +#. Default +#: ../live-build-cron.templates:3001 +msgid "/srv/debian.net/live-cdimage" +msgstr "" + +#. Type: string +#. Description +#. Type: string +#. Description +#: ../live-build-cron.templates:3002 ../live-build-cron.templates:12002 +msgid "What directory to put builds to?" +msgstr "" + +#. Type: string +#. Description +#: ../live-build-cron.templates:3002 +msgid "Enter the directory where the images should be stored in." +msgstr "" + +#. Type: select +#. Choices +#: ../live-build-cron.templates:4001 +msgid "git, host, release" +msgstr "" + +#. Type: select +#. Description +#: ../live-build-cron.templates:4002 +msgid "Which version of live-build to use?" +msgstr "" + +#. Type: select +#. Description +#: ../live-build-cron.templates:4002 +msgid "Select the version of live-build to use." +msgstr "" + +#. Type: select +#. Description +#: ../live-build-cron.templates:4002 +msgid "" +"If you choose git, the current version of live-build from git will be used. " +"host will use the live-build from the host system, and release will use the " +"last released version." +msgstr "" + +#. Type: multiselect +#. Choices +#. Type: multiselect +#. Choices +#. Type: multiselect +#. Choices +#: ../live-build-cron.templates:5001 ../live-build-cron.templates:7001 +#: ../live-build-cron.templates:9001 +msgid "squeeze, wheezy, sid" +msgstr "" + +#. Type: multiselect +#. Description +#: ../live-build-cron.templates:5002 +msgid "What distributions to build for daily images?" +msgstr "" + +#. Type: multiselect +#. Description +#: ../live-build-cron.templates:5002 +msgid "Select the distributions you would like to build for daily-images." +msgstr "" + +#. Type: multiselect +#. Choices +#. Type: multiselect +#. Choices +#. Type: multiselect +#. Choices +#: ../live-build-cron.templates:6001 ../live-build-cron.templates:8001 +#: ../live-build-cron.templates:10001 +msgid "" +"standard, rescue, gnome-desktop, kde-desktop, lxde-desktop, xfce-desktop" +msgstr "" + +#. Type: multiselect +#. Description +#: ../live-build-cron.templates:6002 +msgid "What flavours to build for daily images?" +msgstr "" + +#. Type: multiselect +#. Description +#: ../live-build-cron.templates:6002 +msgid "Select the flavours you would like to build for daily-images." +msgstr "" + +#. Type: multiselect +#. Description +#: ../live-build-cron.templates:7002 +msgid "What distributions to build for weekly images?" +msgstr "" + +#. Type: multiselect +#. Description +#: ../live-build-cron.templates:7002 +msgid "Select the distributions you would like to build for weekly-images." +msgstr "" + +#. Type: multiselect +#. Description +#: ../live-build-cron.templates:8002 +msgid "What flavours to build for weekly images?" +msgstr "" + +#. Type: multiselect +#. Description +#: ../live-build-cron.templates:8002 +msgid "Select the flavours you would like to build for weekly-images." +msgstr "" + +#. Type: multiselect +#. Description +#: ../live-build-cron.templates:9002 +msgid "What distributions to build for monthly images?" +msgstr "" + +#. Type: multiselect +#. Description +#: ../live-build-cron.templates:9002 +msgid "Select the distributions you would like to build for monthly-images." +msgstr "" + +#. Type: multiselect +#. Description +#: ../live-build-cron.templates:10002 +msgid "What flavours to build for monthly images?" +msgstr "" + +#. Type: multiselect +#. Description +#: ../live-build-cron.templates:10002 +msgid "Select the flavours you would like to build for monthly-images." +msgstr "" + +#. Type: boolean +#. Description +#: ../live-build-cron.templates:11001 +msgid "Enable source for live-build-cron-images?" +msgstr "" + +#. Type: boolean +#. Description +#: ../live-build-cron.templates:11001 +msgid "Do you sources for live-build-cron-images?" +msgstr "" + +#. Type: string +#. Default +#: ../live-build-cron.templates:12001 +msgid "0 0 * * *" +msgstr "" + +#. Type: string +#. Description +#: ../live-build-cron.templates:12002 +msgid "Enter the cron times where the images should be build." +msgstr "" diff --git a/debian/rules b/debian/rules index 6a24cd52c..3d268c7b7 100755 --- a/debian/rules +++ b/debian/rules @@ -19,9 +19,13 @@ override_dh_auto_install: rm -f debian/live-build/usr/share/doc/live-build/COPYING rm -f debian/live-build/usr/share/doc/live-build/ChangeLog - # live-buld-cgi + # live-build-cgi mkdir -p debian/live-build-cgi/usr/share/live/build mv debian/live-build/usr/share/live/build/cgi debian/live-build-cgi/usr/share/live/build + # live-build-cron + mkdir -p debian/live-build-cron/usr/bin + mv debian/live-build/usr/bin/live-build-cron* debian/live-build-cron/usr/bin + override_dh_installchangelogs: dh_installchangelogs docs/ChangeLog diff --git a/debian/tmp/live-build-cron-manual.config b/debian/tmp/live-build-cron-manual.config new file mode 100644 index 000000000..264477825 --- /dev/null +++ b/debian/tmp/live-build-cron-manual.config @@ -0,0 +1,50 @@ +#!/bin/sh + +set -e + +. /usr/share/debconf/confmodule + +_FILES="/etc/live/autobuild.conf /etc/live/autobuild.d/*" + +for _FILE in "${_FILES}" +do + if [ -e "${_FILE}" ] + then + _DEBCONF="true" + + . "${_FILE}" || true + fi +done + +if [ "${_DEBCONF}" = "true" ] +then + db_set live-autobuild-manual/enable "${LIVE_AUTOBUILD_MANUAL}" +fi + +db_settitle live-autobuild-manual/title +db_input high live-autobuild-manual/enable || true +db_go + +db_get live-autobuild-manual/enable +LIVE_AUTOBUILD_MANUAL="${RET}" + +if [ "${LIVE_AUTOBUILD_MANUAL}" != "true" ] +then + db_stop + + exit 0 +fi + +db_settitle live-autobuild-manual/title +db_input low live-autobuild-manual/username || true +db_go + +db_settitle live-autobuild-manual/title +db_input low live-autobuild-manual/directory || true +db_go + +db_settitle live-autobuild-manual/title +db_input low live-autobuild-manual/cron || true +db_go + +db_stop diff --git a/debian/tmp/live-build-cron-manual.postinst b/debian/tmp/live-build-cron-manual.postinst new file mode 100644 index 000000000..45c645dfe --- /dev/null +++ b/debian/tmp/live-build-cron-manual.postinst @@ -0,0 +1,111 @@ +#!/bin/sh + +set -e + +. /usr/share/debconf/confmodule + +_FILE="/etc/live/autobuild.d/manual.conf" + +case "${1}" in + configure) + db_get live-autobuild-manual/enable + LIVE_AUTOBUILD_MANUAL="${RET}" # boolean + + db_get live-autobuild-manual/username + _USERNAME="${RET:-live-autobuild-manual}" # string (w/o empty) + + db_get live-autobuild-manual/directory + LIVE_AUTOBUILD_MANUAL_DIRECTORY="${RET:-/srv/debian.net/live/cdimage}" # string (w/o empty) + + db_get live-autobuild-manual/cron + _CRON="${RET}" # string (w empty) + + db_stop + + if [ ! -e "${_FILE}" ] + then + + mkdir -p "$(dirname ${_FILE})" + +cat > "${_FILE}" << EOF +# /etc/live/autobuild.d/manual.conf + +LIVE_AUTOBUILD_MANUAL="${LIVE_AUTOBUILD_MANUAL}" +LIVE_AUTOBUILD_MANUAL_DIRECTORY="${LIVE_AUTOBUILD_MANUAL_DIRECTORY}" + +export LIVE_AUTOBUILD_MANUAL LIVE_AUTOBUILD_MANUAL_DIRECTORY +EOF + + fi + + cp -a -f "${_FILE}" "${_FILE}.tmp" + + # If the admin deleted or commented some variables but then set + # them via debconf, (re-)add them to the config file. + + test -z "${LIVE_AUTOBUILD_MANUAL}" || \ + grep -Eq '^ *LIVE_AUTOBUILD_MANUAL=' "${_FILE}" || \ + echo "LIVE_AUTOBUILD_MANUAL=" >> "${_FILE}" + + test -z "${LIVE_AUTOBUILD_MANUAL_DIRECTORY}" || \ + grep -Eq '^ *LIVE_AUTOBUILD_MANUAL_DIRECTORY=' "${_FILE}" || \ + echo "LIVE_AUTOBUILD_MANUAL_DIRECTORY=" >> "${_FILE}" + + sed -e "s|^ *LIVE_AUTOBUILD_MANUAL=.*|LIVE_AUTOBUILD_MANUAL=\"${LIVE_AUTOBUILD_MANUAL}\"|" \ + -e "s|^ *LIVE_AUTOBUILD_MANUAL_DIRECTORY=.*|LIVE_AUTOBUILD_MANUAL_DIRECTORY=\"${LIVE_AUTOBUILD_MANUAL_DIRECTORY}\"|" \ + "${_FILE}" > "${_FILE}.tmp" + + mv -f "${_FILE}.tmp" "${_FILE}" + + if ! getent passwd "${_USERNAME}" + then + adduser --quiet --system --home ${LIVE_AUTOBUILD_MANUAL_DIRECTORY} --shell /bin/sh --disabled-password --no-create-home --gecos 'live-autobuild-manual' --group ${_USERNAME} + elif ! getent group "${_USERNAME}" + then + addgroup --system --quiet ${_USERNAME} + gpasswd -a ${_USERNAME} ${_USERNAME} + fi + + mkdir -p "${LIVE_AUTOBUILD_MANUAL_DIRECTORY}" + chown ${_USERNAME}:${_USERNAME} "${LIVE_AUTOBUILD_MANUAL_DIRECTORY}" -R + + if [ -n "${_CRON}" ] + then + +cat > /etc/cron.d/live-autobuild-manual << EOF +# /etc/cron.d/live-autobuild-manual + +PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + +# m h dom mon dow user command +${_CRON} ${_USERNAME} /usr/bin/live-autobuild-manual +EOF + + else + rm -f /etc/cron.d/live-autobuild-manual + fi + + if [ -x "/etc/init.d/cron" ] + then + if [ -x "$(which invoke-rc.d 2>/dev/null)" ] + then + invoke-rc.d cron restart || exit ${?} + else + /etc/init.d/cron restart || exit ${?} + fi + fi + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst called with unknown argument \`${1}'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/tmp/live-build-cron-manual.postrm b/debian/tmp/live-build-cron-manual.postrm new file mode 100644 index 000000000..6e15675b5 --- /dev/null +++ b/debian/tmp/live-build-cron-manual.postrm @@ -0,0 +1,37 @@ +#!/bin/sh + +set -e + +_USERNAME="live-autobuild-manual" +_DIRECTORY="/srv/debian.net/live-manual" + +case "${1}" in + remove) + if [ -x /usr/sbin/deluser ] + then + deluser --system ${_USERNAME} || true + fi + + if [ -d "${_DIRECTORY}" ] + then + rmdir --ignore-fail-on-non-empty "${_DIRECTORY}" || true + fi + ;; + + purge) + rm -rf "${_DIRECTORY}" + ;; + + upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + + ;; + + *) + echo "postrm called with unknown argument \`${1}'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/tmp/live-build-cron-manual.templates b/debian/tmp/live-build-cron-manual.templates new file mode 100644 index 000000000..9baa0a0e8 --- /dev/null +++ b/debian/tmp/live-build-cron-manual.templates @@ -0,0 +1,29 @@ +Template: live-autobuild-manual/title +Type: title +Description: Debian Live - System Build Scripts + +Template: live-autobuild-manual/enable +Type: boolean +Default: false +Description: Enable live-autobuild-manual? + Do you want to enable live-autobuild-manual? + . + If unsure, use 'no' (default). + +Template: live-autobuild-manual/username +Type: string +Default: live-autobuild-manual +Description: What useraccount to use to build the manual? + Enter the name of the username. + +Template: live-autobuild-manual/directory +Type: string +Default: /srv/debian.net/live-manual +Description: What directory to put builds to? + Enter the directory where the manual should be stored in. + +Template: live-autobuild-manual/cron +Type: string +Default: 0-59/10 * * * * +Description: What directory to put builds to? + Enter the cron times where the manual should be build. |