root/trunk/make/abook.mk

Revision 11229, 7.0 kB (checked in by jomaster, 1 month ago)

abook: removing build-marker on cleaning

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 ###########################################################
2 #
3 # abook
4 #
5 ###########################################################
6
7 #
8 # ABOOK_VERSION, ABOOK_SITE and ABOOK_SOURCE define
9 # the upstream location of the source code for the package.
10 # ABOOK_DIR is the directory which is created when the source
11 # archive is unpacked.
12 # ABOOK_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 # Please make sure that you add a description, and that you
17 # list all your packages' dependencies, seperated by commas.
18 #
19 # If you list yourself as MAINTAINER, please give a valid email
20 # address, and indicate your irc nick if it cannot be easily deduced
21 # from your name or email address.  If you leave MAINTAINER set to
22 # "NSLU2 Linux" other developers will feel free to edit.
23 #
24 ABOOK_SITE=http://$(SOURCEFORGE_MIRROR)/sourceforge/abook
25 ABOOK_VERSION=0.5.6
26 ABOOK_SOURCE=abook-$(ABOOK_VERSION).tar.gz
27 ABOOK_DIR=abook-$(ABOOK_VERSION)
28 ABOOK_UNZIP=zcat
29 ABOOK_MAINTAINER=Brian Zhou <bzhou@users.sf.net>
30 ABOOK_DESCRIPTION=Abook is a text-based addressbook program designed to use with mutt mail client.
31 ABOOK_SECTION=misc
32 ABOOK_PRIORITY=optional
33 ABOOK_DEPENDS=ncurses, readline
34 ABOOK_CONFLICTS=
35
36 #
37 # ABOOK_IPK_VERSION should be incremented when the ipk changes.
38 #
39 ABOOK_IPK_VERSION=2
40
41 #
42 # ABOOK_CONFFILES should be a list of user-editable files
43 #ABOOK_CONFFILES=/opt/etc/abook.conf /opt/etc/init.d/SXXabook
44
45 #
46 # ABOOK_PATCHES should list any patches, in the the order in
47 # which they should be applied to the source code.
48 #
49 ABOOK_PATCHES=$(ABOOK_SOURCE_DIR)/0.5.6-01_editor
50
51 #
52 # If the compilation of the package requires additional
53 # compilation or linking flags, then list them here.
54 #
55 ABOOK_CPPFLAGS=
56 ABOOK_LDFLAGS=
57
58 #
59 # ABOOK_BUILD_DIR is the directory in which the build is done.
60 # ABOOK_SOURCE_DIR is the directory which holds all the
61 # patches and ipkg control files.
62 # ABOOK_IPK_DIR is the directory in which the ipk is built.
63 # ABOOK_IPK is the name of the resulting ipk files.
64 #
65 # You should not change any of these variables.
66 #
67 ABOOK_BUILD_DIR=$(BUILD_DIR)/abook
68 ABOOK_SOURCE_DIR=$(SOURCE_DIR)/abook
69 ABOOK_IPK_DIR=$(BUILD_DIR)/abook-$(ABOOK_VERSION)-ipk
70 ABOOK_IPK=$(BUILD_DIR)/abook_$(ABOOK_VERSION)-$(ABOOK_IPK_VERSION)_$(TARGET_ARCH).ipk
71
72 .PHONY: abook-source abook-unpack abook abook-stage abook-ipk abook-clean abook-dirclean abook-check
73
74 #
75 # This is the dependency on the source code.  If the source is missing,
76 # then it will be fetched from the site using wget.
77 #
78 $(DL_DIR)/$(ABOOK_SOURCE):
79         $(WGET) -P $(@D) $(ABOOK_SITE)/$(@F) || \
80         $(WGET) -P $(@D) $(SOURCES_NLO_SITE)/$(@F)
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 abook-source: $(DL_DIR)/$(ABOOK_SOURCE) $(ABOOK_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 $(ABOOK_BUILD_DIR)/.configured: $(DL_DIR)/$(ABOOK_SOURCE) $(ABOOK_PATCHES) make/abook.mk
105         $(MAKE) readline-stage ncurses-stage
106         rm -rf $(BUILD_DIR)/$(ABOOK_DIR) $(ABOOK_BUILD_DIR)
107         $(ABOOK_UNZIP) $(DL_DIR)/$(ABOOK_SOURCE) | tar -C $(BUILD_DIR) -xvf -
108         if test -n "$(ABOOK_PATCHES)"; \
109                 then cat $(ABOOK_PATCHES) | patch -d $(BUILD_DIR)/$(ABOOK_DIR) -p0; \
110         fi
111         mv $(BUILD_DIR)/$(ABOOK_DIR) $(@D)
112         cp -f $(SOURCE_DIR)/common/config.* $(@D)/
113         (cd $(@D); \
114                 $(TARGET_CONFIGURE_OPTS) \
115                 CPPFLAGS="$(STAGING_CPPFLAGS) $(ABOOK_CPPFLAGS)" \
116                 LDFLAGS="$(STAGING_LDFLAGS) $(ABOOK_LDFLAGS)" \
117                 ./configure \
118                 --build=$(GNU_HOST_NAME) \
119                 --host=$(GNU_TARGET_NAME) \
120                 --target=$(GNU_TARGET_NAME) \
121                 --prefix=/opt \
122                 --disable-nls \
123         )
124         touch $@
125
126 abook-unpack: $(ABOOK_BUILD_DIR)/.configured
127
128 #
129 # This builds the actual binary.
130 #
131 $(ABOOK_BUILD_DIR)/.built: $(ABOOK_BUILD_DIR)/.configured
132         rm -f $@
133         $(MAKE) -C $(@D)
134         touch $@
135
136 #
137 # This is the build convenience target.
138 #
139 abook: $(ABOOK_BUILD_DIR)/.built
140
141 #
142 # If you are building a library, then you need to stage it too.
143 #
144 #$(ABOOK_BUILD_DIR)/.staged: $(ABOOK_BUILD_DIR)/.built
145 #       rm -f $@
146 #       $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) install
147 #       touch $@
148 #
149 #abook-stage: $(ABOOK_BUILD_DIR)/.staged
150
151 #
152 # This rule creates a control file for ipkg.  It is no longer
153 # necessary to create a seperate control file under sources/abook
154 #
155 $(ABOOK_IPK_DIR)/CONTROL/control:
156         @install -d $(@D)
157         @rm -f $@
158         @echo "Package: abook" >>$@
159         @echo "Architecture: $(TARGET_ARCH)" >>$@
160         @echo "Priority: $(ABOOK_PRIORITY)" >>$@
161         @echo "Section: $(ABOOK_SECTION)" >>$@
162         @echo "Version: $(ABOOK_VERSION)-$(ABOOK_IPK_VERSION)" >>$@
163         @echo "Maintainer: $(ABOOK_MAINTAINER)" >>$@
164         @echo "Source: $(ABOOK_SITE)/$(ABOOK_SOURCE)" >>$@
165         @echo "Description: $(ABOOK_DESCRIPTION)" >>$@
166         @echo "Depends: $(ABOOK_DEPENDS)" >>$@
167         @echo "Conflicts: $(ABOOK_CONFLICTS)" >>$@
168
169 #
170 # This builds the IPK file.
171 #
172 # Binaries should be installed into $(ABOOK_IPK_DIR)/opt/sbin or $(ABOOK_IPK_DIR)/opt/bin
173 # (use the location in a well-known Linux distro as a guide for choosing sbin or bin).
174 # Libraries and include files should be installed into $(ABOOK_IPK_DIR)/opt/{lib,include}
175 # Configuration files should be installed in $(ABOOK_IPK_DIR)/opt/etc/abook/...
176 # Documentation files should be installed in $(ABOOK_IPK_DIR)/opt/doc/abook/...
177 # Daemon startup scripts should be installed in $(ABOOK_IPK_DIR)/opt/etc/init.d/S??abook
178 #
179 # You may need to patch your application to make it use these locations.
180 #
181 $(ABOOK_IPK): $(ABOOK_BUILD_DIR)/.built
182         rm -rf $(ABOOK_IPK_DIR) $(BUILD_DIR)/abook_*_$(TARGET_ARCH).ipk
183         $(MAKE) -C $(ABOOK_BUILD_DIR) DESTDIR=$(ABOOK_IPK_DIR) install-strip
184         $(MAKE) $(ABOOK_IPK_DIR)/CONTROL/control
185 #       echo $(ABOOK_CONFFILES) | sed -e 's/ /\n/g' > $(ABOOK_IPK_DIR)/CONTROL/conffiles
186         cd $(BUILD_DIR); $(IPKG_BUILD) $(ABOOK_IPK_DIR)
187
188 #
189 # This is called from the top level makefile to create the IPK file.
190 #
191 abook-ipk: $(ABOOK_IPK)
192
193 #
194 # This is called from the top level makefile to clean all of the built files.
195 #
196 abook-clean:
197         rm -f $(ABOOK_BUILD_DIR)/.built
198         -$(MAKE) -C $(ABOOK_BUILD_DIR) clean
199
200 #
201 # This is called from the top level makefile to clean all dynamically created
202 # directories.
203 #
204 abook-dirclean:
205         rm -rf $(BUILD_DIR)/$(ABOOK_DIR) $(ABOOK_BUILD_DIR) $(ABOOK_IPK_DIR) $(ABOOK_IPK)
206
207 #
208 # Some sanity check for the package.
209 #
210 abook-check: $(ABOOK_IPK)
211         perl scripts/optware-check-package.pl --target=$(OPTWARE_TARGET) $^
Note: See TracBrowser for help on using the browser.