root/trunk/make/adns.mk

Revision 6879, 7.4 kB (checked in by bzhou, 2 years ago)

adns: corrected symlink using wildcard

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 ###########################################################
2 #
3 # adns
4 #
5 ###########################################################
6
7 #
8 # ADNS_VERSION, ADNS_SITE and ADNS_SOURCE define
9 # the upstream location of the source code for the package.
10 # ADNS_DIR is the directory which is created when the source
11 # archive is unpacked.
12 # ADNS_UNZIP is the command used to unzip the source.
13 # It is usually "zcat" (for .gz) or "bzcat" (for .bz2)
14 #
15 # You should change all these variables to suit your package.
16 #
17 ADNS_SITE=http://www.chiark.greenend.org.uk/~ian/adns/ftp
18 ADNS_VERSION=1.4
19 ADNS_SOURCE=adns-$(ADNS_VERSION).tar.gz
20 ADNS_DIR=adns-$(ADNS_VERSION)
21 ADNS_UNZIP=zcat
22 ADNS_PRIORITY=optional
23 ADNS_MAINTAINER= NSLU2 Linux <nslu2-linux@yahoogroups.com>
24 ADNS_SECTION=libraries
25 ADNS_DEPENDS=
26 ADNS_DESCRIPTION=Asynchronous resolver library and DNS resolver utilities.
27
28 #
29 # ADNS_IPK_VERSION should be incremented when the ipk changes.
30 #
31 ADNS_IPK_VERSION=2
32
33 #
34 # ADNS_CONFFILES should be a list of user-editable files
35 ADNS_CONFFILES=/opt/etc/adns.conf /opt/etc/init.d/SXXadns
36
37 #
38 # ADNS_PATCHES should list any patches, in the the order in
39 # which they should be applied to the source code.
40 #
41 ADNS_PATCHES=
42
43 #
44 # If the compilation of the package requires additional
45 # compilation or linking flags, then list them here.
46 #
47 ADNS_CPPFLAGS=
48 ADNS_LDFLAGS=
49
50 #
51 # ADNS_BUILD_DIR is the directory in which the build is done.
52 # ADNS_SOURCE_DIR is the directory which holds all the
53 # patches and ipkg control files.
54 # ADNS_IPK_DIR is the directory in which the ipk is built.
55 # ADNS_IPK is the name of the resulting ipk files.
56 #
57 # You should not change any of these variables.
58 #
59 ADNS_BUILD_DIR=$(BUILD_DIR)/adns
60 ADNS_SOURCE_DIR=$(SOURCE_DIR)/adns
61 ADNS_IPK_DIR=$(BUILD_DIR)/adns-$(ADNS_VERSION)-ipk
62 ADNS_IPK=$(BUILD_DIR)/adns_$(ADNS_VERSION)-$(ADNS_IPK_VERSION)_$(TARGET_ARCH).ipk
63
64 #
65 # This is the dependency on the source code.  If the source is missing,
66 # then it will be fetched from the site using wget.
67 #
68 $(DL_DIR)/$(ADNS_SOURCE):
69         $(WGET) -P $(DL_DIR) $(ADNS_SITE)/$(ADNS_SOURCE)
70
71 #
72 # The source code depends on it existing within the download directory.
73 # This target will be called by the top level Makefile to download the
74 # source code's archive (.tar.gz, .bz2, etc.)
75 #
76 adns-source: $(DL_DIR)/$(ADNS_SOURCE) $(ADNS_PATCHES)
77
78 #
79 # This target unpacks the source code in the build directory.
80 # If the source archive is not .tar.gz or .tar.bz2, then you will need
81 # to change the commands here.  Patches to the source code are also
82 # applied in this target as required.
83 #
84 # This target also configures the build within the build directory.
85 # Flags such as LDFLAGS and CPPFLAGS should be passed into configure
86 # and NOT $(MAKE) below.  Passing it to configure causes configure to
87 # correctly BUILD the Makefile with the right paths, where passing it
88 # to Make causes it to override the default search paths of the compiler.
89 #
90 # If the compilation of the package requires other packages to be staged
91 # first, then do that first (e.g. "$(MAKE) <bar>-stage <baz>-stage").
92 #
93 $(ADNS_BUILD_DIR)/.configured: $(DL_DIR)/$(ADNS_SOURCE) $(ADNS_PATCHES)
94         rm -rf $(BUILD_DIR)/$(ADNS_DIR) $(ADNS_BUILD_DIR)
95         $(ADNS_UNZIP) $(DL_DIR)/$(ADNS_SOURCE) | tar -C $(BUILD_DIR) -xvf -
96 #       cat $(ADNS_PATCHES) | patch -d $(BUILD_DIR)/$(ADNS_DIR) -p1
97         mv $(BUILD_DIR)/$(ADNS_DIR) $(ADNS_BUILD_DIR)
98         (cd $(ADNS_BUILD_DIR); \
99                 $(TARGET_CONFIGURE_OPTS) \
100                 CPPFLAGS="$(STAGING_CPPFLAGS) $(ADNS_CPPFLAGS)" \
101                 LDFLAGS="$(STAGING_LDFLAGS) $(ADNS_LDFLAGS)" \
102                 ./configure \
103                 --build=$(GNU_HOST_NAME) \
104                 --host=$(GNU_TARGET_NAME) \
105                 --target=$(GNU_TARGET_NAME) \
106                 --prefix=/opt \
107                 --disable-nls \
108         )
109         touch $(ADNS_BUILD_DIR)/.configured
110
111 adns-unpack: $(ADNS_BUILD_DIR)/.configured
112
113 #
114 # This builds the actual binary.
115 #
116 $(ADNS_BUILD_DIR)/.built: $(ADNS_BUILD_DIR)/.configured
117         rm -f $(ADNS_BUILD_DIR)/.built
118         $(MAKE) -C $(ADNS_BUILD_DIR)
119         touch $(ADNS_BUILD_DIR)/.built
120
121 #
122 # This is the build convenience target.
123 #
124 adns: $(ADNS_BUILD_DIR)/.built
125
126 #
127 # If you are building a library, then you need to stage it too.
128 #
129 $(ADNS_BUILD_DIR)/.staged: $(ADNS_BUILD_DIR)/.built
130         rm -f $(ADNS_BUILD_DIR)/.staged
131         (cd $(ADNS_BUILD_DIR); \
132                 install -c -m 644 src/libadns.a $(STAGING_LIB_DIR)/libadns.a ; \
133                 install -c -m 755 dynamic/libadns.so.$(ADNS_VERSION) \
134                          $(STAGING_LIB_DIR)/libadns.so.$(ADNS_VERSION) ; \
135                 ln -sf libadns.so.$(ADNS_VERSION) \
136                         $(STAGING_LIB_DIR)/libadns.so.1 ; \
137                 ln -sf libadns.so.$(ADNS_VERSION) $(STAGING_LIB_DIR)/libadns.so ; \
138                 install -c -m 644 src/adns.h $(STAGING_INCLUDE_DIR)/adns.h ; \
139         )
140         touch $(ADNS_BUILD_DIR)/.staged
141
142 adns-stage: $(ADNS_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/<foo>
147 #
148 $(ADNS_IPK_DIR)/CONTROL/control:
149         @install -d $(ADNS_IPK_DIR)/CONTROL
150         @rm -f $@
151         @echo "Package: adns" >>$@
152         @echo "Architecture: $(TARGET_ARCH)" >>$@
153         @echo "Priority: $(ADNS_PRIORITY)" >>$@
154         @echo "Section: $(ADNS_SECTION)" >>$@
155         @echo "Version: $(ADNS_VERSION)-$(ADNS_IPK_VERSION)" >>$@
156         @echo "Maintainer: $(ADNS_MAINTAINER)" >>$@
157         @echo "Source: $(ADNS_SITE)/$(ADNS_SOURCE)" >>$@
158         @echo "Description: $(ADNS_DESCRIPTION)" >>$@
159         @echo "Depends: $(ADNS_DEPENDS)" >>$@
160         @echo "Conflicts: $(ADNS_CONFLICTS)" >>$@
161
162 #
163 # This builds the IPK file.
164 #
165 # Binaries should be installed into $(ADNS_IPK_DIR)/opt/sbin or $(ADNS_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 $(ADNS_IPK_DIR)/opt/{lib,include}
168 # Configuration files should be installed in $(ADNS_IPK_DIR)/opt/etc/adns/...
169 # Documentation files should be installed in $(ADNS_IPK_DIR)/opt/doc/adns/...
170 # Daemon startup scripts should be installed in $(ADNS_IPK_DIR)/opt/etc/init.d/S??adns
171 #
172 # You may need to patch your application to make it use these locations.
173 #
174 $(ADNS_IPK): $(ADNS_BUILD_DIR)/.built
175         rm -rf $(ADNS_IPK_DIR) $(BUILD_DIR)/adns_*_$(TARGET_ARCH).ipk
176         install -d $(ADNS_IPK_DIR)/opt/lib/
177         #install -m 644 $(ADNS_BUILD_DIR)/src/libadns.a $(ADNS_IPK_DIR)/opt/lib/libadns.a
178         install -m 755 $(ADNS_BUILD_DIR)/dynamic/libadns.so.[0-9]*.[0-9]* \
179                  $(ADNS_IPK_DIR)/opt/lib/
180         cd $(ADNS_IPK_DIR)/opt/lib && ln -sf libadns.so.[0-9]*.[0-9]* libadns.so.1
181         ln -sf libadns.so.1 $(ADNS_IPK_DIR)/opt/lib/libadns.so
182         $(STRIP_COMMAND) $(ADNS_IPK_DIR)/opt/lib/libadns.so.[0-9]*.[0-9]*
183         install -d $(ADNS_IPK_DIR)/opt/include/
184         install -m 644 $(ADNS_BUILD_DIR)/src/adns.h $(ADNS_IPK_DIR)/opt/include/adns.h
185         install -d $(ADNS_IPK_DIR)/opt/bin/
186         install -m 755 $(ADNS_BUILD_DIR)/client/adnslogres    $(ADNS_IPK_DIR)/opt/bin/adnslogres
187         install -m 755 $(ADNS_BUILD_DIR)/client/adnshost      $(ADNS_IPK_DIR)/opt/bin/adnshost
188         install -m 755 $(ADNS_BUILD_DIR)/client/adnsresfilter $(ADNS_IPK_DIR)/opt/bin/adnsresfilter
189         $(STRIP_COMMAND) $(ADNS_IPK_DIR)/opt/bin/*
190         install -d $(ADNS_IPK_DIR)/CONTROL
191         $(MAKE) $(ADNS_IPK_DIR)/CONTROL/control
192         cd $(BUILD_DIR); $(IPKG_BUILD) $(ADNS_IPK_DIR)
193
194 #
195 # This is called from the top level makefile to create the IPK file.
196 #
197 adns-ipk: $(ADNS_IPK)
198
199 #
200 # This is called from the top level makefile to clean all of the built files.
201 #
202 adns-clean:
203         -$(MAKE) -C $(ADNS_BUILD_DIR) clean
204
205 #
206 # This is called from the top level makefile to clean all dynamically created
207 # directories.
208 #
209 adns-dirclean:
210         rm -rf $(BUILD_DIR)/$(ADNS_DIR) $(ADNS_BUILD_DIR) $(ADNS_IPK_DIR) $(ADNS_IPK)
211
212 #
213 # Some sanity check for the package.
214 #
215 adns-check: $(ADNS_IPK)
216         perl scripts/optware-check-package.pl --target=$(OPTWARE_TARGET) $(ADNS_IPK)
Note: See TracBrowser for help on using the browser.