mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2024-12-22 13:12:41 +00:00
Add missing pbuilder script
This commit is contained in:
parent
20ffb2484a
commit
5ab9dc3840
2 changed files with 40 additions and 15 deletions
15
dist/debian/.gitignore
vendored
15
dist/debian/.gitignore
vendored
|
@ -1,15 +0,0 @@
|
||||||
*
|
|
||||||
!.gitignore
|
|
||||||
!arsse.*
|
|
||||||
!compat
|
|
||||||
!control
|
|
||||||
!copyright
|
|
||||||
!lintian-overrides
|
|
||||||
!rules
|
|
||||||
!config.php
|
|
||||||
!dbconfig-common.php
|
|
||||||
|
|
||||||
!source/
|
|
||||||
source/*
|
|
||||||
!source/lintian-overrides
|
|
||||||
!source/format
|
|
40
dist/debian/pbuilder.sh
vendored
Executable file
40
dist/debian/pbuilder.sh
vendored
Executable file
|
@ -0,0 +1,40 @@
|
||||||
|
#! /bin/bash -e
|
||||||
|
|
||||||
|
###
|
||||||
|
# This script is fed to pbuilder to build Debian packages. The base tarball
|
||||||
|
# should be created with a command similar to the following:
|
||||||
|
#
|
||||||
|
# sudo pbuilder create --basetgz pbuilder-arsse.tgz --mirror http://ftp.ca.debian.org/debian/ --extrapackages debhelper --extrapackages devscripts
|
||||||
|
#
|
||||||
|
# Thereafter pbuilder can be used to build packages with this command:
|
||||||
|
#
|
||||||
|
# sudo pbuilder execute --basetgz pbuilder-arsse.tgz --bindmounts `basedir "/path/to/release/tarball"` -- pbuilder.sh "/path/to/release/tarball"
|
||||||
|
#
|
||||||
|
# This somewhat roundabout procedure is used because the pbuilder debuild
|
||||||
|
# command does not seem to work in Arch Linux, nor does pdebuild. Doing
|
||||||
|
# as much as possible within the chroot itself works around these problems.
|
||||||
|
###
|
||||||
|
|
||||||
|
# create a temporary directory
|
||||||
|
tmp=`mktemp -d`
|
||||||
|
|
||||||
|
# define various variables
|
||||||
|
here=`dirname "$1"`
|
||||||
|
tarball=`basename "$1"`
|
||||||
|
version=`echo "$tarball" | grep -oP '\d+(?:\.\d+)*' | head -1`
|
||||||
|
out="$here/debian"
|
||||||
|
in="$tmp/arsse-$version"
|
||||||
|
|
||||||
|
# create necessary directories
|
||||||
|
mkdir -p "$in" "$out"
|
||||||
|
# extract the release tarball
|
||||||
|
tar -C "$in" -xf "$1" --strip-components=1
|
||||||
|
# repackage the release tarball into a Debian "orig" tarball
|
||||||
|
tar -C "$tmp" -czf "$tmp/arsse_$version.orig.tar.gz" "arsse-$version"
|
||||||
|
# copy the "dist/debian" directory down the tree where Debian expects it
|
||||||
|
cp -r "$in/dist/debian" "$in/debian"
|
||||||
|
# build the package
|
||||||
|
cd "$in"
|
||||||
|
debuild
|
||||||
|
# move the resultant files to their final destination
|
||||||
|
find "$tmp" -maxdepth 1 -type f -exec mv '{}' "$out" \;
|
Loading…
Reference in a new issue