Magellan Linux

Annotation of /trunk/mage/usr/lib/mage/smage2.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 497 - (hide annotations) (download) (as text)
Thu Jun 7 13:16:03 2007 UTC (16 years, 11 months ago) by niro
File MIME type: application/x-sh
File size: 29414 byte(s)
-added mlibtoolize() function

1 niro 24 #!/bin/bash
2    
3     # compiles/installs .smage2 source install scripts
4     # needs pkgbuild_dir (mage)
5    
6     # SMAGE2
7 niro 497 # $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.58 2007-06-07 13:16:03 niro Exp $
8 niro 24
9     #01.10.2004
10     # added ccache support
11     # added distcc support
12    
13 niro 419 # set default user mage.rc
14     : ${MAGERC="/etc/mage.rc"}
15    
16 niro 24 ## setup ##
17     PKGSUFFIX="mpk"
18 niro 403 SRCPKGSUFFIX="mpks"
19 niro 24 SMAGENAME="$1"
20     SMAGESUFFIX="smage2"
21     MLIBDIR=/usr/lib/mage
22 niro 186 SMAGEVERSION="$( < ${MLIBDIR}/version)"
23 niro 24
24 niro 351 ## only for tests -> normally in /etc/rc.d/init.d/functions
25     COLRED="\033[1;6m\033[31m"
26     COLGREEN="\033[1;6m\033[32m"
27     COLYELLOW="\033[1;6m\033[33m"
28     COLBLUE="\033[1;6m\033[34m"
29     COLMAGENTA="\033[1;6m\033[35m"
30     COLWHITE="\033[1;6m\033[37m"
31     COLGRAY="\033[0;6m\033[37m"
32     COLBOLD="\033[1m"
33     COLDEFAULT="\033[0m"
34    
35     if [[ ${NOCOLORS} = true ]]
36     then
37     COLRED=""
38     COLGREEN=""
39     COLYELLOW=""
40     COLBLUE=""
41     COLMAGENTA=""
42     COLWHITE=""
43     COLGRAY=""
44     COLBOLD=""
45     COLDEFAULT=""
46     fi
47    
48 niro 169 # export default C locale
49     export LC_ALL=C
50    
51 niro 439 source /etc/mage.rc.global
52 niro 419 source ${MAGERC}
53 niro 24
54 niro 347 # set PKGDIR and BUILDDIR and BINDIR to MROOT
55     if [[ -n ${MROOT} ]]
56     then
57     export PKGDIR=${MROOT}/${PKGDIR}
58     export BUILDDIR=${MROOT}/${BUILDDIR}
59     export BINDIR=${MROOT}/${BINDIR}
60     fi
61    
62 niro 306 showversion()
63     {
64 niro 24 echo -en "Magellan Source Install v${SMAGEVERSION} "
65     echo -e "-- Niels Rogalla (niro@magellan-linux.de)"
66     }
67    
68 niro 306 die()
69     {
70 niro 24 xtitleclean
71 niro 413 echo -e ${COLRED}"Exited ${BASH_SOURCE} at line no ${BASH_LINENO}."${COLDEFAULT}
72 niro 24 echo "SMAGE failed: $@"
73     exit 1
74     }
75    
76 niro 306 xtitle()
77     {
78     if [[ ${TERM} = xterm ]]
79 niro 24 then
80     echo -ne "\033]0;[sMage: $@]\007"
81     fi
82     return 0
83     }
84    
85 niro 306 xtitleclean()
86     {
87     if [[ ${TERM} = xterm ]]
88 niro 24 then
89     echo -ne "\033]0;\007"
90     fi
91     return 0
92     }
93    
94 niro 306 syncsmage2()
95     {
96 niro 24 xtitle "Updating smage2-script tree ..."
97     local i
98     for i in ${SMAGE2RSYNC}
99     do
100 niro 386 rsync ${RSYNC_FETCH_OPTIONS} ${i} ${SMAGESCRIPTSDIR}
101 niro 306 if [[ $? = 0 ]]
102 niro 24 then
103     break
104     else
105     continue
106     fi
107     done
108 niro 306
109     # clean up backup files (foo~)
110 niro 24 find ${SMAGESCRIPTSDIR} -name *~ -exec rm '{}' ';'
111 niro 306
112 niro 24 xtitleclean
113     }
114    
115 niro 59 # $1 filename
116 niro 306 get_db_md5_sum()
117     {
118 niro 59 local DB_FILE
119     local MD5_FILE
120     local i
121    
122     DB_ENTRY="$(basename $1)"
123     MD5_FILE="${MD5DIR}/$(basename ${SMAGENAME} ${SMAGESUFFIX})"
124    
125     i="$(cat ${MD5_FILE}| grep ${DB_ENTRY} | cut -d' ' -f1)"
126    
127     echo "${i}"
128     }
129    
130 niro 306 download_sources()
131     {
132 niro 59
133 niro 61 [ -z "${SRC_URI}" ] && echo -e "\nNothing declared to download.\n" && return 0
134 niro 59
135     local EOA=${#SRC_URI[*]}
136 niro 66 local my_SRC_URI
137     local my_SRC_URI_DEST
138     local my_SRC_URI_MIRROR
139     local my_SOURCEDIR
140 niro 59 local DB_MD5_SUM_FILE="${MD5DIR}/$(basename ${SMAGENAME} .${SMAGESUFFIX}).md5"
141     local FETCHING
142     local i mirror
143    
144 niro 306
145     # install SRCDIR/PNAME if not exist
146 niro 59 [ ! -d ${SOURCEDIR}/${PNAME} ] && install -d ${SOURCEDIR}/${PNAME}
147    
148     # check if FETCHING is needed
149 niro 66 ( cd ${SOURCEDIR}/${PNAME}; md5sum --check ${DB_MD5_SUM_FILE} &> /dev/null )
150 niro 306 if [[ $? = 0 ]]
151 niro 59 then
152 niro 439 # md5's ok, no fetching needed
153 niro 59 FETCHING=false
154     else
155     FETCHING=true
156     fi
157 niro 306
158 niro 59 for ((i=0; i < EOA; i++))
159     do
160 niro 66 # url to file
161     my_SRC_URI="$(echo ${SRC_URI[${i}]} | cut -d' ' -f1)"
162 niro 59
163 niro 66 # subdir in sources dir; the my_SRCI_URI file goes to there
164     my_SRC_URI_DEST="$(echo ${SRC_URI[${i}]} | cut -d' ' -f2)"
165    
166     # if my_src_uri_dest is not equal my_src_uri; than an other dir is used
167     if [[ ${my_SRC_URI_DEST} != ${my_SRC_URI} ]]
168     then
169     my_SOURCEDIR="${SOURCEDIR}/${PNAME}/${my_SRC_URI_DEST}"
170     else
171     my_SOURCEDIR="${SOURCEDIR}/${PNAME}"
172     fi
173    
174 niro 59 # if an mirrored file than replace first the mirror uri
175 niro 439 if [[ -n $(echo ${my_SRC_URI} | grep 'mirror://') ]]
176 niro 59 then
177     for mirror in ${MIRRORS}
178     do
179 niro 66 my_SRC_URI_MIRROR="$(echo ${my_SRC_URI} | sed "s|mirror:/|${mirror}/sources|g")"
180 niro 59
181 niro 306 if [[ ${FETCHING} = true ]]
182 niro 59 then
183 niro 439 echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}"
184 niro 59 wget \
185     --passive-ftp \
186     --tries 3 \
187     --continue \
188     --progress bar \
189 niro 66 --directory-prefix="${my_SOURCEDIR}" \
190     "${my_SRC_URI_MIRROR}"
191 niro 306 if [[ $? = 0 ]]
192 niro 59 then
193     break
194     else
195     continue
196     fi
197     fi
198     done
199 niro 439 elif [[ -n $(echo ${my_SRC_URI} | grep 'sourceforge://') ]]
200     then
201     for mirror in ${SOURCEFORGE_MIRRORS}
202     do
203     my_SRC_URI_MIRROR="$(echo ${my_SRC_URI} | sed "s|sourceforge:/|${mirror}|g")"
204    
205     if [[ ${FETCHING} = true ]]
206     then
207     echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}"
208     wget \
209     --passive-ftp \
210     --tries 3 \
211     --continue \
212     --progress bar \
213     --directory-prefix="${my_SOURCEDIR}" \
214     "${my_SRC_URI_MIRROR}"
215     if [[ $? = 0 ]]
216     then
217     break
218     else
219     continue
220     fi
221     fi
222     done
223     elif [[ -n $(echo ${my_SRC_URI} | grep 'gnu://') ]]
224     then
225     for mirror in ${GNU_MIRRORS}
226     do
227     my_SRC_URI_MIRROR="$(echo ${my_SRC_URI} | sed "s|gnu:/|${mirror}|g")"
228    
229     if [[ ${FETCHING} = true ]]
230     then
231     echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}"
232     wget \
233     --passive-ftp \
234     --tries 3 \
235     --continue \
236     --progress bar \
237     --directory-prefix="${my_SOURCEDIR}" \
238     "${my_SRC_URI_MIRROR}"
239     if [[ $? = 0 ]]
240     then
241     break
242     else
243     continue
244     fi
245     fi
246     done
247 niro 459 elif [[ -n $(echo ${my_SRC_URI} | grep 'kde://') ]]
248     then
249     for mirror in ${KDE_MIRRORS}
250     do
251     my_SRC_URI_MIRROR="$(echo ${my_SRC_URI} | sed "s|kde:/|${mirror}|g")"
252    
253     if [[ ${FETCHING} = true ]]
254     then
255     echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}"
256     wget \
257     --passive-ftp \
258     --tries 3 \
259     --continue \
260     --progress bar \
261     --directory-prefix="${my_SOURCEDIR}" \
262     "${my_SRC_URI_MIRROR}"
263     if [[ $? = 0 ]]
264     then
265     break
266     else
267     continue
268     fi
269     fi
270     done
271     elif [[ -n $(echo ${my_SRC_URI} | grep 'gnome://') ]]
272     then
273     for mirror in ${GNOME_MIRRORS}
274     do
275     my_SRC_URI_MIRROR="$(echo ${my_SRC_URI} | sed "s|gnome:/|${mirror}|g")"
276    
277     if [[ ${FETCHING} = true ]]
278     then
279     echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}"
280     wget \
281     --passive-ftp \
282     --tries 3 \
283     --continue \
284     --progress bar \
285     --directory-prefix="${my_SOURCEDIR}" \
286     "${my_SRC_URI_MIRROR}"
287     if [[ $? = 0 ]]
288     then
289     break
290     else
291     continue
292     fi
293     fi
294     done
295 niro 59 else
296 niro 306 if [[ ${FETCHING} = true ]]
297 niro 59 then
298 niro 439 echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI}${COLDEFAULT}"
299 niro 59 wget \
300     --passive-ftp \
301     --tries 3 \
302     --continue \
303     --progress bar \
304 niro 66 --directory-prefix="${my_SOURCEDIR}" \
305     "${my_SRC_URI}"
306 niro 59 fi
307     fi
308 niro 306
309 niro 66 # unset them to be shure
310     unset my_SRC_URI
311     unset my_SRC_URI_DEST
312     unset my_SRC_URI_MIRROR
313     unset my_SOURCEDIR
314 niro 59 done
315    
316     # recheck md5 sums
317     echo
318 niro 439 echo -e "${COLBLUE}===${COLGREEN} Checking MD5 sums:${COLDEFAULT}"
319 niro 63 ( cd ${SOURCEDIR}/${PNAME}; md5sum --check ${DB_MD5_SUM_FILE} ) || die "md5 failed"
320 niro 59 echo
321    
322     # not needed anymore
323     unset SRC_URI
324     }
325    
326 niro 24 # dummy function, used if that not exist in smage file
327 niro 306 src_prepare()
328     {
329 niro 24 echo "no src_prepare defined"
330     sleep 2
331     return 0
332     }
333    
334     # dummy function, used if that not exist in smage file
335 niro 306 src_compile()
336     {
337 niro 24 echo "no src_compile defined"
338     sleep 2
339     return 0
340     }
341    
342     # dummy function, used if that not exist in smage file
343 niro 306 src_install()
344     {
345 niro 24 echo "no src_install defined"
346     sleep 2
347     return 0
348     }
349    
350 niro 351 mlibdir()
351     {
352     local libdir=lib
353     [[ ${ARCH} = x86_64 ]] && libdir=lib64
354    
355     echo "${libdir}"
356     }
357    
358 niro 306 mconfigure()
359     {
360 niro 24 if [ -x ./configure ]
361     then
362 niro 306 ./configure \
363     --prefix=/usr \
364     --host=${CHOST} \
365     --mandir=/usr/share/man \
366     --infodir=/usr/share/info \
367     --datadir=/usr/share \
368     --sysconfdir=/etc \
369     --localstatedir=/var/lib \
370 niro 351 --libdir=/usr/$(mlibdir) \
371 niro 306 "$@" || die "mconfigure failed"
372 niro 24 else
373     echo "configure is not an executable ..."
374     exit 1
375     fi
376     }
377    
378 niro 306 minstall()
379     {
380     if [ -f ./[mM]akefile -o -f ./GNUmakefile ]
381     then
382 niro 24 make prefix=${BINDIR}/usr \
383     datadir=${BINDIR}/usr/share \
384     infodir=${BINDIR}/usr/share/info \
385     localstatedir=${BINDIR}/var/lib \
386     mandir=${BINDIR}/usr/share/man \
387     sysconfdir=${BINDIR}/etc \
388 niro 351 libdir=${BINDIR}/usr/$(mlibdir) \
389 niro 24 "$@" install || die "minstall failed"
390     else
391     die "no Makefile found"
392     fi
393     }
394    
395 niro 306 mmake()
396     {
397 niro 24 make ${MAKEOPTS} ${EXTRA_EMAKE} "$@"
398     }
399    
400 niro 306 munpack()
401     {
402 niro 24 local SRCFILE
403     local IFTAR
404     local DEST
405    
406     SRCFILE=$1
407 niro 306
408 niro 24 if [ -z "$2" ]
409     then
410     DEST=${BUILDDIR}
411     else
412     DEST=$2
413     fi
414 niro 306
415 niro 411 [[ ! -d ${DEST} ]] && install -d ${DEST}
416    
417 niro 24 case "${SRCFILE##*.}" in
418     bz2)
419     IFTAR="$(basename $SRCFILE .bz2)"
420     IFTAR="${IFTAR##*.}"
421 niro 306 if [[ ${IFTAR} = tar ]]
422 niro 24 then
423     tar --no-same-owner -xvjf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST}
424     fi
425     ;;
426     gz)
427     IFTAR="$(basename $SRCFILE .gz)"
428     IFTAR="${IFTAR##*.}"
429 niro 306 if [[ ${IFTAR} = tar ]]
430 niro 24 then
431     tar --no-same-owner -xvzf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST}
432     fi
433     ;;
434     tbz2)
435     tar --no-same-owner -xvjf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST}
436     ;;
437     tgz)
438     tar --no-same-owner -xvzf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST}
439     ;;
440     *)
441     die "munpack failed"
442     ;;
443     esac
444     }
445    
446 niro 306 mpatch()
447     {
448 niro 24 local PATCHOPTS
449     local PATCHFILE
450 niro 447 local i
451 niro 24
452     PATCHOPTS=$1
453     PATCHFILE=$2
454    
455 niro 447 if [[ -z $2 ]]
456     then
457     PATCHFILE=$1
458    
459     ## patch level auto-detection, get patch level
460     for ((i=0; i < 10; i++))
461     do
462     patch --dry-run -Np${i} -i ${SOURCEDIR}/${PNAME}/${PATCHFILE} > /dev/null
463     if [[ $? = 0 ]]
464     then
465     PATCHOPTS="-Np${i}"
466     break
467     fi
468     done
469     fi
470    
471 niro 384 echo -e "${COLBLUE}*** ${COLGREEN}Applying patch '${PATCHFILE}'${COLDEFAULT}"
472 niro 24 patch "${PATCHOPTS}" -i ${SOURCEDIR}/${PNAME}/${PATCHFILE}
473     }
474    
475 niro 497 mlibtoolize()
476     {
477     local opts="$@"
478     [[ -z ${opts} ]] && opts="--copy --force"
479 niro 24
480 niro 497 libtoolize ${opts} || die "running: mlibtoolize ${opts}"
481     }
482    
483 niro 306 minstalldocs()
484     {
485 niro 24 local docfiles
486     docfiles="$@"
487 niro 306
488 niro 24 if [ ! -d ${BINDIR}/usr/share/doc/${PNAME}-${PVER} ]
489     then
490     install -d ${BINDIR}/usr/share/doc/${PNAME}-${PVER} || die "creating doc dirs."
491     fi
492 niro 306
493 niro 24 for i in ${docfiles}
494     do
495     cat ${i} | gzip -9c > ${i}.gz || die "gzipping docs."
496     install -m 0644 ${SRCDIR}/${i}.gz \
497     ${BINDIR}/usr/share/doc/${PNAME}-${PVER} || die "coping docs."
498     done
499     }
500    
501 niro 306 mstriplibs()
502     {
503 niro 79 local stripdir="$@"
504    
505     [ -z "${stripdir}" ] && stripdir=${BINDIR}
506     find ${stripdir} | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
507     }
508    
509 niro 306 mstripbins()
510     {
511 niro 79 local stripdir="$@"
512    
513     [ -z "${stripdir}" ] && stripdir=${BINDIR}
514     find ${stripdir} | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
515     }
516    
517 niro 306 sminclude()
518     {
519 niro 172 local i
520    
521 niro 183 if [[ -n "$@" ]]
522 niro 172 then
523     for i in $@
524     do
525 niro 175 echo "--- Including ${SMAGESCRIPTSDIR}/include/${i}.sminc"
526 niro 172 source ${SMAGESCRIPTSDIR}/include/${i}.sminc
527     done
528 niro 177 echo
529 niro 172 fi
530     }
531    
532 niro 306 setup_distcc_environment()
533     {
534 niro 24 if [ -x /usr/bin/distcc ]
535     then
536 niro 441 echo -e "${COLBLUE}---${COLGREEN} Using DistCC for compilation ...${COLDEFAULT}"
537 niro 351 export PATH=/usr/$(mlibdir)/distcc/bin:${PATH} || die "distcc: could not export new $PATH"
538 niro 24
539     export DISTCC_DIR="${DISTCC_DIR}" || die "distcc_dir export failed"
540    
541 niro 306 # creating distcc tempdir
542 niro 24 install -o distcc -g daemon -d ${DISTCC_DIR}
543     chmod 1777 ${DISTCC_DIR}
544     fi
545     }
546    
547 niro 306 setup_ccache_environment()
548     {
549 niro 24 if [ -x /usr/bin/ccache ]
550     then
551 niro 441 echo -e "${COLBLUE}---${COLGREEN} Using CCache for compilation ...${COLDEFAULT}"
552 niro 351 export PATH=/usr/$(mlibdir)/ccache/bin:${PATH} || die "ccache: could not export new $PATH"
553 niro 24 fi
554     }
555    
556 niro 193
557     # fixes given dependencies to match a MAGE_TARGET
558 niro 198 # fix_mage_deps -target s/depend # <-- note -target !
559 niro 306 fix_mage_deps()
560     {
561 niro 193 local target="$1"
562     local depend="$2"
563     local NDEPEND
564     local sym dep cat pver pname
565    
566     # deps and provides are special
567     # they must be fixed to match the target
568    
569     # run this only if target and depend is not empty
570     if [ -n "${target}" ] && [ -n "${depend}" ]
571     then
572     # fix DEPEND
573     while read sym dep
574     do
575 niro 427 # ignore empty lines
576     [[ -z ${dep} ]] && continue
577    
578 niro 193 cat="$(dirname ${dep})"
579 niro 199 # change if not virtual
580 niro 200 if [[ ${cat} = virtual ]]
581 niro 199 then
582 niro 200 pname="$(basename ${dep})"
583     else
584 niro 199 # fix pver to target-pver
585     # to get pname-target-pver
586 niro 193
587 niro 199 # doing it backwards !
588     pver="${dep##*-}"
589 niro 200 # full pver
590     pname="$(basename ${dep/-${pver}/})${target}-${pver}"
591 niro 199 fi
592 niro 193
593     # do not add empty lines
594     if [ -z "${NDEPEND}" ]
595     then
596 niro 200 NDEPEND="${sym} ${cat}/${pname}"
597 niro 193 else
598     NDEPEND="${NDEPEND}
599 niro 201 ${sym} ${cat}/${pname}"
600 niro 193 fi
601    
602     unset cat pname pver
603     done << EOF
604     ${depend}
605     EOF
606     # set NDEPEND to DEPEND
607     depend="${NDEPEND}"
608     fi
609    
610     echo "${depend}"
611     }
612    
613 niro 192 # build_mage_script(): helper functions for regen_mage_tree()
614 niro 191 # generates an mage file with given information in smage file
615     # needs at least:
616     # PNAME name of pkg
617     # PVER version
618     # PBUILD revision
619     # PCATEGORIE categorie of the pkg
620     # STATE state of pkg stable|unstable|old
621     # DESCRIPTION va short description (opt)
622     # HOMEPAGE homepage (opt)
623     # DEPEND runtime dependencies (opt)
624     # SDEPEND add. needed deps to build the pkg (opt)
625     # PROVIDE provides a virtual (opt)
626     #
627     # special tags:
628     # PKGTYPE type of pkg
629     # INHERITS which functions get included
630     # SPECIAL_FUNCTIONS special functions wich should also be added
631     # warning: they get killed before the build starts !
632     #
633     # MAGE_TREE_DEST target destination of the generated tree
634     # REGEN_MAGE_TREE set to 'true' to enable this
635 niro 193 #
636 niro 195 # gets called with build_mage_script target
637 niro 192 build_mage_script()
638 niro 191 {
639     local magefile
640     local dest
641 niro 193 local target
642 niro 191 local sym
643     local depname
644    
645     # if MAGE_TREE_DEST not set use BUILDDIR
646     : ${MAGE_TREE_DEST=${BUILDDIR}/mage-tree}
647    
648     # determinate which suffix this mage file should get, if any
649 niro 195 [ -n "$1" ] && target="-$1"
650 niro 191
651     # name of magefile
652 niro 193 magefile="${PNAME}${target}-${PVER}-${PBUILD}.mage"
653 niro 191
654     # destination to magefile
655 niro 193 dest="${MAGE_TREE_DEST}/${PCATEGORIE}/${PNAME}${target}/${magefile}"
656 niro 191
657     # show what we are doing
658 niro 439 echo -e "${COLBLUE}===${COLGREEN} generating mage file:${COLDEFAULT}"
659     echo "${dest}"
660 niro 191
661     install -d "$(dirname ${dest})"
662     # now build the mage file
663     > ${dest}
664    
665     # header
666 niro 497 echo '# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.58 2007-06-07 13:16:03 niro Exp $' >> ${dest}
667 niro 191 echo >> ${dest}
668    
669     # pgkname and state
670 niro 193 echo "PKGNAME=\"${PNAME}${target}-${PVER}-\${ARCH}-${PBUILD}\"" >> ${dest}
671 niro 191 echo "STATE=\"${STATE}\"" >> ${dest}
672     echo >> ${dest}
673    
674     # description and homepage
675     echo "DESCRIPTION=\"${DESCRIPTION}\"" >> ${dest}
676     echo "HOMEPAGE=\"${HOMEPAGE}\"" >> ${dest}
677     echo >> ${dest}
678    
679 niro 196 # special tags and vars
680 niro 191 echo "PKGTYPE=\"${PKGTYPE}\"" >> ${dest}
681 niro 214
682     # echo MAGE_TARGETS ## note -target is needed !
683     echo "MAGE_TARGETS=\"${target}\"" >> ${dest}
684     echo >> ${dest}
685    
686 niro 197 # add special vars
687     if [ -n "${SPECIAL_VARS}" ]
688 niro 191 then
689     local i
690 niro 197 for i in ${SPECIAL_VARS}
691 niro 191 do
692 niro 197 # being tricky here :)
693     echo "${i}=\"$(eval echo \$${i})\"" >> ${dest}
694 niro 191 done
695     echo >> ${dest}
696     fi
697 niro 214
698 niro 197 # add at least all includes
699     if [ -n "${INHERITS}" ]
700 niro 196 then
701 niro 197 echo -n "minclude" >> ${dest}
702 niro 196 local i
703 niro 197 for i in ${INHERITS}
704 niro 196 do
705 niro 197 echo -n " ${i}" >> ${dest}
706 niro 196 done
707     echo >> ${dest}
708     fi
709 niro 197 echo >> ${dest}
710 niro 196
711 niro 191 # deps and provides
712 niro 193 echo "DEPEND=\"$(fix_mage_deps "${target}" "${DEPEND}")\"" >> ${dest}
713 niro 196 echo >> ${dest}
714 niro 193 echo "SDEPEND=\"$(fix_mage_deps "${target}" "${SDEPEND}")\"" >> ${dest}
715 niro 196 echo >> ${dest}
716 niro 191 echo "PROVIDE=\"${PROVIDE}\"" >> ${dest}
717     echo >> ${dest}
718    
719     # add special functions
720     if [ -n "${SPECIAL_FUNCTIONS}" ]
721     then
722     local i
723     for i in ${SPECIAL_FUNCTIONS}
724     do
725     # add to mage (quotes needed !)
726     typeset -f "${i}" >> ${dest}
727 niro 214 echo >> ${dest}
728 niro 191 # unset to be safe (quotes needed !)
729 niro 192 #unset "${i}" <-- later to get every target built
730 niro 191 done
731 niro 196 echo >> ${dest}
732 niro 191 fi
733    
734     # pre|post-install|removes
735     typeset -f preinstall >> ${dest}
736     echo >> ${dest}
737     typeset -f postinstall >> ${dest}
738     echo >> ${dest}
739     typeset -f preremove >> ${dest}
740     echo >> ${dest}
741     typeset -f postremove >> ${dest}
742     echo >> ${dest}
743     }
744    
745     regen_mage_tree()
746     {
747     local i
748    
749     # build them only if requested
750     if [[ ${REGEN_MAGE_TREE} = true ]]
751     then
752 niro 195 # run it without targets
753     if [ -z "${MAGE_TARGETS}" ]
754     then
755 niro 191 echo
756 niro 195 build_mage_script
757 niro 191 echo
758 niro 195 else
759    
760     # build for each target an mage file
761     # run it with several targets
762     for i in ${MAGE_TARGETS}
763     do
764     echo
765     build_mage_script "${i}"
766     echo
767     done
768     fi
769 niro 191 fi
770    
771     # now unset all uneeded vars to be safe
772 niro 192 # unset PKGNAME <-- don't do that; smage needs this var
773     # unset to be safe (quotes needed !)
774 niro 477 # for i in ${SPECIAL_FUNCTIONS}
775     # do
776     # unset "${i}"
777     # done
778 niro 192 unset SPECIAL_FUNCTIONS
779 niro 477 # for i in ${SPECIAL_VARS}
780     # do
781     # unset "${i}"
782     # done
783 niro 194 unset SPECIAL_VARS
784 niro 191 unset STATE
785     unset DESCRIPTION
786     unset HOMEPAGE
787     unset PKGTYPE
788     unset INHERITS
789     unset DEPEND
790     unset SDEPEND
791     unset PROVIDE
792     unset preinstall
793     unset postinstall
794     unset preremove
795     unset postremove
796     }
797    
798 niro 253 export_inherits()
799     {
800     local include="$1"
801     shift
802    
803     while [ "$1" ]
804     do
805     local functions="$1"
806    
807     # sanity checks
808     [ -z "${include}" ] && die "export_inherits(): \$include not given."
809     [ -z "${functions}" ] && die "export_inherits(): \$functions not given."
810    
811     eval "${functions}() { ${include}_${functions} ; }"
812    
813     # debug
814     [[ ${MAGEDEBUG} = on ]] && typeset -f "${functions}"
815    
816     shift
817     done
818     }
819    
820 niro 255 generate_package_md5sum()
821     {
822     local dest
823     local pcat
824     local pname
825     local pver
826     local pbuild
827     local parch
828     local target
829     local pkgname
830    
831     # very basic getops
832     for i in $*
833     do
834     case $1 in
835     --pcat|-c) shift; pcat="$1" ;;
836     --pname|-n) shift; pname="$1" ;;
837     --pver|-v) shift; pver="$1" ;;
838     --pbuild|-b) shift; pbuild="$1" ;;
839     --parch|a) shift; parch="$1" ;;
840     --target|t) shift; target="$1" ;;
841     esac
842     shift
843     done
844    
845     # sanity checks; abort if not given
846     [ -z "${pcat}" ] && die "generate_package_md5sum() \$pcat not given."
847     [ -z "${pname}" ] && die "generate_package_md5sum() \$pname not given."
848     [ -z "${pver}" ] && die "generate_package_md5sum() \$pver not given."
849     [ -z "${pbuild}" ] && die "generate_package_md5sum() \$pbuild not given."
850     [ -z "${parch}" ] && die "generate_package_md5sum() \$parch not given."
851    
852     # check needed global vars
853     [ -z "${PKGDIR}" ] && die "generate_package_md5sum() \$PKGDIR not set."
854     [ -z "${PKGSUFFIX}" ] && die "generate_package_md5sum() \$PKGSUFFIX not set."
855    
856     # fix target as it may be empty !
857     [ -n "${target}" ] && target="-${target}"
858    
859     # build pkgname
860     pkgname="${pname}${target}-${pver}-${parch}-${pbuild}"
861    
862     # build pkg-md5-sum only if requested
863     if [[ ${REGEN_MAGE_TREE} = true ]]
864     then
865 niro 439 echo -ne "${COLBLUE}===${COLGREEN} generating md5's for ${pkgname}.${PKGSUFFIX} ... ${COLDEFAULT}"
866 niro 255
867     # abort if not exist
868     if [ ! -f ${PKGDIR}/${pkgname}.${PKGSUFFIX} ]
869     then
870 niro 439 echo -e "${COLRED}! exists${COLDEFAULT}"
871 niro 255 return 0
872     fi
873    
874     # if MAGE_TREE_DEST not set use BUILDDIR
875     : ${MAGE_TREE_DEST=${BUILDDIR}/mage-tree}
876    
877     # setup md5 dir
878     dest="${MAGE_TREE_DEST}/${pcat}/${pname}/md5"
879     install -d ${dest}
880    
881     # gen md5sum
882     ( cd ${PKGDIR}; md5sum "${pkgname}.${PKGSUFFIX}" ) \
883 niro 256 > ${dest}/${pkgname}.md5
884 niro 439 echo -e "${COLGREEN}done${COLDEFAULT}"
885 niro 255 fi
886     }
887    
888 niro 403 source_pkg_build()
889     {
890     if [[ ${PKGTYPE} = virtual ]]
891     then
892     echo "Virtual package detected; src-pkg-tarball not necessary ..."
893     return 0
894     fi
895    
896     if [[ ! -d ${SOURCEDIR}/${PNAME} ]]
897     then
898     echo "No SRC_URI defined; src-pkg-tarball not necessary ..."
899     return 0
900     fi
901    
902 niro 419 [ -z "${SRCPKGDIR}" ] && die "\$SRCPKGDIR not found. Please setup your ${MAGERC} correctly."
903 niro 406
904 niro 403 echo -e "${COLGREEN}Creating source package tarball ... ${COLDEFAULT}"
905 niro 412
906     # include the smage2 file
907     cp ${SMAGENAME} ${SOURCEDIR}/${PNAME}
908    
909 niro 403 ( cd ${SOURCEDIR}; tar cvjf ${BUILDDIR}/${PNAME}-${PVER}-${PBUILD}.tar.bz2 ${PNAME}; )
910 niro 406 [[ ! -d ${SRCPKGDIR} ]] && install -d ${SRCPKGDIR}
911     mv ${BUILDDIR}/${PNAME}-${PVER}-${PBUILD}.tar.bz2 ${SRCPKGDIR}/${PNAME}-${PVER}-${PBUILD}.${SRCPKGSUFFIX}
912 niro 403
913     echo -e "${COLGREEN}Source package ${COLBLUE}${PNAME}-${PVER}-${PBUILD}.${SRCPKGSUFFIX} ${COLGREEN}successfully builded.${COLDEFAULT}"
914     }
915    
916    
917 niro 59 # print out our version
918     showversion
919     echo
920    
921 niro 24 if [ -z "$1" ]
922     then
923     echo "No .smage2 file given. Exiting."
924     echo
925     exit 1
926     fi
927    
928 niro 192 # updating smage2-scripts
929 niro 306 if [[ $1 = update ]]
930 niro 24 then
931 niro 59 if [ ! -d ${SOURCEDIR} ]
932     then
933     install -d ${SOURCEDIR}
934     fi
935     syncsmage2
936     exit 0
937     fi
938    
939 niro 192 # creates md5sums for smages to given dir
940 niro 306 if [[ $1 = calcmd5 ]]
941 niro 59 then
942     if [ $# -ge 3 ]
943     then
944     SMAGENAME="$2"
945     MD5DIR="$3"
946     source ${SMAGENAME} || die "download source failed"
947    
948 niro 66 # overridable sourcedir; must be declared after source of the smage2
949     CALC_SOURCEDIR="${CALC_SOURCEDIR:="${SOURCEDIR}/${PNAME}"}"
950    
951 niro 59 [ -z "${SRC_URI}" ] && die "Nothing declared to calculate."
952    
953     # end of array
954     EOA=${#SRC_URI[*]}
955    
956     [ ! -d ${MD5DIR} ] && install -d ${MD5DIR}
957    
958     # clear md5sum file
959     MY_MD5_FILE="${MD5DIR}/$(basename ${SMAGENAME} .${SMAGESUFFIX}).md5"
960     echo -n > ${MY_MD5_FILE}
961    
962     for ((i=0; i < EOA; i++))
963     do
964 niro 66 # url to file
965     my_SRC_URI="$(echo ${SRC_URI[${i}]} | cut -d' ' -f1)"
966    
967     # subdir in sources dir; the my_SRCI_URI file goes to there
968     my_SRC_URI_DEST="$(echo ${SRC_URI[${i}]} | cut -d' ' -f2)"
969    
970     # if my_src_uri_dest is not equal my_src_uri; than an other dir is used
971     if [[ ${my_SRC_URI_DEST} != ${my_SRC_URI} ]]
972     then
973     MY_SRC_FILE="${my_SRC_URI_DEST}/$(basename ${SRC_URI[${i}]})"
974     else
975     MY_SRC_FILE="$(basename ${SRC_URI[${i}]})"
976     fi
977    
978 niro 59 if [ -e "${CALC_SOURCEDIR}/${MY_SRC_FILE}" ]
979     then
980     echo "calculating $(basename ${MY_SRC_FILE}) ..."
981     ( cd ${CALC_SOURCEDIR}; md5sum "${MY_SRC_FILE}" ) >> ${MY_MD5_FILE}
982     else
983     echo "WARNING: File '$(basename ${MY_SRC_FILE}) not found in ${CALC_SOURCEDIR}."
984     fi
985 niro 66
986     # unset them to be shure
987     unset my_SRC_URI
988     unset my_SRC_URI_DEST
989     unset my_SRC_URI_MIRROR
990     unset my_SOURCEDIR
991 niro 59 done
992 niro 306
993 niro 59 echo
994     echo "Calculating of md5 sums for '$(basename ${SMAGENAME} .${SMAGESUFFIX})' done."
995     echo
996     else
997     echo "Usage: Calculating MD5 Sums:"
998     echo " $(basename $0) calcmd5 /path/to/SMAGENAME /path/to/MD5DIR"
999     echo
1000     echo
1001     echo "Export the CALC_SOURCEDIR variable to override current SOURCEDIRs."
1002     echo
1003     exit 1
1004     fi
1005 niro 306
1006 niro 59 exit 0
1007     fi
1008    
1009 niro 192 # download sources
1010 niro 59 if [ "$1" == "download" -a -n "$2" ]
1011     then
1012 niro 24 if [ ! -d ${SMAGESCRIPTSDIR} ]
1013     then
1014     install -d ${SMAGESCRIPTSDIR}
1015     fi
1016 niro 59
1017     # get smage
1018     SMAGENAME="$2"
1019     MD5DIR="$(dirname ${SMAGENAME})/md5"
1020     source ${SMAGENAME} || die "download source failed"
1021    
1022     download_sources
1023 niro 24 exit 0
1024     fi
1025    
1026 niro 202 # regen-mage-tree
1027     if [ "$1" == "only-regen-tree" -a -n "$2" ]
1028     then
1029     # set correct SMAGENAME
1030     SMAGENAME="$2"
1031     MD5DIR="$(dirname ${SMAGENAME})/md5"
1032     source ${SMAGENAME} || die "regen: smage2 not found"
1033    
1034     regen_mage_tree
1035 niro 255
1036     # build md5sum for existing packages
1037     generate_package_md5sum \
1038     --pcat "${PCATEGORIE}" \
1039     --pname "${PNAME}" \
1040     --pver "${PVER}" \
1041     --pbuild "${PBUILD}" \
1042     --parch "${ARCH}" \
1043     --target "${target}"
1044    
1045 niro 202 exit 0
1046     fi
1047    
1048 niro 412 if [ "$1" == "--create-src-tarball" -a -n "$2" ]
1049 niro 403 then
1050     # set correct SMAGENAME
1051     SMAGENAME="$2"
1052     MD5DIR="$(dirname ${SMAGENAME})/md5"
1053    
1054 niro 412 echo -e "${COLGREEN}create-src-tarball called for ${COLBLUE}${SMAGENAME}${COLGREEN} ...${COLDEFAULT}"
1055 niro 403
1056     source ${SMAGENAME} || die "regen: smage2 not found"
1057    
1058     if [[ -d ${SOURCEDIR}/${PNAME} ]]
1059     then
1060     echo -e "${COLGREEN}Deleting old sourcefiles ${COLBLUE}${SOURCEDIR}/${PNAME}${COLGREEN} ...${COLDEFAULT}"
1061     rm -rf ${SOURCEDIR}/${PKGNAME}
1062     fi
1063    
1064     download_sources
1065     source_pkg_build ${SMAGENAME}
1066     exit 0
1067     fi
1068    
1069 niro 406 if [ "$1" == "--src-tarball" -a -n "$2" ] || [ "$1" == "-st" -a -n "$2" ]
1070 niro 403 then
1071 niro 412 SRCPKGTARBALL="${2}"
1072 niro 403 USE_SRC_PKG_TARBALL=true
1073    
1074 niro 412 # abort if given file is not a source pkg
1075     [[ ${SRCPKGTARBALL##*.} != ${SRCPKGSUFFIX} ]] && die "${SRCPKGTARBALL} is not a valid src-pkg file."
1076    
1077     # set correct SMAGENAME; use the one that the src_pkg provide
1078     # /path/to/SOURCEDIR/PNAME/SMAGENAME
1079     SMAGENAME="${SOURCEDIR}/$(basename ${SRCPKGTARBALL%-*-*})/$(basename ${SRCPKGTARBALL} .${SRCPKGSUFFIX}).${SMAGESUFFIX}"
1080    
1081 niro 403 echo -e "${COLGREEN}Using src-tarball ${COLBLUE}${SRCPKGTARBALL}${COLGREEN} ...${COLDEFAULT}"
1082    
1083     [[ ! -d ${SOURCEDIR} ]] && install -d ${SOURCEDIR}
1084    
1085     # unpack srctarball
1086     [[ ! -f ${SRCPKGTARBALL} ]] && die "Error: ${SRCPKGTARBALL} does not exist. Aborting."
1087    
1088     tar xvjf ${SRCPKGTARBALL} -C ${SOURCEDIR} || die "Error unpackung src-tarball ${SRCPKGTARBALL}"
1089 niro 412
1090     [[ ! -f ${SMAGENAME} ]] && die "Included smage2 file in src-tarball not found: ${SMAGENAME}"
1091 niro 403 fi
1092    
1093    
1094 niro 306 [ ! -e ${MLIBDIR}/pkgbuild_dir.sh ] && die "Error: ${MLIBDIR}/pkgbuild_dir.sh not found. Aborting."
1095     [ -z "$(basename ${SMAGENAME} | grep .${SMAGESUFFIX})" ] &&
1096     die "File '$(basename ${SMAGENAME})' is not a sMage v${SMAGEVERSION} file. Aborting."
1097 niro 419 [ -z "${SOURCEDIR}" ] && die "\$SOURCEDIR not found. Please setup your ${MAGERC} correctly."
1098     [ -z "${SMAGESCRIPTSDIR}" ] && die "\$SMAGESCRIPTSDIR not found. Please setup your ${MAGERC} correctly."
1099     [ -z "${SMAGE2RSYNC}" ] && die "\$SMAGE2RSYNC not found. Please setup your ${MAGERC} correctly."
1100     [ -z "${BINDIR}" ] && die "no BINDIR variable found in ${MAGERC}"
1101     [ -z "${CHOST}" ] && die "no CHOST variable found in ${MAGERC}"
1102     [ -z "${CFLAGS}" ] && die "no CFLAGS variable found in ${MAGERC}"
1103     [ -z "${CXXFLAGS}" ] && die "no CXXFLAGS variable found in ${MAGERC}"
1104 niro 24
1105     source ${SMAGENAME} || die "source failed"
1106 niro 255 PKGNAME="${PNAME}-${PVER}-${ARCH}-${PBUILD}"
1107 niro 59 MD5DIR="$(dirname ${SMAGENAME})/md5"
1108 niro 24
1109     xtitle "Compiling ${PKGNAME}"
1110 niro 439 echo -e "${COLGREEN}Compiling ${PKGNAME}${COLDEFAULT}"
1111 niro 59
1112 niro 191 # auto regen mage tree if requested
1113     regen_mage_tree
1114    
1115 niro 403 if [[ ${CREATE_SRC_PKG_TARBALL} = true ]]
1116     then
1117     if [[ -d ${SOURCEDIR}/${PNAME} ]]
1118     then
1119 niro 441 echo -e "${COLBLUE}===${COLGREEN} deleting old sourcefiles ${COLBLUE}${SOURCEDIR}/${PNAME}${COLGREEN} ...${COLDEFAULT}"
1120 niro 408 rm -rf ${SOURCEDIR}/${PNAME}
1121 niro 403 fi
1122     fi
1123    
1124 niro 192 # download sources
1125 niro 403 [[ ${USE_SRC_PKG_TARBALL} != true ]] && download_sources
1126 niro 59
1127 niro 192 # fixes some issues with these functions
1128 niro 24 export -f src_prepare || die "src_prepare export failed"
1129     export -f src_compile || die "src_compile export failed"
1130     export -f src_install || die "src_install export failed"
1131    
1132 niro 192 # fixes some compile issues
1133 niro 24 export CHOST="${CHOST}" || die "CHOST export failed"
1134     export CFLAGS="${CFLAGS}" || die "CFLAGS export failed"
1135     export CXXFLAGS="${CFLAGS}" || die "CXXFLAGS export failed"
1136     export BINDIR="${BINDIR}" || die "BINDIR export failed"
1137     export MAKEOPTS="${MAKEOPTS}" || die "MAKEOPTS export failed"
1138    
1139    
1140 niro 192 # setup distcc
1141 niro 351 # setup for distcc goes *before* ccache, so ccache comes before distcc in path
1142 niro 306 [[ ${SMAGE_USE_DISTCC} = true ]] && setup_distcc_environment
1143 niro 24
1144 niro 192 # setup ccache
1145 niro 306 [[ ${SMAGE_USE_CCACHE} = true ]] && setup_ccache_environment
1146 niro 24
1147     # small sleep to show our settings
1148     sleep 1
1149    
1150 niro 192 # cleans up build if a previously one exists
1151 niro 24 if [ -d ${BUILDDIR} ]
1152     then
1153     rm -rf ${BUILDDIR}/* || die "couldn't cleanup \$BUILDDIR."
1154     fi
1155     install -d ${BUILDDIR} || die "couldn't create \$BUILDDIR."
1156    
1157 niro 192 # cleans up srcdir if a previously unpacked one exists
1158 niro 24 if [ -d ${SRCDIR} ]
1159     then
1160     rm -rf ${SRCDIR}
1161     fi
1162    
1163 niro 192 # cleans up bindir if a previous build exists or creates a new one
1164 niro 24 if [ -d ${BINDIR} ]
1165     then
1166     rm -rf ${BINDIR}
1167     fi
1168     install -d ${BINDIR} || die "couldn't create \$BINDIR."
1169    
1170 niro 192 # cleans up package temp dir if a previous build exists
1171 niro 24 if [ -d ${BUILDDIR}/${PKGNAME} ]
1172     then
1173     rm -rf ${BUILDDIR}/${PKGNAME}
1174     fi
1175    
1176 niro 192 # cleans up timestamp if one exists
1177 niro 24 if [ -f /var/tmp/timestamp ]
1178     then
1179     mage rmstamp
1180     fi
1181    
1182     src_prepare || die "src_prepare failed"
1183     src_compile || die "src_compile failed"
1184     src_install || die "src_install failed"
1185    
1186    
1187 niro 192 # compressing doc, info & man files
1188 niro 24 if [ -d ${BUILDDIR}/builded/usr/share/man ]
1189     then
1190 niro 439 echo -e "${COLBLUE}===${COLGREEN} compressing man-pages ...${COLDEFAULT}"
1191 niro 24 ${MLIBDIR}/compressdoc -g -9 ${BUILDDIR}/builded/usr/share/man
1192     fi
1193    
1194     if [ -d ${BUILDDIR}/builded/usr/share/info ]
1195     then
1196 niro 439 echo -e "${COLBLUE}===${COLGREEN} compressing info-pages ...${COLDEFAULT}"
1197 niro 24 ${MLIBDIR}/compressdoc -g -9 ${BUILDDIR}/builded/usr/share/info
1198     fi
1199    
1200 niro 79 # stripping all bins and libs
1201     case ${NOSTRIP} in
1202     true|TRUE|yes|y)
1203     echo -e "NOSTRIP=true detected; Package will not be stripped ..."
1204     ;;
1205     *)
1206 niro 439 echo -e "${COLBLUE}===${COLGREEN} stripping binaries ...${COLDEFAULT}"
1207 niro 79 mstripbins ${BINDIR}
1208 niro 439 echo -e "${COLBLUE}===${COLGREEN} stripping libraries ...${COLDEFAULT}"
1209 niro 79 mstriplibs ${BINDIR}
1210     ;;
1211     esac
1212    
1213 niro 192 # the new buildpkg command
1214 niro 24 case ${NOPKGBUILD} in
1215     true|TRUE|yes|y)
1216     echo -e "NOPGKBUILD=true detected; Package will not be build ..."
1217     ;;
1218 niro 192 *)
1219 niro 306 # build several targets
1220 niro 192 if [ -n "${MAGE_TARGETS}" ]
1221     then
1222     for target in ${MAGE_TARGETS}
1223     do
1224     # check if an special target_pkgbuild exists
1225     if typeset -f ${target}_pkgbuild > /dev/null
1226     then
1227     # run it
1228     ${target}_pkgbuild
1229     fi
1230     # now create the target package
1231     ${MLIBDIR}/pkgbuild_dir.sh \
1232 niro 255 "${PNAME}-${target}-${PVER}-${ARCH}-${PBUILD}" \
1233 niro 192 ${BINDIR} || die "target: ${target} package-build failed"
1234 niro 255
1235     # build pkg-md5-sum if requested
1236     generate_package_md5sum \
1237     --pcat "${PCATEGORIE}" \
1238     --pname "${PNAME}" \
1239     --pver "${PVER}" \
1240     --pbuild "${PBUILD}" \
1241     --parch "${ARCH}" \
1242     --target "${target}"
1243    
1244 niro 439 echo -e "${COLGREEN}\nPackage ${PNAME}-${target}-${PVER}-${ARCH}-${PBUILD} successfully builded.\n${COLDEFAULT}"
1245 niro 192 done
1246     else
1247     ${MLIBDIR}/pkgbuild_dir.sh ${PKGNAME} ${BINDIR} || die "package-build failed"
1248 niro 255
1249     # build pkg-md5-sum if requested
1250     generate_package_md5sum \
1251     --pcat "${PCATEGORIE}" \
1252     --pname "${PNAME}" \
1253     --pver "${PVER}" \
1254     --pbuild "${PBUILD}" \
1255     --parch "${ARCH}"
1256    
1257 niro 439 echo -e "${COLGREEN}\nPackage ${PKGNAME} successfully builded.\n${COLDEFAULT}"
1258 niro 192 fi
1259 niro 403
1260     # build src-pkg-tarball if requested
1261     [[ ${CREATE_SRC_PKG_TARBALL} = true ]] && source_pkg_build ${SMAGENAME}
1262 niro 24 ;;
1263     esac
1264    
1265 niro 192 # for sure
1266 niro 24 unset NOPKGBUILD
1267 niro 85 unset NOSTRIP
1268 niro 351
1269 niro 24 xtitleclean

Properties

Name Value
svn:executable *