root/trunk/make/asterisk14-moh-freeplay-ulaw.mk

Revision 7615, 10.1 kB (checked in by bzhou, 2 years ago)

asterisk14 sound: updated SITE URLs, provides backup SITE

Line 
1 ###########################################################
2 #
3 # asterisk14-moh-freeplay-ulaw
4 #
5 ###########################################################
6 #
7 # ASTERISK14_MOH_FREEPLAY_ULAW_VERSION, ASTERISK14_MOH_FREEPLAY_ULAW_SITE and ASTERISK14_MOH_FREEPLAY_ULAW_SOURCE define
8 # the upstream location of the source code for the package.
9 # ASTERISK14_MOH_FREEPLAY_ULAW_DIR is the directory which is created when the source
10 # archive is unpacked.
11 # ASTERISK14_MOH_FREEPLAY_ULAW_UNZIP is the command used to unzip the source.
12 # It is usually "zcat" (for .gz) or "bzcat" (for .bz2)
13 #
14 # You should change all these variables to suit your package.
15 # Please make sure that you add a description, and that you
16 # list all your packages' dependencies, seperated by commas.
17 #
18 # If you list yourself as MAINTAINER, please give a valid email
19 # address, and indicate your irc nick if it cannot be easily deduced
20 # from your name or email address.  If you leave MAINTAINER set to
21 # "NSLU2 Linux" other developers will feel free to edit.
22 #
23 ASTERISK14_MOH_FREEPLAY_ULAW_SITE=http://ftp.digium.com/pub/telephony/sounds/releases
24 ASTERISK14_MOH_FREEPLAY_ULAW_VERSION=0.0.0
25 #ASTERISK14_MOH_FREEPLAY_ULAW_SOURCE=asterisk-moh-freeplay-ulaw-$(ASTERISK14_MOH_FREEPLAY_ULAW_VERSION).tar.gz
26 ASTERISK14_MOH_FREEPLAY_ULAW_SOURCE=asterisk-moh-freeplay-ulaw.tar.gz
27 ASTERISK14_MOH_FREEPLAY_ULAW_DIR=asterisk-moh-freeplay-ulaw-$(ASTERISK14_MOH_FREEPLAY_ULAW_VERSION)
28 ASTERISK14_MOH_FREEPLAY_ULAW_UNZIP=zcat
29 ASTERISK14_MOH_FREEPLAY_ULAW_MAINTAINER=NSLU2 Linux <nslu2-linux@yahoogroups.com>
30 ASTERISK14_MOH_FREEPLAY_ULAW_DESCRIPTION=asterisk-moh-freeplay-ulaw
31 ASTERISK14_MOH_FREEPLAY_ULAW_SECTION=misc
32 ASTERISK14_MOH_FREEPLAY_ULAW_PRIORITY=optional
33 ASTERISK14_MOH_FREEPLAY_ULAW_DEPENDS=
34 ASTERISK14_MOH_FREEPLAY_ULAW_SUGGESTS=
35 ASTERISK14_MOH_FREEPLAY_ULAW_CONFLICTS=asterisk-sounds
36
37 #
38 # ASTERISK14_MOH_FREEPLAY_ULAW_IPK_VERSION should be incremented when the ipk changes.
39 #
40 ASTERISK14_MOH_FREEPLAY_ULAW_IPK_VERSION=1
41
42 #
43 # ASTERISK14_MOH_FREEPLAY_ULAW_CONFFILES should be a list of user-editable files
44 #ASTERISK14_MOH_FREEPLAY_ULAW_CONFFILES=/opt/etc/asterisk14-moh-freeplay-ulaw.conf /opt/etc/init.d/SXXasterisk14-moh-freeplay-ulaw
45
46 #
47 # ASTERISK14_MOH_FREEPLAY_ULAW_PATCHES should list any patches, in the the order in
48 # which they should be applied to the source code.
49 #
50 #ASTERISK14_MOH_FREEPLAY_ULAW_PATCHES=$(ASTERISK14_MOH_FREEPLAY_ULAW_SOURCE_DIR)/configure.patch
51
52 #
53 # If the compilation of the package requires additional
54 # compilation or linking flags, then list them here.
55 #
56 ASTERISK14_MOH_FREEPLAY_ULAW_CPPFLAGS=
57 ASTERISK14_MOH_FREEPLAY_ULAW_LDFLAGS=
58
59 #
60 # ASTERISK14_MOH_FREEPLAY_ULAW_BUILD_DIR is the directory in which the build is done.
61 # ASTERISK14_MOH_FREEPLAY_ULAW_SOURCE_DIR is the directory which holds all the
62 # patches and ipkg control files.
63 # ASTERISK14_MOH_FREEPLAY_ULAW_IPK_DIR is the directory in which the ipk is built.
64 # ASTERISK14_MOH_FREEPLAY_ULAW_IPK is the name of the resulting ipk files.
65 #
66 # You should not change any of these variables.
67 #
68 ASTERISK14_MOH_FREEPLAY_ULAW_BUILD_DIR=$(BUILD_DIR)/asterisk14-moh-freeplay-ulaw
69 ASTERISK14_MOH_FREEPLAY_ULAW_SOURCE_DIR=$(SOURCE_DIR)/asterisk14-moh-freeplay-ulaw
70 ASTERISK14_MOH_FREEPLAY_ULAW_IPK_DIR=$(BUILD_DIR)/asterisk14-moh-freeplay-ulaw-$(ASTERISK14_MOH_FREEPLAY_ULAW_VERSION)-ipk
71 ASTERISK14_MOH_FREEPLAY_ULAW_IPK=$(BUILD_DIR)/asterisk14-moh-freeplay-ulaw_$(ASTERISK14_MOH_FREEPLAY_ULAW_VERSION)-$(ASTERISK14_MOH_FREEPLAY_ULAW_IPK_VERSION)_$(TARGET_ARCH).ipk
72
73 .PHONY: asterisk14-moh-freeplay-ulaw-source asterisk14-moh-freeplay-ulaw-unpack asterisk14-moh-freeplay-ulaw asterisk14-moh-freeplay-ulaw-stage asterisk14-moh-freeplay-ulaw-ipk asterisk14-moh-freeplay-ulaw-clean asterisk14-moh-freeplay-ulaw-dirclean asterisk14-moh-freeplay-ulaw-check
74
75 #
76 # This is the dependency on the source code.  If the source is missing,
77 # then it will be fetched from the site using wget.
78 #
79 $(DL_DIR)/$(ASTERISK14_MOH_FREEPLAY_ULAW_SOURCE):
80         $(WGET) -P $(DL_DIR) $(ASTERISK14_MOH_FREEPLAY_ULAW_SITE)/$(@F) || \
81         $(WGET) -P $(DL_DIR) $(SOURCES_NLO_SITE)/$(@F)
82
83 #
84 # The source code depends on it existing within the download directory.
85 # This target will be called by the top level Makefile to download the
86 # source code's archive (.tar.gz, .bz2, etc.)
87 #
88 #asterisk14-moh-freeplay-ulaw-source: $(DL_DIR)/$(ASTERISK14_MOH_FREEPLAY_ULAW_SOURCE) $(ASTERISK14_MOH_FREEPLAY_ULAW_PATCHES)
89
90 #
91 # This target unpacks the source code in the build directory.
92 # If the source archive is not .tar.gz or .tar.bz2, then you will need
93 # to change the commands here.  Patches to the source code are also
94 # applied in this target as required.
95 #
96 # This target also configures the build within the build directory.
97 # Flags such as LDFLAGS and CPPFLAGS should be passed into configure
98 # and NOT $(MAKE) below.  Passing it to configure causes configure to
99 # correctly BUILD the Makefile with the right paths, where passing it
100 # to Make causes it to override the default search paths of the compiler.
101 #
102 # If the compilation of the package requires other packages to be staged
103 # first, then do that first (e.g. "$(MAKE) <bar>-stage <baz>-stage").
104 #
105 # If the package uses  GNU libtool, you should invoke $(PATCH_LIBTOOL) as
106 # shown below to make various patches to it.
107 #
108 $(ASTERISK14_MOH_FREEPLAY_ULAW_BUILD_DIR)/.configured: $(DL_DIR)/$(ASTERISK14_MOH_FREEPLAY_ULAW_SOURCE) $(ASTERISK14_MOH_FREEPLAY_ULAW_PATCHES) make/asterisk14-moh-freeplay-ulaw.mk
109         #$(MAKE) <bar>-stage <baz>-stage
110         rm -rf $(BUILD_DIR)/$(ASTERISK14_MOH_FREEPLAY_ULAW_DIR) $(ASTERISK14_MOH_FREEPLAY_ULAW_BUILD_DIR)
111         mkdir -p $(BUILD_DIR)/$(ASTERISK14_MOH_FREEPLAY_ULAW_DIR); $(ASTERISK14_MOH_FREEPLAY_ULAW_UNZIP) $(DL_DIR)/$(ASTERISK14_MOH_FREEPLAY_ULAW_SOURCE) | tar -C $(BUILD_DIR)/$(ASTERISK14_MOH_FREEPLAY_ULAW_DIR) -xvf -
112         if test -n "$(ASTERISK14_MOH_FREEPLAY_ULAW_PATCHES)" ; \
113                 then cat $(ASTERISK14_MOH_FREEPLAY_ULAW_PATCHES) | \
114                 patch -d $(BUILD_DIR)/$(ASTERISK14_MOH_FREEPLAY_ULAW_DIR) -p0 ; \
115         fi
116         if test "$(BUILD_DIR)/$(ASTERISK14_MOH_FREEPLAY_ULAW_DIR)" != "$(ASTERISK14_MOH_FREEPLAY_ULAW_BUILD_DIR)" ; \
117                 then mv $(BUILD_DIR)/$(ASTERISK14_MOH_FREEPLAY_ULAW_DIR) $(ASTERISK14_MOH_FREEPLAY_ULAW_BUILD_DIR) ; \
118         fi
119         touch $(ASTERISK14_MOH_FREEPLAY_ULAW_BUILD_DIR)/.configured
120
121 asterisk14-moh-freeplay-ulaw-unpack: $(ASTERISK14_MOH_FREEPLAY_ULAW_BUILD_DIR)/.configured
122
123 #
124 # This builds the actual binary.
125 #
126 $(ASTERISK14_MOH_FREEPLAY_ULAW_BUILD_DIR)/.built: $(ASTERISK14_MOH_FREEPLAY_ULAW_BUILD_DIR)/.configured
127         rm -f $(ASTERISK14_MOH_FREEPLAY_ULAW_BUILD_DIR)/.built
128         touch $(ASTERISK14_MOH_FREEPLAY_ULAW_BUILD_DIR)/.built
129
130 #
131 # This is the build convenience target.
132 #
133 asterisk14-moh-freeplay-ulaw: $(ASTERISK14_MOH_FREEPLAY_ULAW_BUILD_DIR)/.built
134
135 #
136 # If you are building a library, then you need to stage it too.
137 #
138 $(ASTERISK14_MOH_FREEPLAY_ULAW_BUILD_DIR)/.staged: $(ASTERISK14_MOH_FREEPLAY_ULAW_BUILD_DIR)/.built
139         rm -f $(ASTERISK14_MOH_FREEPLAY_ULAW_BUILD_DIR)/.staged
140         touch $(ASTERISK14_MOH_FREEPLAY_ULAW_BUILD_DIR)/.staged
141
142 asterisk14-moh-freeplay-ulaw-stage: $(ASTERISK14_MOH_FREEPLAY_ULAW_BUILD_DIR)/.staged
143
144 #
145 # This rule creates a control file for ipkg.  It is no longer
146 # necessary to create a seperate control file under sources/asterisk14-moh-freeplay-ulaw
147 #
148 $(ASTERISK14_MOH_FREEPLAY_ULAW_IPK_DIR)/CONTROL/control:
149         @install -d $(@D)
150         @rm -f $@
151         @echo "Package: asterisk14-moh-freeplay-ulaw" >>$@
152         @echo "Architecture: $(TARGET_ARCH)" >>$@
153         @echo "Priority: $(ASTERISK14_MOH_FREEPLAY_ULAW_PRIORITY)" >>$@
154         @echo "Section: $(ASTERISK14_MOH_FREEPLAY_ULAW_SECTION)" >>$@
155         @echo "Version: $(ASTERISK14_MOH_FREEPLAY_ULAW_VERSION)-$(ASTERISK14_MOH_FREEPLAY_ULAW_IPK_VERSION)" >>$@
156         @echo "Maintainer: $(ASTERISK14_MOH_FREEPLAY_ULAW_MAINTAINER)" >>$@
157         @echo "Source: $(ASTERISK14_MOH_FREEPLAY_ULAW_SITE)/$(ASTERISK14_MOH_FREEPLAY_ULAW_SOURCE)" >>$@
158         @echo "Description: $(ASTERISK14_MOH_FREEPLAY_ULAW_DESCRIPTION)" >>$@
159         @echo "Depends: $(ASTERISK14_MOH_FREEPLAY_ULAW_DEPENDS)" >>$@
160         @echo "Suggests: $(ASTERISK14_MOH_FREEPLAY_ULAW_SUGGESTS)" >>$@
161         @echo "Conflicts: $(ASTERISK14_MOH_FREEPLAY_ULAW_CONFLICTS)" >>$@
162
163 #
164 # This builds the IPK file.
165 #
166 # Binaries should be installed into $(ASTERISK14_MOH_FREEPLAY_ULAW_IPK_DIR)/opt/sbin or $(ASTERISK14_MOH_FREEPLAY_ULAW_IPK_DIR)/opt/bin
167 # (use the location in a well-known Linux distro as a guide for choosing sbin or bin).
168 # Libraries and include files should be installed into $(ASTERISK14_MOH_FREEPLAY_ULAW_IPK_DIR)/opt/{lib,include}
169 # Configuration files should be installed in $(ASTERISK14_MOH_FREEPLAY_ULAW_IPK_DIR)/opt/etc/asterisk14-moh-freeplay-ulaw/...
170 # Documentation files should be installed in $(ASTERISK14_MOH_FREEPLAY_ULAW_IPK_DIR)/opt/doc/asterisk14-moh-freeplay-ulaw/...
171 # Daemon startup scripts should be installed in $(ASTERISK14_MOH_FREEPLAY_ULAW_IPK_DIR)/opt/etc/init.d/S??asterisk14-moh-freeplay-ulaw
172 #
173 # You may need to patch your application to make it use these locations.
174 #
175 $(ASTERISK14_MOH_FREEPLAY_ULAW_IPK): $(ASTERISK14_MOH_FREEPLAY_ULAW_BUILD_DIR)/.built
176         rm -rf $(ASTERISK14_MOH_FREEPLAY_ULAW_IPK_DIR) $(BUILD_DIR)/asterisk14-moh-freeplay-ulaw_*_$(TARGET_ARCH).ipk
177         $(MAKE) $(ASTERISK14_MOH_FREEPLAY_ULAW_IPK_DIR)/CONTROL/control
178         install -d $(ASTERISK14_MOH_FREEPLAY_ULAW_IPK_DIR)/opt/var/lib/asterisk/moh
179         install -m 644 $(ASTERISK14_MOH_FREEPLAY_ULAW_BUILD_DIR)/*ulaw $(ASTERISK14_MOH_FREEPLAY_ULAW_IPK_DIR)/opt/var/lib/asterisk/moh
180         cd $(BUILD_DIR); $(IPKG_BUILD) $(ASTERISK14_MOH_FREEPLAY_ULAW_IPK_DIR)
181
182 #
183 # This is called from the top level makefile to create the IPK file.
184 #
185 asterisk14-moh-freeplay-ulaw-ipk: $(ASTERISK14_MOH_FREEPLAY_ULAW_IPK)
186
187 #
188 # This is called from the top level makefile to clean all of the built files.
189 #
190 asterisk14-moh-freeplay-ulaw-clean:
191         rm -f $(ASTERISK14_MOH_FREEPLAY_ULAW_BUILD_DIR)/.built
192
193 #
194 # This is called from the top level makefile to clean all dynamically created
195 # directories.
196 asterisk14-moh-freeplay-ulaw-dirclean:
197         rm -rf $(BUILD_DIR)/$(ASTERISK14_MOH_FREEPLAY_ULAW_DIR) $(ASTERISK14_MOH_FREEPLAY_ULAW_BUILD_DIR) $(ASTERISK14_MOH_FREEPLAY_ULAW_IPK_DIR) $(ASTERISK14_MOH_FREEPLAY_ULAW_IPK)
198 #
199 #
200 # Some sanity check for the package.
201 #
202 asterisk14-moh-freeplay-ulaw-check: $(ASTERISK14_MOH_FREEPLAY_ULAW_IPK)
203         perl scripts/optware-check-package.pl --target=$(OPTWARE_TARGET) $(ASTERISK14_MOH_FREEPLAY_ULAW_IPK)
Note: See TracBrowser for help on using the browser.