Tagging release version 0.6.0
[mdictionary] / Makefile
1 ARCH = `arch`
2 REP_TAG = ../tags
3 REP_BRANCH = branches
4
5
6 #declaration of directory names
7 BINARIES = bin
8 SOURCE = src
9 INCLUDE = include
10 DATA = data
11 PLUGINS = ${SOURCE}/plugins
12 XDXF_PLUGIN = ${PLUGINS}/xdxf
13 STARDICT_PLUGIN = ${PLUGINS}/stardict
14 GUI = ${SOURCE}/gui
15 MANAGER = ${SOURCE}/manager
16 DBUS = ${SOURCE}/dbus_wrapper
17 BOOKMARKS = ${SOURCE}/bookmarks
18 PACKAGES = packages
19
20 #probably trash
21 STARDICT = stardict
22 APP_NAME = whitestork
23
24 #versions
25 MAJOR_VER = 0
26 MINOR_VER = 6
27 RELEASE_MAJOR_VER = 0
28 RELEASE_MINOR_VER = 6
29 RELEASE_PATCH_VER = 0
30 # APP_VER = ${MAJOR_VER}.${MINOR_VER}.`svn info | grep "Revision:" | awk '{print $$2}'`
31 PACK_VER = 1
32 FRM_VER = 0.1
33
34 VERSION_FILE = ./${INCLUDE}/ws_version.h
35
36 #package structure
37 GUI_PACK_NAME = whitestorkgui
38 MNG_PACK_NAME = whitestork
39 PLUGINS_PACK_NAME = whitestorkplugins
40 BOOKMARKS_PACK_NAME = whitestorkbookmarks
41 META_PACK = whitestorkdictionary
42
43 GUI_EXECUTABLE = ${BINARIES}/WhiteStork
44 GUI_SERVICEFILE = org.maemo.WhiteStorkGui.service
45 GUI_DIRS = ${PACKAGES}/${GUI_PACK_NAME}/usr/bin ${PACKAGES}/${GUI_PACK_NAME}/usr/share/applications/hildon ${PACKAGES}/${GUI_PACK_NAME}/usr/share/doc/whitestorkgui ${PACKAGES}/${GUI_PACK_NAME}/usr/share/pixmaps ${PACKAGES}/${GUI_PACK_NAME}/usr/share/dbus-1/services ${PACKAGES}/${GUI_PACK_NAME}/usr/share/locale  
46 GUI_DBUS = ${DATA}/other/${GUI_SERVICEFILE}
47 GUI_ICONS = ${DATA}/icons/whitestork_icon.png ${DATA}/icons/whitestork.png ${DATA}/icons/ws_top.png ${DATA}/icons/ws_tra.png
48 GUI_LOCALE = ${DATA}/locale/en_GB ${DATA}/locale/pl_PL
49 GUI_DOC = ${DATA}/docs/${GUI_PACK_NAME}/
50 GUI_OTHER = ${DATA}/other/whitestork.desktop
51
52 MNG_EXECUTABLE = ${BINARIES}/WhiteStorkManager 
53 MNG_SERVICEFILE = org.maemo.WhiteStorkManager.service
54 MNG_LIB = ${BINARIES}/ws_bookmark.so
55 MNG_DIRS = ${PACKAGES}/${MNG_PACK_NAME}/usr/bin ${PACKAGES}/${MNG_PACK_NAME}/usr/lib/WhiteStork ${PACKAGES}/${MNG_PACK_NAME}/usr/share/dbus-1/services  ${PACKAGES}/${MNG_PACK_NAME}/usr/share/WhiteStork ${PACKAGES}/${MNG_PACK_NAME}/usr/share/doc/${MNG_PACK_NAME}
56 MNG_DBUS = ${DATA}/other/${MNG_SERVICEFILE}
57 MNG_OTHER = ${DATA}/dictionaries
58 MNG_DOC = ${DATA}/docs/${MNG_PACK_NAME}/
59
60 PLUGINS_LIB = ${BINARIES}/engine_*.so
61 PLUGINS_DIRS = ${PACKAGES}/${PLUGINS_PACK_NAME}/usr/lib/WhiteStork ${PACKAGES}/${PLUGINS_PACK_NAME}/usr/share/doc/${PLUGINS_PACK_NAME} ${PACKAGES}/${PLUGINS_PACK_NAME}/usr/share/pixmaps
62 PLUGINS_ICONS = ${DATA}/icons/engine_xdxf_icon.png
63 PLUGINS_DOC = ${DATA}/docs/${PLUGINS_PACK_NAME}/
64
65 MAIL_ADDRESS = mdictionary-devel@garage.maemo.org
66 LOCALEDIR=/usr/share/locale
67 GETTEXT_PACKAGE=whitestork
68 ALL_LINGUAS="en_GB"
69
70
71 #ifeq (${MAKECMDGOALS}, release-package)
72 #       APP_VER = ${RELEASE_MAJOR_VER}.${RELEASE_MINOR_VER}.`svn info | grep "Revision:" | awk '{print $$2}'`
73 #else
74 #       APP_VER = ${MAJOR_VER}.${MINOR_VER}.`svn info | grep "Revision:" | awk '{print $$2}'`
75 #endif
76
77 ifeq (${MAKECMDGOALS}, release-package)
78 APP_VER = ${RELEASE_MAJOR_VER}.${RELEASE_MINOR_VER}.${RELEASE_PATCH_VER}
79 else
80 APP_VER = ${MAJOR_VER}.${MINOR_VER}.`svn info | grep "Revision:" | awk '{print $$2}'`
81 endif
82
83 FILES = ${DATA}/files_debbuild
84 LOG_DIR = logs
85 LOG_CLEAN = ${LOG_DIR}/clean.log
86 LOG_BUILD = ${LOG_DIR}/build.log
87 LOG_RUN = ${LOG_DIR}/run.log
88 LOG_DEBS = ${LOG_DIR}/debs.log
89 LOG_INST = ${LOG_DIR}/install.log
90
91 first: build
92         @echo -e -n ""
93
94 #create new tagged version from current trunk
95
96 update-version: 
97                 @echo -e -n "#ifndef _VERSION_H\n#define _VERSION_H\n\n#define WS_VERSION \"${APP_VER}\"\n#endif\n"  > ${VERSION_FILE}
98
99 tag-version:    clean
100                 @install -d ${REP_TAG}/${APP_NAME}-${APP_VER}
101                 @tar -czf ${REP_TAG}/${APP_NAME}-${APP_VER}/${APP_NAME}-${APP_VER}.tar.gz ../trunk/* --exclude .svn
102                 @svn add ${REP_TAG}/${APP_NAME}-${APP_VER} 
103                 @svn ci ${REP_TAG}/${APP_NAME}-${APP_VER} -m "Tagged new version: ${APP_NAME}-${APP_VER}"
104
105 send-last:      debs
106                 @tar -czf ${APP_NAME}-${APP_VER}.tar.gz *_${APP_VER}-${PACK_VER}_${ARCH}.deb
107                 @echo -e -n "#!/bin/bash\n\
108                         mutt -x -a ~/debs.log -a ~/build.log -a ~/${APP_NAME}-${APP_VER}.tar.gz -s \"[WhiteStork]: daily build - version ${APP_NAME}-${APP_VER}\" ${MAIL_ADDRESS} <~/mail.content\n\
109                         rm -f ~/${APP_NAME}-${APP_VER}.tar.gz\n" > mail.script
110
111                 @chmod +x mail.script
112
113                 @echo -e -n "\
114                         This message was generated automatically , please do not reply.\n\
115                         Attachment: ${APP_NAME}-${APP_VER}.tar.gz - tarball with the newest Whitestork's packages.\n\
116                         Attachment: build.log - logs from building binaries.\n\
117                         Attachment: debs.log - logs from making *.deb packages.\n\n\
118                         Automatic Building Framework ver: ${FRM_VER}\nCopyright 2006 ComArch S.A.\n" > mail.content
119                 @scp ${APP_NAME}-${APP_VER}.tar.gz krzsas@localhost:~/
120                 @scp ${LOG_BUILD} krzsas@localhost:~/
121                 @scp ${LOG_DEBS} krzsas@localhost:~/
122                 @scp mail.script krzsas@localhost:~/
123                 @scp mail.content krzsas@localhost:~/
124                 @rm -f mail.script
125                 @rm -f mail.content
126                 @ssh krzsas@localhost  ./mail.script
127
128 localization:
129
130                 @install -d ${DATA}/locale/en_GB/LC_MESSAGES/
131                 @install -d ${DATA}/locale/pl_PL/LC_MESSAGES/
132                 @msgfmt ${DATA}/locale/en_GB.po -o ${DATA}/locale/en_GB/LC_MESSAGES/whitestork.mo
133                 @msgfmt ${DATA}/locale/pl_PL.po -o ${DATA}/locale/pl_PL/LC_MESSAGES/whitestork.mo
134
135 build: pre-build  ${BINARIES}/ws_dbus.o ${BINARIES}/WhiteStork ${BINARIES}/WhiteStorkManager ${BINARIES}/ws_bookmark.so plugins
136                 @echo -e -n "\nBuilding WhiteStork is finished.\n"
137
138 pre-build: 
139                 @echo -e -n "Building WhiteStork... \n"
140                 @echo -e -n "" > ${LOG_BUILD}
141                 
142 plugins: ${BINARIES}/engine_xdxf.so ${BINARIES}/engine_stardict.so 
143                 
144
145 ${BINARIES}/WhiteStorkManager: update-version
146                 @echo -e -n "**--> Compiling Manager...\n"
147                 @echo -e -n "**--> Compiling Manager...\n" >> ${LOG_BUILD}
148                 @cd ${MANAGER} && make >> ../../${LOG_BUILD}
149
150 ${BINARIES}/ws_dbus.o:
151                 @echo -e -n "**--> Compiling D-BUS Wrapper... \n"
152                 @echo -e -n "**--> Compiling D-BUS Wrapper... \n" >> ${LOG_BUILD}
153                 @cd ${DBUS} && make >> ../../${LOG_BUILD}
154
155 ${BINARIES}/WhiteStork: update-version
156                 @echo -e -n "**--> Compiling User Interface...\n"
157                 @echo -e -n "**--> Compiling User Interface...\n" >> ${LOG_BUILD}
158                 @cd ${GUI} && make >> ../../${LOG_BUILD}
159
160 ${BINARIES}/engine_xdxf.so: update-version
161                 @echo -e -n "**--> Compiling XDXF Engine...\n"
162                 @echo -e -n "**--> Compiling XDXF Engine...\n" >> ${LOG_BUILD}
163                 @cd ${XDXF_PLUGIN} && make >> ../../../${LOG_BUILD}
164
165 ${BINARIES}/engine_stardict.so:  update-version
166                 @echo -e -n "**--> Compiling StarDict Engine...\n"
167                 @echo -e -n "**--> Compiling StarDict Engine...\n" >> ${LOG_BUILD}
168                 @cd ${STARDICT_PLUGIN} && make >> ../../../${LOG_BUILD}
169
170 ${BINARIES}/ws_bookmark.so: update-version
171                 @echo -e -n "**--> Compiling Bookmarks...\n"
172                 @echo -e -n "**--> Compiling Bookmarks...\n" >> ${LOG_BUILD}
173                 @cd ${BOOKMARKS} && make >> ../../${LOG_BUILD}
174                 
175 clean-logs:      
176                 @echo -e -n "Cleaning all logs\n"
177                 @rm -f ${LOG_DIR}/*.log
178
179 clean: clean-logs
180                 @-echo -e -n "Cleaning project directories\n"
181                 @echo -e -n "" > ${LOG_CLEAN}
182                 @-rm -f ${BINARIES}/* >> ${LOG_CLEAN} 2>> ${LOG_CLEAN}
183                 @-rm -f *~ >> ${LOG_CLEAN} 2>> ${LOG_CLEAN}
184                 @-rm -f *.deb >> ${LOG_CLEAN} 2>> ${LOG_CLEAN}
185                 @-rm -rf ${PACKAGES}/*
186                 @-cd ${GUI} && make clean >> ../../${LOG_CLEAN} 2>> ../../${LOG_CLEAN}
187                 @-cd ${DBUS} && make clean >> ../../${LOG_CLEAN} 2>> ../../${LOG_CLEAN}
188                 @-cd ${XDXF_PLUGIN} && make clean >> ../../../${LOG_CLEAN} 2>> ../../../${LOG_CLEAN}
189                 @-cd ${MANAGER} && make clean >> ../../${LOG_CLEAN} 2>> ../../${LOG_CLEAN}
190                 @-cd ${BOOKMARKS} && make clean >> ../../${LOG_CLEAN} 2>> ../../${LOG_CLEAN}
191                 @-cd ${STARDICT_PLUGIN} && make clean >> ../../../${LOG_CLEAN} 2>> ../../../${LOG_CLEAN}
192
193 run: build-test run-dict clean-temp
194
195
196 run-dict:
197                 @run-standalone.sh WhiteStorkManager
198
199 build-test: clean clean-temp build
200                 @echo -e -n "Copying needed files to specific directories...\n"
201                 @echo -e -n > ${LOG_RUN}
202                 @-fakeroot install -d /usr/share/WhiteStork/dictionaries/elements
203                 @-fakeroot mkdir /usr/share/WhiteStork/dictionaries/us-en
204                 @-fakeroot mkdir /usr/share/WhiteStork/dictionaries/bookmarks
205                 @-fakeroot mkdir /usr/lib/WhiteStork
206                 @-fakeroot mkdir /usr/include/WhiteStork
207
208                 @echo "Copying Manager files"
209                 @cp -f ${BINARIES}/WhiteStorkManager /usr/bin/
210                 @cp -f ${DATA}/other/org.maemo.WhiteStorkManager.service  /usr/share/dbus-1/services
211                 @cp -f ${DATA}/dict1.xdxf /usr/share/WhiteStork/dictionaries/elements/dict.xdxf
212                 @cp -f ${DATA}/dict1.cache  /usr/share/WhiteStork/dictionaries/elements/dict.cache
213                 @cp -f ${DATA}/dict2.xdxf  /usr/share/WhiteStork/dictionaries/us-en/dict.xdxf
214                 
215                 @cp -rf ${DATA}/stardict /usr/share/WhiteStork/dictionaries
216
217                 @gconftool-2 --type string --set /apps/maemo/WhiteStork/Dictionaries/bookmarks/name "Bookmarks"
218                 @gconftool-2 --type string --set /apps/maemo/WhiteStork/Dictionaries/bookmarks/path "/usr/share/WhiteStork/dictionaries/bookmarks"
219                 @gconftool-2 --type bool --set /apps/maemo/WhiteStork/Dictionaries/bookmarks/active true
220                 @gconftool-2 --type string --set /apps/maemo/WhiteStork/Engines/xdxf/path "/usr/lib/WhiteStork/engine_xdxf.so"
221                 @gconftool-2 --type string --set /apps/maemo/WhiteStork/Engines/bookmarks/path "/usr/lib/WhiteStork/ws_bookmark.so"
222                 @gconftool-2 --type string --set /apps/maemo/WhiteStork/Engines/stardict/path "/usr/lib/WhiteStork/engine_stardict.so"
223                 @gconftool-2 --type string --set /apps/maemo/WhiteStork/Dictionaries/elements/name "Elements Database"
224                 @gconftool-2 --type string --set /apps/maemo/WhiteStork/Dictionaries/elements/path "/usr/share/WhiteStork/dictionaries/elements"
225                 @gconftool-2 --type bool --set /apps/maemo/WhiteStork/Dictionaries/elements/active true
226                 @gconftool-2 --type string --set /apps/maemo/WhiteStork/Dictionaries/us-en/name "American - English Dictionary"
227                 @gconftool-2 --type string --set /apps/maemo/WhiteStork/Dictionaries/us-en/path "/usr/share/WhiteStork/dictionaries/us-en"
228                 @gconftool-2 --type bool --set /apps/maemo/WhiteStork/Dictionaries/us-en/active true
229                 @gconftool-2 --type string --set /apps/maemo/WhiteStork/Dictionaries/stardict/name "StarDict"
230                 @gconftool-2 --type string --set /apps/maemo/WhiteStork/Dictionaries/stardict/path "/usr/share/WhiteStork/dictionaries/stardict"
231                 @gconftool-2 --type bool --set /apps/maemo/WhiteStork/Dictionaries/stardict/active true
232
233                 @echo "Copying GUI files"
234                 @cp -f ${BINARIES}/WhiteStork /usr/bin/
235                 @cp -f ${DATA}/whitestorkgui.desktop /usr/share/applications/hildon/whitestork.desktop
236                 @ln -s /usr/share/applications/hildon/whitestork.desktop /etc/others-menu/extra_applications/0112_whitestorkgui.desktop
237                 @cp -f ${DATA}/whitestork.png /usr/share/pixmaps
238                 @cp -f ${DATA}/icon.png /usr/share/pixmaps/whitestork_icon.png
239                 @cp -f ${DATA}/org.maemo.WhiteStorkGui.service /usr/share/dbus-1/services
240                 @gconftool-2 --type bool --set /apps/maemo/WhiteStork/configuration/licence true
241                 
242                 @echo "Copying XDXF Engine files"
243                 @cp -f ${BINARIES}/engine_xdxf.so /usr/lib/WhiteStork/
244                 @cp -f ${DATA}/engine_xdxf_icon.png /usr/share/pixmaps
245
246                 @echo "Copying StarDict Engine files"
247                 @cp -f ${BINARIES}/engine_stardict.so /usr/lib/WhiteStork/
248                 #@cp -f ${DATA}/engine_stardict_icon.png /usr/share/pixmaps
249                 
250                 @echo "Copying Bookmark's files"
251                 @cp -f ${BINARIES}/ws_bookmark.so /usr/lib/WhiteStork/
252                 @cp -f ${DATA}/ws_bookmarks /usr/share/WhiteStork/dictionaries/bookmarks/ws_bookmarks
253
254 clean-temp:
255                 @-fakeroot rm -rf /usr/share/WhiteStork
256                 @-fakeroot rm -rf /usr/lib/WhiteStork
257                 @-fakeroot rm -rf /usr/include/WhiteStork
258                 @-fakeroot rm -f /etc/others-menu/extra_applications/0112_whitestorkgui.desktop
259                 @-fakeroot rm -f /usr/share/applications/hildon/whitestorkgui.desktop 
260                 @-fakeroot rm -f /usr/share/pixmaps/whitestork.png 
261                 @-fakeroot rm -f /usr/share/pixmaps/whitestork_icon.png
262                 @-fakeroot rm -f /usr/bin/WhiteStork
263                 @-fakeroot rm -f /usr/bin/WhiteStorkManager
264                 @-fakeroot rm -f /usr/share/applications/hildon/whitestorkgui.desktop 
265                 @-fakeroot rm -f /usr/lib/WhiteStork/engine_xdxf.so
266                 @-fakeroot rm -f /usr/lib/WhiteStork/engine_stardict.so
267
268                 gconftool-2 --recursive-unset /apps/maemo/WhiteStork
269 run-deb:
270                 @run-standalone.sh WhiteStork &
271
272 debs: pre-debs mng-deb plugins-deb gui-deb 
273                 @echo -e -n "Building debian packages finished.\n"
274
275 mng-deb: ${BINARIES}/ws_dbus.o ${BINARIES}/WhiteStorkManager ${BINARIES}/ws_bookmark.so
276                 @echo -e -n "**-->Making manager package...\n"
277                 @echo -e -n "**-->Making manager package...\n" >> ${LOG_DEBS} 2>> ${LOG_DEBS}
278                 
279                 @cp -rf ${DATA}/package_contents/${MNG_PACK_NAME} ${PACKAGES}
280                 @install -d ${MNG_DIRS}
281                 @cp ${MNG_EXECUTABLE} ${PACKAGES}/${MNG_PACK_NAME}/usr/bin
282                 @cp ${MNG_LIB} ${PACKAGES}/${MNG_PACK_NAME}/usr/lib/WhiteStork
283                 @cp ${MNG_DBUS} ${PACKAGES}/${MNG_PACK_NAME}/usr/share/dbus-1/services
284                 
285                 @find  ${MNG_DOC} -type f -not -name copyright -not -path *.svn* -exec cp {} ${PACKAGES}/${MNG_PACK_NAME}/usr/share/doc/${MNG_PACK_NAME} \;
286
287                 @gzip -r --best ${PACKAGES}/${MNG_PACK_NAME}/usr/share/doc/${MNG_PACK_NAME}
288                 
289                 @cp ${MNG_DOC}/copyright ${PACKAGES}/${MNG_PACK_NAME}/usr/share/doc/${MNG_PACK_NAME}
290                                 @cp -rf ${MNG_OTHER} ${PACKAGES}/${MNG_PACK_NAME}/usr/share/WhiteStork
291                 @-find ${PACKAGES}/${MNG_PACK_NAME} -name .svn -exec rm -rf {} \;>> ${LOG_DEBS} 2>> ${LOG_DEBS}
292
293                 @sed 's/Version:/Version: '${APP_VER}-${PACK_VER}'/ ' ${PACKAGES}/${MNG_PACK_NAME}/DEBIAN/control > ${PACKAGES}/${MNG_PACK_NAME}/DEBIAN/control_backup
294                 @sed 's/Installed-Size:/Installed-Size: '`du -s ${PACKAGES}/${MNG_PACK_NAME} | awk {'print $$1'}`'/ ' ${PACKAGES}/${MNG_PACK_NAME}/DEBIAN/control_backup > ${PACKAGES}/${MNG_PACK_NAME}/DEBIAN/control
295                 @rm ${PACKAGES}/${MNG_PACK_NAME}/DEBIAN/control_backup
296                 
297                 @cd ${PACKAGES}/${MNG_PACK_NAME} && find -path '*DEBIAN*' -prune -o -type f -exec md5sum {} >> DEBIAN/md5sums \;
298                 @cd ${PACKAGES} && fakeroot dpkg-deb --build ${MNG_PACK_NAME} ../${MNG_PACK_NAME}_${APP_VER}-${PACK_VER}_${ARCH}.deb >> ../${LOG_DEBS} 2>> ../${LOG_DEBS}
299
300 gui-deb: clean ${BINARIES}/ws_dbus.o ${BINARIES}/WhiteStork localization
301                 @echo -e -n "**-->Making whitestork GUI package...\n"
302                 @echo -e -n "**-->Making whitestork GUI package...\n" >> ${LOG_DEBS} 2>> ${LOG_DEBS}
303                 
304                 @cp -rf ${DATA}/package_contents/${GUI_PACK_NAME} ${PACKAGES}
305                 @install -d ${GUI_DIRS}
306                 @cp ${GUI_EXECUTABLE} ${PACKAGES}/${GUI_PACK_NAME}/usr/bin
307                 @cp ${GUI_ICONS} ${PACKAGES}/${GUI_PACK_NAME}/usr/share/pixmaps
308                 @cp ${GUI_DBUS} ${PACKAGES}/${GUI_PACK_NAME}/usr/share/dbus-1/services
309                 @cp -r ${GUI_LOCALE} ${PACKAGES}/${GUI_PACK_NAME}/usr/share/locale
310                 @cp ${GUI_OTHER} ${PACKAGES}/${GUI_PACK_NAME}/usr/share/applications/hildon
311                 
312                 @find  ${GUI_DOC} -type f -not -name copyright -not -path *.svn* -exec cp {} ${PACKAGES}/${GUI_PACK_NAME}/usr/share/doc/${GUI_PACK_NAME} \;
313
314                 @gzip -r --best ${PACKAGES}/${GUI_PACK_NAME}/usr/share/doc/${GUI_PACK_NAME}
315                 
316                 @cp ${GUI_DOC}/copyright ${PACKAGES}/${GUI_PACK_NAME}/usr/share/doc/${GUI_PACK_NAME}
317                 
318                 @-find ${PACKAGES}/${GUI_PACK_NAME} -name .svn -exec rm -rf {} \;>> ${LOG_DEBS} 2>> ${LOG_DEBS}
319                 
320                 @sed 's/Version:/Version: '${APP_VER}-${PACK_VER}'/ ' ${PACKAGES}/${GUI_PACK_NAME}/DEBIAN/control > ${PACKAGES}/${GUI_PACK_NAME}/DEBIAN/control_backup
321                 @sed 's/Installed-Size:/Installed-Size: '`du -s ${PACKAGES}/${GUI_PACK_NAME}| awk {'print $$1'}`'/ ' ${PACKAGES}/${GUI_PACK_NAME}/DEBIAN/control_backup > ${PACKAGES}/${GUI_PACK_NAME}/DEBIAN/control
322                 
323                 @rm ${PACKAGES}/${GUI_PACK_NAME}/DEBIAN/control_backup
324                 
325                 @touch ${PACKAGES}/${GUI_PACK_NAME}/DEBIAN/md5sums
326                 @cd ${PACKAGES}/${GUI_PACK_NAME} && find -path '*DEBIAN*' -prune -o -type f -exec md5sum {} >> DEBIAN/md5sums \;
327                 @cd ${PACKAGES} && fakeroot dpkg-deb --build ${GUI_PACK_NAME} ../${GUI_PACK_NAME}_${APP_VER}-${PACK_VER}_${ARCH}.deb >> ../${LOG_DEBS} 2>> ../${LOG_DEBS}
328
329
330 plugins-deb: clean plugins
331                 @echo -e -n "**-->Making whitestorkplugins package...\n"
332                 @echo -e -n "**-->Making whitestorkplugins package...\n" >> ${LOG_DEBS} 2>> ${LOG_DEBS}
333                 
334                 @cp -rf ${DATA}/package_contents/${PLUGINS_PACK_NAME} ${PACKAGES}
335                 @install -d ${PLUGINS_DIRS}
336                 @cp ${PLUGINS_LIB} ${PACKAGES}/${PLUGINS_PACK_NAME}/usr/lib/WhiteStork
337                 @cp ${PLUGINS_ICONS} ${PACKAGES}/${PLUGINS_PACK_NAME}/usr/share/pixmaps
338                 
339                 @find  ${PLUGINS_DOC} -type f -not -name copyright -not -path *.svn* -exec cp {} ${PACKAGES}/${PLUGINS_PACK_NAME}/usr/share/doc/${PLUGINS_PACK_NAME} \;
340
341                 @gzip -r --best ${PACKAGES}/${PLUGINS_PACK_NAME}/usr/share/doc/${PLUGINS_PACK_NAME}
342                 
343                 @cp ${PLUGINS_DOC}/copyright ${PACKAGES}/${PLUGINS_PACK_NAME}/usr/share/doc/${PLUGINS_PACK_NAME}
344                 
345                 @sed 's/Version:/Version: '${APP_VER}-${PACK_VER}'/ ' ${PACKAGES}/${PLUGINS_PACK_NAME}/DEBIAN/control > ${PACKAGES}/${PLUGINS_PACK_NAME}/DEBIAN/control_backup
346                 @sed 's/Installed-Size:/Installed-Size: '`du -s ${PACKAGES}/${PLUGINS_PACK_NAME} | awk {'print $$1'}`'/ ' ${PACKAGES}/${PLUGINS_PACK_NAME}/DEBIAN/control_backup > ${PACKAGES}/${PLUGINS_PACK_NAME}/DEBIAN/control
347                 
348                 @rm ${PACKAGES}/${PLUGINS_PACK_NAME}/DEBIAN/control_backup
349                 
350                 @cd ${PACKAGES}/${PLUGINS_PACK_NAME} && find -path '*DEBIAN*' -prune -o -type f -exec md5sum {} >> DEBIAN/md5sums \;
351                 @cd ${PACKAGES}  &&  fakeroot dpkg-deb --build ${PLUGINS_PACK_NAME} ../${PLUGINS_PACK_NAME}_${APP_VER}-${PACK_VER}_${ARCH}.deb>> ../${LOG_DEBS}  2>> ../${LOG_DEBS}
352
353                 
354 eng-deb: plugins-deb
355
356 debs-i: install
357                 
358                 
359 install: clean-inst-log uninstall eng-deb-i mng-deb-i gui-deb-i
360                 @echo -e -n "All packages have been installed/reinstalled.\n"
361
362 clean-inst-log: 
363                 @echo -n "" > ${LOG_INST}
364
365 debs-ir: debs-i
366                 @echo -e -n "Restarting af-sb-init.sh <af-sb-init.sh restart>...\n"
367                 @af-sb-init.sh restart
368                 @echo -e -n "Now You can test Your new WhiteStork :D .. enjoy :-)\n"
369
370 mng-deb-i: 
371                 @echo -e -n "Installing new package MANAGER...\n"
372                 @fakeroot dpkg -i ${MNG_PACK_NAME}_${APP_VER}-${PACK_VER}_${ARCH}.deb  >> ${LOG_INST} 2>> ${LOG_INST}
373
374 gui-deb-i: 
375                 @echo -e -n "Installing new package GUI...\n"
376                 @fakeroot dpkg -i ${GUI_PACK_NAME}_${APP_VER}-${PACK_VER}_${ARCH}.deb  >> ${LOG_INST} 2>> ${LOG_INST}
377
378 eng-deb-i: plugins-deb-i
379
380 plugins-deb-i: 
381                 @echo -e -n "Installing WhiteStork's plugin package...\n"
382                 @fakeroot dpkg -i ${PLUGINS_PACK_NAME}_${APP_VER}-${PACK_VER}_${ARCH}.deb  >> ${LOG_INST} 2>> ${LOG_INST}
383
384 bookmark-deb-i: 
385                 @echo -e -n "Removing old BOOKMARKS ENGINE...\n"
386                 @fakeroot dpkg -r whitestorkbookmarks  >/dev/null 2>/dev/null           
387                 @echo -e -n "Installing new package whitestorkbookmarks...\n"
388                 @fakeroot dpkg -i ${BOOKMARKS_PACK_NAME}_${APP_VER}-${PACK_VER}_${ARCH}.deb  >> ${LOG_INST} 2>> ${LOG_INST}
389                 
390
391
392 pre-debs: clean
393                 @echo -e -n "Making *.deb packages...\nPlease wait...\n"
394                 @echo -e -n "" > ${LOG_DEBS}
395
396 uninstall:
397                 @-fakeroot dpkg --purge whitestorkgui
398                 @-fakeroot dpkg --purge whitestork
399                 @-fakeroot dpkg --purge whitestorkplugins
400
401 display: access
402                 @fakeroot su ${USER} -c 'af-sb-init.sh start'   
403
404 display-s: access
405                 @fakeroot su ${USER} -c 'af-sb-init.sh stop'
406
407 display-r: access
408                 @fakeroot su ${USER} -c 'af-sb-init.sh restart'
409
410 access:
411                 @fakeroot chmod 0777 /var/run
412
413 release-package: clean debs 
414                 @echo "Release package generation successfully completed"
415
416 snapshot: tag-version send-last
417
418 meta-package-pack-dirs:
419                 @echo -e -n "Creating and cleaning directories necessary for whitestorkdictionary meta-package..."   >/dev/null 2>/dev/null
420                 @-rm -rf ${PACKAGES}/*   >/dev/null 2>/dev/null
421
422                 @install -d ${PACKAGES}/debian/DEBIAN   >/dev/null 2>/dev/null
423                 @install -d ${PACKAGES}/debian/etc/others-menu/extra_applications   >/dev/null 2>/dev/null
424                 @install -d ${PACKAGES}/debian/usr/share/applications/hildon   >/dev/null 2>/dev/null
425                 @install -d ${PACKAGES}/debian/usr/share/doc/whitestorkdictionary >/dev/null 2>/dev/null
426                 @install -d ${PACKAGES}/debian/bin >/dev/null 2>/dev/null
427                 @install -d ${PACKAGES}/debian/usr/share/dbus-1/services >/dev/null 2>/dev/null
428
429                 @find ${PACKAGES}/debian -type d -exec chmod 0755 {} \;
430
431 meta-package:   meta-package-pack-dirs
432
433                 @echo -e -n "**-->Making WhiteStork meta-package...\n"
434
435                 @find ${FILES} -type f -maxdepth 1 -name "metc_*[^~]" -exec ${DATA}/copy_clean.sh {} "${PACKAGES}/debian/DEBIAN" \;
436
437                 @sed 's/Version:/Version: '${APP_VER}-${PACK_VER}'/ ' ${PACKAGES}/debian/DEBIAN/control > ${PACKAGES}/debian/DEBIAN/control_backup
438
439                 @mv ${PACKAGES}/debian/DEBIAN/control_backup ${PACKAGES}/debian/DEBIAN/control
440
441                 @find ${FILES} -type f -maxdepth 1 -name "metC_*[^~]" -exec ${DATA}/copy_clean.sh {} "${PACKAGES}/debian/usr/share/doc/whitestorkdictionary" \;
442                 @gzip --best "${PACKAGES}/debian/usr/share/doc/${META_PACK}/changelog"
443                 @gzip --best "${PACKAGES}/debian/usr/share/doc/${META_PACK}/changelog.Debian"
444
445                 @touch ${PACKAGES}/debian/DEBIAN/md5sums
446                 @chmod g-w ${PACKAGES}/debian/DEBIAN/md5sums
447                 @find "${PACKAGES}/debian" -path '*DEBIAN*' -prune -o -type f -exec ${DATA}/add_sums.sh {} "${PACKAGES}/debian" \;
448
449                 @cd ${PACKAGES} && fakeroot dpkg-deb --build ../${META_PACK}_${APP_VER}-${PACK_VER}_${ARCH}.deb >> ../${LOG_DEBS} 2>> ../${LOG_DEBS}
450
451 repo:   release-package 
452
453         @rm -rf repo
454         @./generate_repo