Port icecast to -ng
[packages.git] / net / icecast / Makefile
1 # Copyright (C) 2006 OpenWrt.org
2 #
3 # This is free software, licensed under the GNU General Public License v2.
4 # See /LICENSE for more information.
5 #
6 # $Id$
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=icecast
11 PKG_VERSION:=2.3.0
12 PKG_RELEASE:=1
13 PKG_MD5SUM:=35256fbc4a93571662af2ed18fbbfcc5
14
15 PKG_SOURCE_URL:=http://downloads.us.xiph.org/releases/icecast/
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_CAT:=zcat
18
19 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
20 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/icecast
25   SECTION:=net
26   CATEGORY:=Network
27   DEPENDS:=+libcurl +libvorbisidec +libxml2 +libxslt
28   TITLE:=A streaming media server for Ogg/Vorbis and MP3 audio streams
29   DESCRIPTION:=Icecast is a streaming media server which currently supports Ogg\\\
30 Vorbis and MP3 audio streams. It can be used to create an Internet\\\
31 radio station or a privately running jukebox and many things in\\\
32 between. It is very versatile in that new formats can be added\\\
33 relatively easily and supports open standards for commuincation and\\\
34 interaction.\\\
35   URL:=http://www.icecast.org/
36 endef
37
38
39 define Build/Configure
40         (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
41                 $(TARGET_CONFIGURE_OPTS) \
42                 CFLAGS="$(TARGET_CFLAGS)" \
43                 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include -I$(STAGING_DIR)/usr/include/libxml2 " \
44                 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
45                 PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig" \
46                 ./configure \
47                         --target=$(GNU_TARGET_NAME) \
48                         --host=$(GNU_TARGET_NAME) \
49                         --build=$(GNU_HOST_NAME) \
50                         --program-prefix="" \
51                         --program-suffix="" \
52                         --prefix=/usr \
53                         --exec-prefix=/usr \
54                         --bindir=/usr/bin \
55                         --datadir=/usr/share \
56                         --includedir=/usr/include \
57                         --infodir=/usr/share/info \
58                         --libdir=/usr/lib \
59                         --libexecdir=/usr/lib \
60                         --localstatedir=/var \
61                         --mandir=/usr/share/man \
62                         --sbindir=/usr/sbin \
63                         --sysconfdir=/etc \
64                         $(DISABLE_LARGEFILE) \
65                         $(DISABLE_NLS) \
66                         --enable-shared \
67                         --disable-static \
68                         --disable-rpath \
69                         --with-gnu-ld \
70                         --enable-yp \
71                         --with-curl="yes" \
72                         --with-curl-config="$(STAGING_DIR)/usr/bin/curl-config" \
73                         --with-ogg="$(STAGING_DIR)/usr" \
74                         --with-speex="no" \
75                         --with-theora="no" \
76                         --with-vorbis="$(STAGING_DIR)/usr" \
77                         --with-xslt-config="$(STAGING_DIR)/usr/bin/xslt-config" \
78         );
79 endef
80
81 define Build/Compile    
82         rm -rf $(PKG_INSTALL_DIR)
83         mkdir -p $(PKG_INSTALL_DIR)
84         $(MAKE) -C $(PKG_BUILD_DIR) \
85                 DESTDIR="$(PKG_INSTALL_DIR)" \
86                 all install
87 endef
88
89 define Package/icecast/install  
90         install -d -m0755 $(1)/etc
91         $(CP) $(PKG_INSTALL_DIR)/etc/icecast.xml $(1)/etc/
92         install -d -m0755 $(1)/usr/bin
93         $(CP) $(PKG_INSTALL_DIR)/usr/bin/icecast $(1)/usr/bin/
94         install -d -m0755 $(1)/usr/share/icecast
95         $(CP) $(PKG_INSTALL_DIR)/usr/share/icecast/admin $(1)/usr/share/icecast/
96         $(CP) $(PKG_INSTALL_DIR)/usr/share/icecast/web $(1)/usr/share/icecast/
97 endef
98
99 $(eval $(call BuildPackage,icecast))