# SliTaz package receipt. PACKAGE="ncmpcpp" VERSION="0.5.10" CATEGORY="multimedia" SHORT_DESC="Ncurses mpd client inspired by ncmpc." MAINTAINER="paul@slitaz.org" LICENSE="GPL2" TARBALL="$PACKAGE-$VERSION.tar.bz2" WEB_SITE="https://rybczak.net/ncmpcpp/" WGET_URL="http://ncmpcpp.rybczak.net/stable/$TARBALL" TAGS="music audio player" DEPENDS="ncurses taglib mpd curl libmpdclient ncursesw" BUILD_DEPENDS="ncurses-dev taglib taglib-dev curl-dev libmpdclient-dev" # What is the latest version available today? current_version() { wget -O - ${WGET_URL%/*}/ 2>/dev/null | \ sed "/latest/d;/$PACKAGE-[0-9]/!d;/tar/!d;s|.*$PACKAGE-\\(.*\\).tar.*|\\1|" | sort -Vr | sed q } # Rules to configure and make the package. compile_rules() { cd $src ./configure \ --prefix=/usr \ --enable-clock \ --with-taglib \ --with-curl \ --mandir=/usr/share/man \ $CONFIGURE_ARGS && make && make install } # Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() { mkdir -p $fs/usr/share $fs/etc/skel/.ncmpcpp cp -a $install/usr/bin $fs/usr cp -a $install/usr/share/doc $fs/usr/share ln $fs/usr/share/doc/ncmpcpp/config $fs/etc/skel/.ncmpcpp ln $fs/usr/share/doc/ncmpcpp/keys $fs/etc/skel/.ncmpcpp } post_install() { for i in $(ls "$1/home" 2> /dev/null); do [ -d "$1/home/$i/.ncmpcpp" ] && continue echo echo -n "Enabling configuration files for $i ..." cp -a "$1/etc/skel/.ncmpcpp" "$1/home/$i/" sed -i 's|#mpd_music_dir = ""|mpd_music_dir = "/home/'$i'/music"|' "/home/$i/.ncmpcpp/config" # Change permissions also chroot "$1/" chown -R $(stat -c "%u.%g" "$1/home/$i") "/home/$i/.ncmpcpp" done status } post_remove() { echo -n "Removing configuration files..." rm -rf /home/*/.ncmpcpp status }