Change wich remove commercial gui licence
[mdictionary] / Makefile
1 #REP_LOCATION = ${HOME}/whitestork/repository/WhiteStork
2 #REP_LOCATION := `pwd`/..
3 ARCH = `arch`
4 REP_TAG = tags
5 REP_BRANCH = branches
6 REP_TRUNK = trunk
7
8 MAKEFILE_FILE = ${REP_LOCATION}/${REP_TRUNK}
9
10 ENGINE = engine
11 DBUS = dbus
12 MANAGER = manager
13 GUI = gui
14
15 APP_NAME = whitestork
16 MAJOR_VER = 0
17 MINOR_VER = 4
18 RELEASE_MAJOR_VER = 0
19 RELEASE_MINOR_VER = 4
20 RELEASE_PATCH_VER = 0
21 APP_VER := ${MAJOR_VER}.${MINOR_VER}.`svn info | grep "Revision:" | awk '{print $$2}'`
22 PACK_VER = 1
23 FRM_VER = 0.1
24 EXECUTABLE = ${BINARIES}/WhiteStork
25
26 GUI_PACK_NAME = whitestorkgui
27 MNG_PACK_NAME = whitestork
28 ENG_PACK_NAME = enginexdxf
29
30 BINARIES = bin
31 INCLUDE = include
32 DATA = data
33 PACKAGES = packages
34
35 FILES = ${REP_LOCATION}/${REP_TRUNK}/${DATA}/files_debbuild
36 LOG_DIR = logs
37 LOG_CLEAN = ${REP_LOCATION}/${REP_TRUNK}/${LOG_DIR}/clean.log
38 LOG_BUILD = ${REP_LOCATION}/${REP_TRUNK}/${LOG_DIR}/build.log
39 LOG_RUN = ${REP_LOCATION}/${REP_TRUNK}/${LOG_DIR}/run.log
40 LOG_DEBS = ${REP_LOCATION}/${REP_TRUNK}/${LOG_DIR}/debs.log
41 LOG_INST = ${REP_LOCATION}/${REP_TRUNK}/${LOG_DIR}/install.log
42
43
44 first: build-test
45         @echo -e -n ""
46
47 # build new version (x+1).0.0
48 version: version-pre
49
50 # build new release with version x,(y+1).0
51 release: release-pre
52
53 # build new pre-release with version x.y.(z=REPOSITORY REVISION)
54 pre-release: pre-release-pre
55
56 #create new tagget version from actual trunk
57 tagged-version: clean debs
58                 @mkdir  ${REP_LOCATION}/${REP_TAG}/${APP_NAME}-${APP_VER}
59                 @cp -r  ${REP_LOCATION}/${REP_TRUNK}/*        ${REP_LOCATION}/${REP_TAG}/${APP_NAME}-${APP_VER}
60                 @echo -e -n ".svn\n*~\n"    >    ${REP_LOCATION}/${REP_TRUNK}/NOT_FOR_SVN
61                 @-find ${REP_LOCATION}/${REP_TAG}/${APP_NAME}-${APP_VER} -iname ".svn" -exec rm -f -r {} \; >/dev/null 2>/dev/null
62                 @-find ${REP_LOCATION}/${REP_TAG}/${APP_NAME}-${APP_VER} -iname "*~" -exec rm -f -r {} \; >/dev/null 2>/dev/null
63                 @-find ${REP_LOCATION}/${REP_TAG}/${APP_NAME}-${APP_VER} -maxdepth 1 -iname "dict.*" -exec rm -f -r {} \; >/dev/null 2>/dev/null
64                 @-find ${REP_LOCATION}/${REP_TAG}/${APP_NAME}-${APP_VER} -iname "*.deb" -exec mv {} ${REP_LOCATION}/${REP_TAG} \; >/dev/null 2>/dev/null
65                 @cd ${REP_LOCATION}/${REP_TAG} && svn add ${APP_NAME}-${APP_VER}
66                 @cd ${REP_LOCATION}/${REP_TAG} && svn ci -m "BUILD FRAMEWORK: Added new tagged version of WhiteStork: ${APP_NAME}-${APP_VER}\n"
67
68 send-last:
69                 @cd ${REP_LOCATION}/${REP_TRUNK} && tar -czf ${APP_NAME}-${APP_VER}.tar.gz   *_${APP_VER}-${PACK_VER}_${ARCH}.deb
70                 @echo -e -n "#!/bin/bash\n\
71                         mutt -x -a ~/debs.log -a ~/build.log -a ~/${APP_NAME}-${APP_VER}.tar.gz -s \"[WhiteStork]: daily build - version ${APP_NAME}-${APP_VER}\" mdictionary-devel@garage.maemo.org <~/stranger.content\n\
72                         rm -f ~/${APP_NAME}-${APP_VER}.tar.gz\n" > stranger.script
73                 @echo -e -n "\
74                         This message was generated automatically , please do not reply.\n\
75                         Attachment: ${APP_NAME}-${APP_VER}.tar.gz - tarball with the newest whitestorks' packages.\n\
76                         Attachment: build.log - logs from building binaries.\n\
77                         Attachment: debs.log - logs from making *.deb packages.\n\n\
78                         Automatic Building Framework ver: ${FRM_VER}\nCopyright 2006 ComArch S.A.\n" > stranger.content
79                 @scp ${REP_LOCATION}/${REP_TRUNK}/${APP_NAME}-${APP_VER}.tar.gz stranger@stud.ics.p.lodz.pl:~/
80                 @scp ${LOG_BUILD} stranger@stud.ics.p.lodz.pl:~/
81                 @scp ${LOG_DEBS} stranger@stud.ics.p.lodz.pl:~/
82                 @scp ${MAKEFILE_FILE}/stranger.script stranger@stud.ics.p.lodz.pl:~/
83                 @scp ${MAKEFILE_FILE}/stranger.content stranger@stud.ics.p.lodz.pl:~/
84                 @rm -f ${MAKEFILE_FILE}/stranger.script
85                 @rm -f ${MAKEFILE_FILE}/stranger.content
86                 @ssh stranger@stud.ics.p.lodz.pl  ./mailscript
87
88 version-post: tagged-version send-last
89                 @echo -e -n "New version ${APP_VER} created and sent.\n"
90 release-post: tagged-version send-last
91                 @echo -e -n "New release ${APP_VER} created.\n"
92 pre-release-post: tagged-version send-last
93                 @echo -e -n "New pre-release ${APP_VER} created and sent.\n"
94
95 version-pre:
96                 @-cd  ${REP_LOCATION}/${REP_TRUNK} && svn update
97                 @${REP_LOCATION}/${REP_TRUNK}/${DATA}/version.sh "${MAKEFILE_FILE}"
98                 @echo -e -n "VERSION: Jeden zamykamy\n" 
99
100 release-pre:
101                 @-cd  ${REP_LOCATION}/${REP_TRUNK} && svn update
102                 @${REP_LOCATION}/${REP_TRUNK}/${DATA}/release.sh "${MAKEFILE_FILE}"
103                 @echo -e -n "RELEASE: Jeden zamykamy\n"
104
105 pre-release-pre:
106                 @-cd  ${REP_LOCATION}/${REP_TRUNK} && svn update
107                 @${REP_LOCATION}/${REP_TRUNK}/${DATA}/pre-release.sh "${MAKEFILE_FILE}"
108                 @echo -e -n "PRE_RELEASE: Jeden zamykamy\n"             
109
110 build: pre-build ${BINARIES}/engine_xdxf.so ${BINARIES}/ws_dbus.o ${BINARIES}/WhiteStork ${BINARIES}/WhiteStorkManager
111                 @echo -e -n "\nBuilding WhiteStork is finished.\n"
112 pre-build:
113                 @echo -e -n "Building WhiteStork... \n"
114                 @echo -e -n "Location: ${REP_LOCATION}\n\nplease wait a while....\n"
115                 @echo -e -n "" > ${LOG_BUILD}
116
117 ${BINARIES}/WhiteStorkManager:
118                 @echo -e -n "**--> Compiling Manager...\n" >> ${LOG_BUILD}
119                 @cd ${MANAGER} && make >> ${LOG_BUILD}
120
121 ${BINARIES}/ws_dbus.o:
122                 @echo -e -n "**--> Compiling D-BUS Wrapper... \n" >> ${LOG_BUILD}
123                 @cd ${DBUS} && make >> ${LOG_BUILD}
124
125 ${BINARIES}/WhiteStork:
126                 @echo -e -n "**--> Compiling User Interface...\n" >> ${LOG_BUILD}
127                 @cd ${GUI} && make >> ${LOG_BUILD}
128
129 ${BINARIES}/engine_xdxf.so:
130                 @echo -e -n "**--> Compiling Engine...\n" >> ${LOG_BUILD}
131                 @cd ${ENGINE} && make >> ${LOG_BUILD}
132
133
134 clean:
135                 @echo -e -n "" > ${LOG_CLEAN}
136                 @-rm -f ./${BINARIES}/* >> ${LOG_CLEAN} 2>> ${LOG_CLEAN}
137                 @-rm -f ${REP_LOCATION}/${REP_TRUNK}/*~ >> ${LOG_CLEAN} 2>> ${LOG_CLEAN}
138                 @-rm -f ${REP_LOCATION}/${REP_TRUNK}/*.deb >> ${LOG_CLEAN} 2>> ${LOG_CLEAN}
139                 @-cd ./${GUI} && make clean >> ${LOG_CLEAN} 2>> ${LOG_CLEAN}
140                 @-cd ./${DBUS} && make clean >> ${LOG_CLEAN} 2>> ${LOG_CLEAN}
141                 @-cd ./${ENGINE} && make clean >> ${LOG_CLEAN} 2>> ${LOG_CLEAN}
142                 @-cd ./${MANAGER} && make clean >> ${LOG_CLEAN} 2>> ${LOG_CLEAN}
143                 @-echo -e -n "Project directories are cleaned.\n"
144
145 run:
146                 @run-standalone.sh WhiteStork
147
148 build-test: clean build
149                 @echo -e -n "Copying needed files to specyfic directories...\n"
150                 @echo -e -n > ${LOG_RUN}
151                 @-fakeroot mkdir /usr/share/WhiteStork >> ${LOG_RUN} 2>> ${LOG_RUN}
152                 @-fakeroot rm -f /usr/share/WhiteStork/*  >> ${LOG_RUN} 2>> ${LOG_RUN}
153                 @-fakeroot mkdir  /usr/share/WhiteStork/engines >> ${LOG_RUN} 2>> ${LOG_RUN}
154                 @-fakeroot mkdir  /usr/share/WhiteStork/dictionaries >> ${LOG_RUN} 2>> ${LOG_RUN}
155                 @-fakeroot mkdir  /usr/share/WhiteStork/dictionaries/local >> ${LOG_RUN} 2>> ${LOG_RUN}
156                 @-fakeroot mkdir /usr/lib/WhiteStork >> ${LOG_RUN} 2>> ${LOG_RUN}
157                 @-fakeroot rm -f /usr/lib/WhiteStork/*  >> ${LOG_RUN} 2>> ${LOG_RUN}
158                 @-fakeroot mkdir /usr/include/WhiteStork >> ${LOG_RUN} 2>> ${LOG_RUN}
159                 @-fakeroot rm -f /usr/include/WhiteStork/*  >> ${LOG_RUN} 2>> ${LOG_RUN}
160                 @-fakeroot cp ${REP_LOCATION}/${REP_TRUNK}/${BINARIES}/WhiteStork ${REP_LOCATION}/${REP_TRUNK}/${BINARIES}/WhiteStorkManager /usr/bin/  >> ${LOG_RUN} 2>> ${LOG_RUN}
161                 @-fakeroot cp ${REP_LOCATION}/${REP_TRUNK}/${BINARIES}/engine_xdxf.so /usr/lib/WhiteStork  >> ${LOG_RUN} 2>> ${LOG_RUN}
162                 @-fakeroot cp ${REP_LOCATION}/${REP_TRUNK}/${INCLUDE}/dictionary_engine.h /usr/include/WhiteStork
163                 @-fakeroot cp ${REP_LOCATION}/${REP_TRUNK}/${DATA}/whitestork.png /usr/share/pixmaps/WhiteStork  >> ${LOG_RUN} 2>> ${LOG_RUN}
164                 @-fakeroot cp ${REP_LOCATION}/${REP_TRUNK}/${DATA}/icon.png /usr/share/pixmaps/WhiteStork  >> ${LOG_RUN} 2>> ${LOG_RUN}
165                 @-fakeroot cp ${REP_LOCATION}/${REP_TRUNK}/dict.xdxf /usr/share/WhiteStork/dictionaries/local  >> ${LOG_RUN} 2>> ${LOG_RUN}
166                 @-fakeroot cp ${REP_LOCATION}/${REP_TRUNK}/dict.cache /usr/share/WhiteStork/dictionaries/local >> ${LOG_RUN} 2>> ${LOG_RUN}
167                 @-fakeroot cp ${REP_LOCATION}/${REP_TRUNK}/${DATA}/org.maemo.WhiteStorkManager.service /usr/share/dbus-1/services  >> ${LOG_RUN} 2>> ${LOG_RUN}
168                 @-fakeroot cp ${REP_LOCATION}/${REP_TRUNK}/${DATA}/whitestork.desktop /usr/share/applications/hildon  >> ${LOG_RUN} 2>> ${LOG_RUN}
169                 @gconftool-2 --type string --set /apps/WhiteStork/Dictionaries/local/path "/usr/share/WhiteStork/dictionaries/local"
170                 @gconftool-2 --type string --set /apps/WhiteStork/Dictionaries/local/name "Local dictionary"
171                 @gconftool-2 --type bool --set /apps/WhiteStork/Dictionaries/local/active true
172
173 run-deb:
174                 @run-standalone.sh WhiteStork
175
176 debs: pre-debs mng-deb eng-deb gui-deb
177                 @echo -e -n "Building debian packages finished.\n"
178
179 mng-deb: mng-pack-dirs ${BINARIES}/ws_dbus.o ${BINARIES}/WhiteStorkManager
180                 @echo -e -n "**-->Makeing manager package...\n"
181                 @echo -e -n "**-->Makeing manager package...\n" >> ${LOG_DEBS} 2>> ${LOG_DEBS}
182                 @cp -f ${REP_LOCATION}/${REP_TRUNK}/${BINARIES}/WhiteStorkManager ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/bin/ >> ${LOG_DEBS} 2>> ${LOG_DEBS}
183                 @cp -f ${REP_LOCATION}/${REP_TRUNK}/${DATA}/org.maemo.WhiteStorkManager.service  ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/dbus-1/services   >> ${LOG_DEBS} 2>> ${LOG_DEBS}
184                 @cp -f ${REP_LOCATION}/${REP_TRUNK}/${DATA}/dict1.xdxf ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/WhiteStork/dictionaries/elements/dict.xdxf   >> ${LOG_DEBS} 2>> ${LOG_DEBS}
185                 @cp -f ${REP_LOCATION}/${REP_TRUNK}/${DATA}/dict1.cache ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/WhiteStork/dictionaries/elements/dict.cache   >> ${LOG_DEBS} 2>> ${LOG_DEBS}
186                 @cp -f ${REP_LOCATION}/${REP_TRUNK}/${DATA}/dict2.xdxf ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/WhiteStork/dictionaries/us-en/dict.xdxf   >> ${LOG_DEBS} 2>> ${LOG_DEBS}
187                 @find ${FILES} -type f -maxdepth 1 -name "mngc_*[^~]" -exec ${REP_LOCATION}/${REP_TRUNK}/${DATA}/copy_clean.sh {} "${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/DEBIAN" \;
188
189                 @sed 's/Version:/Version: '${APP_VER}-${PACK_VER}'/ ' ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/DEBIAN/control > ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/DEBIAN/control_backup
190
191                 mv ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/DEBIAN/control_backup ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/DEBIAN/control
192
193
194                 @find ${FILES} -type f -maxdepth 1 -name "mngC_*[^~]" -exec ${REP_LOCATION}/${REP_TRUNK}/${DATA}/copy_clean.sh {} "${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/doc/whitestork" \;
195                 @gzip --best "${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/doc/whitestork/changelog"
196                 @gzip --best "${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/doc/whitestork/changelog.Debian"
197                 @touch ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/DEBIAN/md5sums
198                 @chmod g-w ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/DEBIAN/md5sums
199                 @find "${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian" -path '*DEBIAN*' -prune -o -type f -exec ${REP_LOCATION}/${REP_TRUNK}/${DATA}/add_sums.sh {} "${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian" \;
200                 @cd ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES} && fakeroot dpkg-deb --build debian >> ${LOG_DEBS} 2>> ${LOG_DEBS}
201                 @cd ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES} && mv -f debian.deb ../${MNG_PACK_NAME}_${APP_VER}-${PACK_VER}_${ARCH}.deb   >> ${LOG_DEBS} 2>> ${LOG_DEBS}
202
203 gui-deb: gui-pack-dirs ${BINARIES}/ws_dbus.o ${BINARIES}/WhiteStork
204                 @echo -e -n "**-->Making whitestork GUI package...\n"
205                 @echo -e -n "**-->Making whitestork GUI package...\n" >> ${LOG_DEBS} 2>> ${LOG_DEBS}
206                 @cp -f ${REP_LOCATION}/${REP_TRUNK}/${BINARIES}/WhiteStork ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/bin/ >> ${LOG_DEBS} 2>> ${LOG_DEBS}
207                 @cp -f ${REP_LOCATION}/${REP_TRUNK}/${DATA}/whitestork.desktop ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/applications/hildon/whitestorkgui.desktop   >> ${LOG_DEBS} 2>> ${LOG_DEBS}
208                 @fakeroot cp -f ${REP_LOCATION}/${REP_TRUNK}/${DATA}/whitestork.desktop /usr/share/applications/hildon/whitestorkgui.desktop
209                 @ln -s /usr/share/applications/hildon/whitestorkgui.desktop ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/etc/others-menu/extra_applications/0112_whitestorkgui.desktop
210                 @cp -f ${REP_LOCATION}/${REP_TRUNK}/${DATA}/whitestork.png ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/pixmaps   >> ${LOG_DEBS} 2>> ${LOG_DEBS}
211                 @cp -f ${REP_LOCATION}/${REP_TRUNK}/${DATA}/icon.png ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/pixmaps/whitestork_icon.png   >> ${LOG_DEBS} 2>> ${LOG_DEBS}
212                 @cp -f ${REP_LOCATION}/${REP_TRUNK}/${DATA}/org.maemo.WhiteStorkGui.service  ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/dbus-1/services   >> ${LOG_DEBS} 2>> ${LOG_DEBS}
213                 @find ${FILES} -type f -maxdepth 1 -name "guic_*[^~]" -exec ${REP_LOCATION}/${REP_TRUNK}/${DATA}/copy_clean.sh {} "${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/DEBIAN" \;
214                 
215                 @sed 's/Version:/Version: '${APP_VER}-${PACK_VER}'/ ' ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/DEBIAN/control > ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/DEBIAN/control_backup
216
217                 mv ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/DEBIAN/control_backup ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/DEBIAN/control
218
219                 @find ${FILES} -type f -maxdepth 1 -name "guiC_*[^~]" -exec ${REP_LOCATION}/${REP_TRUNK}/${DATA}/copy_clean.sh {} "${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/doc/whitestorkgui" \;
220 #               @gzip --best "${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}"/debian/usr/share/doc/whitestorkgui.1
221                 @gzip --best "${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/doc/whitestorkgui/changelog"
222                 @gzip --best "${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/doc/whitestorkgui/changelog.Debian"
223                 @touch ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/DEBIAN/md5sums
224                 @chmod g-w ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/DEBIAN/md5sums
225                 @find "${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian" -path '*DEBIAN*' -prune -o -type f -exec ${REP_LOCATION}/${REP_TRUNK}/${DATA}/add_sums.sh {} "${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian" \;
226                 @cd ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES} && fakeroot dpkg-deb --build debian >> ${LOG_DEBS} 2>> ${LOG_DEBS}
227                 @cd ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES} && mv -f debian.deb ../${GUI_PACK_NAME}_${APP_VER}-${PACK_VER}_${ARCH}.deb   >> ${LOG_DEBS} 2>> ${LOG_DEBS}                
228
229 eng-deb: eng-pack-dirs ${BINARIES}/engine_xdxf.so
230                 @echo -e -n "**-->Making engine package...\n"
231                 @echo -e -n "**-->Making engine package...\n" >> ${LOG_DEBS} 2>> ${LOG_DEBS}
232                 @cp -f ${REP_LOCATION}/${REP_TRUNK}/${BINARIES}/engine_xdxf.so ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/lib/WhiteStork/ >> ${LOG_DEBS} 2>> ${LOG_DEBS}
233                 @cp -f ${REP_LOCATION}/${REP_TRUNK}/${INCLUDE}/dictionary_engine.h ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/include/WhiteStork  >> ${LOG_DEBS} 2>> ${LOG_DEBS}
234                 @cp -f ${REP_LOCATION}/${REP_TRUNK}/${DATA}/engine_xdxf_icon.png ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/pixmaps >> ${LOG_DEBS} 2>> ${LOG_DEBS}
235                 @find ${FILES} -type f -maxdepth 1 -name "engc_*[^~]" -exec ${REP_LOCATION}/${REP_TRUNK}/${DATA}/copy_clean.sh {} "${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/DEBIAN" \;
236                 
237                 @sed 's/Version:/Version: '${APP_VER}-${PACK_VER}'/ ' ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/DEBIAN/control > ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/DEBIAN/control_backup
238
239                 mv ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/DEBIAN/control_backup ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/DEBIAN/control
240
241                 @find ${FILES} -type f -maxdepth 1 -name "engC_*[^~]" -exec ${REP_LOCATION}/${REP_TRUNK}/${DATA}/copy_clean.sh {} "${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/doc/enginexdxf" \;
242                 @gzip --best "${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/doc/enginexdxf/changelog"
243                 @gzip --best "${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/doc/enginexdxf/changelog.Debian"
244                 @touch ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/DEBIAN/md5sums
245                 @chmod g-w ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/DEBIAN/md5sums
246                 @find "${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian" -path '*DEBIAN*' -prune -o -type f -exec ${REP_LOCATION}/${REP_TRUNK}/${DATA}/add_sums.sh {} "${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian" \;
247                 @cd ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}  &&  fakeroot dpkg-deb --build debian  >> ${LOG_DEBS}  2>> ${LOG_DEBS}
248                 @cd ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES} && mv -f debian.deb ../${ENG_PACK_NAME}_${APP_VER}-${PACK_VER}_${ARCH}.deb  >> ${LOG_DEBS} 2>> ${LOG_DEBS}         
249
250 debs-i: clean-inst-log mng-deb-i gui-deb-i eng-deb-i
251                 @echo -e -n "Every packages has been reinstalled.\n"
252
253 clean-inst-log:
254                 @echo -n "" > ${LOG_INST}
255
256 debs-ir: debs-i
257                 @echo -e -n "Restarting af-sb-init.sh <af-sb-init.sh restart>...\n"
258                 @af-sb-init.sh restart
259                 @echo -e -n "Now You can test Your new WhiteStork :D .. enjoy :-)\n"
260
261 mng-deb-i:
262                 @echo -e -n "Removing old MANAGER...\n"
263                 @-fakeroot dpkg -r whitestork  >/dev/null 2>/dev/null           
264                 @echo -e -n "Installing new package MANAGER...\n"
265                 @cd ${REP_LOCATION}/${REP_TRUNK} && fakeroot dpkg -i ${MNG_PACK_NAME}_${APP_VER}-${PACK_VER}_${ARCH}.deb  >> ${LOG_INST} 2>> ${LOG_INST}
266
267 gui-deb-i:
268                 @echo -e -n "Removing old GUI...\n"
269                 @-fakeroot dpkg -r whitestorkgui  >/dev/null 2>/dev/null                
270                 @echo -e -n "Installing new package GUI...\n"
271                 @cd ${REP_LOCATION}/${REP_TRUNK} && fakeroot dpkg -i ${GUI_PACK_NAME}_${APP_VER}-${PACK_VER}_${ARCH}.deb  >> ${LOG_INST} 2>> ${LOG_INST}
272
273 eng-deb-i:
274                 @echo -e -n "Removing old ENGINE...\n"
275                 @-fakeroot dpkg -r enginexdxf  >/dev/null 2>/dev/null           
276                 @echo -e -n "Installing new package ENGINE...\n"
277                 @cd ${REP_LOCATION}/${REP_TRUNK} && fakeroot dpkg -i ${ENG_PACK_NAME}_${APP_VER}-${PACK_VER}_${ARCH}.deb  >> ${LOG_INST} 2>> ${LOG_INST}
278
279 pre-debs: clean
280                 @echo -e -n "Making of *.deb packages...\nPlease wait...\n"
281                 @echo -e -n "" > ${LOG_DEBS}
282
283 eng-pack-dirs:
284                 @echo -e -n "Creating and cleaning required directories for ENGINE..."   >/dev/null 2>/dev/null
285                 @-rm -f -r ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/*   >/dev/null 2>/dev/null
286                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian   >/dev/null 2>/dev/null
287                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/DEBIAN   >/dev/null 2>/dev/null
288                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr   >/dev/null 2>/dev/null
289                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/lib   >/dev/null 2>/dev/null
290                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/lib/WhiteStork   >/dev/null 2>/dev/null
291                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/include   >/dev/null 2>/dev/null
292                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/include/WhiteStork   >/dev/null 2>/dev/null  
293                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share   >/dev/null 2>/dev/null
294                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/doc   >/dev/null 2>/dev/null
295                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/doc/enginexdxf   >/dev/null 2>/dev/null
296                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/pixmaps   >/dev/null 2>/dev/null
297                 @find ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian -type d -exec chmod 0755 {} \;
298
299 mng-pack-dirs:
300                 @echo -e -n "Creating and cleaning required directories for MANAGER..."   >/dev/null 2>/dev/null
301                 @-rm -f -r ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/*   >/dev/null 2>/dev/null
302                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian   >/dev/null 2>/dev/null
303                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/DEBIAN   >/dev/null 2>/dev/null
304                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr   >/dev/null 2>/dev/null
305                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/bin   >/dev/null 2>/dev/null
306                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share   >/dev/null 2>/dev/null
307                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/WhiteStork   >/dev/null 2>/dev/null
308                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/WhiteStork/engines   >/dev/null 2>/dev/null
309                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/WhiteStork/dictionaries   >/dev/null 2>/dev/null
310                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/WhiteStork/dictionaries/elements   >/dev/null 2>/dev/null
311                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/WhiteStork/dictionaries/us-en   >/dev/null 2>/dev/null
312                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/dbus-1   >/dev/null 2>/dev/null
313                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/dbus-1/services   >/dev/null 2>/dev/null
314                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/doc   >/dev/null 2>/dev/null
315                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/doc/whitestork   >/dev/null 2>/dev/null
316                 @find ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian -type d -exec chmod 0755 {} \;
317
318 gui-pack-dirs:
319                 @echo -e -n "Creating and cleaning required directories for GUI..."   >/dev/null 2>/dev/null
320                 @-rm -f -r ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/*   >/dev/null 2>/dev/null
321                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian   >/dev/null 2>/dev/null
322                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/DEBIAN   >/dev/null 2>/dev/null
323                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/etc   >/dev/null 2>/dev/null
324                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/etc/others-menu   >/dev/null 2>/dev/null
325                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/etc/others-menu/extra_applications   >/dev/null 2>/dev/null
326                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr   >/dev/null 2>/dev/null
327                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/bin   >/dev/null 2>/dev/null
328                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share   >/dev/null 2>/dev/null
329                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/pixmaps   >/dev/null 2>/dev/null
330                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/pixmaps/WhiteStork   >/dev/null 2>/dev/null
331                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/applications   >/dev/null 2>/dev/null
332                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/applications/hildon   >/dev/null 2>/dev/null
333                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/doc   >/dev/null 2>/dev/null
334                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/doc/whitestorkgui   >/dev/null 2>/dev/null
335                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/dbus-1   >/dev/null 2>/dev/null
336                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/dbus-1/services   >/dev/null 2>/dev/null
337                 @find ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian -type d -exec chmod 0755 {} \;
338
339 whole-pack-dirs:
340                 @echo -e -n "Creating and cleaning required directories WHOLE SYSTEM..."
341                 @-rm -f -r ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/*
342                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian
343                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/DEBIAN
344                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/etc   >/dev/null 2>/dev/null
345                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/etc/others-menu   >/dev/null 2>/dev/null
346                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/etc/others-menu/extra_applications   >/dev/null 2>/dev/null
347                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr
348                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/bin
349                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/lib
350                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share
351                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/include
352                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/lib/WhiteStork
353                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/include/WhiteStork
354                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/WhiteStork
355                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/WhiteStork/engines
356                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/WhiteStork/dictionaries
357                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/WhiteStork/dictionaries/elements
358                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/WhiteStork/dictionaries/us-en
359                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/dbus-1
360                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/dbus-1/services
361                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/pixmaps
362                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/pixmaps/WhiteStork
363                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/applications
364                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/applications/hildon    
365                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/doc   >/dev/null 2>/dev/null
366                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/doc/whitestork   >/dev/null 2>/dev/null
367                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/doc/whitestorkgui   >/dev/null 2>/dev/null
368                 @mkdir ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian/usr/share/doc/enginexdxf   >/dev/null 2>/dev/null
369                 @find ${REP_LOCATION}/${REP_TRUNK}/${PACKAGES}/debian -type d -exec chmod 0755 {} \;
370
371 uninstall:
372                 @-fakeroot dpkg -r enginexdxf
373                 @-fakeroot dpkg -r whitestorkgui
374                 @-fakeroot dpkg -r whitestork
375                 @-fakeroot dpkg --purge whitestork
376                 @-fakeroot dpkg --purge whitestorkgui
377                 @-fakeroot dpkg --purge enginexdxf
378                 @-gconftool-2 --recursive-unset /apps/WhiteStork
379                 @-gconftool-2 --recursive-unset /apps/maemo/WhiteStork
380                 @-rm -rf  /usr/share/WhiteStork
381                 @-rm -f  /usr/share/pixmaps/whitestork.png
382                 @-rm -f  /usr/share/pixmaps/engine_xdxf_icon.png
383                 @-rm -f  /usr/share/pixmaps/whitestork_icon.png
384
385 display: access
386                 @fakeroot su ${USER} -c 'af-sb-init.sh start'   
387
388 display-s: access
389                 @fakeroot su ${USER} -c 'af-sb-init.sh stop'
390
391 display-r: access
392                 @fakeroot su ${USER} -c 'af-sb-init.sh restart'
393
394 access:
395                 @fakeroot chmod 0777 /var/run
396
397 release-package: 
398                 @make -f release_makefile clean
399                 @make -f release_makefile debs && echo "Release package generation successfully completed"