+projects (1.2-%BUILD%) unstable; urgency=medium
+ * support version numbers set by user (-v option)
+ * support version numbers set by project (-V option)
+ -- Michael Wagner <michael@wagnertech.de> Tue, 06 Aug 2021 22:54:48 +0100
+
projects (1.1-%BUILD%) unstable; urgency=medium
* support of cross compile environments with cmake
-- Michael Wagner <michael@wagnertech.de> Tue, 12 Jan 2021 22:54:48 +0100
mkdir -p $base/usr/bin/
cp tools/make/mconfigure $base/usr/bin/
cp tools/make/treecopy $base/usr/bin/
+cp tools/make/make-conffile $base/usr/bin/
mkdir -p $base/usr/share/mbuild/
cp tools/make/rules $base/usr/share/mbuild/
configuration
is done by the
.B mconfigure
-script. It determins the verion number from the git/subversion status. A
+script. The configuration step has the following tasks:
+
+Determination of version and build number. The version number can be set in a
.B PAKET.changelog
-file is needed. Per
-default this script also performs compile and pack step.
+file, can be set by the -v option of
+.B mconfigure
+or be set by the project itself in the
+.B PAKET.prepare
+script. The build number is always taken from the CM system: With SVN it is the global version number, with
+GIT the build number is taken from the tag. On build a tag in the form project_version-build is expected. If not
+present a tag in the form v_version-build is searched. Verion may be 0.0 if set elsewhere.
If a
.B PAKET.prepare
compile
To perform the compile step a
.B PAKET.build
-script is needed in the
+script or a
+.B PAKET.cmake
+file is needed in the
.B debian
directory.
.TP
A standard copyright file is included. An user defined file can be used by copying it to debian/copyright
in the PAKET.prepare script.
.br
-A standard README.debian file is included. An user defined file can be used by defining a debian/PAKET.README.debian.
+
.SH FILES
.TP
PAKET.changelog
PAKET.build
Any executable script file executing the build in the ../build directory
.TP
+PAKET.cmake
+cmake file (CMakeLists.txt) for building C/C++ code. If a cross compile option is set in the mconfigure
+script, according definitions are included.
+.TP
PAKET.cp
An executable script file copying the artefacts to target paths preposed by $1:
.br
.B mbuild(8).
.SH OPTIONS
.TP
+-a ARCH
+A multiarch cross compile is issued
+.TP
-c
select configuration step
.TP
+-C TOOLSET
+Defines the cross compile toolset. TOOLSET can either be an absolute path or a directory expected
+in the /opt/cross directory
+.TP
-d
select compile step
.TP
.TP
-o
support old Debian 7 format
+.TP
+-v VERSION
+set version to VERSION
+.TP
+-V
+verion is set by the project in the prepare step
.PP
If no steps are selected all steps are performed.
.SH SEE ALSO
--- /dev/null
+#!/bin/bash
+set -e
+
+if [ $# -ne 1 ]; then
+ echo "usage: create-conffiles BASE_DIR"
+ exit 1
+fi
+
+cd $1
+mkdir -p DEBIAN
+for files in $(find etc -type f); do
+ echo "/$files" >> DEBIAN/conffiles
+done
+
echo " -d : compile"
echo " -p : pack default: do all"
echo " -v : set version"
+ echo " -V : version set by project"
echo " -o : support old Debian 7 format"
}
then
tag=$(git describe --tags --match "${paket}_*" 2>/dev/null) || true
if test -z "$tag"
+ then
+ # try generic "v_" tag
+ tag=$(git describe --tags --match "v_*" 2>/dev/null) || true
+ fi
+ if test -z "$tag"
then
tag="0.0-0TOP"
fi
fi
}
+##############################################################################
+# Main program
+##############################################################################
+
if [ ! -d debian ]
then
echo "run mconfigure in the project base directory with a debian directory in it!"
configure=0
compile=0
pack=0
-while getopts "a:cC:dpov:" opt; do
- case $opt in
- a) ARCH=$OPTARG
- ;;
- c) configure=1
- ;;
- d) compile=1
- ;;
- C) cross=$OPTARG
- ;;
- p) pack=1
- ;;
- o) oldpack="-Zgzip"
- ;;
- v) optversion=$OPTARG
- ;;
- \?) echo "Invalid option: -$OPTARG"
- echo_usage
- exit 1
- ;;
- :) echo "Option -$OPTARG requires an argument."
- echo_usage
- exit 1
- ;;
- esac
+while [ $OPTIND -le "$#" ]
+do
+ if getopts "a:cC:dpov:V" opt
+ then
+ case $opt in
+ a) ARCH=$OPTARG
+ ;;
+ c) configure=1
+ ;;
+ d) compile=1
+ ;;
+ C) cross=$OPTARG
+ ;;
+ p) pack=1
+ ;;
+ o) oldpack="-Zgzip"
+ ;;
+ v) optversion=$OPTARG
+ ;;
+ V) optversion="0.0"
+ ;;
+ \?) echo "Invalid option: -$OPTARG"
+ echo_usage
+ exit 1
+ ;;
+ :) echo "Option -$OPTARG requires an argument."
+ echo_usage
+ exit 1
+ ;;
+ esac
+ else
+ paket="${!OPTIND}"
+ eval OPTIND=OPTIND+1
+ fi
done
-shift $((OPTIND -1))
-if [ $# -lt 1 ]
+if [ -z "$paket" ]
then
echo_usage
exit 1
fi
-paket=$1
-
if [ -n "$ARCH" -a -n "$cross" ]
then
echo "invalid options: supply -a for multiarch or -C for explicit cross compile environment"
fi
# check for pre/post installation scripts
- echo "TODO: check for conffiles"
if [ -f $paket.preinst ]
then
echo "add_inst_tgt += debian/tmp/DEBIAN/preinst" >> rules.pre
copy: debian/$(paket).cp
debian/$(paket).cp debian/tmp
+ create-conffiles debian/tmp
touch debian/tmp
../$(paket)_$(version)-$(build)_$(arch).deb:debian/tmp/DEBIAN/control $(std_inst_tgt) $(add_inst_tgt) debian/tmp