From f4d78e0c2e058d26f9261dad1b438fcc0fc18c75 Mon Sep 17 00:00:00 2001 From: zador-blood-stained Date: Fri, 15 Jul 2016 23:01:14 +0300 Subject: [PATCH] Improve packaging --- chroot-buildpackages.sh | 27 ++-- extras-buildpkgs/90-libvdpau-sunxi.conf | 1 + extras-buildpkgs/libUMP/debian/libump.install | 1 + .../libUMP/debian/libump.postinst | 14 +- extras-buildpkgs/libUMP/debian/rules | 6 + extras-buildpkgs/libUMP/debian/ump.conf | 1 + .../libcedrus/debian/libcedrus1.postinst | 11 ++ .../debian/libvdpau-sunxi1.postinst | 12 ++ .../debian/libvdpau-sunxi1.udev | 1 - .../debian/patches/default-driver-sunxi.patch | 13 ++ .../libvdpau/debian/patches/series | 1 + extras-buildpkgs/mpv/debian/config/mpv.conf | 144 ++++++++++++++++++ extras-buildpkgs/mpv/debian/rules | 2 + extras-buildpkgs/sunxi-mali-r3p0/debian/rules | 4 +- .../debian/sunxi-mali-r3p0.install | 1 + .../debian/sunxi-mali-r3p0.postinst | 12 ++ .../debian/sunxi-mali-r3p0.udev | 1 + 17 files changed, 235 insertions(+), 17 deletions(-) create mode 100644 extras-buildpkgs/libUMP/debian/ump.conf create mode 100644 extras-buildpkgs/libcedrus/debian/libcedrus1.postinst create mode 100644 extras-buildpkgs/libvdpau-sunxi/debian/libvdpau-sunxi1.postinst create mode 100644 extras-buildpkgs/libvdpau/debian/patches/default-driver-sunxi.patch create mode 100644 extras-buildpkgs/mpv/debian/config/mpv.conf create mode 100644 extras-buildpkgs/sunxi-mali-r3p0/debian/sunxi-mali-r3p0.postinst create mode 100644 extras-buildpkgs/sunxi-mali-r3p0/debian/sunxi-mali-r3p0.udev diff --git a/chroot-buildpackages.sh b/chroot-buildpackages.sh index 04c8fe15f5..4816bdd68a 100644 --- a/chroot-buildpackages.sh +++ b/chroot-buildpackages.sh @@ -50,6 +50,11 @@ update_chroot() local t=$target_dir/root/.update-timestamp # apply changes to previously created chroots mkdir -p $target_dir/root/{build,overlay,sources} $target_dir/selinux + # it is symlinked to /run/lock by default + if [[ -L $target_dir/var/lock ]]; then + rm -rf $target_dir/var/lock + mkdir -p $target_dir/var/lock + fi if [[ ! -f $t || $(( ($(date +%s) - $(<$t)) / 86400 )) -gt 2 ]]; then systemd-nspawn -a -q -D $target_dir /bin/bash -c "apt-get -q update; apt-get -q -y upgrade" date +%s > $t @@ -79,9 +84,7 @@ chroot_build_packages() # local builddate=$(date +"%Y%m%d") mkdir -p $DEST/debs/extra/$RELEASE - [[ ! -f $target_dir/root/.debootstrap-complete ]] && create_chroot "$target_dir" - [[ ! -f $target_dir/bin/bash ]] && exit_with_error "Creating chroot failed" "$RELEASE" update_chroot "$target_dir" @@ -98,8 +101,7 @@ chroot_build_packages() local needs_building=no if [[ -n $package_install_target ]]; then for f in $package_install_target; do - if [[ -z $(find $DEST/debs/extra/$RELEASE/ -name "${f}_*$REVISION*_$ARCH.deb" \ - -o -name "${f}_*$REVISION*_all.deb") ]]; then + if [[ -z $(find $DEST/debs/extra/$RELEASE/ -name "${f}_*$REVISION*_$ARCH.deb") ]]; then needs_building=yes break fi @@ -140,7 +142,6 @@ chroot_build_packages() # set local version # debchange -l~armbian${REVISION}-${builddate}+ "New Armbian release" debchange -l~armbian${REVISION}+ "New Armbian release" - # build display_alert "Building package" dpkg-buildpackage -b -uc -us -jauto if [[ \$? -eq 0 ]]; then @@ -163,13 +164,11 @@ chroot_build_packages() chmod +x $target_dir/root/build.sh - # fetch sources fetch_from_repo "$package_repo" "extra/$package_name" "$package_ref" - # run build script in chroot - systemd-nspawn -a -q -D $target_dir --tmpfs=/root/build --tmpfs=/tmp --bind-ro $SRC/lib/extras-buildpkgs/:/root/overlay \ - --bind-ro $SRC/sources/extra/:/root/sources /bin/bash -c "/root/build.sh" 2>&1 | tee -a $DEST/debug/buildpkg.log - # move built packages to $DEST/debs/extras/$RELEASE + eval systemd-nspawn -a -q -D $target_dir --tmpfs=/root/build --tmpfs=/tmp --bind-ro $SRC/lib/extras-buildpkgs/:/root/overlay \ + --bind-ro $SRC/sources/extra/:/root/sources /bin/bash -c "/root/build.sh" 2>&1 \ + ${PROGRESS_LOG_TO_FILE:+' | tee -a $DEST/debug/buildpkg.log'} mv $target_dir/root/*.deb $DEST/debs/extra/$RELEASE/ done } ############################################################################# @@ -238,8 +237,12 @@ fetch_from_repo() git checkout -f -q FETCH_HEAD elif [[ -n $(git status -uno --porcelain) ]]; then # working directory is not clean - display_alert "... checking out" - git checkout -f -q HEAD + if [[ $FORCE_CHECKOUT == yes ]]; then + display_alert "... checking out" + git checkout -f -q HEAD + else + display_alert "... skipping checkout" + fi else # working directory is clean, nothing to do display_alert "... up to date" diff --git a/extras-buildpkgs/90-libvdpau-sunxi.conf b/extras-buildpkgs/90-libvdpau-sunxi.conf index e5bec29c7a..f30289e139 100644 --- a/extras-buildpkgs/90-libvdpau-sunxi.conf +++ b/extras-buildpkgs/90-libvdpau-sunxi.conf @@ -1,6 +1,7 @@ # libvdpau-sunxi # depends on libcedrus # depends on newer libvdpau for Jessie +# dev branch depends on libcsptr-dev local package_name="libvdpau-sunxi" local package_repo="https://github.com/linux-sunxi/libvdpau-sunxi.git" local package_ref="branch:master" diff --git a/extras-buildpkgs/libUMP/debian/libump.install b/extras-buildpkgs/libUMP/debian/libump.install index dfa8a80281..3dec15da72 100644 --- a/extras-buildpkgs/libUMP/debian/libump.install +++ b/extras-buildpkgs/libUMP/debian/libump.install @@ -1 +1,2 @@ usr/lib/*/libUMP.so.* +etc/modules-load.d/* diff --git a/extras-buildpkgs/libUMP/debian/libump.postinst b/extras-buildpkgs/libUMP/debian/libump.postinst index 172d68e2d8..c39910c67d 100644 --- a/extras-buildpkgs/libUMP/debian/libump.postinst +++ b/extras-buildpkgs/libUMP/debian/libump.postinst @@ -1,2 +1,12 @@ -which udevadm > /dev/null || exit 0 -udevadm trigger --action=add --sysname-match=ump +#!/bin/sh + +case "$1" in + install) + which udevadm > /dev/null && udevadm trigger --action=add --sysname-match=ump || true + modprobe -q ump || true + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/extras-buildpkgs/libUMP/debian/rules b/extras-buildpkgs/libUMP/debian/rules index fe04793539..b537e775c7 100644 --- a/extras-buildpkgs/libUMP/debian/rules +++ b/extras-buildpkgs/libUMP/debian/rules @@ -2,5 +2,11 @@ PACKAGE = libump + +override_dh_auto_install: + dh_auto_install + mkdir -p debian/tmp/etc/modules-load.d/ + install -m0644 debian/ump.conf debian/tmp/etc/modules-load.d/ump.conf + %: dh $@ --with autoreconf diff --git a/extras-buildpkgs/libUMP/debian/ump.conf b/extras-buildpkgs/libUMP/debian/ump.conf new file mode 100644 index 0000000000..0360851748 --- /dev/null +++ b/extras-buildpkgs/libUMP/debian/ump.conf @@ -0,0 +1 @@ +ump diff --git a/extras-buildpkgs/libcedrus/debian/libcedrus1.postinst b/extras-buildpkgs/libcedrus/debian/libcedrus1.postinst new file mode 100644 index 0000000000..eead4ac989 --- /dev/null +++ b/extras-buildpkgs/libcedrus/debian/libcedrus1.postinst @@ -0,0 +1,11 @@ +#!/bin/sh + +case "$1" in + install) + which udevadm > /dev/null && udevadm trigger --action=add --sysname-match=cedar_dev || true + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/extras-buildpkgs/libvdpau-sunxi/debian/libvdpau-sunxi1.postinst b/extras-buildpkgs/libvdpau-sunxi/debian/libvdpau-sunxi1.postinst new file mode 100644 index 0000000000..ad4083546a --- /dev/null +++ b/extras-buildpkgs/libvdpau-sunxi/debian/libvdpau-sunxi1.postinst @@ -0,0 +1,12 @@ +#!/bin/sh + +case "$1" in + install) + which udevadm > /dev/null && udevadm trigger --action=add --sysname-match=disp || true + which udevadm > /dev/null && udevadm trigger --action=add --sysname-match=g2d || true + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/extras-buildpkgs/libvdpau-sunxi/debian/libvdpau-sunxi1.udev b/extras-buildpkgs/libvdpau-sunxi/debian/libvdpau-sunxi1.udev index c067df289c..a20f90ec00 100644 --- a/extras-buildpkgs/libvdpau-sunxi/debian/libvdpau-sunxi1.udev +++ b/extras-buildpkgs/libvdpau-sunxi/debian/libvdpau-sunxi1.udev @@ -1,3 +1,2 @@ KERNEL=="disp", MODE="0660", GROUP="video" KERNEL=="g2d", MODE="0660", GROUP="video" -KERNEL=="mali", MODE="0660", GROUP="video" diff --git a/extras-buildpkgs/libvdpau/debian/patches/default-driver-sunxi.patch b/extras-buildpkgs/libvdpau/debian/patches/default-driver-sunxi.patch new file mode 100644 index 0000000000..aaa0a8e066 --- /dev/null +++ b/extras-buildpkgs/libvdpau/debian/patches/default-driver-sunxi.patch @@ -0,0 +1,13 @@ +diff --git a/src/vdpau_wrapper.c b/src/vdpau_wrapper.c +index 722576e..66969f8 100644 +--- a/src/vdpau_wrapper.c ++++ b/src/vdpau_wrapper.c +@@ -137,7 +137,7 @@ static VdpStatus _vdp_open_driver( + _vdp_get_driver_name_from_dri2(display, screen); + } + if (!vdpau_driver) { +- vdpau_driver = "nvidia"; ++ vdpau_driver = "sunxi"; + } + + _vdp_driver_dll = NULL; diff --git a/extras-buildpkgs/libvdpau/debian/patches/series b/extras-buildpkgs/libvdpau/debian/patches/series index 0865fa55b7..884a10bbbb 100644 --- a/extras-buildpkgs/libvdpau/debian/patches/series +++ b/extras-buildpkgs/libvdpau/debian/patches/series @@ -2,3 +2,4 @@ link-with-libx11.patch simplify-dlopen-path-length-error-handling.patch vdpau-module-searchpath.patch doxygen-no-timestamps.patch +default-driver-sunxi.patch diff --git a/extras-buildpkgs/mpv/debian/config/mpv.conf b/extras-buildpkgs/mpv/debian/config/mpv.conf new file mode 100644 index 0000000000..f113c11b48 --- /dev/null +++ b/extras-buildpkgs/mpv/debian/config/mpv.conf @@ -0,0 +1,144 @@ +# +# MPV configuration file for Armbian +# +# Warning: +# +# The commented example options usually do _not_ set the default values. Call +# mpv with --list-options to see the default values for most options. There is +# no builtin or example mpv.conf with all the defaults. +# +# +# Configuration files are read system-wide from /etc/mpv/mpv.conf +# and per-user from ~/.config/mpv/mpv.conf, where per-user settings override +# system-wide settings, all of which are overridden by the command line. +# +# Configuration file settings and the command line options use the same +# underlying mechanisms. Most options can be put into the configuration file +# by dropping the preceding '--'. See the man page for a complete list of +# options. +# +# Lines starting with '#' are comments and are ignored. +# +# See the CONFIGURATION FILES section in the man page +# for a detailed description of the syntax. +# +# Profiles should be placed at the bottom of the configuration file to ensure +# that settings wanted as defaults are not restricted to specific profiles. + +################## +# video settings # +################## + +# Start in fullscreen mode by default. +#fs=yes + +# force starting with centered window +#geometry=50%:50% + +# don't allow a new window to have a size larger than 90% of the screen size +#autofit-larger=90%x90% + +# Do not close the window on exit. +#keep-open=yes + +# Do not wait with showing the video window until it has loaded. (This will +# resize the window once video is loaded. Also always shows a window with +# audio.) +#force-window=immediate + +# Disable the On Screen Controller (OSC). +#osc=no + +# Keep the player window on top of all other windows. +#ontop=yes + +# Specify default video driver (see --vo=help for a list). +# This one selects high quality video scaling etc. - can cause problems with +# some drivers and GPUs. +vo=vdpau + +# Force video to lock on the display's refresh rate, and change video and audio +# speed to some degree to ensure synchronous playback - can cause problems +# with some drivers and desktop environments. +#video-sync=display-resample + +# Enable hardware decoding if available. Often, this does not work with all +# video outputs, but should work well with default settings on most systems. +# If performance or energy usage is an issue, forcing the vdpau or vaapi VOs +# may or may not help. +hwdec=vdpau +hwdec-codecs=all + +################## +# audio settings # +################## + +# Specify default audio driver (see --ao=help for a list). +#ao=alsa + +# Disable softvol usage, and always use the system mixer if available. +#softvol=no + +# Do not filter audio to keep pitch when changing playback speed. +#audio-pitch-correction=no + +# Output 5.1 audio natively, and upmix/downmix audio with a different format. +#audio-channels=5.1 +# Disable any automatic remix, _if_ the audio output accepts the audio format. +# of the currently played file. See caveats mentioned in the manpage. +# (This is the default.) +#audio-channels=auto + +################## +# other settings # +################## + +# Pretend to be a web browser. Might fix playback with some streaming sites, +# but also will break with shoutcast streams. +#user-agent="Mozilla/5.0" + +# cache settings +# +# Use 150MB input cache by default. The cache is enabled for network streams only. +#cache-default=153600 +# +# Use 150MB input cache for everything, even local files. +#cache=153600 +# +# Disable the behavior that the player will pause if the cache goes below a +# certain fill size. +#cache-pause=no +# +# Read ahead about 5 seconds of audio and video packets. +#demuxer-readahead-secs=5.0 +# +# Raise readahead from demuxer-readahead-secs to this value if a cache is active. +#cache-secs=50.0 + +# Display English subtitles if available. +#slang=en + +# Play Finnish audio if available, fall back to English otherwise. +#alang=fi,en + +# Change subtitle encoding. For Arabic subtitles use 'cp1256'. +# If the file seems to be valid UTF-8, prefer UTF-8. +#sub-codepage=utf8:cp1256 + + +# You can also include other configuration files. +#include=/path/to/the/file/you/want/to/include + + +############ +# Profiles # +############ + +# The options declared as part of profiles override global default settings, +# but only take effect when the profile is active. + +# The following profile can be enabled on the command line with: --profile=invert + +#[invert] +# The profile forces this video filter: +#vf-add=flip diff --git a/extras-buildpkgs/mpv/debian/rules b/extras-buildpkgs/mpv/debian/rules index 9df842f3c1..23c6359737 100644 --- a/extras-buildpkgs/mpv/debian/rules +++ b/extras-buildpkgs/mpv/debian/rules @@ -22,6 +22,8 @@ override_dh_auto_build: override_dh_auto_install: python ./waf install --destdir=debian/tmp + mkdir -p debian/tmp/etc/mpv + install -m0644 debian/config/mpv.conf debian/tmp/etc/mpv/mpv.conf override_dh_install: dh_install --sourcedir=debian/tmp diff --git a/extras-buildpkgs/sunxi-mali-r3p0/debian/rules b/extras-buildpkgs/sunxi-mali-r3p0/debian/rules index 9333b07979..42939e59b9 100644 --- a/extras-buildpkgs/sunxi-mali-r3p0/debian/rules +++ b/extras-buildpkgs/sunxi-mali-r3p0/debian/rules @@ -15,5 +15,5 @@ override_dh_auto_configure: override_dh_auto_install: mkdir -p debian/tmp/usr/lib/ debian/tmp/usr/include dh_auto_install - mkdir -p debian/sunxi-mali-r3p0/etc/modules-load.d/ - install -m0644 debian/sunxi-mali.conf debian/sunxi-mali-r3p0/etc/modules-load.d/sunxi-mali.conf + mkdir -p debian/tmp/etc/modules-load.d/ + install -m0644 debian/sunxi-mali.conf debian/tmp/etc/modules-load.d/sunxi-mali.conf diff --git a/extras-buildpkgs/sunxi-mali-r3p0/debian/sunxi-mali-r3p0.install b/extras-buildpkgs/sunxi-mali-r3p0/debian/sunxi-mali-r3p0.install index ad3fd2f708..a8d0d34e3b 100644 --- a/extras-buildpkgs/sunxi-mali-r3p0/debian/sunxi-mali-r3p0.install +++ b/extras-buildpkgs/sunxi-mali-r3p0/debian/sunxi-mali-r3p0.install @@ -1,2 +1,3 @@ usr/lib/lib*.so.* usr/lib/libMali.so +etc/modules-load.d/* diff --git a/extras-buildpkgs/sunxi-mali-r3p0/debian/sunxi-mali-r3p0.postinst b/extras-buildpkgs/sunxi-mali-r3p0/debian/sunxi-mali-r3p0.postinst new file mode 100644 index 0000000000..5e92815906 --- /dev/null +++ b/extras-buildpkgs/sunxi-mali-r3p0/debian/sunxi-mali-r3p0.postinst @@ -0,0 +1,12 @@ +#!/bin/sh + +case "$1" in + install) + modprobe -q mali || true + which udevadm > /dev/null && udevadm trigger --action=add --sysname-match=mali || true + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/extras-buildpkgs/sunxi-mali-r3p0/debian/sunxi-mali-r3p0.udev b/extras-buildpkgs/sunxi-mali-r3p0/debian/sunxi-mali-r3p0.udev new file mode 100644 index 0000000000..1bb41b9a87 --- /dev/null +++ b/extras-buildpkgs/sunxi-mali-r3p0/debian/sunxi-mali-r3p0.udev @@ -0,0 +1 @@ +KERNEL=="mali", MODE="0660", GROUP="video"