7 |
smagesource() |
smagesource() |
8 |
{ |
{ |
9 |
local file="$1" |
local file="$1" |
10 |
local mystate |
local localstate |
11 |
local mycodename |
local distfilestate |
12 |
|
local mytag |
13 |
|
|
14 |
source ${file} |
source ${file} |
15 |
|
|
16 |
[[ -n ${STATE} ]] && mystate="${STATE}" |
# if PCAT was not set and PCATEGORIE was found |
17 |
|
# inform the user and use PCATEGORIE as PCAT |
18 |
|
if [[ -z ${PCAT} ]] |
19 |
|
then |
20 |
|
if [[ -n ${PCATEGORIE} ]] |
21 |
|
then |
22 |
|
PCAT="${PCATEGORIE}" |
23 |
|
unset PCATEGORIE |
24 |
|
# print a warning |
25 |
|
echo -e "${COLYELLOW}Warning: 'PCATEGORIE' is deprecated and gets removed in the future.${COLDEFAULT}" |
26 |
|
echo -e "${COLYELLOW} Please modify this smage2 script to use the 'PCAT' variable.${COLDEFAULT}" |
27 |
|
echo |
28 |
|
else |
29 |
|
die "Neither PCAT nor PCATEGORIE are defined!" |
30 |
|
fi |
31 |
|
fi |
32 |
|
|
33 |
# do not overide if local state was broken or disabled! |
[[ -n ${STATE} ]] && localstate="${STATE}" |
34 |
case ${STATE} in |
[[ -n ${DISTROTAG} ]] && mytag="${DISTROTAG}" |
|
broken) return ;; |
|
|
disabled) return ;; |
|
|
esac |
|
35 |
|
|
36 |
if [ -f ${SMAGESCRIPTSDIR}/distribution ] |
if [ -f ${SMAGESCRIPTSDIR}/distribution ] |
37 |
then |
then |
38 |
source ${SMAGESCRIPTSDIR}/distribution |
source ${SMAGESCRIPTSDIR}/distribution |
39 |
[[ -n ${STATE} ]] && mystate="${STATE}" |
[[ -n ${STATE} ]] && distfilestate="${STATE}" |
40 |
|
[[ -n ${DISTROTAG} ]] && mytag="${DISTROTAG}" |
41 |
|
fi |
42 |
|
# now switch state and export it but do not overide any local states |
43 |
|
if [[ ! -z ${localstate} ]] |
44 |
|
then |
45 |
|
STATE="${localstate}" |
46 |
|
else |
47 |
|
STATE="${distfilestate}" |
48 |
fi |
fi |
|
# now switch state and export it |
|
|
STATE="${mystate}" |
|
|
} |
|
|
|
|
|
showversion() |
|
|
{ |
|
|
echo -en "Magellan Source Install v${SMAGEVERSION} " |
|
|
echo -e "-- Niels Rogalla (niro@magellan-linux.de)" |
|
|
} |
|
|
|
|
|
die() |
|
|
{ |
|
|
xtitleclean |
|
|
echo -e ${COLRED}"Exited ${BASH_SOURCE} at line no ${BASH_LINENO}."${COLDEFAULT} |
|
|
echo "SMAGE failed: $@" |
|
|
exit 1 |
|
|
} |
|
|
|
|
|
die_pipestatus() |
|
|
{ |
|
|
# the status change if we do any parameter declarations!! |
|
|
# dont do this anymore, keep this in mind! |
|
|
# |
|
|
# local pos="$1" |
|
|
# local comment="$2" |
|
|
# |
|
|
# [ ${PIPESTATUS[${pos}]} -ne 0 ] && die "${comment}" |
|
|
# |
|
|
[ ${PIPESTATUS[$1]} -ne 0 ] && die "$2" |
|
|
} |
|
49 |
|
|
50 |
xtitle() |
if mqueryfeature "pkgdistrotag" |
|
{ |
|
|
if [[ ${TERM} = xterm ]] |
|
51 |
then |
then |
52 |
echo -ne "\033]0;[sMage: $@]\007" |
# if DISTROTAG was not defined globally |
53 |
|
# or in distribution file then deactivate this feature! |
54 |
|
# at this point $mytag must have the distrotag |
55 |
|
if [[ -z ${mytag} ]] |
56 |
|
then |
57 |
|
FVERBOSE=off msetfeature "!pkgdistrotag" |
58 |
|
unset DISTROTAG |
59 |
|
echo -e "${COLRED}Requested 'pkgdistrotag' but no \$DISTROTAG found!${COLDEFAULT}" |
60 |
|
echo -e "${COLRED}Disabled the feature for pkgbuild sanity!${COLDEFAULT}" |
61 |
|
else |
62 |
|
# now switch state and export it but do not overide any local states |
63 |
|
export DISTROTAG="${mytag}" |
64 |
|
fi |
65 |
|
else |
66 |
|
unset DISTROTAG |
67 |
fi |
fi |
|
return 0 |
|
68 |
} |
} |
69 |
|
|
70 |
xtitleclean() |
print_distrotag() |
71 |
{ |
{ |
72 |
if [[ ${TERM} = xterm ]] |
if FVERBOSE=off mqueryfeature "pkgdistrotag" |
73 |
then |
then |
74 |
echo -ne "\033]0;\007" |
if [[ ! -z ${DISTROTAG} ]] |
75 |
|
then |
76 |
|
# add a point as prefix |
77 |
|
echo ".${DISTROTAG}" |
78 |
|
fi |
79 |
fi |
fi |
|
return 0 |
|
80 |
} |
} |
81 |
|
|
82 |
syncsmage2() |
syncsmage2() |
180 |
} |
} |
181 |
|
|
182 |
# dummy function, used if that does not exist in smage file |
# dummy function, used if that does not exist in smage file |
183 |
|
pkg_setup() |
184 |
|
{ |
185 |
|
echo "no pkg_setup defined; doing nothing ..." |
186 |
|
return 0 |
187 |
|
} |
188 |
|
|
189 |
|
# dummy function, used if that does not exist in smage file |
190 |
src_prepare() |
src_prepare() |
191 |
{ |
{ |
192 |
echo "no src_prepare defined; doing nothing ..." |
echo "no src_prepare defined; doing nothing ..." |
243 |
fi |
fi |
244 |
fi |
fi |
245 |
|
|
246 |
# always enable shared by default |
# always enable shared by default but not for waf configure |
247 |
if [[ ! -z $(./configure --help | grep -- '--.*able-shared') ]] |
if [[ ! -z $(./configure --help | grep -- '--.*able-shared') ]] && |
248 |
|
[[ -z $(./configure --version | grep waf) ]] |
249 |
then |
then |
250 |
myopts+=" --enable-shared" |
myopts+=" --enable-shared" |
251 |
fi |
fi |
280 |
sysconfdir=${BINDIR}/etc \ |
sysconfdir=${BINDIR}/etc \ |
281 |
libdir=${BINDIR}/usr/$(mlibdir) \ |
libdir=${BINDIR}/usr/$(mlibdir) \ |
282 |
"$@" install || die "minstall failed" |
"$@" install || die "minstall failed" |
283 |
else |
else |
284 |
die "no Makefile found" |
die "no Makefile found" |
285 |
fi |
fi |
286 |
} |
} |
287 |
|
|
288 |
mmake() |
mmake() |
305 |
DEST=$2 |
DEST=$2 |
306 |
fi |
fi |
307 |
|
|
308 |
|
echo -e "${COLBLUE}>>>${COLGREEN} Unpacking ${SOURCEDIR}/${PNAME}/${SRCFILE}${COLDEFAULT}" |
309 |
|
|
310 |
[[ ! -d ${DEST} ]] && install -d ${DEST} |
[[ ! -d ${DEST} ]] && install -d ${DEST} |
311 |
|
|
312 |
case "${SRCFILE##*.}" in |
case "${SRCFILE##*.}" in |
356 |
tar --no-same-owner -xvJf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST} || die ".txz unpack failed." |
tar --no-same-owner -xvJf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST} || die ".txz unpack failed." |
357 |
;; |
;; |
358 |
rar) |
rar) |
359 |
unrar x ${SOURCEDIR}/${PNAME}/${SRCFILE} ${DEST} || die ".rar unpack failed." |
unrar x ${SOURCEDIR}/${PNAME}/${SRCFILE} ${DEST} || die ".rar unpack failed." |
360 |
;; |
;; |
361 |
zip|xpi|jar) |
zip|xpi|jar) |
362 |
unzip ${SOURCEDIR}/${PNAME}/${SRCFILE} -d ${DEST} || die ".zip unpack failed." |
unzip ${SOURCEDIR}/${PNAME}/${SRCFILE} -d ${DEST} || die ".zip unpack failed." |
528 |
then |
then |
529 |
for i in $@ |
for i in $@ |
530 |
do |
do |
531 |
echo "--- Including ${SMAGESCRIPTSDIR}/include/${i}.sminc" |
[[ ${SILENT} = 1 ]] || echo "--- Including ${SMAGESCRIPTSDIR}/include/${i}.sminc" |
532 |
source ${SMAGESCRIPTSDIR}/include/${i}.sminc |
source ${SMAGESCRIPTSDIR}/include/${i}.sminc |
533 |
done |
done |
534 |
echo |
[[ ${SILENT} = 1 ]] || echo |
535 |
|
fi |
536 |
|
} |
537 |
|
|
538 |
|
march() |
539 |
|
{ |
540 |
|
local retval |
541 |
|
|
542 |
|
if [[ ! -z ${ARCH} ]] |
543 |
|
then |
544 |
|
echo "${ARCH}" |
545 |
|
retval=0 |
546 |
|
else |
547 |
|
retval=1 |
548 |
|
fi |
549 |
|
|
550 |
|
return "${retval}" |
551 |
|
} |
552 |
|
|
553 |
|
marchsrcfile() |
554 |
|
{ |
555 |
|
local retval |
556 |
|
local var="$1" |
557 |
|
|
558 |
|
[[ -z ${var} ]] && var="SRCFILE" |
559 |
|
|
560 |
|
if [[ ! -z $(eval echo \$${var}_${ARCH/i*86/x86}) ]] |
561 |
|
then |
562 |
|
eval echo \$${var}_${ARCH/i*86/x86} | tr ';' '\n' |
563 |
|
retval=0 |
564 |
|
else |
565 |
|
retval=1 |
566 |
|
fi |
567 |
|
|
568 |
|
return "${retval}" |
569 |
|
} |
570 |
|
|
571 |
|
marchsrcdir() |
572 |
|
{ |
573 |
|
local retval |
574 |
|
local var="$1" |
575 |
|
|
576 |
|
[[ -z ${var} ]] && var="SRCDIR" |
577 |
|
|
578 |
|
if [[ ! -z $(eval echo \$${var}_${ARCH/i*86/x86}) ]] |
579 |
|
then |
580 |
|
eval echo \$${var}_${ARCH/i*86/x86} | tr ';' '\n' |
581 |
|
retval=0 |
582 |
|
else |
583 |
|
retval=1 |
584 |
|
fi |
585 |
|
|
586 |
|
return "${retval}" |
587 |
|
} |
588 |
|
|
589 |
|
marchdepend() |
590 |
|
{ |
591 |
|
local retval |
592 |
|
local var="$1" |
593 |
|
|
594 |
|
[[ -z ${var} ]] && var="DEPEND" |
595 |
|
|
596 |
|
if [[ ! -z $(eval echo \$${var}_${ARCH/i*86/x86}) ]] |
597 |
|
then |
598 |
|
echo "\$(eval echo \\\$${var}_\${ARCH/i*86/x86} | tr ';' '\n')" |
599 |
|
retval=0 |
600 |
|
else |
601 |
|
retval=1 |
602 |
fi |
fi |
603 |
|
|
604 |
|
return "${retval}" |
605 |
|
} |
606 |
|
|
607 |
|
marchsdepend() |
608 |
|
{ |
609 |
|
local retval |
610 |
|
local var="$1" |
611 |
|
|
612 |
|
[[ -z ${var} ]] && var="SDEPEND" |
613 |
|
|
614 |
|
if [[ ! -z $(eval echo \$${var}_${ARCH/i*86/x86}) ]] |
615 |
|
then |
616 |
|
echo "\$(eval echo \\\$${var}_\${ARCH/i*86/x86} | tr ';' '\n')" |
617 |
|
retval=0 |
618 |
|
else |
619 |
|
retval=1 |
620 |
|
fi |
621 |
|
|
622 |
|
return "${retval}" |
623 |
} |
} |
624 |
|
|
625 |
setup_distcc_environment() |
setup_distcc_environment() |
637 |
fi |
fi |
638 |
} |
} |
639 |
|
|
640 |
setup_ccache_environment() |
setup_icecc_environment() |
641 |
{ |
{ |
642 |
if [ -x /usr/bin/ccache ] |
if [ -x /usr/bin/icecc ] |
643 |
then |
then |
644 |
echo -e "${COLBLUE}---${COLGREEN} Using CCache for compilation ...${COLDEFAULT}" |
echo -e "${COLBLUE}---${COLGREEN} Using IceCC for compilation ...${COLDEFAULT}" |
645 |
export PATH=/usr/$(mlibdir)/ccache/bin:${PATH} || die "ccache: could not export new $PATH" |
export PATH=/usr/$(mlibdir)/icecc/bin:${PATH} || die "icecc: could not export new $PATH" |
646 |
fi |
fi |
647 |
} |
} |
648 |
|
|
649 |
# fixes given dependencies to match a MAGE_TARGET |
setup_ccache_environment() |
650 |
# fix_mage_deps -target s/depend # <-- note -target ! |
{ |
651 |
fix_mage_deps() |
if [ -x /usr/bin/ccache ] |
|
{ |
|
|
local target="$1" |
|
|
local depend="$2" |
|
|
local NDEPEND |
|
|
local sym dep cat pver pname |
|
|
|
|
|
# deps and provides are special |
|
|
# they must be fixed to match the target |
|
|
|
|
|
# run this only if target and depend is not empty |
|
|
if [ -n "${target}" ] && [ -n "${depend}" ] |
|
652 |
then |
then |
653 |
# fix DEPEND |
mqueryfeature "icecc" && export CCACHE_PREFIX=icecc |
|
while read sym dep |
|
|
do |
|
|
# ignore empty lines |
|
|
[[ -z ${dep} ]] && continue |
|
654 |
|
|
655 |
cat="$(dirname ${dep})" |
echo -e "${COLBLUE}---${COLGREEN} Using CCache for compilation ...${COLDEFAULT}" |
656 |
# change if not virtual |
export PATH=/usr/$(mlibdir)/ccache/bin:${PATH} || die "ccache: could not export new $PATH" |
|
if [[ ${cat} = virtual ]] |
|
|
then |
|
|
pname="$(basename ${dep})" |
|
|
else |
|
|
# fix pver to target-pver |
|
|
# to get pname-target-pver |
|
|
|
|
|
# doing it backwards ! |
|
|
pver="${dep##*-}" |
|
|
# full pver |
|
|
pname="$(basename ${dep/-${pver}/})${target}-${pver}" |
|
|
fi |
|
|
|
|
|
# do not add empty lines |
|
|
if [ -z "${NDEPEND}" ] |
|
|
then |
|
|
NDEPEND="${sym} ${cat}/${pname}" |
|
|
else |
|
|
NDEPEND="${NDEPEND} |
|
|
${sym} ${cat}/${pname}" |
|
|
fi |
|
|
|
|
|
unset cat pname pver |
|
|
done << EOF |
|
|
${depend} |
|
|
EOF |
|
|
# set NDEPEND to DEPEND |
|
|
depend="${NDEPEND}" |
|
657 |
fi |
fi |
|
|
|
|
echo "${depend}" |
|
658 |
} |
} |
659 |
|
|
660 |
# build_mage_script(): helper functions for regen_mage_tree() |
# build_mage_script(): helper functions for regen_mage_tree() |
663 |
# PNAME name of pkg |
# PNAME name of pkg |
664 |
# PVER version |
# PVER version |
665 |
# PBUILD revision |
# PBUILD revision |
666 |
# PCATEGORIE category of the pkg |
# PCAT category of the pkg |
667 |
|
# PCATEGORIE category of the pkg (deprecated, use PCAT!) |
668 |
# STATE state of pkg stable|unstable|old |
# STATE state of pkg stable|unstable|old |
669 |
# DESCRIPTION a short description (opt) |
# DESCRIPTION a short description (opt) |
670 |
# HOMEPAGE homepage (opt) |
# HOMEPAGE homepage (opt) |
671 |
|
# LICENSE license information of the pkg (opt) |
672 |
# DEPEND runtime dependencies (opt) |
# DEPEND runtime dependencies (opt) |
673 |
# SDEPEND adds needed deps to build the pkg (opt) |
# SDEPEND adds needed deps to build the pkg (opt) |
674 |
# PROVIDE provides a virtual (opt) |
# PROVIDE provides a virtual (opt) |
690 |
{ |
{ |
691 |
local magefile |
local magefile |
692 |
local dest |
local dest |
|
local target |
|
693 |
local split_pkg_base |
local split_pkg_base |
694 |
local sym |
local sym |
695 |
local depname |
local depname |
697 |
# if MAGE_TREE_DEST not set use BUILDDIR |
# if MAGE_TREE_DEST not set use BUILDDIR |
698 |
: ${MAGE_TREE_DEST=${BUILDDIR}/mage-tree} |
: ${MAGE_TREE_DEST=${BUILDDIR}/mage-tree} |
699 |
|
|
|
# determinate which suffix this mage file should get, if any |
|
|
[[ $1 = --target ]] && shift && target="-$1" |
|
|
|
|
700 |
# mark package as splitpackage |
# mark package as splitpackage |
701 |
[[ $1 = --split-pkg-base ]] && shift && split_pkg_base="$1" |
[[ $1 = --split-pkg-base ]] && shift && split_pkg_base="$1" |
702 |
|
|
703 |
# name of magefile |
# name of magefile |
704 |
magefile="${PNAME}${target}-${PVER}-${PBUILD}.mage" |
magefile="${PNAME}-${PVER}-${PBUILD}.mage" |
705 |
|
|
706 |
# destination to magefile |
# destination to magefile |
707 |
dest="${MAGE_TREE_DEST}/${PCATEGORIE}/${PNAME}${target}/${magefile}" |
dest="${MAGE_TREE_DEST}/${PCAT}/${PNAME}/${magefile}" |
708 |
|
|
709 |
# show what we are doing |
# show what we are doing |
710 |
echo -e "${COLBLUE}===${COLGREEN} generating mage file:${COLDEFAULT}" |
echo -e "${COLBLUE}===${COLGREEN} generating mage file:${COLDEFAULT}" |
715 |
> ${dest} |
> ${dest} |
716 |
|
|
717 |
# pgkname and state |
# pgkname and state |
718 |
echo "PKGNAME=\"${PNAME}${target}-${PVER}-\${ARCH}-${PBUILD}\"" >> ${dest} |
echo "PKGNAME=\"${PNAME}-${PVER}-\${ARCH}$(print_distrotag)-${PBUILD}\"" >> ${dest} |
719 |
echo "STATE=\"${STATE}\"" >> ${dest} |
echo "STATE=\"${STATE}\"" >> ${dest} |
720 |
|
|
721 |
# description and homepage |
# description and homepage |
722 |
echo "DESCRIPTION=\"${DESCRIPTION}\"" >> ${dest} |
echo "DESCRIPTION=\"${DESCRIPTION}\"" >> ${dest} |
723 |
echo "HOMEPAGE=\"${HOMEPAGE}\"" >> ${dest} |
echo "HOMEPAGE=\"${HOMEPAGE}\"" >> ${dest} |
724 |
|
|
725 |
|
# license information |
726 |
|
echo "LICENSE=\"${LICENSE}\"" >> ${dest} |
727 |
|
|
728 |
# special tags and vars |
# special tags and vars |
729 |
echo "PKGTYPE=\"${PKGTYPE}\"" >> ${dest} |
echo "PKGTYPE=\"${PKGTYPE}\"" >> ${dest} |
730 |
|
|
|
# echo MAGE_TARGETS ## note -target is needed ! |
|
|
echo "MAGE_TARGETS=\"${target}\"" >> ${dest} |
|
|
|
|
731 |
# split package base |
# split package base |
732 |
echo "SPLIT_PACKAGE_BASE=\"${split_pkg_base}\"" >> ${dest} |
echo "SPLIT_PACKAGE_BASE=\"${split_pkg_base}\"" >> ${dest} |
733 |
|
|
756 |
fi |
fi |
757 |
|
|
758 |
# deps and provides |
# deps and provides |
759 |
echo "DEPEND=\"$(fix_mage_deps "${target}" "${DEPEND}")\"" >> ${dest} |
echo "DEPEND=\"${DEPEND}\"" >> ${dest} |
760 |
echo "SDEPEND=\"$(fix_mage_deps "${target}" "${SDEPEND}")\"" >> ${dest} |
echo "SDEPEND=\"${SDEPEND}\"" >> ${dest} |
761 |
echo "PROVIDE=\"${PROVIDE}\"" >> ${dest} |
echo "PROVIDE=\"${PROVIDE}\"" >> ${dest} |
762 |
|
|
763 |
# add special functions |
# add special functions |
768 |
do |
do |
769 |
# add to mage (quotes needed !) |
# add to mage (quotes needed !) |
770 |
typeset -f "${i}" >> ${dest} |
typeset -f "${i}" >> ${dest} |
|
# unset to be safe (quotes needed !) |
|
|
#unset "${i}" <-- later to get every target built |
|
771 |
done |
done |
772 |
fi |
fi |
773 |
|
|
785 |
# build them only if requested |
# build them only if requested |
786 |
if mqueryfeature regentree |
if mqueryfeature regentree |
787 |
then |
then |
|
# run it without targets |
|
|
if [[ -n ${MAGE_TARGETS} ]] |
|
|
then |
|
|
# build for each target a mage file |
|
|
# run it with several targets |
|
|
echo |
|
|
for subpackage in ${MAGE_TARGETS} |
|
|
do |
|
|
build_mage_script --target "${subpackage}" |
|
|
done |
|
|
echo |
|
|
|
|
788 |
# run it for splitpackages |
# run it for splitpackages |
789 |
elif [[ -n ${SPLIT_PACKAGES} ]] |
if [[ -n ${SPLIT_PACKAGES} ]] |
790 |
then |
then |
791 |
local split_pkg_base="${PNAME}" |
local split_pkg_base="${PNAME}" |
792 |
# save smage environment |
# save smage environment |
799 |
# get the right variables for the split |
# get the right variables for the split |
800 |
export PNAME="${subpackage}" |
export PNAME="${subpackage}" |
801 |
split_info_${subpackage} |
split_info_${subpackage} |
802 |
|
# fix PCATEGORIE -> PCAT |
803 |
|
if [[ ! -z ${PCATEGORIE} ]] |
804 |
|
then |
805 |
|
PCAT="${PCATEGORIE}" |
806 |
|
unset PCATEGORIE |
807 |
|
fi |
808 |
# get the preinstall etc |
# get the preinstall etc |
809 |
split_export_inherits ${subpackage} |
split_export_inherits ${subpackage} |
810 |
build_mage_script --split-pkg-base "${split_pkg_base}" |
build_mage_script --split-pkg-base "${split_pkg_base}" |
826 |
|
|
827 |
# now unset all uneeded vars to be safe |
# now unset all uneeded vars to be safe |
828 |
# unset PKGNAME <-- don't do that; smage needs this var |
# unset PKGNAME <-- don't do that; smage needs this var |
|
# unset to be safe (quotes needed !) |
|
|
# for i in ${SPECIAL_FUNCTIONS} |
|
|
# do |
|
|
# unset "${i}" |
|
|
# done |
|
829 |
unset SPECIAL_FUNCTIONS |
unset SPECIAL_FUNCTIONS |
|
# for i in ${SPECIAL_VARS} |
|
|
# do |
|
|
# unset "${i}" |
|
|
# done |
|
830 |
unset SPECIAL_VARS |
unset SPECIAL_VARS |
831 |
unset STATE |
unset STATE |
832 |
unset DESCRIPTION |
unset DESCRIPTION |
847 |
export SAVED_PNAME="${PNAME}" |
export SAVED_PNAME="${PNAME}" |
848 |
export SAVED_PVER="${PVER}" |
export SAVED_PVER="${PVER}" |
849 |
export SAVED_PBUILD="${PBUILD}" |
export SAVED_PBUILD="${PBUILD}" |
850 |
export SAVED_PCATEGORIE="${PCATEGORIE}" |
export SAVED_PCAT="${PCAT}" |
851 |
export SAVED_DESCRIPTION="${DESCRIPTION}" |
export SAVED_DESCRIPTION="${DESCRIPTION}" |
852 |
export SAVED_HOMEPAGE="${HOMEPAGE}" |
export SAVED_HOMEPAGE="${HOMEPAGE}" |
853 |
export SAVED_SPECIAL_VARS="${SPECIAL_VARS}" |
export SAVED_SPECIAL_VARS="${SPECIAL_VARS}" |
854 |
|
export SAVED_SPECIAL_FUNCTIONS="${SPECIAL_FUNCTIONS}" |
855 |
export SAVED_STATE="${STATE}" |
export SAVED_STATE="${STATE}" |
|
export SAVED_PKGTYPE="${PKGTYPE}" |
|
856 |
export SAVED_INHERITS="${INHERITS}" |
export SAVED_INHERITS="${INHERITS}" |
857 |
export SAVED_DEPEND="${DEPEND}" |
export SAVED_DEPEND="${DEPEND}" |
858 |
export SAVED_SDEPEND="${SDEPEND}" |
export SAVED_SDEPEND="${SDEPEND}" |
922 |
export PNAME="${SAVED_PNAME}" |
export PNAME="${SAVED_PNAME}" |
923 |
export PVER="${SAVED_PVER}" |
export PVER="${SAVED_PVER}" |
924 |
export PBUILD="${SAVED_PBUILD}" |
export PBUILD="${SAVED_PBUILD}" |
925 |
export PCATEGORIE="${SAVED_PCATEGORIE}" |
export PCAT="${SAVED_PCAT}" |
926 |
export DESCRIPTION="${SAVED_DESCRIPTION}" |
export DESCRIPTION="${SAVED_DESCRIPTION}" |
927 |
export HOMEPAGE="${SAVED_HOMEPAGE}" |
export HOMEPAGE="${SAVED_HOMEPAGE}" |
928 |
export SPECIAL_VARS="${SAVED_SPECIAL_VARS}" |
export SPECIAL_VARS="${SAVED_SPECIAL_VARS}" |
929 |
|
export SPECIAL_FUNCTIONS="${SAVED_SPECIAL_FUNCTIONS}" |
930 |
export STATE="${SAVED_STATE}" |
export STATE="${SAVED_STATE}" |
|
export PKGTYPE="${SAVED_PKGTYPE}" |
|
931 |
export INHERITS="${SAVED_INHERITS}" |
export INHERITS="${SAVED_INHERITS}" |
932 |
export DEPEND="${SAVED_DEPEND}" |
export DEPEND="${SAVED_DEPEND}" |
933 |
export SDEPEND="${SAVED_SDEPEND}" |
export SDEPEND="${SAVED_SDEPEND}" |
991 |
unset SAVED_PNAME |
unset SAVED_PNAME |
992 |
unset SAVED_PVER |
unset SAVED_PVER |
993 |
unset SAVED_PBUILD |
unset SAVED_PBUILD |
994 |
unset SAVED_PCATEGORIE |
unset SAVED_PCAT |
995 |
unset SAVED_DESCRIPTION |
unset SAVED_DESCRIPTION |
996 |
unset SAVED_HOMEPAGE |
unset SAVED_HOMEPAGE |
997 |
unset SAVED_SPECIAL_VARS |
unset SAVED_SPECIAL_VARS |
998 |
|
unset SAVED_SPECIAL_FUNCTIONS |
999 |
unset SAVED_STATE |
unset SAVED_STATE |
1000 |
unset SAVED_PKGTYPE |
unset SAVED_PKGTYPE |
1001 |
unset SAVED_INHERITS |
unset SAVED_INHERITS |
1076 |
local pver |
local pver |
1077 |
local pbuild |
local pbuild |
1078 |
local parch |
local parch |
|
local target |
|
1079 |
local pkgname |
local pkgname |
1080 |
|
|
1081 |
# very basic getops |
# very basic getops |
1087 |
--pver|-v) shift; pver="$1" ;; |
--pver|-v) shift; pver="$1" ;; |
1088 |
--pbuild|-b) shift; pbuild="$1" ;; |
--pbuild|-b) shift; pbuild="$1" ;; |
1089 |
--parch|a) shift; parch="$1" ;; |
--parch|a) shift; parch="$1" ;; |
|
--target|t) shift; target="$1" ;; |
|
1090 |
esac |
esac |
1091 |
shift |
shift |
1092 |
done |
done |
1102 |
[ -z "${PKGDIR}" ] && die "generate_package_md5sum() \$PKGDIR not set." |
[ -z "${PKGDIR}" ] && die "generate_package_md5sum() \$PKGDIR not set." |
1103 |
[ -z "${PKGSUFFIX}" ] && die "generate_package_md5sum() \$PKGSUFFIX not set." |
[ -z "${PKGSUFFIX}" ] && die "generate_package_md5sum() \$PKGSUFFIX not set." |
1104 |
|
|
|
# fix target as it may be empty ! |
|
|
[ -n "${target}" ] && target="-${target}" |
|
|
|
|
1105 |
# build pkgname |
# build pkgname |
1106 |
pkgname="${pname}${target}-${pver}-${parch}-${pbuild}" |
pkgname="${pname}-${pver}-${parch}$(print_distrotag)-${pbuild}" |
1107 |
|
|
1108 |
# build pkg-md5-sum only if requested |
# build pkg-md5-sum only if requested |
1109 |
if mqueryfeature regentree |
if mqueryfeature regentree |
1121 |
: ${MAGE_TREE_DEST=${BUILDDIR}/mage-tree} |
: ${MAGE_TREE_DEST=${BUILDDIR}/mage-tree} |
1122 |
|
|
1123 |
# setup md5 dir |
# setup md5 dir |
1124 |
dest="${MAGE_TREE_DEST}/${pcat}/${pname}${target}/md5" |
dest="${MAGE_TREE_DEST}/${pcat}/${pname}/md5" |
1125 |
install -d ${dest} |
install -d ${dest} |
1126 |
|
|
1127 |
# gen md5sum |
# gen md5sum |
1156 |
[[ ! -d ${SRCPKGDIR} ]] && install -d ${SRCPKGDIR} |
[[ ! -d ${SRCPKGDIR} ]] && install -d ${SRCPKGDIR} |
1157 |
mv ${BUILDDIR}/${PNAME}-${PVER}-${PBUILD}.tar.bz2 ${SRCPKGDIR}/${PNAME}-${PVER}-${PBUILD}.${SRCPKGSUFFIX} |
mv ${BUILDDIR}/${PNAME}-${PVER}-${PBUILD}.tar.bz2 ${SRCPKGDIR}/${PNAME}-${PVER}-${PBUILD}.${SRCPKGSUFFIX} |
1158 |
|
|
1159 |
echo -e "${COLGREEN}Source package ${COLBLUE}${PNAME}-${PVER}-${PBUILD}.${SRCPKGSUFFIX} ${COLGREEN}successfully builded.${COLDEFAULT}" |
echo -e "${COLGREEN}Source package ${COLBLUE}${PNAME}-${PVER}-${PBUILD}.${SRCPKGSUFFIX} ${COLGREEN}successfully builded.${COLDEFAULT}\n" |
1160 |
} |
} |
1161 |
|
|
1162 |
step_by_step() |
step_by_step() |
1188 |
return 1 |
return 1 |
1189 |
fi |
fi |
1190 |
} |
} |
1191 |
|
|
1192 |
|
mqalint() |
1193 |
|
{ |
1194 |
|
return 0 |
1195 |
|
} |