New additions and edits.

This commit is contained in:
cyteen 2020-11-05 11:23:08 +00:00
parent 7fd34d4d9e
commit 42be22f792
17 changed files with 928 additions and 102 deletions

View File

@ -1,6 +1,7 @@
#!/usr/bin/env bash
sudo apt install -y --reinstall qemu qemu-user-static binfmt-support
sudo update-binfmts --enable qemu-aarch64
sudo update-binfmts --enable qemu-arm
sudo sed -i '10s/^$/yes/g' /var/lib/binfmts/qemu-arm /var/lib/binfmts/qemu-aarch64
@ -8,3 +9,4 @@ sudo /etc/init.d/binfmt-support restart
# test
sudo docker run --rm -it arm64v8/busybox echo Hello World
sudo docker run --rm -it armhf/busybox echo Hello World

View File

@ -7,8 +7,8 @@ ARDUINO_DIR=${ARDUINO_HOME}/arduino-${ARDUINO_VERSION}/
ARDUINO_TOOLS_DIR=${ARDUINO_DIR}
ADD_URLS=
mkdir "${ARDUINO_TOOLS_DIR}"
sudo apt install -y gcc-arm-none-eabi openocd bsdtar
mkdir -p "${ARDUINO_TOOLS_DIR}"
sudo apt install -y gcc-arm-none-eabi openocd libarchive-tools
cd /var/tmp || exit
@ -37,14 +37,14 @@ ${ARDUINO_DIR}/arduino \
# arduino [--install-boards package name:platform architecture[:version]]
${ARDUINO_DIR}/arduino --install-boards esp32:esp32
# ESP32-core from git 369MB
mkdir -p ${ARDUINO_DIR}/hardware/espressif && \
cd ${ARDUINO_DIR}/hardware/espressif && \
git clone https://github.com/espressif/arduino-esp32.git esp32 && \
cd esp32 && \
git submodule update --init --recursive && \
cd tools/ && \
python3 get.py
## ESP32-core from git 369MB Choose this or the above otherwise you will get two menus
#mkdir -p ${ARDUINO_DIR}/hardware/espressif && \
# cd ${ARDUINO_DIR}/hardware/espressif && \
# git clone https://github.com/espressif/arduino-esp32.git esp32 && \
# cd esp32 && \
# git submodule update --init --recursive && \
# cd tools/ && \
# python3 get.py
# Install ESP8266
cd /var/tmp || exit

176
020_cfmesh-cfdof.sh Executable file
View File

@ -0,0 +1,176 @@
#!/usr/bin/env bash
set -x
sudo apt install -y \
dh-autoreconf \
dh-make \
check
USER="Arkq"
PROJECT="cfmesh-cfdof"
LICENSE="mit"
SECTION="science"
HOMEPAGE="https://sourceforge.net/projects/cfmesh-cfdof/files/"
BUILD_HOME="/var/tmp/cfmesh-cfdof-git_build"
#VERSION="2.1.0"
PACKAGE="cfmesh-cfdof"
NOW=`date +"%Y-%m-%d"`
#VERSION=$(curl "https://api.github.com/repos/${USER}/${PROJECT}/tags?per_page=5" | jq -r '.[0] | .name')
#VERSION=${VERSION:1} # strip the preceding 'v'
DEBEMAIL="person@company.tld"
DEBFULLNAME="Testy McTester"
DESCRIPTION="Advanced mult-material CFD meshing"
LONG_DESCRIPTION=" A fork of the cfMesh project ported to the latest OpenFOAM versions."
# Make the BUILD_HOME directory and clone upstream
mkdir -p ${BUILD_HOME}
cd ${BUILD_HOME} || exit
#git clone https://github.com/${USER}/${PROJECT}.git ${PACKAGE}-${VERSION}
git clone https://git.code.sf.net/p/cfmesh-cfdof/cfmesh cfmesh-cfdof-${NOW}
cd ${PACKAGE}-${NOW} || exit
mkdir -p m4
cat <<EOF > .git/gbp.conf
[DEFAULT]
# this is the upstream-branch:
upstream-branch=master
EOF
# debianize the BUILD_HOME directory
echo ${DEBFULLNAME}
dh_make \
--createorig \
--single \
--native \
--copyright ${LICENSE} \
--yes
# Customize the debian directory values
#sed -i 's,^\(Description: \).*,\1'${DESCRIPTION}',' debian/control
sed -i "s,^\(Description: \).*,\1${DESCRIPTION}," debian/control
sed -i 's,^\(Section: \).*,\1'${SECTION}',' debian/control
sed -i "s,^\(Maintainer: \).*,\1'${DEBFULLNAME}\ \<${DEBEMAIL}\>'," debian/control
sed -i 's,^\(Homepage: \).*,\1'${HOMEPAGE}',' debian/control
sed -i "s/.*insert\ long.*/${LONG_DESCRIPTION}/" debian/control
echo ****************
cat debian/control
echo ****************
BUILD_OPTIONS="--enable-aac --enable-ofono --enable-debug"
cat <<EOF > debian/rules
#!/usr/bin/make -f
%:
dh \$@
override_dh_auto_configure:
dh_auto_configure -- ${BUILD_OPTIONS}
EOF
cat <<EOF > debian/watch
version=4
opts=filenamemangle=s/.+\/v?(\d\S+)\.tar\.gz/${PROJECT}-$1\.tar\.gz/ \
https://github.com/${USER}/${PROJECT}/tags .*/v?(\d\S+)\.tar\.gz
EOF
dpkg-buildpackage -us -uc -b
echo ${PACKAGE}_${VERSION}_amd64.deb
sudo dpkg -i ../${PACKAGE}_${VERSION}_amd64.deb
#-------------------------------------------------------------------------------
## When BlueALSA has been created, then you can start BlueALSA as background task:
#bluealsa --disable-hfp &
# Now - for using your bluetooth-speaker/headset - with BlueALSA you have to intoduce the device to the bluetooth-stack using bluetoothctl:
# bluetoothctl >
# scan on
# [NEW] Device 30:23:23:F4:48:2C TH-S10U
# scan off
# pair 30:23:23:F4:48:2C
# trust 30:23:23:F4:48:2C
# exit
# After that power off&on the bt-speaker device and the device will connect automatically as a trusted device.
# Before we try our first audio-command we had to export one thing to make BlueALSA mor system-friendly:
export LIBASOUND_THREAD_SAFE=0
# autostart bluealsa
#cat <<EOF > /etc/rc.local
## Start bluealsa as root <https://github.com/Arkq/bluez-alsa>
#export LIBASOUND_THREAD_SAFE=0
#/usr/bin/bluealsa -S &
#EOF
# Text to speech:
# espeak "Hello, how are you?" -w /home/guido/espeak.wav -s145
# aplay -D bluealsa:HCI=hci0,DEV=30:23:23:F4:48:2C,PROFILE=a2dp /home/guido/espeak.wav
# arecord -D bluealsa capture.wav
# bluealsa-aplay XX:XX:XX:XX:XX:XX
# $ aplay -D bluealsa:SRV=org.bluealsa,DEV=XX:XX:XX:XX:XX:XX,PROFILE=sco Bourree_in_E_minor.wav
# amixer -D bluealsa sset '<control name>' 70%
# amixer -D bluealsa sset 'Jabra MOVE v2.3.0 - A2DP' 50%
# Internetradio:
# mpg123 -a bluealsa:HCI=hci0,DEV=30:23:23:F4:48:2C,PROFILE=a2dp -@ /home/guido/ffh80s.pls
# For shorting the command you could create a ~/.asoundrc with the following content:
# defaults.bluealsa.interface "hci0"
# defaults.bluealsa.device "30:23:23:F4:48:2C"
# defaults.bluealsa.profile "a2dp"
# defaults.bluealsa.delay 10000
# Now you can the shorter version of the command:
# mpg123 -a bluealsa -@ /home/guido/ffh80s.pls
# For set the volume of such a device you have to know the "real" name of the device out of the bluetoothctl and the name of the used protocol:
# Device: 30:23:23:F4:48:2C TH-S10U
# Protocol: A2DP
# amixer -D bluealsa sset 'TH-S10U - A2DP ' 70%
#------------------------------------------------------------------------
## ldacBT
##
## AOSP libldac dispatcher
## https://android.googlesource.com/platform/external/libldac
## https://github.com/EHfive/ldacBT
#git clone https://github.com/EHfive/ldacBT.git
#cd ldacBT
#git submodule update --init
#
#mkdir build && cd build
#cmake \
# -DCMAKE_INSTALL_PREFIX=/usr \
# -DINSTALL_LIBDIR=/usr/lib \
# -DLDAC_SOFT_FLOAT=OFF \
# ../
#make DESTDIR=$DEST_DIR install
#------------------------------------------------------------------------
## [open]aptx - reverse-engineered apt-X
## https://github.com/Arkq/openaptx
#------------------------------------------------------------------------

128
020_docker-buildx.sh Normal file
View File

@ -0,0 +1,128 @@
#!/usr/bin/env bash
ARCH=$(dpkg --print-architecture)
if [[ ${ARCH} == "armhf" ]]; then ARCH="arm-v7"; fi
USER="docker"
PROJECT="buildx"
LICENSE="apache2"
SECTION="admin"
HOMEPAGE="https://docs.docker.com/buildx/working-with-buildx/"
BUILD_HOME="/var/tmp/buildx_build"
#VERSION="2.1.0"
PACKAGE="docker-buildx"
VERSION=$(curl "https://api.github.com/repos/${USER}/${PROJECT}/tags?per_page=5" | jq '[ .[] | select(.name|test("v[[:digit:].]+$"))]|.[0] | .name')
DEB_VERSION=$(echo ${VERSION} | tr -d "\"" | tr -d "v") # strip the preceding 'v'
#VERSION="1.0.0"
DEBEMAIL="person@company.tld"
DEBFULLNAME="Testy McTester"
DESCRIPTION="."
LONG_DESCRIPTION=" ."
REQUIRES="docker-ce"
BUILD_DIR="/var/tmp/buildx_build"
WORKDIR="/var/tmp/buildx_build"
## Checkinstall variables - see defaults in /etc/checkinstallrc
DOC_DIR=/usr/share/doc
# make a new temporary directory for this use to avoid permission issues.
BASE_TMP_DIR=~/tmptmp/checkinstall_tmp
#-------------------------------------------------------------------------------
mkdir -p ${BUILD_DIR}
## Create and populate the install scripts and documentation for checkinstall
cat > ${BUILD_DIR}/description-pak << EOF
Docker Buildx is a CLI plugin that extends the docker command with the full support of the features provided by Moby BuildKit builder toolkit. It provides the same user experience as docker build with many new features like creating scoped builder instances and building against multiple nodes concurrently.
EOF
# | preinstall-pak | Run BEFORE the package is INSTALLED |
cat > ${BUILD_DIR}/preinstall-pak << EOF
#!/usr/bin/env bash
EOF
# | postinstall-pak | Run AFTER the package is INSTALLED |
cat > ${BUILD_DIR}/postinstall-pak << EOF
#!/usr/bin/env bash
EOF
# | preremove-pak | Run BEFORE the package is REMOVED |
cat > ${BUILD_DIR}/preremove-pak << EOF
#!/usr/bin/env bash
EOF
# | postremove-pak | Run AFTER the package is REMOVED
cat > ${BUILD_DIR}/postremove-pak << EOF
#!/usr/bin/env bash
EOF
## Make the doc-pak directory for README, INSTALL, COPYING, Changelog, TODO, CREDITS
mkdir -p ${BUILD_DIR}/doc-pak
#cp README INSTALL COPYING Changelog TODO CREDITS doc-pak
cat > ${BUILD_DIR}/doc-pak/README << 'EOF'
Docker CLI plugin for extended build capabilities with BuildKit
buildx is Tech Preview
TL;DR
Familiar UI from docker build
Full BuildKit capabilities with container driver
Multiple builder instance support
Multi-node builds for cross-platform images
Compose build support
WIP: High-level build constructs (bake)
In-container driver support (both Docker and Kubernetes)
see: https://github.com/docker/buildx
EOF
cat > ${BUILD_DIR}/checkinstall_it.sh << FOE
## Checkinstall variables - see defaults in /etc/checkinstallrc
DOC_DIR=/usr/share/doc
# make a new temporary directory for this use to avoid permission issues.
BASE_TMP_DIR=~/tmptmp/checkinstall_tmp
mkdir -p '${BASE_TMP_DIR}'
# do your work
checkinstall -y --fstrans \
--pkgname=${PACKAGE} \
--pkgversion=${DEB_VERSION}\
--pkgrelease=${RELEASE} \
--pkgarch=${ARCH} \
--pkggroup=admin \
--pkglicense=LICENSE \
--pkgsource=${LATEST_URL} \
--maintainer=cyteen@ring-zero.co.uk \
--requires=${REQUIRES} \
--recommends=${RECOMENDS} \
--suggests=${SUGGESTS} \
-D \
bash ${BUILD_DIR}/install.sh
FOE
echo "Writing install.sh to: ${BUILD_DIR}/install.sh"
cat > ${BUILD_DIR}/install.sh << FOE
#!/usr/bin/env bash
set -e
#set -x
# buildx-${VERSION}.darwin-amd64
# buildx-${VERSION}.linux-amd64
# buildx-${VERSION}.linux-arm-v6
# buildx-${VERSION}.linux-arm-v7
# buildx-${VERSION}.linux-arm64
# buildx-${VERSION}.linux-ppc64le
# buildx-${VERSION}.linux-s390x
DEST_DIR=/root/.docker/cli-plugins
#mkdir -p ${DEST_DIR}
mkdir -p /root/.docker/cli-plugins
#wget -O ${DEST_DIR}/docker-buildx https://github.com/docker/${PROJECT}/releases/download/${VERSION}/buildx-${VERSION}.linux-${ARCH}
wget -O /root/.docker/cli-plugins/docker-buildx https://github.com/docker/${PROJECT}/releases/download/${VERSION}/buildx-${VERSION}.linux-${ARCH}
FOE
bash ${BUILD_DIR}/checkinstall_it.sh

View File

@ -18,12 +18,10 @@ bash -c "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7EA0A9C3F273FC
# Bypass apt-proxy for brave packages
if [ -d /etc/apt/apt.conf.d/02proxy ]; then
if [ ! -z $(grep ${URL}) ]; then
if [ -f /etc/apt/apt.conf.d/02proxy ]; then
if [ ! -z $(grep ${URL} /etc/apt/apt.conf.d/02proxy) ]; then
echo "Acquire::http::Proxy { \"${URL}\" DIRECT; };" >> /etc/apt/apt.conf.d/02proxy
fi
else
echo "Acquire::http::Proxy { \"${URL}\" DIRECT; };" >> /etc/apt/apt.conf.d/02proxy
fi
apt update

180
020_elmerfem.sh Executable file
View File

@ -0,0 +1,180 @@
#!/usr/bin/env bash
set -x
sudo apt install -y \
devscripts
USER="ElmerCSC"
PROJECT="elmerfem"
LICENSE="gpl2"
SECTION="science"
PRIORITY="optional"
MAINTAINER="Junani Kataja <juhmat@gmail.com"
BUILD_DEPENDS="cmake, build-essential, liblapack-dev, libblas-dev, libblas3, libopenmpi-dev, openmpi-bin, libmumps-dev, libhypre-dev, gfortran, gcc, g++, libparmetis-dev, libmetis-dev"
DEPENDS=" libmumps-5.1.2, libhypre-2.15.1, openmpi-bin, libblas3, liblapack3, libparmetis4.0, libmetis5, libgfortran4, libopenblas-base"
HOMEPAGE="http://www.elmerfem.org/"
BUILD_HOME="/var/tmp/elmerfem-git_build"
#VERSION="2.1.0"
PACKAGE="elmerfem-csc"
ARCHITECTURE="any"
VERSION=$(curl "https://api.github.com/repos/${USER}/${PROJECT}/tags?per_page=5" | jq -r '.[0] | .name')
#VERSION=${VERSION:1} # strip the preceding 'v'
#BRANCH=devel
#BRANCH=tensor_reluctivity
BRANCH=next_release
RELEASE=8.5
DEBEMAIL="juhmat@gmail.com"
DEBFULLNAME="Junani Kataja"
DESCRIPTION="Elmer multiphysics FEA package."
LONG_DESCRIPTION=" The Elmer open source mutiphysics simulation package includes physical models of fluid dynamics, structural mechanics, electromagnetics, heat transfer and acoustics, among others. These are described by partial differential equations which Elmer solves by the Finite Element Method (FEM).
Elmer includes physical models of fluid dynamics, structural mechanics, electromagnetics, heat transfer and acoustics."
# Make the BUILD_HOME directory and clone upstream
mkdir -p ${BUILD_HOME}
cd ${BUILD_HOME} || exit
git clone -b ${BRANCH} https://github.com/${USER}/${PROJECT}.git ${PACKAGE}-${RELEASE}
cd ${PACKAGE}-${RELEASE} || exit
mkdir -p m4
cat <<EOF > .git/gbp.conf
[DEFAULT]
# this is the upstream-branch:
upstream-branch=${BRANCH}
EOF
# debianize the BUILD_HOME directory
echo ${DEBFULLNAME}
dh_make -p ${PACKAGE}-${RELEASE}\
--createorig \
--single \
--native \
--copyright ${LICENSE} \
--yes
# Customize the debian directory values
#sed -i 's,^\(Description: \).*,\1'${DESCRIPTION}',' debian/control
sed -i "s,^\(Description: \).*,\1${DESCRIPTION}," debian/control
sed -i 's,^\(Section: \).*,\1'${SECTION}',' debian/control
sed -i 's,^\(Priority: \).*,\1'${PRIORITY}',' debian/control
sed -i "s,^\(Maintainer: \).*,\1'${DEBFULLNAME}\ \<${DEBEMAIL}\>'," debian/control
sed -i 's,^\(Homepage: \).*,\1'${HOMEPAGE}',' debian/control
sed -i 's,^\(Architecture: \).*,\1'${ARCHITECTURE}',' debian/control
sed -i 's,^\(Build-Depends: \).*,\1'${BUILD_DEPENDS}',' debian/control
sed -i 's,^\(Depends: \).*,\1'${DEPENDS}',' debian/control
sed -i "s/.*insert\ long.*/${LONG_DESCRIPTION}/" debian/control
echo ****************
cat debian/control
echo ****************
cat <<EOF > debian/autoreconf
EOF
cat <<EOF > debian/autoreconf
eio matc elmerparam hutiter meshgen2d fem front elmergrid post
EOF
cat <<EOF > debian/libelmsolver-${RELEASE}.prerm
#!/bin/sh -e
# Remove alternatives links
if [ "$1" = "remove" ]; then
update-alternatives --remove elmersolver /usr/lib/elmersolver-${RELEASE}
fi
#DEBHELPER#
EOF
cat <<EOF > debian/libelmsolver-${RELEASE}.postinst
#!/bin/sh -e
# Make alternatives links
if [ "$1" = "configure" ]; then
update-alternatives --install /usr/lib/elmersolver elmersolver \
/usr/lib/elmersolver-${RELEASE} 6100
fi
#DEBHELPER#
EOF
cat <<EOF > debian/buildopts_debian.cmake
SET(WITH_MPI TRUE CACHE BOOL "")
SET(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "")
SET(WITH_MATC TRUE CACHE BOOL "")
SET(WITH_Mumps TRUE CACHE BOOL "")
SET(WITH_Hypre TRUE CACHE BOOL "")
SET(HYPRE_INCLUDE_DIR "/usr/include/hypre" CACHE PATH "")
SET(HYPREROOT "/usr" CACHE PATH "")
SET(WITH_ElmerIce TRUE CACHE BOOL "")
SET(ELMER_SOLVER_HOME "/usr/share/elmersolver" CACHE PATH "")
# ElmerGUI related.
SET(WITH_ELMERGUI FALSE CACHE BOOL "")
SET(WITH_OCC TRUE CACHE BOOL "")
SET(WITH_VTK TRUE CACHE BOOL "")
SET(WITH_PARAVIEW TRUE CACHE BOOL "")
SET(WITH_QWT TRUE CACHE BOOL "")
SET(WITH_LUA TRUE CACHE BOOL "")
EOF
cat <<EOF > debian/rules
#!/usr/bin/make -f
BUILDDIR = build_dir
# secondly called by launchpad
build:
mkdir $(BUILDDIR);
cd $(BUILDDIR); cmake -C ../debian/buildopts_debian.cmake -DCMAKE_INSTALL_PREFIX=../debian/tmp/usr ..
make -j4 -C $(BUILDDIR)
# thirdly called by launchpad
binary: binary-indep binary-arch
binary-indep:
# nothing to be done
binary-arch:
cd $(BUILDDIR); cmake -P cmake_install.cmake
mkdir debian/tmp/DEBIAN
dpkg-gencontrol -pelmerfem-csc
dpkg --build debian/tmp ..
# firstly called by launchpad
clean:
rm -f build
rm -rf $(BUILDDIR)
.PHONY: binary binary-arch binary-indep clean
EOF
cat <<EOF > debian/watch
version=4
opts=filenamemangle=s/.+\/v?(\d\S+)\.tar\.gz/${PROJECT}-$1\.tar\.gz/ \
https://github.com/${USER}/${PROJECT}/tags .*/v?(\d\S+)\.tar\.gz
https://github.com/ElmerCSC/elmerfem/tags
https://github.com/ElmerCSC/elmerfem/archive/scc20.tar.gz
EOF
sudo mk-build-deps --install debian/control
#sudo dpkg -i ${PACKAGE}-build-deps_${RELEASE}_all.deb
sudo rm debian/*ex debian/*EX
echo ""
sudo dpkg-buildpackage -us -uc -b
echo ${PACKAGE}_${VERSION}_amd64.deb
sudo dpkg -i ../${PACKAGE}_${VERSION}_amd64.deb

View File

@ -2,15 +2,24 @@
# https://github.com/FreeCAD/FreeCAD/releases/
# debian is still on 0.16 but 0.17 is needed for current workbenches
# If building, use cmake gui for configuring the build.
sudo apt install -y cmake-qt-gui python-numpy python3-numpy z88
# the ppa has calculix-ccx eigen3 freecad-daily (0.18~beta1) opencascade
# ppa:freecad-maintainers/freecad-daily
# sudo add-apt-repository ppa:freecad-maintainers/freecad-daily
# sudo apt update
YOUR_UBUNTU_VERSION_HERE=bionic # 18.04 buster/sid
# groovy focal eoan disco cosmic bionic artful xenial trusty
# daily: * * * *
# stable: * * * * *
# community: * * * *
# elmer: * * * * * *
# YOUR_UBUNTU_VERSION_HERE=goovy # 20.10 buster/sid
# YOUR_UBUNTU_VERSION_HERE=focal # 20.04 buster/sid
YOUR_UBUNTU_VERSION_HERE=eoan # 19.10 buster/sid
# YOUR_UBUNTU_VERSION_HERE=disco # 19.04 buster/sid
# YOUR_UBUNTU_VERSION_HERE=cosmic # 18.10 buster/sid
# YOUR_UBUNTU_VERSION_HERE=bionic # 18.04 buster/sid
# YOUR_UBUNTU_VERSION_HERE=artful # 17.10 stretch/sid
# YOUR_UBUNTU_VERSION_HERE=xenial # 16.04 stretch/sid
# YOUR_UBUNTU_VERSION_HERE=trusty # 14.04 jessie/sid
@ -22,82 +31,80 @@ EOF
sudo ln -sf /etc/apt/sources.list-available/freecad-daily.list /etc/apt/sources.list.d/freecad-daily.list
# Launchpad PPA for FreeCAD maintainers
# 1024R/83193AA3B52FF6FCF10A1BBF005EAE8119BB5BCA
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 19BB5BCA
sudo bash -c "cat > /etc/apt/sources.list-available/freecad-stable.list" <<EOF
deb http://ppa.launchpad.net/freecad-maintainers/freecad-stable/ubuntu $YOUR_UBUNTU_VERSION_HERE main
deb-src http://ppa.launchpad.net/freecad-maintainers/freecad-stable/ubuntu $YOUR_UBUNTU_VERSION_HERE main
EOF
sudo ln -sf /etc/apt/sources.list-available/freecad-stable.list /etc/apt/sources.list.d/freecad-stable.list
sudo bash -c "cat > /etc/apt/sources.list-available/elmer.list" <<EOF
deb http://ppa.launchpad.net/elmer-csc-ubuntu/elmer-csc-ppa/ubuntu $YOUR_UBUNTU_VERSION_HERE main
deb-src http://ppa.launchpad.net/elmer-csc-ubuntu/elmer-csc-ppa/ubuntu $YOUR_UBUNTU_VERSION_HERE main
sudo bash -c "cat > /etc/apt/sources.list-available/freecad-community.list" <<EOF
deb http://ppa.launchpad.net/freecad-community/ppa/ubuntu $YOUR_UBUNTU_VERSION_HERE main
deb-src http://ppa.launchpad.net/freecad-community/ppa/ubuntu $YOUR_UBUNTU_VERSION_HERE main
EOF
sudo ln -sf /etc/apt/sources.list-available/elmer.list /etc/apt/sources.list.d/elmer.list
sudo ln -sf /etc/apt/sources.list-available/freecad-community.list /etc/apt/sources.list.d/freecad-community.list
# 4096R/D2A62B5CEA1A30BBE1E44B561CDA5240F1B6CE9D
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F1B6CE9D
sudo bash -c "cat > /etc/apt/sources.list-available/elmer.list" <<EOF
deb http://ppa.launchpad.net/elmer-csc-ubuntu/elmer-csc-ppa/ubuntu $YOUR_UBUNTU_VERSION_HERE main
deb-src http://ppa.launchpad.net/elmer-csc-ubuntu/elmer-csc-ppa/ubuntu $YOUR_UBUNTU_VERSION_HERE main
EOF
sudo ln -sf /etc/apt/sources.list-available/elmer.list /etc/apt/sources.list.d/elmer.list
# 4096R/1FE4A88ACFEE8388A409F23A89358ABF9FB7E178
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9FB7E178
sudo apt update
## freecad
# Signing key: 1024R/83193AA3B52FF6FCF10A1BBF005EAE8119BB5BCA (What is this?)
# Fingerprint: 83193AA3B52FF6FCF10A1BBF005EAE8119BB5BCA
## elmer
# Signing key: 4096R/1FE4A88ACFEE8388A409F23A89358ABF9FB7E178 (What is this?)
# Fingerprint: 1FE4A88ACFEE8388A409F23A89358ABF9FB7E178
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 19BB5BCA
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9FB7E178
sudo apt install -y freecad calculix-ccx elmerfem-csc
#sudo ln -s /etc/apt/sources.list-available/devuan-ceres.list /etc/apt/sources.list.d/devuan-ceres.list
#sudo apt update
#sudo apt install -y -t unstable netgen
cd /usr/src
#sudo apt source netgen
#http://http.debian.net/debian/pool/main/n/netgen/netgen_4.9.13.dfsg-11.dsc
#http://http.debian.net/debian/pool/main/n/netgen/netgen_4.9.13.dfsg.orig.tar.gz
#http://http.debian.net/debian/pool/main/n/netgen/netgen_4.9.13.dfsg-11.debian.tar.xz
sudo gbp import-dsc -v --allow-unauthenticated http://http.debian.net/debian/pool/main/n/netgen/netgen_4.9.13.dfsg-11.dsc
cd netgen
sudo gbp dch --snapshot --auto
sudo gbp buildpackage --git-pbuilder --git-arch=amd64 --git-dist=ascii --git-ignore-branch
#sudo gbp buildpackage --git-pbuilder --git-arch=amd64 --git-dist=ascii --no-pristine-tar
#sudo gbp import-orig --upstream-version=0.1.6 --pristine-tar https://sigrok.org/download/source/sigrok-firmware-fx2lafw/sigrok-firmware-fx2lafw-0.1.6.tar.gz
#sudo gbp buildpackage --git-pbuilder --git-arch=amd64 --git-dist=ascii --othermirror="deb [trusted=yes] file:///srv/pbuilder/deps ./" --distribution=ascii --architecture=amd64
# Builds the folloeing:
#libnglib-4.9.13_4.9.13.dfsg-11_amd64.deb
#libnglib-4.9.13-dbgsym_4.9.13.dfsg-11_amd64.deb
#libnglib-dev_4.9.13.dfsg-11_amd64.deb
#netgen_4.9.13.dfsg-11_amd64.deb
#netgen-dbgsym_4.9.13.dfsg-11_amd64.deb
#netgen-doc_4.9.13.dfsg-11_all.deb
#netgen-headers_4.9.13.dfsg-11_amd64.deb
# The would be installed by apt install -f later but let be explicite.
sudo apt install \
tix \
liboce-ocaf-lite10 \
liboce-ocaf10 \
liboce-visualization10 \
libtogl1
# If building, use cmake gui for configuring the build.
sudo apt install -y cmake-qt-gui python3-numpy z88
sudo dpkg -i ../libnglib-4.9.13_4.9.13.dfsg-11_amd64.deb && dpkg -i ../netgen_4.9.13.dfsg-11_amd64.deb
sudo apt install -y freecad-daily calculix-ccx elmerfem-csc
sudo apt install -y -f
### Netgen
##sudo ln -s /etc/apt/sources.list-available/devuan-ceres.list /etc/apt/sources.list.d/devuan-ceres.list
##sudo apt update
##sudo apt install -y -t unstable netgen
#
#cd /usr/src
##sudo apt source netgen
##http://http.debian.net/debian/pool/main/n/netgen/netgen_4.9.13.dfsg-11.dsc
##http://http.debian.net/debian/pool/main/n/netgen/netgen_4.9.13.dfsg.orig.tar.gz
##http://http.debian.net/debian/pool/main/n/netgen/netgen_4.9.13.dfsg-11.debian.tar.xz
#
#sudo gbp import-dsc -v --allow-unauthenticated http://http.debian.net/debian/pool/main/n/netgen/netgen_4.9.13.dfsg-11.dsc
#
#cd netgen
#sudo gbp dch --snapshot --auto
#
#sudo gbp buildpackage --git-pbuilder --git-arch=amd64 --git-dist=ascii --git-ignore-branch
##sudo gbp buildpackage --git-pbuilder --git-arch=amd64 --git-dist=ascii --no-pristine-tar
##sudo gbp import-orig --upstream-version=0.1.6 --pristine-tar https://sigrok.org/download/source/sigrok-firmware-fx2lafw/sigrok-firmware-fx2lafw-0.1.6.tar.gz
##sudo gbp buildpackage --git-pbuilder --git-arch=amd64 --git-dist=ascii --othermirror="deb [trusted=yes] file:///srv/pbuilder/deps ./" --distribution=ascii --architecture=amd64
##
## Builds the folloeing:
##libnglib-4.9.13_4.9.13.dfsg-11_amd64.deb
##libnglib-4.9.13-dbgsym_4.9.13.dfsg-11_amd64.deb
##libnglib-dev_4.9.13.dfsg-11_amd64.deb
##netgen_4.9.13.dfsg-11_amd64.deb
##netgen-dbgsym_4.9.13.dfsg-11_amd64.deb
##netgen-doc_4.9.13.dfsg-11_all.deb
##netgen-headers_4.9.13.dfsg-11_amd64.deb
#
## The would be installed by apt install -f later but let be explicite.
#sudo apt install \
# tix \
# liboce-ocaf-lite10 \
# liboce-ocaf10 \
# liboce-visualization10 \
# libtogl1
#
#
#sudo dpkg -i ../libnglib-4.9.13_4.9.13.dfsg-11_amd64.deb && dpkg -i ../netgen_4.9.13.dfsg-11_amd64.deb
#
#sudo apt install -y -f
#sudo rm /etc/apt/sources.list.d/devuan-ceres.list && apt update
@ -107,6 +114,12 @@ sudo apt install -y -f
# https://github.com/qingfengxia/FenicsSolver
# Available as addon in freecad interface
# https://github.com/jaheyns/CfdFoam
sudo apt install -y python3-gmsh gmsh
sudo apt install -y gnuplot paraview openfoam kicad-packages3d
# Openfoam CFD
# https://github.com/qingfengxia/Cfd
@ -114,18 +127,54 @@ sudo apt install -y -f
# https://opensimsa.github.io/training.htmlGnuplot, Paraview and OpenFOAM
# https://github.com/jaheyns/CfdOF
# Requirements:
# * Latest release version of FreeCAD (0.17)
# * Latest release version of FreeCAD (0.18) or latest development version (0.19 prerelease)
# ** or latest development version (0.18 prerelease; requires git commit 12539 or later)
# * OpenFOAM (versions 4.x and 5.x tested; other versions may work.) ascii has 4.1+dfsg1-1
# * OpenFOAM Foundation versions 5-8 or ESI-OpenCFD versions 1706-2006
# * Paraview - ascii has 5.1.2+dfsg1-2
# * GMSH (version 2.13 or later) ascii has 2.15
# * cfMesh (version 1.1.2 updated to compile with OpenFOAM v5.x)
# * FreeCAD plot workbench
# * HiSA (High Speed Aerodynamic Solver)
# OpenFOAM 5.0 is a major new (july 2017) release of OpenFOAM, accompanied by ParaView 5.4.0
wget -c https://datapacket.dl.sourceforge.net/project/cfmesh-cfdof/cfmesh-cfdof.zip
#NOW=`date +"%Y-%m-%d"`
#cd /tmp
#wget -c https://downloads.sourceforge.net/project/cfmesh-cfdof/cfmesh-cfdof.zip
#wget -c -O cfmesh-cfdof.zip https://downloads.sourceforge.net/project/cfmesh-cfdof/cfmesh-cfdof.zip?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fcfmesh-cfdof%2Ffiles%2Fcfmesh-cfdof.zip%2Fdownload&ts=1603110024
#unzip -d ./cfmesh-cfdof-${NOW} cfmesh-cfdof.zip
#
#git clone https://git.code.sf.net/p/cfmesh-cfdof/cfmesh cfmesh-cfdof-cfmesh cfmesh-cfdof-${NOW}
#cd cfmesh-cfdof-${NOW}/ && \
# sudo checkinstall \
# ./Allwmake 2>&1 | tee ./make.log \
# wmake libso meshLibrary \
# wmake all executables \
# wmake all utilities
# Available as addon in freecad interface
# https://github.com/jaheyns/CfdFoam
# Build elmer from git
apt update -o Acquire::CompressionTypes::Order::=gz && apt upgrade -y && apt install -y \
build-essential \
cmake \
git \
libblas-dev \
liblapack-dev \
libmumps-dev \
libparmetis-dev \
mpich \
sudo \
less
sudo apt install -y python-gmsh gmsh
sudo apt install -y gnuplot paraview openfoam
# Clone the ElmerIce source code and compile Elmer/Ice
RUN git clone git://www.github.com/ElmerCSC/elmerfem -b elmerice elmerice \
&& mkdir elmerice/builddir \
&& cd elmerice/builddir \
&& cmake /home/elmerice \
-DCMAKE_INSTALL_PREFIX=/usr/local/Elmer-devel \
-DCMAKE_C_COMPILER=/usr/bin/gcc \
-DCMAKE_Fortran_COMPILER=/usr/bin/gfortran \
-DWITH_MPI:BOOL=TRUE -DWITH_Mumps:BOOL=TRUE \
-DWITH_Hypre:BOOL=FALSE -DWITH_Trilinos:BOOL=FALSE \
-DWITH_ELMERGUI:BOOL=FALSE -DWITH_ElmerIce:BOOL=TRUE \
&& make \
&& make install \
&& rm -R /home/elmerice

121
020_freerouting.sh Normal file
View File

@ -0,0 +1,121 @@
#!/usr/bin/env bash
## The safest way to use it is to Export Specctra files, open these in FreeRouting and then import the resulting session file.
## From the README
#Additional steps for users of KiCad:
# 1. Download the latest freerouting-executable.jar file from the Releases
# 2. Start KiCad and open your project in Pcbnew.
# 3. Export the PCB into Specctra DSN (File / Export... / Specctra DSN).
# 4. Start the router by running the freerouting-executable.jar file, push the "Open Your Own Design" button and select the exported .dsn file in the file chooser.
# 5. Do the routing.
# 6. When you're finished, export the results into a Specctra session file (File / Export Specctra Session File). The router will generate a .ses file for you.
# 7. Go back to KiCad's Pcbnew and import the results (File / Import Specctra Session...).
set -x
ARCH=amd64
#ARCH=armhf
sudo apt install -y \
dh-make \
debhelper \
javahelper \
gradle-debian-helper \
javahelper \
default-jdk
echo "FIXME: The test suite in the package build is disabled as it currently fails, check that they pass before rebuiding."
USER="freerouting"
PROJECT="freerouting"
LICENSE="gpl3"
SECTION="development"
HOMEPAGE="https://freerouting.mihosoft.eu/"
BUILD_HOME="/var/tmp/freerouting-git_build"
PACKAGE="yq"
VERSION=$(curl "https://api.github.com/repos/${USER}/${PROJECT}/tags?per_page=5" | jq -r '.[0] | .name')
DEBVERSION=${VERSION:1} # strip the preceding 'v'
DEBEMAIL="person@company.tld"
DEBFULLNAME="Testy McTester"
DESCRIPTION="An advanced PCB autorouter."
LONG_DESCRIPTION=" Freerouting is a free and advanced PCB autorouter. It can compete with expensive autorouters and is compatible with most PCB design programs. It works well with KiCad."
# Make the BUILD_HOME directory and clone upstream
mkdir -p ${BUILD_HOME}
cd ${BUILD_HOME} || exit
git clone --branch ${VERSION} https://github.com/${USER}/${PROJECT}.git --depth 1 ${PACKAGE}-${DEBVERSION}
cd ${PACKAGE}-${DEBVERSION} || exit
git checkout tags/${VERSION}
mkdir -p m4
cat <<EOF > .git/gbp.conf
[DEFAULT]
# this is the upstream-branch:
upstream-branch=master
EOF
# debianize the BUILD_HOME directory
echo ${DEBFULLNAME}
USER=root dh_make \
--createorig \
--indep \
--native \
--email ${DEBEMAIL} \
--copyright ${LICENSE} \
--yes
cp README.rst debian/README
rm debian/README.source
# Customize the debian directory values
sed -i 's,^\(Description: \).*,\1'${DESCRIPTION}',' debian/control
sed -i "s,^\(Description: \).*,\1${DESCRIPTION}," debian/control
sed -i 's,^\(Section: \).*,\1'${SECTION}',' debian/control
sed -i "s,^\(Maintainer: \).*,\1'${DEBFULLNAME}\ \<${DEBEMAIL}\>'," debian/control
sed -i 's,^\(Homepage: \).*,\1'${HOMEPAGE}',' debian/control
PLACEHOLDER=" <insert long description, indented with spaces>"
sed -i 's|'"${PLACEHOLDER}"'|'"${LONG_DESCRIPTION}"'|g' debian/control
echo ****************
cat debian/control
echo ****************
BUILD_OPTIONS="--buildsystem=none"
cat <<EOF > debian/rules
#!/usr/bin/make -f
package=freerouting
%:
dh $@
override_dh_auto_build:
export GRADLE_OPTS="-Dorg.gradle.daemon=false -Xmx512m"; \
dh_auto_build -- assemble
#override_dh_install:
# dh_auto_build -- installDist -x test;
#override_dh_clean:
# dh_auto_build -- clean
get-orig-source:
uscan --verbose --repack --compression xz --download-current-version --force-download
EOF
cat <<EOF > debian/watch
version=4
opts=filenamemangle=s/.+\/v?(\d\S+)\.tar\.gz/${PROJECT}-$1\.tar\.gz/ \
https://github.com/${USER}/${PROJECT}/tags .*/v?(\d\S+)\.tar\.gz
EOF
dpkg-buildpackage -us -uc -b
echo ${PACKAGE}_${DEBVERSION}_${ARCH}.deb
sudo dpkg -i ../${PACKAGE}_${DEBVERSION}_${ARCH}.deb

18
020_how2_checkinstall.sh Normal file
View File

@ -0,0 +1,18 @@
USER=santinic
PROJECT=how-2
#RELEASE=$(curl "https://api.github.com/repos/${USER}/${PROJECT}/tags?per_page=5" | jq -r '.[0] | .name')
#VERSION=VERSION=$( date +%Y-%m-%d_ )git
VERSION=1.0
#DOWNLOAD_DIR=/tmp
DEST=/var/tmp/${NPN_PROGRAM}-${VERSION}
mkdir -p /var/tmp/${DEST}
cat > description-pak << EOF
stackoverflow from the terminal
EOF
cd ${DEST}
sudo checkinstall --fstrans=no bash -c "npm install -g ${NPM_PROGRAM} && npm install -S ${NPM_PROGRAM2}"

View File

@ -1 +1,9 @@
apt-get -y install kicad kicad-libraries kicad-symbols kicad-footprints kicad-templates kicad-demos kicad-packages3d
# freerouting
cd /var/tmp
#git clone http://github.com/miho/freerouting
git clone https://github.com/freerouting/freerouting
cd freerouting
bash gradlew assemble

43
020_kvm.sh Normal file
View File

@ -0,0 +1,43 @@
sudo apt install -y \
qemu-kvm \
libvirt-clients \
libvirt-daemon-system \
bridge-utils \
virtinst \
libvirt-daemon \
virt-manager
sudo virsh net-list --all
# Start the net and autostart on reboot
sudo virsh net-start default
sudo virsh net-autostart default
# Offload the mechanism of virtio-net using vhost_net
sudo modprobe vhost_net
echo "vhost_net" | sudo tee -a /etc/modules
# Add default user to virt group
sudo adduser default libvirt
sudo adduser default libvirt-qemu
# reload group membership
newgrp libvirt
newgrp libvirt-qemu
# Add bridge for kvm
sudo cat > /etc/network/interfaces.d/br0 < EOF
#Configure bridge and give it a static ip
auto br0
iface br0 inet static
address 192.168.1.94
netmask 255.255.255.0
network 192.168.1.1
broadcast 192.168.1.255
gateway 192.168.1.1
bridge_ports eth0
bridge_stp off
bridge_fd 0
bridge_maxwait 0
dns-nameservers 8.8.8.8
EOF

View File

@ -1,9 +1,9 @@
#!/usr/bin/env bash
# http://developer.download.nvidia.com/compute/DevZone/docs/html/C/doc/CUDA_C_Getting_Started_Linux.pdf
https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#package-manager-metas
# https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#package-manager-metas
http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1704/x86_64/
# http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1704/x86_64/
# Meta Package Purpose
# cuda Installs all CUDA Toolkit and Driver packages. Handles upgrading to the next version of the cuda package when it's released.
@ -34,6 +34,9 @@ apt install -y \
nvidia-visual-profiler \
nvidia-cuda-dev
# nvidia-legacy-340xx-kernel-dkms
# nvidia-legacy-340xx-driver \
# xserver-xorg-video-nvidia-legacy-340xx
# libnvidia-legacy-304xx-cuda1 - NVIDIA CUDA Driver Library (304xx legacy version)
# libnvidia-legacy-304xx-nvcuvid1 - NVIDIA CUDA Video Decoder runtime library (304xx legacy version)
# libnvidia-legacy-340xx-cuda1 - NVIDIA CUDA Driver Library (340xx legacy version)

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# http://docs.platformio.org/en/latest/faq.html#faq-install-shell-commands
apt install -f python python-pip checkinstall
sudo apt install -f python3 apython3-git python3-pip checkinstall
# sudo python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/develop/scripts/get-platformio.py)"
@ -19,7 +19,7 @@ mkdir -p "${PIO_BUILD_HOME}" && cd "${PIO_BUILD_HOME}" || exit
echo "PlatformIO Core (CLI tool) for embedded programming." > description-pak
mkdir -p doc-pak && wget -c --directory-prefix doc-pak https://raw.githubusercontent.com/platformio/platformio-core/develop/README.rst
echo "http://docs.platformio.org/en/latest/userguide/index.html" > doc-pak/README
sudo checkinstall --fstrans=no pip install -U https://github.com/platformio/platformio-core/archive/"${RELEASE}".zip
sudo checkinstall -y --fstrans=no pip install -U https://github.com/platformio/platformio-core/archive/"${RELEASE}".zip
# install some platforms
platformio platform install espressif8266

View File

@ -11,8 +11,8 @@ VERSION=$( date +%Y-%m-%d_ )git
DOWNLOAD_DIR=/tmp
# make a containing directory
mkdir -p /var/tmp/rustup-"${RELEASE}"
cd /var/tmp/rustup-"${RELEASE}" || exit
mkdir -p /var/tmp/${PROJECT}-"${RELEASE}"
cd /var/tmp/${PROJECT}-"${RELEASE}" || exit
cat > ./description-pak << EOF
The Rustup tool installs and manages the Rust development environment.

View File

@ -7,6 +7,12 @@ sed -i -e 's/"syntax on/syntax on/' /etc/vim/vimrc
sed -i -e 's/"set background=dark/set background=dark/' /etc/vim/vimrc
# Macros
# Directories for swap, backup and undo
mkdir -p ${HOME}/.vim/swap
mkdir -p ${HOME}/.vim/backup
mkdir -p ${HOME}/.vim/undo
# Format json
cat > ${DEST}/.vimrc << 'EOF'
@ -20,6 +26,18 @@ cat > ${DEST}/.vimrc << 'EOF'
" enable syntax highlighting
syntax enable
" persistant undo file in a single location
set undodir=${HOME}/.vim/undo// " Maintain undo history between sessions
set undofile
" Put backup files in a single location with timestamped names
"set backupdir=${HOME}/.vim/backup//
"au BufWritePre * let &bex = substitute(expand('%:p:h'), '/', ':', 'g') . strftime(';%FT%T')
set nobackup
" Put swap files in a single location
set directory=${HOME}/.vim/swap//
" enable mouse
set mouse=a
@ -284,6 +302,9 @@ call FlutterMenu()
Plugin 'neoclide/coc.nvim'
Plugin 'tjdevries/coc-zsh'
" Neomake is a plugin for Vim/Neovim to asynchronously run programs.
Plugin 'neomake/neomake'
" Rust
Plugin 'rust-lang/rust.vim'
@ -428,6 +449,23 @@ HOME=${DEST} vim -V -E -s -c "source ${DEST}/.vimrc" -c "PluginInstall" -c "Plug
# :qa!
#EOF
# Add platformio support to Coc
# :CocConfig
#{
# "ccls": {
# "enable": false,
# "command": "ccls",
# "filetypes": ["c", "cpp", "objc", "objcpp"],
# "rootPatterns": [".ccls", "compile_commands.json", ".vim/", ".git/", ".hg/"],
# "initializationOptions": {
# "cache": {
# "directory": "/tmp/ccls"
# }
# }
# }
# }
#}
# Install YouCompleteMe support
apt install -y build-essential cmake exuberant-ctags
apt install -y python-dev python3-dev

View File

@ -1,10 +1,15 @@
#!/usr/bin/env bash
set -x
ARCH=amd64
#ARCH=armhf
sudo apt install -y \
jq \
dh-make \
python-flake8 \
python-wheel
python3-flake8 \
python3-wheel
echo "FIXME: The test suite in the package build is disabled as it currently fails, check that they pass before rebuiding."
USER="kislyuk"
PROJECT="yq"
@ -12,24 +17,23 @@ LICENSE="mit"
SECTION="admin"
HOMEPAGE="https://kislyuk.github.io/yq/"
BUILD_HOME="/var/tmp/yq-git_build"
#VERSION="2.10.0"
PACKAGE="yq"
VERSION=$(curl "https://api.github.com/repos/${USER}/${PROJECT}/tags?per_page=5" | jq -r '.[0] | .name')
VERSION=${VERSION:1} # strip the preceding 'v'
DEBVERSION=${VERSION:1} # strip the preceding 'v'
DEBEMAIL="person@company.tld"
DEBFULLNAME="Testy McTester"
DESCRIPTION="Command-line YAML and XML processor."
LONG_DESCRIPTION="Command-line YAML and XML processor
jq wrapper for YAML/XML documents."
LONG_DESCRIPTION=" Command-line YAML and XML processor\\n jq wrapper for YAML/XML documents."
# Make the BUILD_HOME directory and clone upstream
mkdir -p ${BUILD_HOME}
cd ${BUILD_HOME} || exit
git clone https://github.com/${USER}/${PROJECT}.git ${PACKAGE}-${VERSION}
#git clone https://github.com/${USER}/${PROJECT}.git ${PACKAGE}-${VERSION}
git clone --branch ${VERSION} https://github.com/${USER}/${PROJECT}.git --depth 1 ${PACKAGE}-${DEBVERSION}
cd ${PACKAGE}-${VERSION} || exit
cd ${PACKAGE}-${DEBVERSION} || exit
git checkout tags/${VERSION}
mkdir -p m4
@ -42,10 +46,11 @@ EOF
# debianize the BUILD_HOME directory
echo ${DEBFULLNAME}
dh_make \
USER=root dh_make \
--createorig \
--single \
--native \
--email ${DEBEMAIL} \
--copyright ${LICENSE} \
--yes
@ -54,25 +59,31 @@ rm debian/README.source
# Customize the debian directory values
#sed -i 's,^\(Description: \).*,\1'${DESCRIPTION}',' debian/control
sed -i 's,^\(Description: \).*,\1'${DESCRIPTION}',' debian/control
sed -i "s,^\(Description: \).*,\1${DESCRIPTION}," debian/control
sed -i 's,^\(Section: \).*,\1'${SECTION}',' debian/control
sed -i "s,^\(Maintainer: \).*,\1'${DEBFULLNAME}\ \<${DEBEMAIL}\>'," debian/control
sed -i 's,^\(Homepage: \).*,\1'${HOMEPAGE}',' debian/control
sed -i "s/.*insert\ long.*/${LONG_DESCRIPTION}/" debian/control
PLACEHOLDER=" <insert long description, indented with spaces>"
sed -i 's|'"${PLACEHOLDER}"'|'"${LONG_DESCRIPTION}"'|g' debian/control
echo ****************
cat debian/control
echo ****************
BUILD_OPTIONS="--enable-aac --enable-ofono --enable-debug"
#BUILD_OPTIONS="--enable-aac --enable-ofono --enable-debug"
BUILD_OPTIONS="--buildsystem=none"
cat <<EOF > debian/rules
#!/usr/bin/make -f
%:
dh \$@
override_dh_auto_test:
echo "Skipping tests."
# -dh_auto_test
override_dh_auto_configure:
dh_auto_configure -- ${BUILD_OPTIONS}
EOF
@ -85,7 +96,6 @@ EOF
dpkg-buildpackage -us -uc -b
echo ${PACKAGE}_${VERSION}_amd64.deb
sudo dpkg -i ../${PACKAGE}_${VERSION}_amd64.deb
echo ${PACKAGE}_${DEBVERSION}_${ARCH}.deb
sudo dpkg -i ../${PACKAGE}_${DEBVERSION}_${ARCH}.deb

View File

@ -0,0 +1,52 @@
#!/usr/bin/env bash
set -x
#serial:
# additionalPorts:
# - /tmp/printer
# baudrate: 250000
# disconnectOnErrors: false
# port: /tmp/printer
OCTO_PRINTER="/tmp/printer"
SERIAL_DEVICE=${OCTO_PRINTER}
JSON_FILE="config.json"
YAML_FILE="config.yaml"
#BASEDIR="/opt/octoprint/etc/"
BASEDIR="/tmp/"
WORKDIR="/tmp"
declare -A OCTO_OPT
OCTO_OPT[1]='.serial.additionalPorts = "/tmp/printer" | .serial.baudrate = 250000 | .serial.disconnectOnErrors = "true" | .serial.port = "/tmp/printer" '
#OCTO_OPT[1]=".serial.additionalPorts = "${OCTO_PRINTER}"
#| .serial.baudrate = 250000
#| .serial.disconnectOnErrors = "false"
#| .serial.port = "${OCTO_PRINTER}" "
if [ ! -f ${WORKDIR}/${JSON_FILE} ]
then
echo "{}" > ${WORKDIR}/${JSON_FILE}
else
echo "${WORKDIR}/${JSON_FILE} exists."
fi
# Count through the number of array elements, using ${#
# looking for one missing.
for ((i = 1; i < ${#OCTO_OPT[@]}; ++i)); do
if [ -z "${OCTO_OPT[$i]}" ]; then
echo Error: $i missing.
exit 1
fi
done
# Work through each array element, using ${!.
# regardless how it's spelled.
for i in "${!OCTO_OPT[@]}"; do
OPTION="${OCTO_OPT[$i]}"
jq "${OPTION}" ${WORKDIR}/${JSON_FILE} > ${WORKDIR}/${JSON_FILE}.new && \
mv -b ${WORKDIR}/${JSON_FILE}.new ${WORKDIR}/${JSON_FILE}
yq -y . ${WORKDIR}/${JSON_FILE} > ${BASEDIR}/${YAML_FILE}
done