From: Michael J.M. Wagner Date: Tue, 27 Dec 2022 10:54:50 +0000 (+0100) Subject: posaune X-Git-Tag: v_0.0-7~6 X-Git-Url: http://wagnertech.de/git?p=projects.git;a=commitdiff_plain;h=f78d86f6be7859d3c726d510ce6c6b3053b1732d posaune --- diff --git a/TestMbuild/.dummy b/TestMbuild/.dummy deleted file mode 100644 index e69de29..0000000 diff --git a/TestMbuild/FitnessePages/.dummy b/TestMbuild/FitnessePages/.dummy deleted file mode 100644 index e69de29..0000000 diff --git a/TestMbuild/FitnessePages/PdfTest/.dummy b/TestMbuild/FitnessePages/PdfTest/.dummy deleted file mode 100644 index e69de29..0000000 diff --git a/TestMbuild/FitnessePages/PdfTest/content.txt b/TestMbuild/FitnessePages/PdfTest/content.txt deleted file mode 100644 index b727ffd..0000000 --- a/TestMbuild/FitnessePages/PdfTest/content.txt +++ /dev/null @@ -1,21 +0,0 @@ -!1 PDF-Test - -Build cobol handout in r.320 - -#|call script|!-rm -r suites/Projekte || true -!| -!|test.util.CallScript| -|call script|!- rm suites/Cobol_320.pdf || true -!| -|call script|if ! [ -d suites/Projekte ]; then svn co http://wagnertech.de/svn/Projekte suites/Projekte/; fi| -|call script|svn up -r 320 suites/Projekte| -|call script|mkdir -p suites/Projekte/Kurse/Logo| -|call script|cp etc/Newelements.jpeg etc/UmschlagNewElements.pdf etc/Newelements1.pdf etc/Newelements2.pdf etc/Newelements3.pdf suites/Projekte/Kurse/Logo| -|call script|cp etc/.cm.ignore suites/Projekte/| -|call script|cd suites/Projekte; mconfigure -o cobol| -|call script|rm suites/Projekte/.cm.ignore| -|call script|ls suites/Cobol_320.pdf| - -Build cobol handout in r.323 - -!|test.util.CallScript| -|call script|svn up -r 323 suites/Projekte/| -|call script|cd suites/Projekte; mconfigure cobol| diff --git a/TestMbuild/FitnessePages/PdfTest/properties.xml b/TestMbuild/FitnessePages/PdfTest/properties.xml deleted file mode 100644 index e13fdf4..0000000 --- a/TestMbuild/FitnessePages/PdfTest/properties.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - true - true - true - true - true - true - true - true - true - diff --git a/TestMbuild/FitnessePages/content.txt b/TestMbuild/FitnessePages/content.txt deleted file mode 100644 index 99c097c..0000000 --- a/TestMbuild/FitnessePages/content.txt +++ /dev/null @@ -1 +0,0 @@ -!contents -R2 -g -p -f -h diff --git a/TestMbuild/FitnessePages/properties.xml b/TestMbuild/FitnessePages/properties.xml deleted file mode 100644 index 3096ff6..0000000 --- a/TestMbuild/FitnessePages/properties.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/TestMbuild/etc/.dummy b/TestMbuild/etc/.dummy deleted file mode 100644 index e69de29..0000000 diff --git a/TestMbuild/etc/Newelements.jpeg b/TestMbuild/etc/Newelements.jpeg deleted file mode 100644 index def536d..0000000 Binary files a/TestMbuild/etc/Newelements.jpeg and /dev/null differ diff --git a/TestMbuild/etc/Newelements1.pdf b/TestMbuild/etc/Newelements1.pdf deleted file mode 100644 index 1b7c5f1..0000000 Binary files a/TestMbuild/etc/Newelements1.pdf and /dev/null differ diff --git a/TestMbuild/etc/Newelements2.pdf b/TestMbuild/etc/Newelements2.pdf deleted file mode 100644 index 91662c4..0000000 Binary files a/TestMbuild/etc/Newelements2.pdf and /dev/null differ diff --git a/TestMbuild/etc/Newelements3.pdf b/TestMbuild/etc/Newelements3.pdf deleted file mode 100644 index 2faec5d..0000000 Binary files a/TestMbuild/etc/Newelements3.pdf and /dev/null differ diff --git a/TestMbuild/etc/UmschlagNewElements.pdf b/TestMbuild/etc/UmschlagNewElements.pdf deleted file mode 100644 index 79ba2a3..0000000 Binary files a/TestMbuild/etc/UmschlagNewElements.pdf and /dev/null differ diff --git a/TestMbuild/suites/.dummy b/TestMbuild/suites/.dummy deleted file mode 100644 index e69de29..0000000 diff --git a/doc/mbuild.7 b/doc/mbuild.7 deleted file mode 100644 index c098321..0000000 --- a/doc/mbuild.7 +++ /dev/null @@ -1,108 +0,0 @@ -.\" Manpage for mbuild. -.\" Contact mail@wagnertech.de to correct errors or typos. -.TH mbuild 7 "Jul 2018" GNU "WagnerTech Utilities" -.SH NAME -mbuild \- build system of WagnerTech UG -.SH SYNOPSIS -.B mbuild -.SH DESCRIPTION -.PP -mbuild provides a simple build system based on make, git, subversion. The build process -consists of 3 phases: configuration - compile - pack -.TP -configuration -is done by the -.B mconfigure -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, 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 -file is present in the debian directory, it is called. - -If a -.B PAKET.build -file is present in the debian directory, it is called with a -prepare parameter (deprecated). -The current directory tree is rsync_ed to ~/build. - -If a -.B PAKET.prebuild -file is present in the debian directory, it is called in the ~/build directory. - -.TP -compile -To perform the compile step a -.B PAKET.build -script or a -.B PAKET.cmake -file is needed in the -.B debian -directory. -.TP -pack -To perform the pack step a -.B PAKET.cp -script and a -.B PAKET.control -file are needed in the debian directory. If pre/post installation scripts -are needed, these files must be also placed in the -.B debian -directory. - -A standard copyright file is included. An user defined file can be used by copying it to debian/copyright -in the PAKET.prepare script. - -If files are present to be placed unter /etc a conffiles is creates to avoid changes made by the administrator. - -.SH FILES -.TP -PAKET.changelog -Example: -.br -projects (0.2-%BUILD%) unstable; urgency=medium - * Build in svn-Umgebung - -- Michael Wagner Fr 10. Aug 22:54:48 CEST 2018 -.TP -PAKET.prepare -Any executable script file executed in configure step -.TP -PAKET.prebuild -Any executable script file executed in configure step in the ../build directory -.TP -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 -cp ../build/my_artefact $1/usr/bin/ -.TP -PAKET.preinst PAKET.postint PAKET.prerm PAKET.postrm -Optional pre/post installation scripts -.TP -PAKET.control -Debian control file -.PP -These files are expected in a -.B debian -directory, placed below the projects main directory. -.SH SEE ALSO -make(1), mconfigure(1) -.SH BUGS -No known bugs. -.SH AUTHOR -Michael Wagner (michael@wagnertech.de) - diff --git a/doc/mconfigure.1 b/doc/mconfigure.1 deleted file mode 100644 index 02022fe..0000000 --- a/doc/mconfigure.1 +++ /dev/null @@ -1,55 +0,0 @@ -.\" Manpage for mconfigure. -.\" Contact mail@wagnertech.de to correct errors or typos. -.TH mconfigure 1 "Aug 2018" "GNU" "WagnerTech Utilities" -.SH NAME -mconfigure \- interface to build system of WagnerTech UG -.SH SYNOPSIS -.B mconfigure -[-cdpoV] [-a ARCH] [-C TOOLSET] [-v VERSION] -.I paket -.SH DESCRIPTION -mconfigure builds the artefact -.I paket. -mconfigure has to be called in the projects base directory containing a directoty named -.B debian, -that contains the files described in -.B mbuild(7). -.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 --p -select pack step -.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. The environment variables -.B version -and -.B build -have to be added to the setenv.sh file in the debian directory. -.PP -If no steps are selected all steps are performed. -.SH SEE ALSO -mbuild(7): Overview description -.SH BUGS -No known bugs. -.SH AUTHOR -Michael Wagner (michael@wagnertech.de) - diff --git a/tools/make/c_configure.sh b/tools/make/c_configure.sh deleted file mode 100755 index 57b395e..0000000 --- a/tools/make/c_configure.sh +++ /dev/null @@ -1,131 +0,0 @@ -#!/bin/bash - -# util routines for a C/C++ - build - -function check_arch { - case $1 in - armel) ;; - i386) ;; - *) echo "unknown architecture $1" - exit 1 - esac -} - -function install_cpp_make { -# $1: dir to install -# $2 (opt): if set to "lib" the fPIC flag is added - - # find makefile - if [ -f /usr/share/mbuild/cpp.make ] - then - makefile=/usr/share/mbuild/cpp.make - elif [ -f $cwd/projects/tools/make/cpp.make ] - then - makefile=$cwd/projects/tools/make/cpp.make - else - echo "cannot find cpp makefile." >&2 - exit 1 - fi - src=$(pwd); - pushd $1 - if [ -f makefile ]; then rm makefile; fi - if [ -L makefile ]; then rm makefile; fi - if [ -f make.post ]; then rm make.post; fi - ln -s $makefile makefile - echo "SOURCE = \\" > make.pre - for file in $(ls *.cpp) - do - echo " $file \\" >> make.pre - done - echo >> make.pre - if [ "$DEB_HOST_ARCH" != "$DEB_BUILD_ARCH" ] - then - #cross compiling - echo "PREFIX = $DEB_HOST_GNU_TYPE-" >> make.pre - echo "SYSROOT = --sysroot=$HOME/cross" >> make.pre - fi - - if [ "$ARCH" = "armel" ] - then - echo "CXX = arm-linux-gnueabi-g++" >> make.pre - echo "CC = arm-linux-gnueabi-g++" >> make.pre - echo "CXXFLAGS += -D_ARMEL" >> make.pre - echo 'export PATH := /opt/eldk-5.0/armv5te/sysroots/i686-oesdk-linux/usr/bin/armv5te-linux-gnueabi/:/opt/eldk-5.0/armv5te/sysroots/i686-oesdk-linux/bin/armv5te-linux-gnueabi/:$(PATH)' >> make.pre - else - echo "CXXFLAGS += -std=c++0x" >> make.pre - fi - - # compilation of libraries need fPIC flag - if [ "$2" == "lib" ] - then - echo "CXXFLAGS += -fPIC" >> make.pre - fi - - popd -} - -function append_dependency_common { -# common part of append_dependency and append_library -# parameter: -# $1: main directory -# $2: dependency directory -# $3: dependency artefact - - src=$(pwd) - echo "DEPS += $3" >> $1/make.pre - echo "$3:" >> $1/make.post - echo " cd $src/$2 && make TARGET=$3" >> $1/make.post -} - -function append_dependency { -# adds another drectory, where a c++ compile is performed - append_dependency_common $* - echo "" >> $1/make.post -} - -function add_include { -# adds a include directory -# parameter: -# $1: main directory -# $2: include dir - - src=$(pwd) - echo "CXXFLAGS += -I$src/$2" >> $1/make.pre -} - -function add_library { -# adds a extern library -# parameter: -# $1: main directory -# $2: library name (without l or lib ) -# $3: library path (optional) - - src=$(pwd) - echo "EXTLIB += -l$2" >> $1/make.pre - if [ -n "$3" ] - then - lib_path=$3 - if [ ${lib_path:0:1} != "/" ] - then - lib_path="$src/$lib_path" - fi - echo "LDFLAGS += -L$lib_path" >> $1/make.pre - fi -} - -function append_library { -# same as append_dependency. In addition a include statement + a link to the library is added to "main directory" -# parameter: -# $1: main directory -# $2: dependency directory -# $3: dependency artefact - - append_dependency_common $* - echo " ln -sf $src/$2/$3 ." >> $1/make.post - echo "" >> $1/make.post - - echo "LDLIBS += $3" >> $1/make.pre - echo "CXXFLAGS += -I$src/$2" >> $1/make.pre - -} - diff --git a/tools/make/configure b/tools/make/configure deleted file mode 100755 index 21cf3f8..0000000 --- a/tools/make/configure +++ /dev/null @@ -1,406 +0,0 @@ -#!/bin/bash -set -e - -function echo_usage { - echo "usage: configure [options] " - echo "--- general options ---" - echo " -h : print this info" - echo "--- compile options ---" - echo " -a " - echo " -c default: NONE" - echo " -C " - echo " -d " - echo " -e " - echo "--- build target options ---" - echo " -i : install dir. default: /, nec. for make install" - echo " -n : default: " - echo " -t , nec. for make pack" - echo " -v : set version" - echo " -V : version set by project" -} - -function create_build { - pushd $BUILD_DIR >/dev/null - if [ "$compile_type" == "PDF" ] - then - echo "cd $compile_dir" > debian/$paket.build - echo "make $compile_target" >> debian/$paket.build - chmod 755 debian/$paket.build - else - echo "build for compile_type not implemented." - exit 10 - fi - popd >/dev/null -} -function cmake_check { - pushd ../build >/dev/null - # do checks - if [ -e debian/$paket.build ] - then - echo "cmake is not compatible with other builds. Remove $paket.build" - exit 1 - fi - if [ -e debian/$paket.prebuild ] - then - echo "cmake is not compatible with other builds. Remove $paket.prebuild" - exit 2 - fi - - if [ -n "$cross" ] - then - # inject cross toolset - echo "set (CMAKE_MODULE_PATH $cross)" > CMakeLists.txt - echo "include(toolset)" >> CMakeLists.txt - cat debian/$paket.cmake >> CMakeLists.txt - else - cp debian/$paket.cmake CMakeLists.txt - fi - - echo "make" > debian/$paket.build - chmod 755 debian/$paket.build - cmake . - popd >/dev/null -} -function check_unversioned { - # has to be called in the projects base directory - # result: "M" in stdout or nothing - set -e - - # check if build is running in a sandbox - if ! [ -f .cm.ignore ] - then - # we create one - echo ".cm.ignore" > .cm.ignore - echo "debian.*" >> .cm.ignore - echo "up.*" >> .cm.ignore - fi - - # add auto created files to .cm.ignore - if ! grep Makefile .cm.ignore >/dev/null ; then echo "Makefile" >>.cm.ignore; fi - if ! grep configure .cm.ignore >/dev/null ; then echo "configure" >>.cm.ignore; fi - if ! grep debian/rules .cm.ignore >/dev/null ; then echo "debian/rules" >>.cm.ignore; fi - if ! grep debian/rules.pre .cm.ignore >/dev/null ; then echo "debian/rules.pre" >>.cm.ignore; fi - if ! grep debian/setenv.sh .cm.ignore >/dev/null ; then echo "debian/setenv.sh" >>.cm.ignore; fi - if ! grep debian/tmp .cm.ignore >/dev/null ; then echo "debian/tmp" >>.cm.ignore; fi - - project=$(pwd) - project=${project##*/} - pushd .. >/dev/null - mCM $project -b -an > /dev/null - wc=$(wc $project.batch) - rm $project.batch - if [ "${wc:0:1}" != "1" ] - then - echo "M" - fi - popd >/dev/null -} - -function set_build { - set -e - if [ -e .svn ] - then - version="0.0" - build=$(svnversion) - build=${build/:/-} - build="$build$(check_unversioned)" - elif [ -e .git ] - 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 - changes=$(check_unversioned) - tag="$tag$changes" - version=${tag##*_} - version=${version%%-*} - build=${tag##*-} - else - echo "No configuration system found. Cannot determine version." - exit 3 - fi -} - -function check_version { - set -e - - vline=$(head -1 debian/$paket.changelog) - vline=${vline%-*} - clversion=${vline#*(} - if [ $version = "0.0" ] - then - version=$clversion - return - fi - - # do no check on a modified git repos - if [ "${build: -1}" == "M" ] - then - return - fi - - if [ "$clversion" != $version ] - then - echo "version mismatch: git: $version, changelog: $clversion" - exit 4 - fi -} - -function add_sources { - echo "Anz: $#" - for suf in $* - do - find . -name "*.$suf" -exec echo " "{}" \\" >> make.pre \; - done - if [ $# -eq 2 ] - then - rm make.tmp || true - find . -name "*.$2" -exec echo {} >> make.tmp \; - while read line - do - echo " ${line/\.$2/\.$1} \\" >> make.pre - done < make.tmp - fi -} - -############################################################################## -# Main program -############################################################################## - -install_dir="/" -compile_type=NONE -extern_build=0 - -while [ $OPTIND -le "$#" ] -do - if getopts "ha:bc:C:d:e:i:n:t:v:V" opt - then - case $opt in - h) echo_usage - exit 0 - ;; - a) ARCH=$OPTARG - ;; - b) extern_build=1 - ;; - c) compile_type=$OPTARG - ;; - C) cross=$OPTARG - ;; - d) compile_dir=$OPTARG - ;; - e) compile_target=$OPTARG - ;; - i) install_dir=$OPTARG - ;; - n) target_name=$OPTARG - ;; - t) target_type=$OPTARG - ;; - v) optversion=$OPTARG - ;; - V) optversion="0.0" - ;; - \?) echo "Invalid option: -$OPTARG" - echo_usage - exit 5 - ;; - :) echo "Option -$OPTARG requires an argument." - echo_usage - exit 6 - ;; - esac - else - paket="${!OPTIND}" - eval OPTIND=OPTIND+1 - fi -done - -if [ -z "$paket" ] -then - echo_usage - exit 7 -fi - -if [ -n "$ARCH" -a -n "$cross" ] -then - echo "invalid options: supply -a for multiarch or -C for explicit cross compile environment" - exit 8 -fi - -if [ ! -e Makefile ] -then - ln -s /usr/share/mbuild/rules Makefile -fi - -# delete changelog and control -rm debian/changelog debian/control debian/README.debian debian/copyright 2>/dev/null || true - -# mconfigure builds 2 environment files: setenv.sh + rules.pre -echo "paket=$paket" > debian/rules.pre -echo "INSTALL_DIR=$install_dir" >> debian/rules.pre -if [ -e debian/setenv.sh ]; then rm debian/setenv.sh; fi - -if [ -n "$cross" ] -then - if [ ${cross:0:1} != "/" ] - then - cross="/opt/cross/$cross" - #export $cross - fi - if [ -f "$cross/setenv.sh" ] - then - . "$cross/setenv.sh" - cp $cross/setenv.sh debian/setenv.sh - fi - if [ -z "$ARCH" ] - then - # determine architecture - GNU_ARCH=${cross%-*} # assumed format: DEB_HOST_GNU_TYPE-g++version, e.g. arm-linux-gnueabihf-4.9 - GNU_ARCH=${GNU_ARCH##*/} - arch_opt="-t $GNU_ARCH" - fi -fi - -if [ -n "$ARCH" ] -then - arch_opt="-a $ARCH" -fi -dpkg-architecture $arch_opt >> debian/setenv.sh - -echo "paket=$paket" >> debian/setenv.sh - -set_build -if [ -z "$optversion" ] -then - check_version -else - version=$optversion -fi -echo "version=$version" >> debian/rules.pre -echo "version=$version" >> debian/setenv.sh -echo "build=$build" >> debian/rules.pre -echo "build=$build" >> debian/setenv.sh - -# get repository name -# tmp=$(pwd) -# pwd=${tmp##*/} -# pwd=${pwd,,*} -# echo "pwd=$pwd" >> debian/rules.pre - -echo "building $paket with version/build=$version-$build" - -pushd debian >/dev/null -# ./debian ------------------------------------- - -ln -sf /usr/share/mbuild/rules . - -if [ -e tmp ] -then - rm -rf tmp -fi - -# check for pre/post installation scripts -if [ -f $paket.preinst ] -then - echo "add_inst_tgt += debian/tmp/DEBIAN/preinst" >> rules.pre -fi -if [ -f $paket.postinst ] -then - echo "add_inst_tgt += debian/tmp/DEBIAN/postinst" >> rules.pre -fi -if [ -f $paket.prerm ] -then - echo "add_inst_tgt += debian/tmp/DEBIAN/prerm" >> rules.pre -fi -if [ -f $paket.postrm ] -then - echo "add_inst_tgt += debian/tmp/DEBIAN/postrm" >> rules.pre -fi - -# check for README.debian -if [ -f $paket.README.debian ] -then - cp $paket.README.debian README.debian -fi - -mkdir -p tmp/DEBIAN - -# add export to setenv.sh -sed -i "s/^/export /" setenv.sh - -popd >/dev/null -# ./. --------------------------------------------- - -# build prepare -if [ -x debian/$paket.prepare ] -then - . debian/setenv.sh - debian/$paket.prepare -fi - -if [ "$compile_type" == "NONE" ] -then - echo "BUILD=nobuild" >> debian/rules.pre -else - echo "BUILD=build" >> debian/rules.pre - - if [ $extern_build -eq 1 ] - then - BUILD_DIR=~/build - echo "BUILD_DIR=~/build" >> debian/rules.pre - debian/rules sync - fi - - # .build - if [ "$compile_type" != "CMAKE" -a "$compile_type" != "ANY" ] - then - cp debian/rules.pre $BUILD_DIR/$compile_dir/make.pre - pushd $BUILD_DIR/$compile_dir >/dev/null - ln -sf /usr/share/mbuild/makefile . - if [ -n "$sources_suffix" ] - then - echo "SOURCES = \\" >> make.pre - for suf in $sources_suffix - do - find . -name "*.$suf" -exec echo " "{}" \\" >> make.pre \; - done - echo >> make.pre - fi - popd >/dev/null - fi - - if [ "$compile_type" == "PDF" ] - then - pushd $BUILD_DIR/$compile_dir >/dev/null - echo "SOURCES = \\" >> make.pre - add_sources tex xml - echo >> make.pre - popd >/dev/null - fi - if [ -x debian/$paket.prebuild ] - then - pushd $BUILD_DIR >/dev/null - . debian/setenv.sh - debian/$paket.prebuild - popd >/dev/null - fi - if ! [ -x debian/$paket.build -o -f debian/$paket.cmake ] - then - create_build - fi - - # .cmake - if [ -e debian/$paket.cmake ] - then - cmake_check - fi -fi - - diff --git a/tools/make/cpp.make b/tools/make/cpp.make deleted file mode 100644 index 7f318af..0000000 --- a/tools/make/cpp.make +++ /dev/null @@ -1,25 +0,0 @@ -# Generic cpp makefile for mBuild build process - -# default parameters -CC = $(PREFIX)g++ -CXX = $(PREFIX)g++ - -include make.pre - -# All Target -all: $(DEPS) $(SOURCE:%.cpp=%.o) $(TARGET) - -# Other Targets -clean: - -rm *.o - -rm $(TARGET) - -.PHONY: all make.post - -%.a: $(SOURCE:%.cpp=%.o) - ar r $(TARGET) *.o - -%.so: $(SOURCE:%.cpp=%.o) $(LDLIBS) - echo $(PATH) - $(CXX) -shared $(SYSROOT) -o $(TARGET) *.o $(LDFLAGS) $(LDLIBS) $(EXTLIB) --include make.post diff --git a/tools/make/create-conffiles b/tools/make/create-conffiles deleted file mode 100755 index 258a350..0000000 --- a/tools/make/create-conffiles +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -set -e - -if [ $# -ne 1 ]; then - echo "usage: create-conffiles BASE_DIR" - exit 1 -fi - -cd $1 -if [ -d etc ] -then - mkdir -p DEBIAN - for files in $(find etc -type f); do - echo "/$files" >> DEBIAN/conffiles - done -fi - diff --git a/tools/make/mconfigure b/tools/make/mconfigure deleted file mode 100755 index 466eb15..0000000 --- a/tools/make/mconfigure +++ /dev/null @@ -1,222 +0,0 @@ -#!/bin/bash -set -e - -function echo_usage { - echo "usage: mconfigure [options] " - echo " -o: old style build (not recommended" - ./configure -h -} - -function create_conf { - if [ -f "debian/$paket.cmake" ] - then - echo "compile_type=CMAKE" > debian/$paket.conf - elif [ -f "debian/$paket.build" ] - then - if [ -f "debian/$paket.cpp" ] - then - echo "compile_type=CPP" > debian/$paket.conf - else - echo "compile_type=ANY" > debian/$paket.conf - fi - else - echo "compile_type=NONE" > debian/$paket.conf - fi - - if [ -f "$paket.control" -a -f "$paket.cp" ] - then - echo "target_type=DEB" >> debian/$paket.conf - else - echo "target_type=FILE" >> debian/$paket.conf - fi - echo "$paket.conf created." -} - -############################################################################## -# Main program -############################################################################## - -if [ ! -d debian ] -then - echo "run mconfigure in the project base directory with a debian directory in it!" - exit 2 -fi - -configure=0 -configure_args="-i debian/tmp" -while [ $OPTIND -le "$#" ] -do - if getopts "o" opt - then - case $opt in - o) old_build=1 - ;; - \?) $confirure_args="$configure_ars -$OPTARG" - if [ $OPTARG="a" -o $OPTARG="C" -o $OPTARG="i" -o $OPTARG="v" ] - then - eval OPTIND=OPTIND+1 - $confirure_args="$configure_ars ${!OPTIND}" - fi - ;; - :) echo "Option -$OPTARG requires an argument." - echo_usage - exit 3 - ;; - esac - else - paket="${!OPTIND}" - eval OPTIND=OPTIND+1 - fi -done - -if [ -z "$paket" ] -then - echo_usage - exit 4 -fi - -if [ ! -f debian/$paket.conf ] -then - # check if any files for $paket are present - if ! ls debian/$paket.* 2>/dev/null - then - echo "$paket is no build target in this repository." - exit 5 - fi - - # build conf file - echo "$paket.conf missing. We create it ..." - create_conf -fi - -if [ ! -e configure ] -then - ln -s /usr/share/mbuild/configure . -fi - -# clean build directory -if [ "$compile_type" != "NONE" ] -then - if [ -e ~/build ] - then - rm -rf ~/build - mkdir ~/build - fi - configure_args="$configure_args -d ~/build" -fi - -# perform configure -. debian/$paket.conf -if [ -n "$old_build" ] -then - rm debian/$paket.conf -fi - -if [ "$compile_type" != "NONE" ] -then - configure_args="$configure_args -b" - if [ -n "$compile_dir" ] - then - configure_args="$configure_args -d $compile_dir" - fi - if [ -z "$compile_type" ] - then - echo "compile_type required in $paket.conf" - exit 51 - fi - configure_args="$configure_args -c $compile_type" - if [ -z "$compile_target" ] - then - echo "compile_target required in $paket.conf" - exit 52 - fi - configure_args="$configure_args -e $compile_target" -fi -if [ "$target_type" == "FILE" ] -then - # no version needed - configure_args="$configure_args -V" -fi -configure_args="$configure_args $paket" -echo "Executing ./configure $configure_args ..." -./configure $configure_args - -if [ "$compile_type" != "NONE" ] -then - if grep -- "-prepare" debian/$paket.build >/dev/null - then - echo "prepare in .build no longer supported. Use .prebuild" - exit 6 - fi - # sync build dir - . debian/setenv.sh - debian/rules sync - make -fi - -# pack prepare -if [ "$target_type" == "DEB" ] -then - if [ ! -f debian/$paket.cp ] - then - echo "debian/$paket.cp missing for target type DEB" - exit 9 - fi - if [ ! -f debian/$paket.control ] - then - echo "debian/$paket.control missing for target type DEB" - exit 10 - fi - - echo "PACK=binary" >> debian/rules.pre - if grep "^Architecture: *all" debian/$paket.control >/dev/null - then - echo "arch = all" >> debian/rules.pre - echo 'BINARY_INDEP = copy ../$(paket)_$(version)-$(build)_all.deb' >> debian/rules.pre - else - echo 'arch = ${DEB_HOST_ARCH}' >> debian/rules.pre - echo "BINARY_ARCH = copy ../${paket}_$version-${build}_"'$(arch).deb' >> debian/rules.pre - fi - if ! [ -f debian/$paket.changelog ] - then - echo "changelog_source = debian/default.changelog" >> debian/rules.pre - if [ -f debian/default.changelog ] - then - rm debian/default.changelog - fi - fi -elif [ "$target_type" == "ZIP" ] -then - echo "PACK=zip" >> debian/rules.pre - if [ ! -f debian/$paket.cp ] - then - echo "debian/$paket.cp missing for target type ZIP" - exit 11 - fi -elif [ "$target_type" == "FILE" ] -then - echo "PACK=version" >> debian/rules.pre - if [ "$compile_type" != "ANY" ] - then - if [ -z "$compile_target" ] - then - echo "compile_target is needed for target_type FILE" - exit 12 - fi - echo "COMPILE_TARGET = $compile_target" >> debian/rules.pre - if [ -n "$target_name" ] - then - echo "TARGET = $target_name" >> debian/rules.pre - else - echo "TARGET = $paket" >> debian/rules.pre - fi - fi -else - echo "Unknown target type: $target_type" - exit 13 -fi - -# build package -debian/rules pack - - diff --git a/tools/make/rules b/tools/make/rules deleted file mode 100755 index e54228c..0000000 --- a/tools/make/rules +++ /dev/null @@ -1,127 +0,0 @@ -#!/usr/bin/make -f - -# Generic rules for mBuild build process - -# defile default operations -NOP = @echo "No operation for target $@" -DEB = fakeroot dpkg-deb --build debian/tmp -INSERT_BUILD = /usr/share/mbuild/insert_build.sh -RSYNC_OPT = -av --exclude="build" --exclude="debian/tmp" --exclude="Packages" --exclude="*Aktuell" --exclude=".*" -BUILD_DIR = . - -std_inst_tgt = debian/tmp/usr/share/doc/$(paket)/copyright debian/tmp/usr/share/doc/$(paket)/README.debian -changelog_source = debian/$(paket).changelog - -include debian/rules.pre - -.PHONY: build - -default: $(BUILD) - -# Löschen aller kompilierten, erzeugten und nicht benötigten Dateien im Bauverzeichnis -clean: - -rm -rf debian/tmp - -# Bauen der kompilierten Programme und formatierten Dokumente aus den Quellen im Bauverzeichnis -build: $(BUILD_DIR)/debian/$(paket).build sync - cd $(BUILD_DIR) ; debian/$(paket).build - # Build succeeded - -nobuild: - # No build required - -install: - debian/$(paket).cp $(INSTALL_DIR) - -pack: $(PACK) - # packing succeeded - -# Bauen der kompilierten architekturabhängigen Programme aus den Quellen im Bauverzeichnis -build-arch: - -# Bauen der architekturunabhängigen formatierten Dokumente aus den Quellen im Bauverzeichnis -build-indep: - -# Installieren der Dateien in einen Verzeichnisbaum unterhalb des Verzeichnisses debian für jedes Binärpaket. Falls sie festgelegt wurden, hängen binary*-Ziele effektiv von diesem Ziel ab (optional) -install: - -# Erstellen aller Binärpakete (effektiv ist dies die Kombination der binary-arch- und binary-indep-Ziele) -binary: binary-arch binary-indep - -# Erstellen Architektur-abhängiger (Architecture: any) Binärpakete im übergeordneten Verzeichnis -binary-arch: $(BINARY_ARCH) - -# Erstellen Architektur-unabhängiger (Architecture: all) Binärpakete im übergeordneten Verzeichnis -binary-indep: $(BINARY_INDEP) - -version: $(BUILD_DIR)/$(TARGET) - $(INSERT_BUILD) $(BUILD_DIR)/$(TARGET) $(build) - cp $(BUILD_DIR)/*$(build)* ../ - -$(BUILD_DIR)/$(TARGET): $(BUILD_DIR)/$(COMPILE_TARGET) - cp $(BUILD_DIR)/$(COMPILE_TARGET) $(BUILD_DIR)/$(TARGET) - -$(BUILD_DIR): - mkdir $(BUILD_DIR) - -sync: $(BUILD_DIR) - rsync $(RSYNC_OPT) ./ $(BUILD_DIR)/ - -copy: debian/$(paket).cp install - create-conffiles debian/tmp - touch debian/tmp - -../$(paket)_$(version)-$(build)_$(arch).deb:debian/tmp/DEBIAN/control $(std_inst_tgt) $(add_inst_tgt) debian/tmp - $(DEB) - mv debian/tmp.deb ../$(paket)_$(version)-$(build)_$(arch).deb - -debian/tmp/DEBIAN/control: debian/control debian/changelog - dpkg-gencontrol - -debian/control: debian/$(paket).control - sed "s/_DEB_HOST_ARCH/${DEB_HOST_ARCH}/" debian/$(paket).control > debian/control - -debian/changelog: $(changelog_source) debian/rules.pre - sed "s/%BUILD%/$(build)/" $(changelog_source) > debian/changelog - -debian/tmp/usr/share/doc/$(paket)/changelog: debian/changelog - mkdir -p debian/tmp/usr/share/doc/$(paket) - cp debian/changelog debian/tmp/usr/share/doc/$(paket)/changelog - -debian/tmp/usr/share/doc/$(paket)/copyright: debian/copyright - mkdir -p debian/tmp/usr/share/doc/$(paket) - cp debian/copyright debian/tmp/usr/share/doc/$(paket)/copyright - -debian/tmp/usr/share/doc/$(paket)/README.debian: debian/README.debian - mkdir -p debian/tmp/usr/share/doc/$(paket) - cp debian/README.debian debian/tmp/usr/share/doc/$(paket)/README.debian - -debian/tmp/DEBIAN/preinst: debian/$(paket).preinst - cp debian/$(paket).preinst debian/tmp/DEBIAN/preinst - -debian/tmp/DEBIAN/postinst: debian/$(paket).postinst - cp debian/$(paket).postinst debian/tmp/DEBIAN/postinst - -debian/tmp/DEBIAN/prerm: debian/$(paket).prerm - cp debian/$(paket).prerm debian/tmp/DEBIAN/prerm - -debian/tmp/DEBIAN/postrm: debian/$(paket).postrm - cp debian/$(paket).postrm debian/tmp/DEBIAN/postrm - -debian/README.debian: - echo "developed under:" > debian/README.debian - cat /etc/issue >> debian/README.debian - echo "Architecture: $(arch)" >> debian/README.debian - -debian/copyright: - cp /usr/share/mbuild/copyright debian/copyright - -debian/default.changelog: - @echo "$(paket) ($(version)-$(build)) unstable; urgency=medium" >debian/default.changelog - @echo " * generated" >>debian/default.changelog - @echo " -- Michael Wagner Thu, 11 Feb 2021 10:00:00 +0100" >>debian/default.changelog - -# Load project specification --include rules.post - -