| 1 |
########################################################### |
|---|
| 2 |
# |
|---|
| 3 |
# alac_decoder |
|---|
| 4 |
# |
|---|
| 5 |
########################################################### |
|---|
| 6 |
|
|---|
| 7 |
# You must replace "alac_decoder" and "ALAC_DECODER" with the lower case name and |
|---|
| 8 |
# upper case name of your new package. Some places below will say |
|---|
| 9 |
# "Do not change this" - that does not include this global change, |
|---|
| 10 |
# which must always be done to ensure we have unique names. |
|---|
| 11 |
|
|---|
| 12 |
# |
|---|
| 13 |
# ALAC_DECODER_VERSION, ALAC_DECODER_SITE and ALAC_DECODER_SOURCE define |
|---|
| 14 |
# the upstream location of the source code for the package. |
|---|
| 15 |
# ALAC_DECODER_DIR is the directory which is created when the source |
|---|
| 16 |
# archive is unpacked. |
|---|
| 17 |
# ALAC_DECODER_UNZIP is the command used to unzip the source. |
|---|
| 18 |
# It is usually "zcat" (for .gz) or "bzcat" (for .bz2) |
|---|
| 19 |
# |
|---|
| 20 |
# You should change all these variables to suit your package. |
|---|
| 21 |
# Please make sure that you add a description, and that you |
|---|
| 22 |
# list all your packages' dependencies, seperated by commas. |
|---|
| 23 |
# |
|---|
| 24 |
# If you list yourself as MAINTAINER, please give a valid email |
|---|
| 25 |
# address, and indicate your irc nick if it cannot be easily deduced |
|---|
| 26 |
# from your name or email address. If you leave MAINTAINER set to |
|---|
| 27 |
# "NSLU2 Linux" other developers will feel free to edit. |
|---|
| 28 |
# |
|---|
| 29 |
ALAC_DECODER_SITE=http://craz.net/programs/itunes/files |
|---|
| 30 |
ALAC_DECODER_VERSION=0.1.0 |
|---|
| 31 |
ALAC_DECODER_SOURCE=alac_decoder-$(ALAC_DECODER_VERSION).tar.gz |
|---|
| 32 |
ALAC_DECODER_DIR=alac_decoder |
|---|
| 33 |
ALAC_DECODER_UNZIP=zcat |
|---|
| 34 |
ALAC_DECODER_MAINTAINER=NSLU2 Linux <nslu2-linux@yahoogroups.com> |
|---|
| 35 |
ALAC_DECODER_DESCRIPTION=A decoder for the apple lossless file format |
|---|
| 36 |
ALAC_DECODER_SECTION=audio |
|---|
| 37 |
ALAC_DECODER_PRIORITY=optional |
|---|
| 38 |
ALAC_DECODER_DEPENDS= |
|---|
| 39 |
ALAC_DECODER_CONFLICTS= |
|---|
| 40 |
|
|---|
| 41 |
# |
|---|
| 42 |
# ALAC_DECODER_IPK_VERSION should be incremented when the ipk changes. |
|---|
| 43 |
# |
|---|
| 44 |
ALAC_DECODER_IPK_VERSION=2 |
|---|
| 45 |
|
|---|
| 46 |
# |
|---|
| 47 |
# ALAC_DECODER_CONFFILES should be a list of user-editable files |
|---|
| 48 |
ALAC_DECODER_CONFFILES= |
|---|
| 49 |
|
|---|
| 50 |
# |
|---|
| 51 |
# ALAC_DECODER_PATCHES should list any patches, in the the order in |
|---|
| 52 |
# which they should be applied to the source code. |
|---|
| 53 |
# |
|---|
| 54 |
ALAC_DECODER_PATCHES=$(ALAC_DECODER_SOURCE_DIR)/makefile.patch $(ALAC_DECODER_SOURCE_DIR)/alac_performance.patch |
|---|
| 55 |
|
|---|
| 56 |
# |
|---|
| 57 |
# If the compilation of the package requires additional |
|---|
| 58 |
# compilation or linking flags, then list them here. |
|---|
| 59 |
# |
|---|
| 60 |
ALAC_DECODER_CPPFLAGS=-O3 |
|---|
| 61 |
ALAC_DECODER_LDFLAGS= |
|---|
| 62 |
|
|---|
| 63 |
# |
|---|
| 64 |
# ALAC_DECODER_BUILD_DIR is the directory in which the build is done. |
|---|
| 65 |
# ALAC_DECODER_SOURCE_DIR is the directory which holds all the |
|---|
| 66 |
# patches and ipkg control files. |
|---|
| 67 |
# ALAC_DECODER_IPK_DIR is the directory in which the ipk is built. |
|---|
| 68 |
# ALAC_DECODER_IPK is the name of the resulting ipk files. |
|---|
| 69 |
# |
|---|
| 70 |
# You should not change any of these variables. |
|---|
| 71 |
# |
|---|
| 72 |
ALAC_DECODER_BUILD_DIR=$(BUILD_DIR)/alac_decoder_build |
|---|
| 73 |
ALAC_DECODER_SOURCE_DIR=$(SOURCE_DIR)/alac-decoder |
|---|
| 74 |
ALAC_DECODER_IPK_DIR=$(BUILD_DIR)/alac-decoder-$(ALAC_DECODER_VERSION)-ipk |
|---|
| 75 |
ALAC_DECODER_IPK=$(BUILD_DIR)/alac-decoder_$(ALAC_DECODER_VERSION)-$(ALAC_DECODER_IPK_VERSION)_$(TARGET_ARCH).ipk |
|---|
| 76 |
|
|---|
| 77 |
# |
|---|
| 78 |
# This is the dependency on the source code. If the source is missing, |
|---|
| 79 |
# then it will be fetched from the site using wget. |
|---|
| 80 |
# |
|---|
| 81 |
$(DL_DIR)/$(ALAC_DECODER_SOURCE): |
|---|
| 82 |
$(WGET) -P $(DL_DIR) $(ALAC_DECODER_SITE)/$(ALAC_DECODER_SOURCE) |
|---|
| 83 |
|
|---|
| 84 |
# |
|---|
| 85 |
# The source code depends on it existing within the download directory. |
|---|
| 86 |
# This target will be called by the top level Makefile to download the |
|---|
| 87 |
# source code's archive (.tar.gz, .bz2, etc.) |
|---|
| 88 |
# |
|---|
| 89 |
alac-decoder-source: $(DL_DIR)/$(ALAC_DECODER_SOURCE) $(ALAC_DECODER_PATCHES) |
|---|
| 90 |
|
|---|
| 91 |
# |
|---|
| 92 |
# This target unpacks the source code in the build directory. |
|---|
| 93 |
# If the source archive is not .tar.gz or .tar.bz2, then you will need |
|---|
| 94 |
# to change the commands here. Patches to the source code are also |
|---|
| 95 |
# applied in this target as required. |
|---|
| 96 |
# |
|---|
| 97 |
# This target also configures the build within the build directory. |
|---|
| 98 |
# Flags such as LDFLAGS and CPPFLAGS should be passed into configure |
|---|
| 99 |
# and NOT $(MAKE) below. Passing it to configure causes configure to |
|---|
| 100 |
# correctly BUILD the Makefile with the right paths, where passing it |
|---|
| 101 |
# to Make causes it to override the default search paths of the compiler. |
|---|
| 102 |
# |
|---|
| 103 |
# If the compilation of the package requires other packages to be staged |
|---|
| 104 |
# first, then do that first (e.g. "$(MAKE) <bar>-stage <baz>-stage"). |
|---|
| 105 |
# |
|---|
| 106 |
$(ALAC_DECODER_BUILD_DIR)/.built: $(DL_DIR)/$(ALAC_DECODER_SOURCE) $(ALAC_DECODER_PATCHES) |
|---|
| 107 |
# $(MAKE) <bar>-stage <baz>-stage |
|---|
| 108 |
rm -rf $(BUILD_DIR)/$(ALAC_DECODER_DIR) $(ALAC_DECODER_BUILD_DIR) |
|---|
| 109 |
$(ALAC_DECODER_UNZIP) $(DL_DIR)/$(ALAC_DECODER_SOURCE) | tar -C $(BUILD_DIR) -xvf - |
|---|
| 110 |
cat $(ALAC_DECODER_PATCHES) | patch -d $(BUILD_DIR)/$(ALAC_DECODER_DIR) -p1 |
|---|
| 111 |
mv $(BUILD_DIR)/$(ALAC_DECODER_DIR) $(ALAC_DECODER_BUILD_DIR) |
|---|
| 112 |
(cd $(ALAC_DECODER_BUILD_DIR); \ |
|---|
| 113 |
$(TARGET_CONFIGURE_OPTS) \ |
|---|
| 114 |
CFLAGS="$(STAGING_CPPFLAGS) $(ALAC_DECODER_CPPFLAGS)" \ |
|---|
| 115 |
LDFLAGS="$(STAGING_LDFLAGS) $(ALAC_DECODER_LDFLAGS)" \ |
|---|
| 116 |
$(MAKE) \ |
|---|
| 117 |
) |
|---|
| 118 |
touch $(ALAC_DECODER_BUILD_DIR)/.built |
|---|
| 119 |
|
|---|
| 120 |
# I'm not sure what this target is used for |
|---|
| 121 |
alac-decoder-unpack: $(ALAC_DECODER_BUILD_DIR)/.built |
|---|
| 122 |
|
|---|
| 123 |
|
|---|
| 124 |
# |
|---|
| 125 |
# This is the build convenience target. |
|---|
| 126 |
# |
|---|
| 127 |
alac-decoder: $(ALAC_DECODER_BUILD_DIR)/.built |
|---|
| 128 |
|
|---|
| 129 |
# |
|---|
| 130 |
# If you are building a library, then you need to stage it too. |
|---|
| 131 |
# |
|---|
| 132 |
#$(ALAC_DECODER_BUILD_DIR)/.staged: $(ALAC_DECODER_BUILD_DIR)/.built |
|---|
| 133 |
# rm -f $(ALAC_DECODER_BUILD_DIR)/.staged |
|---|
| 134 |
# $(MAKE) -C $(ALAC_DECODER_BUILD_DIR) DESTDIR=$(STAGING_DIR) install |
|---|
| 135 |
# touch $(ALAC_DECODER_BUILD_DIR)/.staged |
|---|
| 136 |
# |
|---|
| 137 |
#alac_decoder-stage: $(ALAC_DECODER_BUILD_DIR)/.staged |
|---|
| 138 |
|
|---|
| 139 |
# |
|---|
| 140 |
# This rule creates a control file for ipkg. It is no longer |
|---|
| 141 |
# necessary to create a seperate control file under sources/alac_decoder |
|---|
| 142 |
# |
|---|
| 143 |
$(ALAC_DECODER_IPK_DIR)/CONTROL/control: |
|---|
| 144 |
@install -d $(ALAC_DECODER_IPK_DIR)/CONTROL |
|---|
| 145 |
@rm -f $@ |
|---|
| 146 |
@echo "Package: alac-decoder" >>$@ |
|---|
| 147 |
@echo "Architecture: $(TARGET_ARCH)" >>$@ |
|---|
| 148 |
@echo "Priority: $(ALAC_DECODER_PRIORITY)" >>$@ |
|---|
| 149 |
@echo "Section: $(ALAC_DECODER_SECTION)" >>$@ |
|---|
| 150 |
@echo "Version: $(ALAC_DECODER_VERSION)-$(ALAC_DECODER_IPK_VERSION)" >>$@ |
|---|
| 151 |
@echo "Maintainer: $(ALAC_DECODER_MAINTAINER)" >>$@ |
|---|
| 152 |
@echo "Source: $(ALAC_DECODER_SITE)/$(ALAC_DECODER_SOURCE)" >>$@ |
|---|
| 153 |
@echo "Description: $(ALAC_DECODER_DESCRIPTION)" >>$@ |
|---|
| 154 |
@echo "Depends: $(ALAC_DECODER_DEPENDS)" >>$@ |
|---|
| 155 |
@echo "Conflicts: $(ALAC_DECODER_CONFLICTS)" >>$@ |
|---|
| 156 |
|
|---|
| 157 |
# |
|---|
| 158 |
# This builds the IPK file. |
|---|
| 159 |
# |
|---|
| 160 |
# Binaries should be installed into $(ALAC_DECODER_IPK_DIR)/opt/sbin or $(ALAC_DECODER_IPK_DIR)/opt/bin |
|---|
| 161 |
# (use the location in a well-known Linux distro as a guide for choosing sbin or bin). |
|---|
| 162 |
# Libraries and include files should be installed into $(ALAC_DECODER_IPK_DIR)/opt/{lib,include} |
|---|
| 163 |
# Configuration files should be installed in $(ALAC_DECODER_IPK_DIR)/opt/etc/alac_decoder/... |
|---|
| 164 |
# Documentation files should be installed in $(ALAC_DECODER_IPK_DIR)/opt/doc/alac_decoder/... |
|---|
| 165 |
# Daemon startup scripts should be installed in $(ALAC_DECODER_IPK_DIR)/opt/etc/init.d/S??alac_decoder |
|---|
| 166 |
# |
|---|
| 167 |
# You may need to patch your application to make it use these locations. |
|---|
| 168 |
# |
|---|
| 169 |
$(ALAC_DECODER_IPK): $(ALAC_DECODER_BUILD_DIR)/.built |
|---|
| 170 |
rm -rf $(ALAC_DECODER_IPK_DIR) $(BUILD_DIR)/alac-decoder_*_$(TARGET_ARCH).ipk |
|---|
| 171 |
$(STRIP_COMMAND) $(ALAC_DECODER_BUILD_DIR)/alac |
|---|
| 172 |
install -d $(ALAC_DECODER_IPK_DIR)/opt/bin |
|---|
| 173 |
install -m 755 $(ALAC_DECODER_BUILD_DIR)/alac $(ALAC_DECODER_IPK_DIR)/opt/bin/alac |
|---|
| 174 |
|
|---|
| 175 |
$(MAKE) $(ALAC_DECODER_IPK_DIR)/CONTROL/control |
|---|
| 176 |
|
|---|
| 177 |
echo $(ALAC_DECODER_CONFFILES) | sed -e 's/ /\n/g' > $(ALAC_DECODER_IPK_DIR)/CONTROL/conffiles |
|---|
| 178 |
cd $(BUILD_DIR); $(IPKG_BUILD) $(ALAC_DECODER_IPK_DIR) |
|---|
| 179 |
|
|---|
| 180 |
# |
|---|
| 181 |
# This is called from the top level makefile to create the IPK file. |
|---|
| 182 |
# |
|---|
| 183 |
alac-decoder-ipk: $(ALAC_DECODER_IPK) |
|---|
| 184 |
|
|---|
| 185 |
# |
|---|
| 186 |
# This is called from the top level makefile to clean all of the built files. |
|---|
| 187 |
# |
|---|
| 188 |
alac-decoder-clean: |
|---|
| 189 |
-$(MAKE) -C $(ALAC_DECODER_BUILD_DIR) clean |
|---|
| 190 |
|
|---|
| 191 |
# |
|---|
| 192 |
# This is called from the top level makefile to clean all dynamically created |
|---|
| 193 |
# directories. |
|---|
| 194 |
# |
|---|
| 195 |
alac-decoder-dirclean: |
|---|
| 196 |
rm -rf $(BUILD_DIR)/$(ALAC_DECODER_DIR) $(ALAC_DECODER_BUILD_DIR) $(ALAC_DECODER_IPK_DIR) $(ALAC_DECODER_IPK) |
|---|
| 197 |
# |
|---|
| 198 |
# |
|---|
| 199 |
# Some sanity check for the package. |
|---|
| 200 |
# |
|---|
| 201 |
alac-decoder-check: $(ALAC_DECODER_IPK) |
|---|
| 202 |
perl scripts/optware-check-package.pl --target=$(OPTWARE_TARGET) $(ALAC_DECODER_IPK) |
|---|
| 203 |
|
|---|