+projects (1.0-%BUILD%) unstable; urgency=medium
+ * prebuild in <paket>.build no longer supported
+ * support of cmake builds
+ -- Michael Wagner <michael@wagnertech.de> Tue, 12 Jan 2021 22:54:48 +0100
+
projects (0.6-%BUILD%) unstable; urgency=medium
* calls PAKET.prepare (if present) in config step
* RSYNC_OPTS in rules.pre
--- /dev/null
+#!/bin/bash
+set -e
+cd ../build
+if [ -e debian/$paket.cmake ]
+then
+ cp debian/$paket.cmake CMakeLists.txt
+ echo "make" > debian/$paket.build
+ chmod 755 debian/$paket.build
+ echo "cmake ." > debian/$paket.prebuild
+ chmod 755 debian/$paket.prebuild
+fi
+
echo "usage: mconfigure [options] <package>"
echo " -a <arch>"
echo " -c : configure"
+ echo " -C <cross environment>"
echo " -d : compile"
echo " -p : pack default: do all"
echo " -o : support old Debian 7 format"
configure=0
compile=0
pack=0
-while getopts "a:cdpo" opt; do
+while getopts "a:cC:dpo" opt; do
case $opt in
a) ARCH=$OPTARG
;;
;;
d) compile=1
;;
+ C) cross=$OPTARG
+ ;;
p) pack=1
;;
o) oldpack="-Zgzip"
paket=$1
+if [ -n "$ARCH" -a -n "$cross" ]
+then
+ echo "invalid options: supply -a for multiarch or -C for explicit cross compile environment"
+ exit 1
+fi
+
# if nothing is selected, select all
if [ $configure -eq 0 -a $compile -eq 0 -a $pack -eq 0 ]
then
rm debian/changelog debian/control 2>/dev/null || true
# mconfigure builds 2 environment files: setenv.sh + rules.pre
+ echo "" > debian/rules.pre
+ if [ -e debian/setenv.sh ]; then rm debian/setenv.sh; fi
if [ -n "$ARCH" ]
then
arch_opt="-a $ARCH"
fi
- dpkg-architecture $arch_opt > debian/setenv.sh
- echo "" > debian/rules.pre
+ if [ -n "$cross" ]
+ then
+ if [ ${cross:0:1} != "/" ]
+ then
+ cross="/opt/cross/$cross"
+ fi
+ . "$cross/setenv.sh"
+ cp $cross/setenv.sh debian/setenv.sh
+ fi
+ dpkg-architecture $arch_opt >> debian/setenv.sh
echo "paket=$paket" >> debian/setenv.sh
echo "oldpack=\"$oldpack\"" >> debian/setenv.sh
. debian/setenv.sh
debian/$paket.prepare
fi
+ if [ -e debian/$paket.cmake ]
+ then
+ # trigger build
+ touch debian/$paket.build
+ fi
if [ -e debian/$paket.build ]
then
if [ -e ../build ]
mkdir ../build
fi
if grep -- "-prepare" debian/$paket.build >/dev/null
- then
- debian/rules sync
- debian/$paket.build -prepare
+ then
+ echo "prepare in <paket>.build no longer supported. Use <paket>.prebuild"
+ exit 2
fi
# sync build dir
- . debian/setenv.sh
- debian/rules sync
+# . debian/setenv.sh
+# debian/rules sync
- # executing prebuild
- if [ -x debian/$paket.prebuild ]
- then
- pushd ~/build >/dev/null
- debian/$paket.prebuild
- popd >/dev/null
- fi
fi
# pack prepare
fi
if [ $compile -eq 1 ]
then
- # build artefacts
+ # build package
. debian/setenv.sh
debian/rules build
fi
-rm -rf debian/tmp
# Bauen der kompilierten Programme und formatierten Dokumente aus den Quellen im Bauverzeichnis
-build: debian/$(paket).build sync
+build: debian/$(paket).build prebuild
cd ../build ; debian/$(paket).build
# Build succeeded
sync: ../build
rsync $(RSYNC_OPT) ./ ../build/
+../build/cmake_check:
+ /usr/share/mbuild/cmake_check
+ touch ../build/cmake_check
+
+prebuild: sync ../build/cmake_check
+ cd ../build ; if [ -x debian/$(paket).prebuild ]; then debian/$(paket).prebuild; fi
+
copy: debian/$(paket).cp
debian/$(paket).cp debian/tmp