From 913945a08c8504fadc9591d39260898160d9b498 Mon Sep 17 00:00:00 2001 From: William Petit Date: Wed, 23 Sep 2015 21:59:29 +0200 Subject: [PATCH] Empaquetage paquets binaires OK --- README.md | 57 +++++--------------------- hooks/00-create-changelog-prebuild | 7 +--- hooks/00-detect-debian-format-prebuild | 15 ------- hooks/01-create-orig-archive-prebuild | 12 ------ lib/build.sh | 2 +- 5 files changed, 13 insertions(+), 80 deletions(-) delete mode 100755 hooks/00-detect-debian-format-prebuild delete mode 100755 hooks/01-create-orig-archive-prebuild diff --git a/README.md b/README.md index efa5557..5656cb3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Tamarin -Usine à paquets Debian basée sur Docker. +Usine à paquets binaires Debian basée sur Docker. ## Dépendances @@ -9,53 +9,18 @@ Vous devez avoir [docker](https://docs.docker.com/installation/) installé sur v ## Utilisation ``` -./package-project.sh +Usage: ./package.sh -p project_path [-d destination] [-i image] [-k] + +Parameters: + + -p Path to the project to build + -d Optional : Destination of the builed packages (default ./packages) + -i Optional : Name of the Docker image to use for build (default: debian:jessie) + -k Optional : Keep the Docker container after build + -b Optional : Build directory (default /tmp) + -B Optional : Build branch (for git projects only) (default dist/ubuntu/precise/master) ``` -**Exemple:** *en étant placé dans le répertoire du projet Tamarin* -``` -./package-project.sh ./src-example ./dist "debian:jessie" -``` - -## Le fichier manifeste `tamarin.json` - -La génération des fichiers de métadonnées nécessaires à la construction du paquet peut être semi-automatisé via l'ajout d'un fichier manifeste `tamarin.json` à la racine du projet. - -Si le répertoire `DEBIAN` est déjà présent à la racine du projet, Tamarin n'effectuera pas cette étape. - -Ce fichier à la structure suivante: - -```js -{ - "name": "hello-world", // Nom du projet - "version": "0.0.0", // Version - "dependencies": { // Dépendances du projet suivant la distribution cible - "debian:jessie": [ - "apache2 (>= 2.4)", - "php5 (>= 5.4)" - ] - }, - "hooks": { // Hooks liés au cycle de vie du paquet - "preBuild": "./scripts/pre-build.sh", - "postBuild": "./scripts/post-build.sh", - "preInstall": "", - "preRemove": "", - "postInstall": "", - "postRemove": "" - } -} -``` -### Les hooks - -|Hook |Contexte |Description| -|------------|---------------------------------------------------|-----------| -|preBuild |Exécuté dans le conteneur de construction du paquet|TODO| -|postBuild |Exécuté dans le conteneur de construction du paquet|TODO| -|preInstall |Exécuté juste avant l'installation du paquet |TODO| -|postInstall |Exécuté juste après l'installation du paquet |TODO| -|preRemove |Exécuté juste avant la suppression du paquet |TODO| -|postRemove |Exécuté juste après la suppression du paquet |TODO| - ## Licence GPLv3 diff --git a/hooks/00-create-changelog-prebuild b/hooks/00-create-changelog-prebuild index b60404e..debe135 100755 --- a/hooks/00-create-changelog-prebuild +++ b/hooks/00-create-changelog-prebuild @@ -61,15 +61,10 @@ do # Define project_version opt if not defined if [ -z "$(get_opt project_version)" ]; then - # Share computed package version + # Share computed project version set_opt project_version "${version}" fi - # Native packages should not have a revision number - if [ $(get_opt package_format) == 'native' ]; then - package_version=$(echo ${version} | grep -oE '^[0-9.]+') - fi - echo "${project_name} (${package_version}) ${distribution}; urgency=${urgency}" >> debian/changelog echo >> debian/changelog diff --git a/hooks/00-detect-debian-format-prebuild b/hooks/00-detect-debian-format-prebuild deleted file mode 100755 index 880b10d..0000000 --- a/hooks/00-detect-debian-format-prebuild +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -source "${TAMARIN_UTIL}" - -if [ -f "debian/source/format" ]; then - format=$(cat debian/source/format) - case ${format} in - "3.0 (native)") - set_opt package_format "native" - ;; - "3.0 (quilt)") - set_opt package_format "quilt" - ;; - esac -fi diff --git a/hooks/01-create-orig-archive-prebuild b/hooks/01-create-orig-archive-prebuild deleted file mode 100755 index 48bdd0a..0000000 --- a/hooks/01-create-orig-archive-prebuild +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -source "${TAMARIN_UTIL}" - -project_name=$(get_opt project_name) -project_version=$(get_opt project_version) - -src_tarball="../${project_name}_${project_version}.orig.tar.gz" - -info "Creating sources tarball ${src_tarball}" - -tar -czf "${src_tarball}" . diff --git a/lib/build.sh b/lib/build.sh index 3c79750..fb1d796 100755 --- a/lib/build.sh +++ b/lib/build.sh @@ -34,7 +34,7 @@ function build_project() cd "${workspace}" - dpkg-buildpackage -us -uc 2> >(error) 1> >(info) + dpkg-buildpackage -b 2> >(error) 1> >(info) if [ $? != 0 ]; then fatal "The build process has not completed successfuly !"