Contents of /trunk/mage/usr/lib/mage/smage2.sh
Parent Directory | Revision Log
Revision 183 -
(show annotations)
(download)
(as text)
Tue Aug 9 14:17:15 2005 UTC (19 years, 1 month ago) by niro
File MIME type: application/x-sh
File size: 14593 byte(s)
Tue Aug 9 14:17:15 2005 UTC (19 years, 1 month ago) by niro
File MIME type: application/x-sh
File size: 14593 byte(s)
ixed multiincludes
1 | #!/bin/bash |
2 | |
3 | # compiles/installs .smage2 source install scripts |
4 | # needs pkgbuild_dir (mage) |
5 | |
6 | # SMAGE2 |
7 | # $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.20 2005-08-09 14:17:15 niro Exp $ |
8 | |
9 | #01.10.2004 |
10 | # added ccache support |
11 | # added distcc support |
12 | |
13 | ## setup ## |
14 | SMAGEVERSION=0.3.7-r1 |
15 | PKGSUFFIX="mpk" |
16 | SMAGENAME="$1" |
17 | SMAGESUFFIX="smage2" |
18 | #SOURCEDIR="/bootstrap/sources" |
19 | #SMAGESCRIPTSDIR="/bootstrap/smage2-install-scripts" |
20 | #SMAGE2RSYNC="rsync://192.168.0.2/smage2-scripts" |
21 | MLIBDIR=/usr/lib/mage |
22 | |
23 | # export default C locale |
24 | export LC_ALL=C |
25 | |
26 | source /etc/mage.rc |
27 | |
28 | showversion() { |
29 | echo -en "Magellan Source Install v${SMAGEVERSION} " |
30 | echo -e "-- Niels Rogalla (niro@magellan-linux.de)" |
31 | } |
32 | |
33 | die() { |
34 | xtitleclean |
35 | echo "SMAGE failed: $@" |
36 | exit 1 |
37 | } |
38 | |
39 | xtitle() { |
40 | if [ ${TERM} == "xterm" ] |
41 | then |
42 | echo -ne "\033]0;[sMage: $@]\007" |
43 | fi |
44 | return 0 |
45 | } |
46 | |
47 | xtitleclean() { |
48 | if [ ${TERM} == "xterm" ] |
49 | then |
50 | echo -ne "\033]0;\007" |
51 | fi |
52 | return 0 |
53 | } |
54 | |
55 | syncsmage2() { |
56 | xtitle "Updating smage2-script tree ..." |
57 | local i |
58 | for i in ${SMAGE2RSYNC} |
59 | do |
60 | rsync \ |
61 | --recursive \ |
62 | --links \ |
63 | --perms \ |
64 | --times \ |
65 | --devices \ |
66 | --timeout=600 \ |
67 | --verbose \ |
68 | --compress \ |
69 | --progress \ |
70 | --stats \ |
71 | --delete \ |
72 | --delete-after \ |
73 | ${i} ${SMAGESCRIPTSDIR} |
74 | |
75 | if [ "$?" == "0" ] |
76 | then |
77 | break |
78 | else |
79 | continue |
80 | fi |
81 | |
82 | done |
83 | |
84 | #clean up backup files (foo~) |
85 | find ${SMAGESCRIPTSDIR} -name *~ -exec rm '{}' ';' |
86 | |
87 | xtitleclean |
88 | } |
89 | |
90 | # $1 filename |
91 | get_db_md5_sum() { |
92 | local DB_FILE |
93 | local MD5_FILE |
94 | local i |
95 | |
96 | DB_ENTRY="$(basename $1)" |
97 | MD5_FILE="${MD5DIR}/$(basename ${SMAGENAME} ${SMAGESUFFIX})" |
98 | |
99 | i="$(cat ${MD5_FILE}| grep ${DB_ENTRY} | cut -d' ' -f1)" |
100 | |
101 | echo "${i}" |
102 | } |
103 | |
104 | download_sources() { |
105 | |
106 | [ -z "${SRC_URI}" ] && echo -e "\nNothing declared to download.\n" && return 0 |
107 | |
108 | local EOA=${#SRC_URI[*]} |
109 | local my_SRC_URI |
110 | local my_SRC_URI_DEST |
111 | local my_SRC_URI_MIRROR |
112 | local my_SOURCEDIR |
113 | local DB_MD5_SUM_FILE="${MD5DIR}/$(basename ${SMAGENAME} .${SMAGESUFFIX}).md5" |
114 | local FETCHING |
115 | local i mirror |
116 | |
117 | |
118 | #install SRCDIR/PNAME if not exist |
119 | [ ! -d ${SOURCEDIR}/${PNAME} ] && install -d ${SOURCEDIR}/${PNAME} |
120 | |
121 | # check if FETCHING is needed |
122 | ( cd ${SOURCEDIR}/${PNAME}; md5sum --check ${DB_MD5_SUM_FILE} &> /dev/null ) |
123 | if [[ $? == 0 ]] |
124 | then |
125 | # md5's ok, not fetching needed |
126 | FETCHING=false |
127 | else |
128 | FETCHING=true |
129 | fi |
130 | |
131 | for ((i=0; i < EOA; i++)) |
132 | do |
133 | # url to file |
134 | my_SRC_URI="$(echo ${SRC_URI[${i}]} | cut -d' ' -f1)" |
135 | |
136 | # subdir in sources dir; the my_SRCI_URI file goes to there |
137 | my_SRC_URI_DEST="$(echo ${SRC_URI[${i}]} | cut -d' ' -f2)" |
138 | |
139 | # if my_src_uri_dest is not equal my_src_uri; than an other dir is used |
140 | if [[ ${my_SRC_URI_DEST} != ${my_SRC_URI} ]] |
141 | then |
142 | my_SOURCEDIR="${SOURCEDIR}/${PNAME}/${my_SRC_URI_DEST}" |
143 | else |
144 | my_SOURCEDIR="${SOURCEDIR}/${PNAME}" |
145 | fi |
146 | |
147 | # if an mirrored file than replace first the mirror uri |
148 | if [ -n "$(echo ${my_SRC_URI} | grep 'mirror://')" ] |
149 | then |
150 | for mirror in ${MIRRORS} |
151 | do |
152 | my_SRC_URI_MIRROR="$(echo ${my_SRC_URI} | sed "s|mirror:/|${mirror}/sources|g")" |
153 | |
154 | #echo "DEBUG: ${MY_SRC_URI}" |
155 | if [[ ${FETCHING} == true ]] |
156 | then |
157 | echo "==> fetching ${my_SRC_URI_MIRROR}" |
158 | wget \ |
159 | --passive-ftp \ |
160 | --tries 3 \ |
161 | --continue \ |
162 | --progress bar \ |
163 | --directory-prefix="${my_SOURCEDIR}" \ |
164 | "${my_SRC_URI_MIRROR}" |
165 | if [ "$?" == "0" ] |
166 | then |
167 | break |
168 | else |
169 | continue |
170 | fi |
171 | fi |
172 | done |
173 | else |
174 | #echo "DEBUG: ${SRC_URI[${i}]}" |
175 | if [[ ${FETCHING} == true ]] |
176 | then |
177 | echo "==> fetching ${my_SRC_URI}" |
178 | wget \ |
179 | --passive-ftp \ |
180 | --tries 3 \ |
181 | --continue \ |
182 | --progress bar \ |
183 | --directory-prefix="${my_SOURCEDIR}" \ |
184 | "${my_SRC_URI}" |
185 | # only needed to run through a list of mirrors |
186 | # if [ "$?" == "0" ] |
187 | # then |
188 | # break |
189 | # else |
190 | # continue |
191 | # fi |
192 | fi |
193 | fi |
194 | |
195 | # unset them to be shure |
196 | unset my_SRC_URI |
197 | unset my_SRC_URI_DEST |
198 | unset my_SRC_URI_MIRROR |
199 | unset my_SOURCEDIR |
200 | done |
201 | |
202 | # recheck md5 sums |
203 | echo |
204 | echo ">== Checking MD5 sums:" |
205 | ( cd ${SOURCEDIR}/${PNAME}; md5sum --check ${DB_MD5_SUM_FILE} ) || die "md5 failed" |
206 | echo |
207 | |
208 | # not needed anymore |
209 | unset SRC_URI |
210 | } |
211 | |
212 | # dummy function, used if that not exist in smage file |
213 | src_prepare() { |
214 | echo "no src_prepare defined" |
215 | sleep 2 |
216 | return 0 |
217 | } |
218 | |
219 | # dummy function, used if that not exist in smage file |
220 | src_compile() { |
221 | echo "no src_compile defined" |
222 | sleep 2 |
223 | return 0 |
224 | } |
225 | |
226 | # dummy function, used if that not exist in smage file |
227 | src_install() { |
228 | echo "no src_install defined" |
229 | sleep 2 |
230 | return 0 |
231 | } |
232 | |
233 | |
234 | build_mage_script() { |
235 | return 0 |
236 | } |
237 | |
238 | mconfigure() { |
239 | if [ -x ./configure ] |
240 | then |
241 | ./configure \ |
242 | --prefix=/usr \ |
243 | --host=${CHOST} \ |
244 | --mandir=/usr/share/man \ |
245 | --infodir=/usr/share/info \ |
246 | --datadir=/usr/share \ |
247 | --sysconfdir=/etc \ |
248 | --localstatedir=/var/lib \ |
249 | "$@" || die "mconfigure failed" |
250 | else |
251 | echo "configure is not an executable ..." |
252 | exit 1 |
253 | fi |
254 | } |
255 | |
256 | minstall() { |
257 | if [ -f ./[mM]akefile -o -f ./GNUmakefile ] ; then |
258 | make prefix=${BINDIR}/usr \ |
259 | datadir=${BINDIR}/usr/share \ |
260 | infodir=${BINDIR}/usr/share/info \ |
261 | localstatedir=${BINDIR}/var/lib \ |
262 | mandir=${BINDIR}/usr/share/man \ |
263 | sysconfdir=${BINDIR}/etc \ |
264 | "$@" install || die "minstall failed" |
265 | else |
266 | die "no Makefile found" |
267 | fi |
268 | } |
269 | |
270 | mmake() { |
271 | make ${MAKEOPTS} ${EXTRA_EMAKE} "$@" |
272 | } |
273 | |
274 | munpack() { |
275 | local SRCFILE |
276 | local IFTAR |
277 | local DEST |
278 | |
279 | SRCFILE=$1 |
280 | |
281 | if [ -z "$2" ] |
282 | then |
283 | DEST=${BUILDDIR} |
284 | else |
285 | DEST=$2 |
286 | fi |
287 | |
288 | case "${SRCFILE##*.}" in |
289 | bz2) |
290 | IFTAR="$(basename $SRCFILE .bz2)" |
291 | IFTAR="${IFTAR##*.}" |
292 | if [ "${IFTAR}" == "tar" ] |
293 | then |
294 | tar --no-same-owner -xvjf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST} |
295 | fi |
296 | ;; |
297 | gz) |
298 | IFTAR="$(basename $SRCFILE .gz)" |
299 | IFTAR="${IFTAR##*.}" |
300 | if [ "${IFTAR}" == "tar" ] |
301 | then |
302 | tar --no-same-owner -xvzf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST} |
303 | fi |
304 | ;; |
305 | tbz2) |
306 | tar --no-same-owner -xvjf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST} |
307 | ;; |
308 | tgz) |
309 | tar --no-same-owner -xvzf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST} |
310 | ;; |
311 | *) |
312 | die "munpack failed" |
313 | ;; |
314 | esac |
315 | } |
316 | |
317 | mpatch() { |
318 | local PATCHOPTS |
319 | local PATCHFILE |
320 | |
321 | PATCHOPTS=$1 |
322 | PATCHFILE=$2 |
323 | |
324 | patch "${PATCHOPTS}" -i ${SOURCEDIR}/${PNAME}/${PATCHFILE} |
325 | } |
326 | |
327 | |
328 | minstalldocs() { |
329 | local docfiles |
330 | |
331 | docfiles="$@" |
332 | |
333 | if [ ! -d ${BINDIR}/usr/share/doc/${PNAME}-${PVER} ] |
334 | then |
335 | install -d ${BINDIR}/usr/share/doc/${PNAME}-${PVER} || die "creating doc dirs." |
336 | fi |
337 | |
338 | for i in ${docfiles} |
339 | do |
340 | cat ${i} | gzip -9c > ${i}.gz || die "gzipping docs." |
341 | install -m 0644 ${SRCDIR}/${i}.gz \ |
342 | ${BINDIR}/usr/share/doc/${PNAME}-${PVER} || die "coping docs." |
343 | done |
344 | } |
345 | |
346 | mstriplibs() { |
347 | local stripdir="$@" |
348 | |
349 | [ -z "${stripdir}" ] && stripdir=${BINDIR} |
350 | find ${stripdir} | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null |
351 | } |
352 | |
353 | mstripbins() { |
354 | local stripdir="$@" |
355 | |
356 | [ -z "${stripdir}" ] && stripdir=${BINDIR} |
357 | find ${stripdir} | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null |
358 | } |
359 | |
360 | sminclude() { |
361 | local i |
362 | |
363 | if [[ -n "$@" ]] |
364 | then |
365 | for i in $@ |
366 | do |
367 | echo "--- Including ${SMAGESCRIPTSDIR}/include/${i}.sminc" |
368 | source ${SMAGESCRIPTSDIR}/include/${i}.sminc |
369 | done |
370 | echo |
371 | fi |
372 | } |
373 | |
374 | setup_distcc_environment(){ |
375 | if [ -x /usr/bin/distcc ] |
376 | then |
377 | echo "Using DistCC for compilation ..." |
378 | export PATH=/usr/lib/distcc/bin:${PATH} || die "distcc: could not export new $PATH" |
379 | |
380 | #export distcc as compiler |
381 | # export CC="distcc" |
382 | # export CXX=distcc |
383 | |
384 | export DISTCC_DIR="${DISTCC_DIR}" || die "distcc_dir export failed" |
385 | |
386 | |
387 | #ccache + distcc together |
388 | if [ "${SMAGE_USE_CCACHE}" == "true" ] |
389 | then |
390 | if [ -x /usr/bin/ccache ] |
391 | then |
392 | echo "Preparing DistCC to work together with CCache ..." |
393 | #export CCACHE_PREFIX="distcc" || die "distcc: could not set ccach_prefix" |
394 | # export CC="ccache distcc" |
395 | # export CXX="ccache distcc" |
396 | fi |
397 | fi |
398 | |
399 | #creating distcc tempdir |
400 | install -o distcc -g daemon -d ${DISTCC_DIR} |
401 | chmod 1777 ${DISTCC_DIR} |
402 | fi |
403 | } |
404 | |
405 | setup_ccache_environment(){ |
406 | if [ -x /usr/bin/ccache ] |
407 | then |
408 | echo "Using CCache for compilation ..." |
409 | export PATH=/usr/lib/ccache/bin:${PATH} || die "ccache: could not export new $PATH" |
410 | #unset CC CXX |
411 | fi |
412 | } |
413 | |
414 | # print out our version |
415 | showversion |
416 | echo |
417 | |
418 | if [ -z "$1" ] |
419 | then |
420 | echo "No .smage2 file given. Exiting." |
421 | echo |
422 | exit 1 |
423 | fi |
424 | |
425 | #updating smage2-scripts |
426 | if [ "$1" == "update" ] |
427 | then |
428 | if [ ! -d ${SOURCEDIR} ] |
429 | then |
430 | install -d ${SOURCEDIR} |
431 | fi |
432 | syncsmage2 |
433 | exit 0 |
434 | fi |
435 | |
436 | #creates md5sums for smages to given dir |
437 | if [ "$1" == "calcmd5" ] |
438 | then |
439 | if [ $# -ge 3 ] |
440 | then |
441 | SMAGENAME="$2" |
442 | MD5DIR="$3" |
443 | source ${SMAGENAME} || die "download source failed" |
444 | |
445 | # overridable sourcedir; must be declared after source of the smage2 |
446 | CALC_SOURCEDIR="${CALC_SOURCEDIR:="${SOURCEDIR}/${PNAME}"}" |
447 | |
448 | [ -z "${SRC_URI}" ] && die "Nothing declared to calculate." |
449 | |
450 | # end of array |
451 | EOA=${#SRC_URI[*]} |
452 | |
453 | [ ! -d ${MD5DIR} ] && install -d ${MD5DIR} |
454 | |
455 | # clear md5sum file |
456 | MY_MD5_FILE="${MD5DIR}/$(basename ${SMAGENAME} .${SMAGESUFFIX}).md5" |
457 | echo -n > ${MY_MD5_FILE} |
458 | |
459 | for ((i=0; i < EOA; i++)) |
460 | do |
461 | # url to file |
462 | my_SRC_URI="$(echo ${SRC_URI[${i}]} | cut -d' ' -f1)" |
463 | |
464 | # subdir in sources dir; the my_SRCI_URI file goes to there |
465 | my_SRC_URI_DEST="$(echo ${SRC_URI[${i}]} | cut -d' ' -f2)" |
466 | |
467 | # if my_src_uri_dest is not equal my_src_uri; than an other dir is used |
468 | if [[ ${my_SRC_URI_DEST} != ${my_SRC_URI} ]] |
469 | then |
470 | MY_SRC_FILE="${my_SRC_URI_DEST}/$(basename ${SRC_URI[${i}]})" |
471 | else |
472 | MY_SRC_FILE="$(basename ${SRC_URI[${i}]})" |
473 | fi |
474 | |
475 | if [ -e "${CALC_SOURCEDIR}/${MY_SRC_FILE}" ] |
476 | then |
477 | echo "calculating $(basename ${MY_SRC_FILE}) ..." |
478 | ( cd ${CALC_SOURCEDIR}; md5sum "${MY_SRC_FILE}" ) >> ${MY_MD5_FILE} |
479 | else |
480 | echo "WARNING: File '$(basename ${MY_SRC_FILE}) not found in ${CALC_SOURCEDIR}." |
481 | fi |
482 | |
483 | # unset them to be shure |
484 | unset my_SRC_URI |
485 | unset my_SRC_URI_DEST |
486 | unset my_SRC_URI_MIRROR |
487 | unset my_SOURCEDIR |
488 | done |
489 | |
490 | echo |
491 | echo "Calculating of md5 sums for '$(basename ${SMAGENAME} .${SMAGESUFFIX})' done." |
492 | echo |
493 | else |
494 | echo "Usage: Calculating MD5 Sums:" |
495 | echo " $(basename $0) calcmd5 /path/to/SMAGENAME /path/to/MD5DIR" |
496 | echo |
497 | echo |
498 | echo "Export the CALC_SOURCEDIR variable to override current SOURCEDIRs." |
499 | echo |
500 | exit 1 |
501 | fi |
502 | |
503 | exit 0 |
504 | fi |
505 | |
506 | #download sources |
507 | if [ "$1" == "download" -a -n "$2" ] |
508 | then |
509 | if [ ! -d ${SMAGESCRIPTSDIR} ] |
510 | then |
511 | install -d ${SMAGESCRIPTSDIR} |
512 | fi |
513 | |
514 | # get smage |
515 | SMAGENAME="$2" |
516 | MD5DIR="$(dirname ${SMAGENAME})/md5" |
517 | source ${SMAGENAME} || die "download source failed" |
518 | |
519 | download_sources |
520 | exit 0 |
521 | fi |
522 | |
523 | if [ ! -e ${MLIBDIR}/pkgbuild_dir.sh ] |
524 | then |
525 | die "Error: ${MLIBDIR}/pkgbuild_dir.sh not found. Aborting." |
526 | fi |
527 | |
528 | if [ -z "`basename ${SMAGENAME}|grep .${SMAGESUFFIX}`" ] |
529 | then |
530 | die "File '`basename ${SMAGENAME}`' is not a sMage v${SMAGEVERSION} file. Aborting." |
531 | fi |
532 | |
533 | if [ -z "${SOURCEDIR}" ] |
534 | then |
535 | die "\$SOURCEDIR not found. Please setup your mage.rc correctly." |
536 | fi |
537 | |
538 | if [ -z "${SMAGESCRIPTSDIR}" ] |
539 | then |
540 | die "\$SMAGESCRIPTSDIR not found. Please setup your mage.rc correctly." |
541 | fi |
542 | |
543 | if [ -z "${SMAGE2RSYNC}" ] |
544 | then |
545 | echo "\$SMAGE2RSYNC not found. Please setup your mage.rc correctly." |
546 | exit 1 |
547 | fi |
548 | |
549 | if [ -z "${BINDIR}" ] |
550 | then |
551 | die "no BINDIR variable found in /etc/mage.rc" |
552 | fi |
553 | |
554 | if [ -z "${CHOST}" ] |
555 | then |
556 | die "no CHOST variable found in /etc/mage.rc" |
557 | fi |
558 | |
559 | if [ -z "${CFLAGS}" ] |
560 | then |
561 | die "no CFLAGS variable found in /etc/mage.rc" |
562 | fi |
563 | |
564 | if [ -z "${CXXFLAGS}" ] |
565 | then |
566 | die "no CXXFLAGS variable found in /etc/mage.rc" |
567 | fi |
568 | |
569 | |
570 | source ${SMAGENAME} || die "source failed" |
571 | PKGNAME="${PNAME}-${PVER}-${CHOST%%-*}-${PBUILD}" |
572 | MD5DIR="$(dirname ${SMAGENAME})/md5" |
573 | |
574 | xtitle "Compiling ${PKGNAME}" |
575 | echo "Compiling ${PKGNAME}" |
576 | |
577 | #download sources |
578 | download_sources |
579 | |
580 | #fixes some issues with these functions |
581 | export -f src_prepare || die "src_prepare export failed" |
582 | export -f src_compile || die "src_compile export failed" |
583 | export -f src_install || die "src_install export failed" |
584 | |
585 | #fixes some compile issues |
586 | export CHOST="${CHOST}" || die "CHOST export failed" |
587 | export CFLAGS="${CFLAGS}" || die "CFLAGS export failed" |
588 | export CXXFLAGS="${CFLAGS}" || die "CXXFLAGS export failed" |
589 | export BINDIR="${BINDIR}" || die "BINDIR export failed" |
590 | export MAKEOPTS="${MAKEOPTS}" || die "MAKEOPTS export failed" |
591 | |
592 | |
593 | #setup distcc |
594 | #distcc mus be setup *before* ccache, as ccache need to be before distcc in path |
595 | if [ "${SMAGE_USE_DISTCC}" == "true" ] |
596 | then |
597 | setup_distcc_environment |
598 | fi |
599 | |
600 | #setup ccache |
601 | if [ "${SMAGE_USE_CCACHE}" == "true" ] |
602 | then |
603 | setup_ccache_environment |
604 | fi |
605 | |
606 | |
607 | # small sleep to show our settings |
608 | sleep 1 |
609 | |
610 | #debug |
611 | #echo "CC=${CC}" |
612 | #echo "CXX=${CXX}" |
613 | #echo "DISTCC_DIR=${DISTCC_DIR}" |
614 | #echo "PATH: ${PATH}" |
615 | #echo "--------------------------------------" |
616 | #env |
617 | #echo "--------------------------------------" |
618 | #read |
619 | #debug end |
620 | |
621 | #cleans up build if a previously one exists |
622 | if [ -d ${BUILDDIR} ] |
623 | then |
624 | rm -rf ${BUILDDIR}/* || die "couldn't cleanup \$BUILDDIR." |
625 | fi |
626 | install -d ${BUILDDIR} || die "couldn't create \$BUILDDIR." |
627 | |
628 | #cleans up srcdir if a previously unpacked one exists |
629 | if [ -d ${SRCDIR} ] |
630 | then |
631 | rm -rf ${SRCDIR} |
632 | fi |
633 | |
634 | #cleans up bindir if a previous build exists or creates a new one |
635 | if [ -d ${BINDIR} ] |
636 | then |
637 | rm -rf ${BINDIR} |
638 | fi |
639 | install -d ${BINDIR} || die "couldn't create \$BINDIR." |
640 | |
641 | #cleans up package temp dir if a previous build exists |
642 | if [ -d ${BUILDDIR}/${PKGNAME} ] |
643 | then |
644 | rm -rf ${BUILDDIR}/${PKGNAME} |
645 | fi |
646 | |
647 | #cleans up timestamp if one exists |
648 | if [ -f /var/tmp/timestamp ] |
649 | then |
650 | mage rmstamp |
651 | fi |
652 | |
653 | src_prepare || die "src_prepare failed" |
654 | src_compile || die "src_compile failed" |
655 | src_install || die "src_install failed" |
656 | |
657 | |
658 | #compressing doc, info & man files |
659 | echo -e "Compressing man-pages ..." |
660 | if [ -d ${BUILDDIR}/builded/usr/share/man ] |
661 | then |
662 | ${MLIBDIR}/compressdoc -g -9 ${BUILDDIR}/builded/usr/share/man |
663 | fi |
664 | |
665 | echo -e "Compressing info-pages ..." |
666 | if [ -d ${BUILDDIR}/builded/usr/share/info ] |
667 | then |
668 | ${MLIBDIR}/compressdoc -g -9 ${BUILDDIR}/builded/usr/share/info |
669 | fi |
670 | |
671 | # stripping all bins and libs |
672 | case ${NOSTRIP} in |
673 | true|TRUE|yes|y) |
674 | echo -e "NOSTRIP=true detected; Package will not be stripped ..." |
675 | ;; |
676 | *) |
677 | echo -e "Stripping binaries ..." |
678 | mstripbins ${BINDIR} |
679 | echo -e "Stripping libraries ..." |
680 | mstriplibs ${BINDIR} |
681 | ;; |
682 | esac |
683 | |
684 | #the new buildpkg command |
685 | case ${NOPKGBUILD} in |
686 | true|TRUE|yes|y) |
687 | echo -e "NOPGKBUILD=true detected; Package will not be build ..." |
688 | ;; |
689 | *) |
690 | ${MLIBDIR}/pkgbuild_dir.sh ${PKGNAME} ${BINDIR} || die "package-build failed" |
691 | echo -e "\nPackage ${PKGNAME} successfully builded.\n" |
692 | ;; |
693 | esac |
694 | |
695 | #for sure |
696 | unset NOPKGBUILD |
697 | unset NOSTRIP |
698 | |
699 | xtitleclean |
700 | #echo -e "\nPackage ${PKGNAME} successfully builded.\n" |
Properties
Name | Value |
---|---|
svn:executable | * |