# old version (without -$pkgrel): ${1%%-*}
# new version (without -$pkgrel): ${2%%-*}

pkgname=ublinux-uird

# arg 1:  the new package version
pre_install() {
    true
}

# arg 1:  the new package version
post_install() {
    true
    post_upgrade $@
}

# arg 1:  the new package version
# arg 2:  the old package version
pre_upgrade() {
    true
}

# arg 1:  the new package version
# arg 2:  the old package version
post_upgrade() {
    true
    cat <<EOF 

==> To generate new initrd for current kernel, default options, run as root:
==> ubmkuird --

EOF
#   find ${PATH_DEST_KERNEL}/ -maxdepth 1 -type f ! -iname "*.backup" ! -iname "vmlinuz*" -exec chmod 400 {} \; -exec chown root:root {} \; -exec mv {} "{}.backup" \;
#   find ${path_uird}/ -maxdepth 1 -type f \( -iname "ublinux-*${FILE_EXT}" -o -iname "addon-*${FILE_EXT}" -o -iname "kmod-*${FILE_EXT}" \) | while IFS= read FILE_NAME; do 
#   	install -p -m 400 -o root -g root ${FILE_NAME} ${PATH_DEST_KERNEL}/$(basename ${FILE_NAME%.cpio.xz*})
#   done
}

# arg 1:  the old package version
pre_remove() {
    true
}

# arg 1:  the old package version
post_remove() {
    true
}
