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