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