8 |
{ |
{ |
9 |
local file="$1" |
local file="$1" |
10 |
local mystate |
local mystate |
11 |
local mycodename |
local mytag |
12 |
|
|
13 |
source ${file} |
source ${file} |
14 |
|
|
19 |
if [[ -n ${PCATEGORIE} ]] |
if [[ -n ${PCATEGORIE} ]] |
20 |
then |
then |
21 |
PCAT="${PCATEGORIE}" |
PCAT="${PCATEGORIE}" |
22 |
|
unset PCATEGORIE |
23 |
# print a warning |
# print a warning |
24 |
echo -e "${COLYELLOW}Warning: 'PCATEGORIE' is deprecated and gets removed in the future.${COLDEFAULT}" |
echo -e "${COLYELLOW}Warning: 'PCATEGORIE' is deprecated and gets removed in the future.${COLDEFAULT}" |
25 |
echo -e "${COLYELLOW} Please modify this smage2 script to use the 'PCAT' variable.${COLDEFAULT}" |
echo -e "${COLYELLOW} Please modify this smage2 script to use the 'PCAT' variable.${COLDEFAULT}" |
30 |
fi |
fi |
31 |
|
|
32 |
[[ -n ${STATE} ]] && mystate="${STATE}" |
[[ -n ${STATE} ]] && mystate="${STATE}" |
33 |
|
[[ -n ${DISTROTAG} ]] && mytag="${DISTROTAG}" |
34 |
|
|
35 |
# do not overide if local state was broken or disabled! |
# do not overide if local state was broken or disabled! |
36 |
case ${STATE} in |
case ${STATE} in |
42 |
then |
then |
43 |
source ${SMAGESCRIPTSDIR}/distribution |
source ${SMAGESCRIPTSDIR}/distribution |
44 |
[[ -n ${STATE} ]] && mystate="${STATE}" |
[[ -n ${STATE} ]] && mystate="${STATE}" |
45 |
|
[[ -n ${DISTROTAG} ]] && mytag="${DISTROTAG}" |
46 |
fi |
fi |
47 |
# now switch state and export it |
# now switch state and export it |
48 |
STATE="${mystate}" |
STATE="${mystate}" |
49 |
|
|
50 |
|
if mqueryfeature "pkgdistrotag" |
51 |
|
then |
52 |
|
# 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 |
63 |
|
export DISTROTAG="${mytag}" |
64 |
|
fi |
65 |
|
else |
66 |
|
unset DISTROTAG |
67 |
|
fi |
68 |
|
} |
69 |
|
|
70 |
|
print_distrotag() |
71 |
|
{ |
72 |
|
if FVERBOSE=off mqueryfeature "pkgdistrotag" |
73 |
|
then |
74 |
|
if [[ ! -z ${DISTROTAG} ]] |
75 |
|
then |
76 |
|
# add a point as prefix |
77 |
|
echo ".${DISTROTAG}" |
78 |
|
fi |
79 |
|
fi |
80 |
} |
} |
81 |
|
|
82 |
showversion() |
showversion() |
281 |
fi |
fi |
282 |
fi |
fi |
283 |
|
|
284 |
# always enable shared by default |
# always enable shared by default but not for waf configure |
285 |
if [[ ! -z $(./configure --help | grep -- '--.*able-shared') ]] |
if [[ ! -z $(./configure --help | grep -- '--.*able-shared') ]] && |
286 |
|
[[ -z $(./configure --version | grep waf) ]] |
287 |
then |
then |
288 |
myopts+=" --enable-shared" |
myopts+=" --enable-shared" |
289 |
fi |
fi |
713 |
> ${dest} |
> ${dest} |
714 |
|
|
715 |
# pgkname and state |
# pgkname and state |
716 |
echo "PKGNAME=\"${PNAME}${target}-${PVER}-\${ARCH}-${PBUILD}\"" >> ${dest} |
echo "PKGNAME=\"${PNAME}${target}-${PVER}-\${ARCH}$(print_distrotag)-${PBUILD}\"" >> ${dest} |
717 |
echo "STATE=\"${STATE}\"" >> ${dest} |
echo "STATE=\"${STATE}\"" >> ${dest} |
718 |
|
|
719 |
# description and homepage |
# description and homepage |
814 |
# get the right variables for the split |
# get the right variables for the split |
815 |
export PNAME="${subpackage}" |
export PNAME="${subpackage}" |
816 |
split_info_${subpackage} |
split_info_${subpackage} |
817 |
|
# fix PCATEGORIE -> PCAT |
818 |
|
if [[ ! -z ${PCATEGORIE} ]] |
819 |
|
then |
820 |
|
PCAT="${PCATEGORIE}" |
821 |
|
unset PCATEGORIE |
822 |
|
fi |
823 |
# get the preinstall etc |
# get the preinstall etc |
824 |
split_export_inherits ${subpackage} |
split_export_inherits ${subpackage} |
825 |
build_mage_script --split-pkg-base "${split_pkg_base}" |
build_mage_script --split-pkg-base "${split_pkg_base}" |
1131 |
[ -n "${target}" ] && target="-${target}" |
[ -n "${target}" ] && target="-${target}" |
1132 |
|
|
1133 |
# build pkgname |
# build pkgname |
1134 |
pkgname="${pname}${target}-${pver}-${parch}-${pbuild}" |
pkgname="${pname}${target}-${pver}-${parch}$(print_distrotag)-${pbuild}" |
1135 |
|
|
1136 |
# build pkg-md5-sum only if requested |
# build pkg-md5-sum only if requested |
1137 |
if mqueryfeature regentree |
if mqueryfeature regentree |
1184 |
[[ ! -d ${SRCPKGDIR} ]] && install -d ${SRCPKGDIR} |
[[ ! -d ${SRCPKGDIR} ]] && install -d ${SRCPKGDIR} |
1185 |
mv ${BUILDDIR}/${PNAME}-${PVER}-${PBUILD}.tar.bz2 ${SRCPKGDIR}/${PNAME}-${PVER}-${PBUILD}.${SRCPKGSUFFIX} |
mv ${BUILDDIR}/${PNAME}-${PVER}-${PBUILD}.tar.bz2 ${SRCPKGDIR}/${PNAME}-${PVER}-${PBUILD}.${SRCPKGSUFFIX} |
1186 |
|
|
1187 |
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" |
1188 |
} |
} |
1189 |
|
|
1190 |
step_by_step() |
step_by_step() |