[packages] pianobar: add pianobar, a pandora radio client (#10583, thanks lnxsrt)
[packages] pianobar: add pianobar, a pandora radio client (#10583, thanks lnxsrt)


git-svn-id: svn://svn.openwrt.org/openwrt/packages@30607 3c298f89-4303-0410-b956-a3cf2f4a3e73

  #
  # Copyright (C) 2012 OpenWrt.org
  #
  # This is free software, licensed under the GNU General Public License v2.
  # See /LICENSE for more information.
  #
 
  include $(TOPDIR)/rules.mk
 
  PKG_NAME:=pianobar
  PKG_VERSION:=2012.01.10
  PKG_RELEASE:=1
 
  PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  PKG_SOURCE_URL:=http://6xq.net/static/projects/pianobar
  PKG_MD5SUM:=448c57d65c71158674e8b30a8cfa217e
 
  PKG_BUILD_DEPENDS:=libao libfaad2 libmad
  PKG_INSTALL:=1
 
  include $(INCLUDE_DIR)/package.mk
 
  define Package/pianobar/Default
  DEPENDS:=+libgnutls
  TITLE:=Pandora radio
  URL:=http://6xq.net/projects/pianobar/
  endef
 
  define Package/pianobar/Default/description
  Pianobar is a free/open-source, console-based replacement for Pandora’s flash
  player.
  endef
 
  define Package/pianobar
  $(call Package/pianobar/Default)
  SECTION:=sound
  CATEGORY:=Sound
  DEPENDS+= +libao +libfaad2 +libmad +libpiano +libpthread
  TITLE+= console client
  endef
 
  define Package/pianobar/description
  $(call Package/pianobar/Default/description)
  endef
 
  define Package/libpiano
  $(call Package/pianobar/Default)
  SECTION:=libs
  CATEGORY:=Libraries
  TITLE+= library
  endef
 
  define Package/libpiano/description
  $(call Package/pianobar/Default/description)
  This package contains the libpiano shared library.
  endef
 
  TARGET_CFLAGS += -std=c99
 
  MAKE_FLAGS += \
  DYNLINK="1" \
  PREFIX="/usr"
 
  define Build/InstallDev
  $(INSTALL_DIR) $(1)/usr/include
  $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
  $(INSTALL_DIR) $(1)/usr/lib
  $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpiano.{a,so*} $(1)/usr/lib/
  endef
 
  define Package/pianobar/install
  $(INSTALL_DIR) $(1)/usr/bin
  $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pianobar $(1)/usr/bin/
  endef
 
  define Package/libpiano/install
  $(INSTALL_DIR) $(1)/usr/lib
  $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpiano.so.* $(1)/usr/lib/
  endef
 
  $(eval $(call BuildPackage,pianobar))
  $(eval $(call BuildPackage,libpiano))
 
  --- a/Makefile
  +++ b/Makefile
  @@ -91,14 +91,12 @@ LIBGNUTLS_LDFLAGS=-lgnutls
  # build pianobar
  ifeq (${DYNLINK},1)
  pianobar: ${PIANOBAR_OBJ} ${PIANOBAR_HDR} libpiano.so.0
  - @echo " LINK $@"
  - @${CC} -o $@ ${PIANOBAR_OBJ} ${LDFLAGS} -lao -lpthread -lm -L. -lpiano \
  + ${CC} -o $@ ${PIANOBAR_OBJ} ${LDFLAGS} -lao -lpthread -lm -L. -lpiano \
  ${LIBFAAD_LDFLAGS} ${LIBMAD_LDFLAGS} ${LIBGNUTLS_LDFLAGS}
  else
  pianobar: ${PIANOBAR_OBJ} ${PIANOBAR_HDR} ${LIBPIANO_OBJ} ${LIBWAITRESS_OBJ} \
  ${LIBWAITRESS_HDR} ${LIBEZXML_OBJ} ${LIBEZXML_HDR}
  - @echo " LINK $@"
  - @${CC} ${CFLAGS} ${LDFLAGS} ${PIANOBAR_OBJ} ${LIBPIANO_OBJ} \
  + ${CC} ${CFLAGS} ${LDFLAGS} ${PIANOBAR_OBJ} ${LIBPIANO_OBJ} \
  ${LIBWAITRESS_OBJ} ${LIBEZXML_OBJ} -lao -lpthread -lm \
  ${LIBFAAD_LDFLAGS} ${LIBMAD_LDFLAGS} ${LIBGNUTLS_LDFLAGS} -o $@
  endif
  @@ -107,30 +105,25 @@ endif
  libpiano.so.0: ${LIBPIANO_RELOBJ} ${LIBPIANO_HDR} ${LIBWAITRESS_RELOBJ} \
  ${LIBWAITRESS_HDR} ${LIBEZXML_RELOBJ} ${LIBEZXML_HDR} \
  ${LIBPIANO_OBJ} ${LIBWAITRESS_OBJ} ${LIBEZXML_OBJ}
  - @echo " LINK $@"
  - @${CC} -shared -Wl,-soname,libpiano.so.0 ${CFLAGS} ${LDFLAGS} ${LIBGNUTLS_LDFLAGS} \
  + ${CC} -shared -Wl,-soname,libpiano.so.0 ${CFLAGS} ${LDFLAGS} ${LIBGNUTLS_LDFLAGS} \
  -o libpiano.so.0.0.0 ${LIBPIANO_RELOBJ} \
  ${LIBWAITRESS_RELOBJ} ${LIBEZXML_RELOBJ}
  - @ln -s libpiano.so.0.0.0 libpiano.so.0
  - @ln -s libpiano.so.0 libpiano.so
  - @echo " AR libpiano.a"
  - @${AR} rcs libpiano.a ${LIBPIANO_OBJ} ${LIBWAITRESS_OBJ} ${LIBEZXML_OBJ}
  + ln -s libpiano.so.0.0.0 libpiano.so.0
  + ln -s libpiano.so.0 libpiano.so
  + ${AR} rcs libpiano.a ${LIBPIANO_OBJ} ${LIBWAITRESS_OBJ} ${LIBEZXML_OBJ}
 
  %.o: %.c
  - @echo " CC $<"
  - @${CC} ${CFLAGS} -I ${LIBPIANO_INCLUDE} -I ${LIBWAITRESS_INCLUDE} \
  + ${CC} ${CFLAGS} -I ${LIBPIANO_INCLUDE} -I ${LIBWAITRESS_INCLUDE} \
  -I ${LIBEZXML_INCLUDE} ${LIBFAAD_CFLAGS} \
  ${LIBMAD_CFLAGS} ${LIBGNUTLS_CFLAGS} -c -o $@ $<
 
  # create position independent code (for shared libraries)
  %.lo: %.c
  - @echo " CC $< (PIC)"
  - @${CC} ${CFLAGS} -I ${LIBPIANO_INCLUDE} -I ${LIBWAITRESS_INCLUDE} \
  + ${CC} ${CFLAGS} -I ${LIBPIANO_INCLUDE} -I ${LIBWAITRESS_INCLUDE} \
  -I ${LIBEZXML_INCLUDE} -c -fPIC -o $@ $<
 
  clean:
  - @echo " CLEAN"
  - @${RM} ${PIANOBAR_OBJ} ${LIBPIANO_OBJ} ${LIBWAITRESS_OBJ} ${LIBWAITRESS_OBJ}/test.o \
  + ${RM} ${PIANOBAR_OBJ} ${LIBPIANO_OBJ} ${LIBWAITRESS_OBJ} ${LIBWAITRESS_OBJ}/test.o \
  ${LIBEZXML_OBJ} ${LIBPIANO_RELOBJ} ${LIBWAITRESS_RELOBJ} \
  ${LIBEZXML_RELOBJ} pianobar libpiano.so* libpiano.a waitress-test
 
 
comments