abinfo "Configuring..."
if [[ "${CROSS:-$ARCH}" != "i486" && "${CROSS:-$ARCH}" = "powerpc" ]]; then
    "$SRCDIR"/configure ${AUTOTOOLS_DEF[@]} --disable-alsaconf \
                --with-udev-rules-dir=/usr/lib/udev/rules.d \
                --with-systemdsystemunitdir=/usr/lib/systemd/system
else
    "$SRCDIR"/configure ${AUTOTOOLS_DEF[@]} --disable-alsaconf \
                --with-udev-rules-dir=/usr/lib/udev/rules.d \
                --with-systemdsystemunitdir=/usr/lib/systemd/system \
                --disable-bat
fi
abinfo "Making the main part..."
make

cd alsactl
abinfo "Making udev rule for alsactl restore..."
make conf/90-alsa-restore.rules
cd ..

abinfo "Installing the main part..."
make DESTDIR="$PKGDIR" install

abinfo "Installing udev rule for alsactl restore..."
install -vD -m644 alsactl/conf/90-alsa-restore.rules \
  "$PKGDIR"/usr/lib/udev/rules.d/90-alsa-restore.rules

abinfo "Creating directory for alsactl restore..."
install -vd "$PKGDIR"/var/lib/alsa
