7 #declaration of directory names
12 PLUGINS = ${SOURCE}/plugins
13 XDXF_PLUGIN = ${PLUGINS}/xdxf
14 STARDICT_PLUGIN = ${PLUGINS}/stardict
16 MANAGER = ${SOURCE}/manager
17 DBUS = ${SOURCE}/dbus_wrapper
19 BOOKMARKS_DIR = ${SOURCE}/bookmarks/${BOOKMARKS}
22 ifeq (${BOOKMARKS}, sql)
26 ifeq (${BOOKMARKS}, sql3)
34 APP_NAME = mDictionary
46 # VERSION_FILE = ./${INCLUDE}/ws_version.h
49 GUI_PACK_NAME = mdictionarygui
50 MNG_PACK_NAME = mdictionary
51 PLUGINS_PACK_NAME = mdictionaryplugins
52 BOOKMARKS_PACK_NAME = mdictionarybookmarks
53 META_PACK_NAME = mdictionarydictionary
55 GUI_EXECUTABLE = ${BINARIES}/mdictionary
56 GUI_SERVICEFILE = org.maemo.mdictionaryGui.service
57 GUI_DIRS = ${DESTDIR}/usr/bin ${DESTDIR}/usr/share/applications/hildon ${DESTDIR}/usr/share/pixmaps ${DESTDIR}/usr/share/mis ${DESTDIR}/usr/share/dbus-1/services ${DESTDIR}/usr/share/locale
58 #${DESTDIR}/usr/share/doc/mdictionarygui
59 GUI_DBUS = ${DATA}/other/${GUI_SERVICEFILE}
60 GUI_ICONS = ${DATA}/icons/mdictionary_icon.png ${DATA}/icons/mdictionary.png ${DATA}/icons/ws_top.png ${DATA}/icons/ws_warning_icon.png ${DATA}/icons/qgn_indi_search_mdictionary.png ${DATA}/icons/ws_tra.png ${DATA}/icons/mdictionary_about.png
61 GUI_LOCALE = ${DATA}/locale/out/
62 GUI_DOC = ${DATA}/docs/${GUI_PACK_NAME}/
63 GUI_OTHER = ${DATA}/other/mdictionary.desktop
64 GUI_MIS = ${DATA}/mis/mdictionary-search.xml
66 MNG_EXECUTABLE = ${BINARIES}/mdictionaryManager
67 MNG_SERVICEFILE = org.maemo.mdictionaryManager.service
68 MNG_LIB = ${BINARIES}/engine_bookmarks.so
69 MNG_DIRS = ${DESTDIR}/usr/bin ${DESTDIR}/usr/lib/mdictionary ${DESTDIR}/usr/share/dbus-1/services ${DESTDIR}/usr/share/mdictionary ${DESTDIR}/usr/share/doc/${MNG_PACK_NAME}
70 MNG_DBUS = ${DATA}/other/${MNG_SERVICEFILE}
71 MNG_OTHER = ${DATA}/dictionaries
73 MNG_DICT1 = ${DATA}/dictionaries/FinnishEnglish/comn_sdict02_finnish-english.dict.dz ${DATA}/dictionaries/FinnishEnglish/comn_sdict02_finnish-english.idx ${DATA}/dictionaries/FinnishEnglish/comn_sdict02_finnish-english.ifo ${DESTDIR}/usr/share/mdictionary/dictionaries/FinnishEnglish/
74 MNG_DICT2 = ${DATA}/dictionaries/EnglishFinnish/dict.xdxf ${DATA}/dictionaries/EnglishFinnish/dict.cache ${DESTDIR}/usr/share/mdictionary/dictionaries/EnglishFinnish/
76 MNG_DICT_DIRS = ${DESTDIR}/usr/share/mdictionary/dictionaries/FinnishEnglish/ ${DESTDIR}/usr/share/mdictionary/dictionaries/EnglishFinnish/
78 MNG_BOOKMARKS = ${DATA}/bookmarks/${BOOKMARKS}/*
79 MNG_DOC = ${DATA}/docs/${MNG_PACK_NAME}/
81 PLUGINS_LIB = ${BINARIES}/engine_*.so
82 PLUGINS_DIRS = ${DESTDIR}/usr/lib/mdictionary ${DESTDIR}/usr/share/pixmaps
83 #${DESTDIR}/usr/share/doc/${PLUGINS_PACK_NAME}
84 PLUGINS_ICONS = ${DATA}/icons/engine_xdxf_icon.png
85 PLUGINS_DOC = ${DATA}/docs/${PLUGINS_PACK_NAME}/
87 META_DIRS = ${PACKAGES}/${META_PACK_NAME}/usr/share/doc/${META_PACK_NAME}
88 META_DOC = ${DATA}/docs/${META_PACK_NAME}/
90 MAIL_ADDRESS = mdictionary-devel@garage.maemo.org
91 LOCALEDIR=/usr/share/locale
92 GETTEXT_PACKAGE=mdictionary
94 #APP_VER = ${MAJOR_VER}.${MINOR_VER}.`svn info | grep "Revision:" | awk '{print $$2}'`
96 ifeq (${MAKECMDGOALS}, release-package)
97 APP_VER = ${RELEASE_MAJOR_VER}.${RELEASE_MINOR_VER}.${RELEASE_PATCH_VER}
99 APP_VER = ${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}-build`svn log -r HEAD -q | grep -v -e -- | awk '{print $$1}' | tr -d r`
102 FILES = ${DATA}/files_debbuild
104 LOG_CLEAN = ${LOG_DIR}/clean.log
105 LOG_BUILD = ${LOG_DIR}/build.log
106 LOG_RUN = ${LOG_DIR}/run.log
107 LOG_DEBS = ${LOG_DIR}/debs.log
108 LOG_INST = ${LOG_DIR}/install.log
114 @install -d ${REP_TAG}/${APP_NAME}-${APP_VER}
115 @tar -czf ${REP_TAG}/${APP_NAME}-${APP_VER}/${APP_NAME}-${APP_VER}.tar.gz ../trunk/* --exclude .svn
116 @svn add ${REP_TAG}/${APP_NAME}-${APP_VER}
117 @svn ci ${REP_TAG}/${APP_NAME}-${APP_VER} -m "Tagged new version: ${APP_NAME}-${APP_VER}"
120 @tar -czf ${APP_NAME}-${APP_VER}.tar.gz *_${APP_VER}-${PACK_VER}_${ARCH}.deb
121 @echo -e -n "#!/bin/bash\n\
122 mutt -x -a ~/debs.log -a ~/build.log -a ~/${APP_NAME}-${APP_VER}.tar.gz -s \"[mdictionary]: daily build - version ${APP_NAME}-${APP_VER}\" ${MAIL_ADDRESS} <~/mail.content\n\
123 rm -f ~/${APP_NAME}-${APP_VER}.tar.gz\n" > mail.script
125 @chmod +x mail.script
128 This message was generated automatically , please do not reply.\n\
129 Attachment: ${APP_NAME}-${APP_VER}.tar.gz - tarball with the newest mdictionary's packages.\n\
130 Attachment: build.log - logs from building binaries.\n\
131 Attachment: debs.log - logs from making *.deb packages.\n\n\
132 Automatic Building Framework ver: ${FRM_VER}\nCopyright 2006 ComArch S.A.\n" > mail.content
133 @scp ${APP_NAME}-${APP_VER}.tar.gz krzsas@localhost:~/
134 @scp ${LOG_BUILD} krzsas@localhost:~/
135 @scp ${LOG_DEBS} krzsas@localhost:~/
136 @scp mail.script krzsas@localhost:~/
137 @scp mail.content krzsas@localhost:~/
140 @ssh krzsas@localhost ./mail.script
143 @echo -e -n "Generating locale...\n"
144 @echo -e -n "Generating locale...\n" > ${LOG_BUILD}
146 @./generate_locale ${DATA}/locale/ ${GUI_LOCALE}
147 @echo -e -n "Locale generation successfully completed...\n"
148 @echo -e -n "Locale generation successfully completed...\n" > ${LOG_BUILD}
150 build: pre-build ${BINARIES}/ws_dbus.o ${GUI_EXECUTABLE} ${MNG_EXECUTABLE} ${BINARIES}/engine_bookmarks.so plugins
151 @echo -e -n "\nBuilding mdictionary is finished.\n"
154 @echo -e -n "Building mdictionary... \n"
155 @echo -e -n "" > ${LOG_BUILD}
157 plugins: ${BINARIES}/engine_xdxf.so ${BINARIES}/engine_stardict.so
162 @echo -e -n "**--> Compiling Manager...\n"
163 @echo -e -n "**--> Compiling Manager...\n" >> ${LOG_BUILD}
164 @make SQLITE=${SQLITE} -C ${MANAGER} >> ${LOG_BUILD}
166 ${BINARIES}/ws_dbus.o:
167 @echo -e -n "**--> Compiling D-BUS Wrapper... \n"
168 @echo -e -n "**--> Compiling D-BUS Wrapper... \n" >> ${LOG_BUILD}
169 # @cd ${DBUS} && make >> ../../${LOG_BUILD}
170 @make -C ${DBUS} >> ${LOG_BUILD}
174 @echo -e -n "**--> Compiling User Interface...\n"
175 @echo -e -n "**--> Compiling User Interface...\n" >> ${LOG_BUILD}
176 # @cd ${GUI} && make APP_VER=${APP_VER} >> ../../${LOG_BUILD}
177 @make APP_VER=${APP_VER} -C ${GUI} >> ${LOG_BUILD}
179 ${BINARIES}/engine_xdxf.so:
181 @echo -e -n "**--> Compiling XDXF Engine...\n"
182 @echo -e -n "**--> Compiling XDXF Engine...\n" >> ${LOG_BUILD}
183 # @cd ${XDXF_PLUGIN} && make >> ../../../${LOG_BUILD}
184 @make -C ${XDXF_PLUGIN} >> ${LOG_BUILD}
186 ${BINARIES}/engine_stardict.so:
188 @echo -e -n "**--> Compiling StarDict Engine...\n"
189 @echo -e -n "**--> Compiling StarDict Engine...\n" >> ${LOG_BUILD}
190 # @cd ${STARDICT_PLUGIN} && make >> ../../../${LOG_BUILD}
191 @make -C ${STARDICT_PLUGIN} >> ${LOG_BUILD}
193 ${BINARIES}/engine_bookmarks.so:
195 @echo -e -n "**--> Compiling Bookmarks...\n"
196 @echo -e -n "**--> Compiling Bookmarks...\n" >> ${LOG_BUILD}
197 @make -C ${BOOKMARKS_DIR} >> ${LOG_BUILD}
200 @echo -e -n "Cleaning all logs\n"
201 @rm -f ${LOG_DIR}/*.log
204 @-echo -e -n "Cleaning project directories\n"
205 @echo -e -n "" > ${LOG_CLEAN}
206 @-rm -f ${BINARIES}/* >> ${LOG_CLEAN} 2>> ${LOG_CLEAN}
207 @-rm -f *~ >> ${LOG_CLEAN} 2>> ${LOG_CLEAN}
208 @-rm -f *.deb >> ${LOG_CLEAN} 2>> ${LOG_CLEAN}
209 @-rm -rf ${PACKAGES}/*
210 @-make -C ${GUI} clean >> ${LOG_CLEAN} 2>> ${LOG_CLEAN}
211 @-make -C ${DBUS} clean >> ${LOG_CLEAN} 2>> ${LOG_CLEAN}
212 @-make -C ${XDXF_PLUGIN} clean >> ${LOG_CLEAN} 2>> ${LOG_CLEAN}
213 @-make -C ${STARDICT_PLUGIN} clean >> ${LOG_CLEAN} 2>> ${LOG_CLEAN}
214 @-cd ${MANAGER} && make clean >> ../../${LOG_CLEAN} 2>> ../../${LOG_CLEAN}
215 @-make -C ${MANAGER} clean >> ${LOG_CLEAN} 2>> ${LOG_CLEAN}
216 @find src/bookmarks/ -mindepth 1 -maxdepth 1 -type d -not -name .svn -exec make -C {} clean >> ${LOG_CLEAN} 2>> ${LOG_CLEAN} \;
217 @-rm -rf ${GUI_LOCALE}*
219 # @-cd ${GUI} && make clean >> ../../${LOG_CLEAN} 2>> ../../${LOG_CLEAN}
220 # @-cd ${DBUS} && make clean >> ../../${LOG_CLEAN} 2>> ../../${LOG_CLEAN}
221 # @-cd ${XDXF_PLUGIN} && make clean >> ../../../${LOG_CLEAN} 2>> ../../../${LOG_CLEAN}
222 # @-cd ${STARDICT_PLUGIN} && make clean >> ../../../${LOG_CLEAN} 2>> ../../../${LOG_CLEAN}
223 # @-cd ${BOOKMARKS_DIR} && make clean >> ../../../${LOG_CLEAN} 2>> ../../../${LOG_CLEAN}
225 run: clean install entries run-dict clean-temp
229 @run-standalone.sh mdictionaryManager
232 @-fakeroot rm -rf /usr/share/mdictionary
233 @-fakeroot rm -rf /usr/lib/mdictionary
234 @-fakeroot rm -rf /usr/include/mdictionary
235 @-fakeroot rm -f /etc/others-menu/extra_applications/0112_mdictionarygui.desktop
236 @-fakeroot rm -f /usr/share/applications/hildon/mdictionarygui.desktop
237 @-fakeroot rm -f /usr/share/pixmaps/mdictionary.png
238 @-fakeroot rm -f /usr/share/pixmaps/mdictionary_icon.png
239 @-fakeroot rm -f /usr/bin/mdictionary
240 @-fakeroot rm -f /usr/bin/mdictionaryManager
241 @-fakeroot rm -f /usr/share/applications/hildon/mdictionarygui.desktop
242 @-fakeroot rm -f /usr/lib/mdictionary/engine_xdxf.so
243 @-fakeroot rm -f /usr/lib/mdictionary/engine_stardict.so
245 # gconftool-2 --recursive-unset /apps/maemo/mdictionary
247 install-manager: localization ${BINARIES}/ws_dbus.o ${BINARIES}/engine_bookmarks.so ${MNG_EXECUTABLE}
248 @install -d ${MNG_DIRS}
249 @cp ${MNG_EXECUTABLE} ${DESTDIR}/usr/bin
250 @cp ${MNG_LIB} ${DESTDIR}/usr/lib/mdictionary
251 @cp ${MNG_DBUS} ${DESTDIR}/usr/share/dbus-1/services
252 @find ${MNG_DOC} -type f -not -path *.svn* -exec cp {} ${DESTDIR}/usr/share/doc/${MNG_PACK_NAME} \;
254 # @install -d ${MNG_DICT_DIRS}
258 @install -d ${DESTDIR}/usr/share/mdictionary/dictionaries/bookmarks
259 @cp -rf ${MNG_BOOKMARKS} ${DESTDIR}/usr/share/mdictionary/dictionaries/bookmarks
261 install-gui: ${BINARIES}/ws_dbus.o ${GUI_EXECUTABLE}
262 @install -d ${GUI_DIRS}
263 @cp ${GUI_EXECUTABLE} ${DESTDIR}/usr/bin
264 @cp ${GUI_ICONS} ${DESTDIR}/usr/share/pixmaps
265 @cp ${GUI_DBUS} ${DESTDIR}/usr/share/dbus-1/services
266 @cp ${GUI_OTHER} ${DESTDIR}/usr/share/applications/hildon
267 @cp ${GUI_MIS} ${DESTDIR}/usr/share/mis
268 @cp -a ${GUI_LOCALE}* ${DESTDIR}/usr/share/locale/
269 # @find ${GUI_DOC} -type f -not -path *.svn* -exec cp {} ${DESTDIR}/usr/share/doc/${GUI_PACK_NAME} \;
271 install-plugins: plugins
272 @install -d ${PLUGINS_DIRS}
273 @cp ${PLUGINS_LIB} ${DESTDIR}/usr/lib/mdictionary
274 @cp ${PLUGINS_ICONS} ${DESTDIR}/usr/share/pixmaps
275 @install -d ${MNG_DICT_DIRS}
278 # @find ${PLUGINS_DOC} -type f -not -path *.svn* -exec cp {} ${DESTDIR}/usr/share/doc/${PLUGINS_PACK_NAME} \;
280 install-mdictionary: install-manager install-gui install-plugins
282 install: install-manager install-gui install-plugins
283 @echo -e "\n\nIf you are installing mdictionary, please run 'make entries', before running the application ( not as root )\n\n"
286 gconftool-2 --type string --set /apps/maemo/mdictionary/dictionaries/StarDictSampleDict/name "Polish - English Sample Dictionary"
287 gconftool-2 --type string --set /apps/maemo/mdictionary/dictionaries/StarDictSampleDict/path "/usr/share/mdictionary/dictionaries/StarDictSampleDict"
288 gconftool-2 --type bool --set /apps/maemo/mdictionary/dictionaries/StarDictSampleDict/active true
289 gconftool-2 --type bool --set /apps/maemo/mdictionary/dictionaries/StarDictSampleDict/optimized false
290 gconftool-2 --type string --set /apps/maemo/mdictionary/dictionaries/XDXFSampleDict/name "English - Polish Sample Dictionary"
291 gconftool-2 --type string --set /apps/maemo/mdictionary/dictionaries/XDXFSampleDict/path "/usr/share/mdictionary/dictionaries/XDXFSampleDict"
292 gconftool-2 --type bool --set /apps/maemo/mdictionary/dictionaries/XDXFSampleDict/active true
293 gconftool-2 --type bool --set /apps/maemo/mdictionary/dictionaries/XDXFSampleDict/optimized false
295 gconftool-2 --type string --set /apps/maemo/mdictionary/engines/bookmarks/path "/usr/lib/mdictionary/engine_bookmarks.so"
296 gconftool-2 --type string --set /apps/maemo/mdictionary/dictionaries/bookmarks/name "Bookmarks"
297 gconftool-2 --type string --set /apps/maemo/mdictionary/dictionaries/bookmarks/path "/usr/share/mdictionary/dictionaries/bookmarks"
298 gconftool-2 --type bool --set /apps/maemo/mdictionary/dictionaries/bookmarks/active false
299 gconftool-2 --type bool --set /apps/maemo/mdictionary/dictionaries/bookmarks/optimized true
300 chmod -R 0777 /usr/share/mdictionary/dictionaries
302 gconftool-2 --type string --set /apps/maemo/mdictionary/engines/xdxf/path "/usr/lib/mdictionary/engine_xdxf.so"
303 gconftool-2 --type string --set /apps/maemo/mdictionary/engines/stardict/path "/usr/lib/mdictionary/engine_stardict.so"
305 # maemo-select-menu-location mdictionary.desktop
308 install_deb: clean-inst-log uninstall eng-deb-i mng-deb-i gui-deb-i
309 @echo -e -n "All packages have been installed/reinstalled.\n"
312 @echo -n "" > ${LOG_INST}
315 @-fakeroot dpkg --purge mdictionary
316 # @-fakeroot dpkg --purge mdictionarydictionary
319 @fakeroot su ${USER} -c 'af-sb-init.sh start'
322 @fakeroot su ${USER} -c 'af-sb-init.sh stop'
325 @fakeroot su ${USER} -c 'af-sb-init.sh restart'
328 @fakeroot chmod 0777 /var/run
330 release-package: clean debs meta-package
331 @echo "Release package generation successfully completed"
333 snapshot: tag-version send-last
335 repo: release-package meta-package
337 @rm -rf ${DEB_REP_DIR}
338 @./generate_repo ${DEB_REP_DIR}
341 dpkg-buildpackage -rfakeroot