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