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