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

Revision 7278, 10.1 kB (checked in by osas, 2 years ago)

asterisk14 sounds: moh in alaw and g729 ready for testing

Line 
1 ###########################################################
2 #
3 # asterisk14-moh-freeplay-g729
4 #
5 ###########################################################
6 #
7 # ASTERISK14_MOH_FREEPLAY_G729_VERSION, ASTERISK14_MOH_FREEPLAY_G729_SITE and ASTERISK14_MOH_FREEPLAY_G729_SOURCE define
8 # the upstream location of the source code for the package.
9 # ASTERISK14_MOH_FREEPLAY_G729_DIR is the directory which is created when the source
10 # archive is unpacked.
11 # ASTERISK14_MOH_FREEPLAY_G729_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_G729_SITE=http://downloads.digium.com/pub/telephony/sounds/releases
24 ASTERISK14_MOH_FREEPLAY_G729_VERSION=0.0.0
25 #ASTERISK14_MOH_FREEPLAY_G729_SOURCE=asterisk-moh-freeplay-g729-$(ASTERISK14_MOH_FREEPLAY_G729_VERSION).tar.gz
26 ASTERISK14_MOH_FREEPLAY_G729_SOURCE=asterisk-moh-freeplay-g729.tar.gz
27 ASTERISK14_MOH_FREEPLAY_G729_DIR=asterisk-moh-freeplay-g729-$(ASTERISK14_MOH_FREEPLAY_G729_VERSION)
28 ASTERISK14_MOH_FREEPLAY_G729_UNZIP=zcat
29 ASTERISK14_MOH_FREEPLAY_G729_MAINTAINER=NSLU2 Linux <nslu2-linux@yahoogroups.com>
30 ASTERISK14_MOH_FREEPLAY_G729_DESCRIPTION=asterisk-moh-freeplay-g729
31 ASTERISK14_MOH_FREEPLAY_G729_SECTION=misc
32 ASTERISK14_MOH_FREEPLAY_G729_PRIORITY=optional
33 ASTERISK14_MOH_FREEPLAY_G729_DEPENDS=
34 ASTERISK14_MOH_FREEPLAY_G729_SUGGESTS=
35 ASTERISK14_MOH_FREEPLAY_G729_CONFLICTS=asterisk-sounds
36
37 #
38 # ASTERISK14_MOH_FREEPLAY_G729_IPK_VERSION should be incremented when the ipk changes.
39 #
40 ASTERISK14_MOH_FREEPLAY_G729_IPK_VERSION=1
41
42 #
43 # ASTERISK14_MOH_FREEPLAY_G729_CONFFILES should be a list of user-editable files
44 #ASTERISK14_MOH_FREEPLAY_G729_CONFFILES=/opt/etc/asterisk14-moh-freeplay-g729.conf /opt/etc/init.d/SXXasterisk14-moh-freeplay-g729
45
46 #
47 # ASTERISK14_MOH_FREEPLAY_G729_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_G729_PATCHES=$(ASTERISK14_MOH_FREEPLAY_G729_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_G729_CPPFLAGS=
57 ASTERISK14_MOH_FREEPLAY_G729_LDFLAGS=
58
59 #
60 # ASTERISK14_MOH_FREEPLAY_G729_BUILD_DIR is the directory in which the build is done.
61 # ASTERISK14_MOH_FREEPLAY_G729_SOURCE_DIR is the directory which holds all the
62 # patches and ipkg control files.
63 # ASTERISK14_MOH_FREEPLAY_G729_IPK_DIR is the directory in which the ipk is built.
64 # ASTERISK14_MOH_FREEPLAY_G729_IPK is the name of the resulting ipk files.
65 #
66 # You should not change any of these variables.
67 #
68 ASTERISK14_MOH_FREEPLAY_G729_BUILD_DIR=$(BUILD_DIR)/asterisk14-moh-freeplay-g729
69 ASTERISK14_MOH_FREEPLAY_G729_SOURCE_DIR=$(SOURCE_DIR)/asterisk14-moh-freeplay-g729
70 ASTERISK14_MOH_FREEPLAY_G729_IPK_DIR=$(BUILD_DIR)/asterisk14-moh-freeplay-g729-$(ASTERISK14_MOH_FREEPLAY_G729_VERSION)-ipk
71 ASTERISK14_MOH_FREEPLAY_G729_IPK=$(BUILD_DIR)/asterisk14-moh-freeplay-g729_$(ASTERISK14_MOH_FREEPLAY_G729_VERSION)-$(ASTERISK14_MOH_FREEPLAY_G729_IPK_VERSION)_$(TARGET_ARCH).ipk
72
73 .PHONY: asterisk14-moh-freeplay-g729-source asterisk14-moh-freeplay-g729-unpack asterisk14-moh-freeplay-g729 asterisk14-moh-freeplay-g729-stage asterisk14-moh-freeplay-g729-ipk asterisk14-moh-freeplay-g729-clean asterisk14-moh-freeplay-g729-dirclean asterisk14-moh-freeplay-g729-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_G729_SOURCE):
80         $(WGET) -P $(DL_DIR) $(ASTERISK14_MOH_FREEPLAY_G729_SITE)/$(ASTERISK14_MOH_FREEPLAY_G729_SOURCE)
81
82 #
83 # The source code depends on it existing within the download directory.
84 # This target will be called by the top level Makefile to download the
85 # source code's archive (.tar.gz, .bz2, etc.)
86 #
87 #asterisk14-moh-freeplay-g729-source: $(DL_DIR)/$(ASTERISK14_MOH_FREEPLAY_G729_SOURCE) $(ASTERISK14_MOH_FREEPLAY_G729_PATCHES)
88
89 #
90 # This target unpacks the source code in the build directory.
91 # If the source archive is not .tar.gz or .tar.bz2, then you will need
92 # to change the commands here.  Patches to the source code are also
93 # applied in this target as required.
94 #
95 # This target also configures the build within the build directory.
96 # Flags such as LDFLAGS and CPPFLAGS should be passed into configure
97 # and NOT $(MAKE) below.  Passing it to configure causes configure to
98 # correctly BUILD the Makefile with the right paths, where passing it
99 # to Make causes it to override the default search paths of the compiler.
100 #
101 # If the compilation of the package requires other packages to be staged
102 # first, then do that first (e.g. "$(MAKE) <bar>-stage <baz>-stage").
103 #
104 # If the package uses  GNU libtool, you should invoke $(PATCH_LIBTOOL) as
105 # shown below to make various patches to it.
106 #
107 $(ASTERISK14_MOH_FREEPLAY_G729_BUILD_DIR)/.configured: $(DL_DIR)/$(ASTERISK14_MOH_FREEPLAY_G729_SOURCE) $(ASTERISK14_MOH_FREEPLAY_G729_PATCHES) make/asterisk14-moh-freeplay-g729.mk
108         #$(MAKE) <bar>-stage <baz>-stage
109         rm -rf $(BUILD_DIR)/$(ASTERISK14_MOH_FREEPLAY_G729_DIR) $(ASTERISK14_MOH_FREEPLAY_G729_BUILD_DIR)
110         mkdir -p $(BUILD_DIR)/$(ASTERISK14_MOH_FREEPLAY_G729_DIR); $(ASTERISK14_MOH_FREEPLAY_G729_UNZIP) $(DL_DIR)/$(ASTERISK14_MOH_FREEPLAY_G729_SOURCE) | tar -C $(BUILD_DIR)/$(ASTERISK14_MOH_FREEPLAY_G729_DIR) -xvf -
111         if test -n "$(ASTERISK14_MOH_FREEPLAY_G729_PATCHES)" ; \
112                 then cat $(ASTERISK14_MOH_FREEPLAY_G729_PATCHES) | \
113                 patch -d $(BUILD_DIR)/$(ASTERISK14_MOH_FREEPLAY_G729_DIR) -p0 ; \
114         fi
115         if test "$(BUILD_DIR)/$(ASTERISK14_MOH_FREEPLAY_G729_DIR)" != "$(ASTERISK14_MOH_FREEPLAY_G729_BUILD_DIR)" ; \
116                 then mv $(BUILD_DIR)/$(ASTERISK14_MOH_FREEPLAY_G729_DIR) $(ASTERISK14_MOH_FREEPLAY_G729_BUILD_DIR) ; \
117         fi
118         touch $(ASTERISK14_MOH_FREEPLAY_G729_BUILD_DIR)/.configured
119
120 asterisk14-moh-freeplay-g729-unpack: $(ASTERISK14_MOH_FREEPLAY_G729_BUILD_DIR)/.configured
121
122 #
123 # This builds the actual binary.
124 #
125 $(ASTERISK14_MOH_FREEPLAY_G729_BUILD_DIR)/.built: $(ASTERISK14_MOH_FREEPLAY_G729_BUILD_DIR)/.configured
126         rm -f $(ASTERISK14_MOH_FREEPLAY_G729_BUILD_DIR)/.built
127         touch $(ASTERISK14_MOH_FREEPLAY_G729_BUILD_DIR)/.built
128
129 #
130 # This is the build convenience target.
131 #
132 asterisk14-moh-freeplay-g729: $(ASTERISK14_MOH_FREEPLAY_G729_BUILD_DIR)/.built
133
134 #
135 # If you are building a library, then you need to stage it too.
136 #
137 $(ASTERISK14_MOH_FREEPLAY_G729_BUILD_DIR)/.staged: $(ASTERISK14_MOH_FREEPLAY_G729_BUILD_DIR)/.built
138         rm -f $(ASTERISK14_MOH_FREEPLAY_G729_BUILD_DIR)/.staged
139         touch $(ASTERISK14_MOH_FREEPLAY_G729_BUILD_DIR)/.staged
140
141 asterisk14-moh-freeplay-g729-stage: $(ASTERISK14_MOH_FREEPLAY_G729_BUILD_DIR)/.staged
142
143 #
144 # This rule creates a control file for ipkg.  It is no longer
145 # necessary to create a seperate control file under sources/asterisk14-moh-freeplay-g729
146 #
147 $(ASTERISK14_MOH_FREEPLAY_G729_IPK_DIR)/CONTROL/control:
148         @install -d $(@D)
149         @rm -f $@
150         @echo "Package: asterisk14-moh-freeplay-g729" >>$@
151         @echo "Architecture: $(TARGET_ARCH)" >>$@
152         @echo "Priority: $(ASTERISK14_MOH_FREEPLAY_G729_PRIORITY)" >>$@
153         @echo "Section: $(ASTERISK14_MOH_FREEPLAY_G729_SECTION)" >>$@
154         @echo "Version: $(ASTERISK14_MOH_FREEPLAY_G729_VERSION)-$(ASTERISK14_MOH_FREEPLAY_G729_IPK_VERSION)" >>$@
155         @echo "Maintainer: $(ASTERISK14_MOH_FREEPLAY_G729_MAINTAINER)" >>$@
156         @echo "Source: $(ASTERISK14_MOH_FREEPLAY_G729_SITE)/$(ASTERISK14_MOH_FREEPLAY_G729_SOURCE)" >>$@
157         @echo "Description: $(ASTERISK14_MOH_FREEPLAY_G729_DESCRIPTION)" >>$@
158         @echo "Depends: $(ASTERISK14_MOH_FREEPLAY_G729_DEPENDS)" >>$@
159         @echo "Suggests: $(ASTERISK14_MOH_FREEPLAY_G729_SUGGESTS)" >>$@
160         @echo "Conflicts: $(ASTERISK14_MOH_FREEPLAY_G729_CONFLICTS)" >>$@
161
162 #
163 # This builds the IPK file.
164 #
165 # Binaries should be installed into $(ASTERISK14_MOH_FREEPLAY_G729_IPK_DIR)/opt/sbin or $(ASTERISK14_MOH_FREEPLAY_G729_IPK_DIR)/opt/bin
166 # (use the location in a well-known Linux distro as a guide for choosing sbin or bin).
167 # Libraries and include files should be installed into $(ASTERISK14_MOH_FREEPLAY_G729_IPK_DIR)/opt/{lib,include}
168 # Configuration files should be installed in $(ASTERISK14_MOH_FREEPLAY_G729_IPK_DIR)/opt/etc/asterisk14-moh-freeplay-g729/...
169 # Documentation files should be installed in $(ASTERISK14_MOH_FREEPLAY_G729_IPK_DIR)/opt/doc/asterisk14-moh-freeplay-g729/...
170 # Daemon startup scripts should be installed in $(ASTERISK14_MOH_FREEPLAY_G729_IPK_DIR)/opt/etc/init.d/S??asterisk14-moh-freeplay-g729
171 #
172 # You may need to patch your application to make it use these locations.
173 #
174 $(ASTERISK14_MOH_FREEPLAY_G729_IPK): $(ASTERISK14_MOH_FREEPLAY_G729_BUILD_DIR)/.built
175         rm -rf $(ASTERISK14_MOH_FREEPLAY_G729_IPK_DIR) $(BUILD_DIR)/asterisk14-moh-freeplay-g729_*_$(TARGET_ARCH).ipk
176         $(MAKE) $(ASTERISK14_MOH_FREEPLAY_G729_IPK_DIR)/CONTROL/control
177         install -d $(ASTERISK14_MOH_FREEPLAY_G729_IPK_DIR)/opt/var/lib/asterisk/moh
178         install -m 644 $(ASTERISK14_MOH_FREEPLAY_G729_BUILD_DIR)/*g729 $(ASTERISK14_MOH_FREEPLAY_G729_IPK_DIR)/opt/var/lib/asterisk/moh
179         cd $(BUILD_DIR); $(IPKG_BUILD) $(ASTERISK14_MOH_FREEPLAY_G729_IPK_DIR)
180
181 #
182 # This is called from the top level makefile to create the IPK file.
183 #
184 asterisk14-moh-freeplay-g729-ipk: $(ASTERISK14_MOH_FREEPLAY_G729_IPK)
185
186 #
187 # This is called from the top level makefile to clean all of the built files.
188 #
189 asterisk14-moh-freeplay-g729-clean:
190         rm -f $(ASTERISK14_MOH_FREEPLAY_G729_BUILD_DIR)/.built
191
192 #
193 # This is called from the top level makefile to clean all dynamically created
194 # directories.
195 asterisk14-moh-freeplay-g729-dirclean:
196         rm -rf $(BUILD_DIR)/$(ASTERISK14_MOH_FREEPLAY_G729_DIR) $(ASTERISK14_MOH_FREEPLAY_G729_BUILD_DIR) $(ASTERISK14_MOH_FREEPLAY_G729_IPK_DIR) $(ASTERISK14_MOH_FREEPLAY_G729_IPK)
197 #
198 #
199 # Some sanity check for the package.
200 #
201 asterisk14-moh-freeplay-g729-check: $(ASTERISK14_MOH_FREEPLAY_G729_IPK)
202         perl scripts/optware-check-package.pl --target=$(OPTWARE_TARGET) $(ASTERISK14_MOH_FREEPLAY_G729_IPK)
Note: See TracBrowser for help on using the browser.