json-c: fix package name, add UninstallDev
[openwrt/svn-archive/archive.git] / package / fonera-mp3 / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id: Makefile 8444 2007-08-20 16:12:24Z nbd $
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=fonera-mp3d
12 PKG_RELEASE:=1
13 PKG_VERSION:=1.0
14 PKG_BUILD_DEPENDS:=json-c
15
16 include $(INCLUDE_DIR)/package.mk
17
18 define Package/fonera-mp3d
19 SECTION:=utils
20 CATEGORY:=Utilities
21 DEPENDS:=@LINUX_2_6_ATHEROS
22 TITLE:=Daemon for fonera-mp3
23 DESCRIPTION:=Daemon to drive a vs1011X mp3 decoder attached to the \
24 fonera gpio pins
25 endef
26
27 define Build/Prepare
28 mkdir -p $(PKG_BUILD_DIR)
29 $(CP) ./src/* $(PKG_BUILD_DIR)/
30 endef
31
32 define Build/Compile
33 $(MAKE) -C $(PKG_BUILD_DIR) \
34 $(TARGET_CONFIGURE_OPTS) \
35 CFLAGS="$(TARGET_CFLAGS)"
36 $(MAKE) -C $(PKG_BUILD_DIR)/cgi \
37 $(TARGET_CONFIGURE_OPTS) \
38 CFLAGS="$(TARGET_CFLAGS) -I $(STAGING_DIR)/usr/include/json" \
39 LDLIBS="$(STAGING_DIR)/usr/lib/libjson.a"
40 $(MAKE) -C $(PKG_BUILD_DIR)/cli \
41 $(TARGET_CONFIGURE_OPTS) \
42 CFLAGS="$(TARGET_CFLAGS)"
43 endef
44
45 define Package/fonera-mp3d/install
46 $(INSTALL_DIR) $(1)/usr/bin
47 $(INSTALL_BIN) $(PKG_BUILD_DIR)/mp3d $(1)/usr/bin/
48 $(INSTALL_BIN) $(PKG_BUILD_DIR)/cli/mplay $(1)/usr/bin/
49 $(INSTALL_DIR) $(1)/www/cgi-bin
50 $(INSTALL_DIR) $(1)/www/local
51 $(INSTALL_BIN) $(PKG_BUILD_DIR)/cgi/{stylesheet.css,json.js} $(1)/www/local
52 $(INSTALL_BIN) $(PKG_BUILD_DIR)/cgi/mp3.cgi $(1)/www/cgi-bin
53 ln -s mp3.cgi $(1)/www/cgi-bin/mp3_cmd.cgi
54 ln -s mp3.cgi $(1)/www/cgi-bin/mp3_json.cgi
55 ln -s mp3.cgi $(1)/www/cgi-bin/mp3_remote.cgi
56 endef
57
58 $(eval $(call BuildPackage,fonera-mp3d))