1st working "make all debs" in subdirectories. Statical examples work, submodules needs adjustements.
3
.gitmodules
vendored
|
@ -1,12 +1,9 @@
|
|||
[submodule "debs/common/armbian-config"]
|
||||
path = debs/common/armbian-config
|
||||
url = https://github.com/armbian/config
|
||||
ignore = dirty
|
||||
[submodule "debs/common/armbian-firmware/lib/firmware"]
|
||||
path = debs/common/armbian-firmware/lib/firmware
|
||||
url = https://github.com/armbian/firmware
|
||||
ignore = dirty
|
||||
[submodule "debs/common/armbian-firmware-full/lib/firmware"]
|
||||
path = debs/common/armbian-firmware-full/lib/firmware
|
||||
url = https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
|
||||
ignore = dirty
|
||||
|
|
14
build-deb.sh
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/bin/bash
|
||||
|
||||
SRC="$(dirname "$(realpath "${BASH_SOURCE}")")"
|
||||
# fallback for Trusty
|
||||
[[ -z "${SRC}" ]] && SRC="$(pwd)"
|
||||
|
||||
REVISION="5.67$SUBREVISION" # all boards have same revision
|
||||
ROOTPWD="1234" # Must be changed @first login
|
||||
[[ -z $MAINTAINER ]] && MAINTAINER="Igor Pecovnik" # deb signature
|
||||
[[ -z $MAINTAINERMAIL ]] && MAINTAINERMAIL="igor.pecovnik@****l.com" # deb signature
|
||||
|
||||
#echo $SRC
|
||||
DEST=$SRC/output
|
||||
source debs/go.sh
|
13
debs/TEMPLATE/armbian.config
Normal file
|
@ -0,0 +1,13 @@
|
|||
PACKAGE=armbian-example-package
|
||||
VERSION: 2.9
|
||||
MAINTAINER: John Doe <john@armbian.com>
|
||||
ARCH=all
|
||||
PRIORITY=optional
|
||||
DEPENDS="libc6 (>= 2.14)"
|
||||
CONFLICTS="nano"
|
||||
BREAKS="text (<< 2.9)"
|
||||
REPLACES="joe (<< 2.9), hello-joe"
|
||||
SECTION="devel"
|
||||
HOMEPAGE="https://www.johndoe.com"
|
||||
DESCRIPTION="Example"
|
||||
REPOSITORY=bionic # internal settings for repository
|
3
debs/TEMPLATE/armbian.postinst
Normal file
|
@ -0,0 +1,3 @@
|
|||
echo "#!/bin/sh"
|
||||
echo "# This script is executed after files are unpacked"
|
||||
echo "exit 0"
|
3
debs/TEMPLATE/armbian.postrm
Normal file
|
@ -0,0 +1,3 @@
|
|||
echo "#!/bin/sh"
|
||||
echo "# This script removes files created by the package."
|
||||
echo "exit 0"
|
3
debs/TEMPLATE/armbian.preinst
Normal file
|
@ -0,0 +1,3 @@
|
|||
echo "#!/bin/sh"
|
||||
echo "# This script is executed before the package is unpacked."
|
||||
echo "exit 0"
|
3
debs/TEMPLATE/armbian.prerm
Normal file
|
@ -0,0 +1,3 @@
|
|||
echo "#!/bin/sh"
|
||||
echo "# This script is executed before the removal of files associated with the package."
|
||||
echo "exit 0"
|
1
debs/TEMPLATE/overlay/boot/boot.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Example file
|
7
debs/board/pinebook/armbian.config
Normal file
|
@ -0,0 +1,7 @@
|
|||
PACKAGE=armbian-pinebok-desktop
|
||||
REVISION=5.99
|
||||
ARCH=all
|
||||
MAINTAINER=John
|
||||
MAINTAINERMAIL=john@doe.com
|
||||
SECTION=xorg
|
||||
PRIORITY=optional
|
Before Width: | Height: | Size: 4 MiB After Width: | Height: | Size: 4 MiB |
Before Width: | Height: | Size: 4 MiB After Width: | Height: | Size: 4 MiB |
Before Width: | Height: | Size: 4 MiB After Width: | Height: | Size: 4 MiB |
Before Width: | Height: | Size: 3 MiB After Width: | Height: | Size: 3 MiB |
14
debs/common/armbian-desktop-xfce/armbian.config
Normal file
|
@ -0,0 +1,14 @@
|
|||
# SAMPLE
|
||||
PACKAGE=armbian-bionic-desktop
|
||||
REVISION=5.99
|
||||
ARCH=all
|
||||
MAINTAINER=John
|
||||
MAINTAINERMAIL=john@doe.com
|
||||
SECTION=xorg
|
||||
PRIORITY=optional
|
||||
DEPENDS="xserver-xorg xserver-xorg-video-fbdev gvfs-backends gvfs-fuse xfonts-base xinit x11-xserver-utils xfce4 lxtask xfce4-terminal thunar-volman gtk2-engines gtk2-engines-murrine gtk2-engines-pixbuf libgtk2.0-bin libgnome2-perl network-manager-gnome xfce4-notifyd gnome-keyring gcr libgck-1-0 p11-kit pasystray pavucontrol pulseaudio pavumeter pulseaudio-module-gconf bluez bluez-tools pulseaudio-module-bluetooth blueman libpam-gnome-keyring libgl1-mesa-dri policykit-1 profile-sync-daemon gnome-orca numix-gtk-theme xserver-xorg-input-all paprefs dbus-x11"
|
||||
RECOMMENDS="mirage galculator hexchat xfce4-screenshooter network-manager-openvpn-gnome mpv fbi cups-pk-helper cups geany atril xarchiver leafpad chromium-browser system-config-printer-common system-config-printer language-selector-gnome"
|
||||
PROVIDES=armbian-bionic-desktop
|
||||
DESCRIPTION="Armbian XFCE desktop"
|
||||
CONFLICTS="joe"
|
||||
REPLACES="ui"
|
2
debs/common/armbian-desktop-xfce/armbian.postinst
Normal file
|
@ -0,0 +1,2 @@
|
|||
echo "#!/bin/bash"
|
||||
echo "echo \"jeba\""
|
BIN
debs/common/armbian-desktop-xfce/overlay/armbian.png
Normal file
After Width: | Height: | Size: 12 KiB |
|
@ -1,5 +0,0 @@
|
|||
#!/bin/sh
|
||||
echo "foe"
|
||||
exit 0
|
||||
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
#!/bin/sh
|
||||
echo "foe"
|
||||
exit 0
|
7
debs/family/rockchip64/armbian.config
Normal file
|
@ -0,0 +1,7 @@
|
|||
PACKAGE=armbian-xxx-desktop
|
||||
ARCH=all
|
||||
SECTION=xorg
|
||||
PRIORITY=optional
|
||||
REPOSITORY=bionic
|
||||
DEPENDS=xserver-xorg
|
||||
PROVIDES=test
|
3
debs/family/rockchip64/armbian.postinst
Normal file
|
@ -0,0 +1,3 @@
|
|||
echo "#!/bin/sh"
|
||||
echo "# This script is executed after files are unpacked"
|
||||
echo "exit 0"
|
3
debs/family/rockchip64/armbian.postrm
Normal file
|
@ -0,0 +1,3 @@
|
|||
echo "#!/bin/sh"
|
||||
echo "# This script removes files created by the package."
|
||||
echo "exit 0"
|
3
debs/family/rockchip64/armbian.preinst
Normal file
|
@ -0,0 +1,3 @@
|
|||
echo "#!/bin/sh"
|
||||
echo "# This script is executed before the package is unpacked."
|
||||
echo "exit 0"
|
3
debs/family/rockchip64/armbian.prerm
Normal file
|
@ -0,0 +1,3 @@
|
|||
echo "#!/bin/sh"
|
||||
echo "# This script is executed before the removal of files associated with the package."
|
||||
echo "exit 0"
|
7
debs/family/rockchip64/overlay/usr/hello_world
Normal file
|
@ -0,0 +1,7 @@
|
|||
CHOSEN_DESKTOP=armbian-bionic-desktop
|
||||
REVISION=5.99
|
||||
ARCH=all
|
||||
MAINTAINER=John
|
||||
MAINTAINERMAIL=john@doe.com
|
||||
SECTION=xorg
|
||||
PRIORITY=optional
|
75
debs/go.sh
Normal file
|
@ -0,0 +1,75 @@
|
|||
find_deb_configs(){
|
||||
IFS=$'\n'
|
||||
names=()
|
||||
dirs=( $(find debs -maxdepth 2 -mindepth 2 -not -path "*/TEMPLATE/*" ) )
|
||||
|
||||
#echo $dirs
|
||||
|
||||
# required for "for" command
|
||||
shopt -s nullglob dotglob
|
||||
|
||||
# check subdirectories for debian package definitions
|
||||
for dir in "${dirs[@]}"; do
|
||||
for config in ${dir%%:*}/armbian.config; do
|
||||
#echo $config
|
||||
names+=($(basename $config))
|
||||
if [[ -f ${dir%%:*}/$names ]]; then
|
||||
local location_source="$SRC/${dir%%:*}/"
|
||||
local location_destination="$SRC/.tmp/${dir%%:*}/"
|
||||
create_deb_control $location_source $location_destination
|
||||
|
||||
#echo $SRC/.tmp/${dir%%:*}/$names
|
||||
fi
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
function process_line()
|
||||
{
|
||||
if [[ -f $1/$2 ]]; then
|
||||
local filename="$3$PACKAGE/DEBIAN/"$(echo $2 | sed -e "s/^armbian.//")
|
||||
postinst=$(bash $1/$2)
|
||||
while read -r line; do
|
||||
echo "$line" >> $filename
|
||||
done <<< "$postinst"
|
||||
chmod +x $filename
|
||||
fi
|
||||
}
|
||||
|
||||
function create_deb_control ()
|
||||
{
|
||||
echo $1 $2
|
||||
unset PACKAGE ARCH SECTION PRIORITY DEPENDS PROVIDES RECOMMENDS REPOSITORY
|
||||
[[ -f $1/armbian.config ]] && source $1/armbian.config
|
||||
[[ -z $PACKAGE ]] && echo "Error. Package name must be defined" && return 1
|
||||
[[ -z $DESCRIPTION ]] && DESCRIPTION="Unnamed Armbian package"
|
||||
[[ -n $REPOSITORY ]] && REPOSITORY=$REPOSITORY"/"
|
||||
[[ $2 != "/" ]] && rm -rf $2 && mkdir -p $2/$PACKAGE $2/$PACKAGE/DEBIAN
|
||||
[[ -d $1/overlay ]] && cp -rp $1/overlay/. $2/$PACKAGE/
|
||||
local packagesize=$(du -sx --exclude DEBIAN $2 | awk '{ print $1 }')
|
||||
|
||||
process_line $1 "armbian.preinst" $2
|
||||
process_line $1 "armbian.postinst" $2
|
||||
process_line $1 "armbian.prerm" $2
|
||||
process_line $1 "armbian.postrm" $2
|
||||
|
||||
echo "Package: ${PACKAGE}" > $2/$PACKAGE/DEBIAN/control
|
||||
echo "Version: ${REVISION}" >> $2/$PACKAGE/DEBIAN/control
|
||||
echo "Architecture: ${ARCH}" >> $2/$PACKAGE/DEBIAN/control
|
||||
echo "Maintainer: ${MAINTAINER} ${MAINTAINERMAIL}" >> $2/$PACKAGE/DEBIAN/control
|
||||
echo "Installed-Size: ${packagesize}" >> $2/$PACKAGE/DEBIAN/control
|
||||
echo "Section: ${SECTION}" >> $2/$PACKAGE/DEBIAN/control
|
||||
echo "Priority: ${PRIORITY}" >> $2/$PACKAGE/DEBIAN/control
|
||||
[[ -n $DEPENDS ]] && echo "Depends: $(echo ${DEPENDS} | tr " " ,)" >> $2/$PACKAGE/DEBIAN/control
|
||||
[[ -n $PROVIDES ]] && echo "Provides: $(echo ${PROVIDES} | tr " " ,)" >> $2/$PACKAGE/DEBIAN/control
|
||||
[[ -n $RECOMMENDS ]] && echo "Recommends: $(echo ${RECOMMENDS} | tr " " ,)" >> $2/$PACKAGE/DEBIAN/control
|
||||
[[ -n $CONFLICTS ]] && echo "Conflicts: $(echo ${CONFLICTS} | tr " " ,)" >> $2/$PACKAGE/DEBIAN/control
|
||||
[[ -n $REPLACES ]] && echo "Replaces: $(echo ${REPLACES} | tr " " ,)" >> $2/$PACKAGE/DEBIAN/control
|
||||
echo -e "Homepage: ${HOMEPAGE}" >> $2/$PACKAGE/DEBIAN/control
|
||||
echo -e "Description: ${DESCRIPTION}\n" >> $2/$PACKAGE/DEBIAN/control
|
||||
|
||||
fakeroot dpkg-deb -b $2/$PACKAGE $DEST/debs/${REPOSITORY}$PACKAGE.deb
|
||||
}
|
||||
|
||||
find_deb_configs
|
||||
#create_deb_control
|