File duilder changed (mode: 100755) (index c93b35d..083fd22) |
... |
... |
function duilder_docs() |
26 |
26 |
mkdir -p "${EXPORT_PATH}" |
mkdir -p "${EXPORT_PATH}" |
27 |
27 |
fi |
fi |
28 |
28 |
|
|
|
29 |
|
if [ "${BUILD_SDEB}" = "1" ]; then |
|
30 |
|
if [ -d "debian" ]; then |
|
31 |
|
>debian/docs |
|
32 |
|
fi |
|
33 |
|
fi |
|
34 |
|
|
29 |
35 |
echo "[*] Copying docs to [${EXPORT_PATH}]..." |
echo "[*] Copying docs to [${EXPORT_PATH}]..." |
30 |
36 |
for f in README License LICENSE Changelog Changelog-last TODO FAQ INSTALL AUTHORS; do |
for f in README License LICENSE Changelog Changelog-last TODO FAQ INSTALL AUTHORS; do |
31 |
37 |
if [ -r "${f}" ]; then |
if [ -r "${f}" ]; then |
32 |
38 |
cp -vp "${f}" "${EXPORT_PATH}/" |
cp -vp "${f}" "${EXPORT_PATH}/" |
|
39 |
|
if [ "${BUILD_SDEB}" = "1" ]; then |
|
40 |
|
# No need to install the license file |
|
41 |
|
if [ "${f}" = "LICENSE" ]; then |
|
42 |
|
continue |
|
43 |
|
fi |
|
44 |
|
echo "${f}" >> debian/docs |
|
45 |
|
fi |
33 |
46 |
fi |
fi |
34 |
47 |
done |
done |
35 |
48 |
echo |
echo |
|
... |
... |
function duilder_git() |
103 |
116 |
|
|
104 |
117 |
# get the list of tags |
# get the list of tags |
105 |
118 |
number_of_tags=0 |
number_of_tags=0 |
|
119 |
|
git show-ref --tags -d | grep refs/tags/v > duilder.tmp |
106 |
120 |
while read sha1 full_tag; do |
while read sha1 full_tag; do |
107 |
121 |
tag=`echo ${full_tag} | sed -e 's#refs/tags/##' | cut -d'^' -f1` |
tag=`echo ${full_tag} | sed -e 's#refs/tags/##' | cut -d'^' -f1` |
108 |
122 |
tags[${number_of_tags}]=${tag} |
tags[${number_of_tags}]=${tag} |
109 |
123 |
tags_commit[${number_of_tags}]=${sha1} |
tags_commit[${number_of_tags}]=${sha1} |
110 |
124 |
number_of_tags=$[${number_of_tags}+1] |
number_of_tags=$[${number_of_tags}+1] |
111 |
|
done < <(git show-ref --tags -d | grep refs/tags/v) |
|
|
125 |
|
done < duilder.tmp |
|
126 |
|
rm -f duilder.tmp |
112 |
127 |
|
|
113 |
128 |
# get the list of commits, test if is a tag and do the diff |
# get the list of commits, test if is a tag and do the diff |
114 |
129 |
prev="" |
prev="" |
|
... |
... |
function duilder_srpm() |
192 |
207 |
if [ ! -z "${SRPM_DEST}" ]; then |
if [ ! -z "${SRPM_DEST}" ]; then |
193 |
208 |
echo "[*] Copying [${PKG}] to [${SRPM_DEST}]..." |
echo "[*] Copying [${PKG}] to [${SRPM_DEST}]..." |
194 |
209 |
cp -vp "${PKG}" "${SRPM_DEST}/" |
cp -vp "${PKG}" "${SRPM_DEST}/" |
195 |
|
echo |
|
196 |
210 |
fi |
fi |
197 |
211 |
|
|
198 |
212 |
echo "[*] Copying to export dir [${EXPORT_PATH}]..." |
echo "[*] Copying to export dir [${EXPORT_PATH}]..." |
|
... |
... |
function duilder_sdeb() |
210 |
224 |
{ |
{ |
211 |
225 |
PRJ="${1}" |
PRJ="${1}" |
212 |
226 |
VER="${2}" |
VER="${2}" |
213 |
|
SDEB_EXPORT_PATH="${3}" |
|
|
227 |
|
EXPORT_PATH="${3}" |
214 |
228 |
BUILD_SDEB="${4}" |
BUILD_SDEB="${4}" |
215 |
229 |
SDEB_DEST="${5}" |
SDEB_DEST="${5}" |
216 |
230 |
SDEB_POST_RUN="${6}" |
SDEB_POST_RUN="${6}" |
|
... |
... |
function duilder_sdeb() |
221 |
235 |
exit 0 |
exit 0 |
222 |
236 |
fi |
fi |
223 |
237 |
|
|
224 |
|
if [ ! -d "${SDEB_EXPORT_PATH}" ]; then |
|
225 |
|
echo "WARN: ${SDEB_EXPORT_PATH} does not exists. Creating it..." |
|
226 |
|
mkdir -p "${SDEB_EXPORT_PATH}" |
|
|
238 |
|
if [ ! -d "${EXPORT_PATH}" ]; then |
|
239 |
|
echo "WARN: ${EXPORT_PATH} does not exists. Creating it..." |
|
240 |
|
mkdir -p "${EXPORT_PATH}" |
227 |
241 |
fi |
fi |
228 |
242 |
|
|
229 |
|
echo "[*] Building SDEB..." |
|
230 |
|
tmp=`mktemp -d duilder-XXXXXXXXXXXXXXX` |
|
231 |
|
ln ${P}.tar.gz "${tmp}/${PRJ}_${VER}.orig.tar.gz" |
|
232 |
|
mkdir "${tmp}/debian" |
|
233 |
|
touch "${tmp}/debian/changelog" |
|
234 |
|
# control |
|
235 |
|
echo "Source: ${PRJ}" > "${tmp}/debian/control" |
|
236 |
|
echo "Maintainer: ???" >> "${tmp}/debian/control" |
|
237 |
|
echo "Section: misc" >> "${tmp}/debian/control" |
|
238 |
|
echo "Priority: optional" >> "${tmp}/debian/control" |
|
|
243 |
|
echo "[*] Copying SDEB..." |
|
244 |
|
PKG="${PRJ}_${VER}.orig.tar.gz" |
239 |
245 |
|
|
240 |
|
PKG="${RPMBUILD}/SRPMS/${P}-${REV}.src.rpm" |
|
241 |
|
|
|
242 |
|
if [ ! -z "${SDEB_DEST}" ]; then |
|
243 |
|
echo "[*] Copying [${PKG}] to [${SDEB_DEST}]..." |
|
244 |
|
cp -vp "${PKG}" "${SDEB_DEST}/" |
|
245 |
|
echo |
|
|
246 |
|
if [ -n "${SDEB_DEST}" ]; then |
|
247 |
|
cp -vp "${P}.tar.gz" "${SDEB_DEST}/${PKG}" |
246 |
248 |
fi |
fi |
247 |
249 |
|
|
248 |
250 |
echo "[*] Copying to export dir [${DEB_EXPORT_PATH}]..." |
echo "[*] Copying to export dir [${DEB_EXPORT_PATH}]..." |
249 |
|
mkdir -p "${SDEB_EXPORT_PATH}" |
|
250 |
|
cp -vp "${PKG}" "${SDEB_EXPORT_PATH}/" |
|
|
251 |
|
mkdir -p "${EXPORT_PATH}" |
|
252 |
|
cp -vp "${P}.tar.gz" "${EXPORT_PATH}/${PKG}" |
251 |
253 |
echo |
echo |
252 |
254 |
|
|
253 |
255 |
if [ -x "${SDEB_POST_RUN}" ]; then |
if [ -x "${SDEB_POST_RUN}" ]; then |
254 |
256 |
echo "[*] Running post SDEB build script [${SDEB_POST_RUN}]..." |
echo "[*] Running post SDEB build script [${SDEB_POST_RUN}]..." |
255 |
|
${SDEB_POST_RUN} "${PKG}" |
|
|
257 |
|
${SDEB_POST_RUN} "${SDEB}/${PKG}" |
256 |
258 |
fi |
fi |
257 |
259 |
} |
} |
258 |
260 |
|
|
|
... |
... |
if [ -z "${REV}" ]; then |
332 |
334 |
fi |
fi |
333 |
335 |
|
|
334 |
336 |
# export variables - just in case a script cares |
# export variables - just in case a script cares |
335 |
|
export PRJ VER REV SHORT_DESCRIPTION EXPORT_PATH EXPORT_GIT GIT_PUSH GIT_DEST SRPM_DEST LICENSE |
|
|
337 |
|
export PRJ VER REV SHORT_DESCRIPTION EXPORT_PATH EXPORT_GIT GIT_PUSH GIT_DEST |
|
338 |
|
export SRPM_DEST SDEB_DEST LICENSE MAINTAINER_NAME MAINTAINER_EMAIL |
|
339 |
|
export HOME_PAGE BUILD_SRPM BUILD_SDEB |
336 |
340 |
|
|
337 |
341 |
|
|
338 |
342 |
# Multiplexer |
# Multiplexer |
|
... |
... |
if [ "${1}" = "srpm" ]; then |
360 |
364 |
exit $? |
exit $? |
361 |
365 |
fi |
fi |
362 |
366 |
|
|
|
367 |
|
if [ "${1}" = "sdeb" ]; then |
|
368 |
|
shift |
|
369 |
|
duilder_sdeb "$@" |
|
370 |
|
exit $? |
|
371 |
|
fi |
|
372 |
|
|
363 |
373 |
if [ "${1}" = "final" ]; then |
if [ "${1}" = "final" ]; then |
364 |
374 |
shift |
shift |
365 |
375 |
duilder_final "$@" |
duilder_final "$@" |
|
... |
... |
echo "[*] Duilder builder script" |
372 |
382 |
echo "[*] Copyright Catalin(ux) M. BOIE - catab at embedromix dot ro" |
echo "[*] Copyright Catalin(ux) M. BOIE - catab at embedromix dot ro" |
373 |
383 |
echo "[*] PRJ=${PRJ}, VER=${VER}, REV=${REV}" |
echo "[*] PRJ=${PRJ}, VER=${VER}, REV=${REV}" |
374 |
384 |
echo "[*] System: `uname -a`" |
echo "[*] System: `uname -a`" |
|
385 |
|
echo "[*] Parameters: ${@}" |
375 |
386 |
|
|
376 |
387 |
ETC="/etc" |
ETC="/etc" |
377 |
388 |
BIN="/bin" |
BIN="/bin" |
|
... |
... |
else |
384 |
395 |
USR_LIB="/usr/lib64" |
USR_LIB="/usr/lib64" |
385 |
396 |
fi |
fi |
386 |
397 |
USR_SHARE="/usr/share" |
USR_SHARE="/usr/share" |
387 |
|
USR_SHARE_DOC="/usr/share/doc/${PRJ}-${VER}" |
|
|
398 |
|
USR_SHARE_DOC="/usr/share/doc/${PRJ}" |
388 |
399 |
SBIN="/usr/sbin" |
SBIN="/usr/sbin" |
389 |
400 |
VAR="/var" |
VAR="/var" |
390 |
401 |
VAR_LIB="/var/lib" |
VAR_LIB="/var/lib" |
391 |
402 |
MAN="/usr/share/man" |
MAN="/usr/share/man" |
|
403 |
|
PREFIX="/usr" |
392 |
404 |
|
|
393 |
405 |
while [ "${1}" != "" ]; do |
while [ "${1}" != "" ]; do |
394 |
406 |
xVAR="`echo ${1} | cut -d'=' -f1`" |
xVAR="`echo ${1} | cut -d'=' -f1`" |
395 |
|
xVAL="`echo ${1} | cut -d'=' -f2`" |
|
|
407 |
|
xVAL="`echo ${1} | cut -d'=' -f2 | sed -e "s|\\${prefix}|${PREFIX}|"`" |
|
408 |
|
shift |
396 |
409 |
case ${xVAR} in |
case ${xVAR} in |
397 |
410 |
--sysconfdir) |
--sysconfdir) |
398 |
411 |
ETC="${xVAL}" |
ETC="${xVAL}" |
|
... |
... |
while [ "${1}" != "" ]; do |
421 |
434 |
--mandir) |
--mandir) |
422 |
435 |
MAN="${xVAL}" |
MAN="${xVAL}" |
423 |
436 |
;; |
;; |
|
437 |
|
--prefix) |
|
438 |
|
PREFIX="${xVAL}" |
|
439 |
|
;; |
424 |
440 |
esac |
esac |
425 |
|
shift |
|
426 |
441 |
done |
done |
427 |
442 |
|
|
428 |
443 |
# Last fixes |
# Last fixes |
|
... |
... |
echo "s#@MAN@#${MAN}#g" >> tmp.sed |
566 |
581 |
echo "s#@EXPORT_PATH@#${EXPORT_PATH}#g" >> tmp.sed |
echo "s#@EXPORT_PATH@#${EXPORT_PATH}#g" >> tmp.sed |
567 |
582 |
# cc_switches |
# cc_switches |
568 |
583 |
echo "s#@CC_SWITCHES@#${_CC_SWITCHES}#g" >> tmp.sed |
echo "s#@CC_SWITCHES@#${_CC_SWITCHES}#g" >> tmp.sed |
|
584 |
|
echo "s#@MAINTAINER_NAME@#${MAINTAINER_NAME}#g" >> tmp.sed |
|
585 |
|
echo "s#@MAINTAINER_EMAIL@#${MAINTAINER_EMAIL}#g" >> tmp.sed |
|
586 |
|
echo "s#@SHORT_DESCRIPTION@#${SHORT_DESCRIPTION}#g" >> tmp.sed |
|
587 |
|
echo "s#@HOME_PAGE@#${HOME_PAGE}#g" >> tmp.sed |
569 |
588 |
|
|
570 |
589 |
|
|
571 |
590 |
|
|
|
... |
... |
if [ -r Makefile.in ]; then |
623 |
642 |
echo " @./duilder git \"\$(PRJ)\" \"${GIT_DEST}\" \"${EXPORT_GIT}\" \"${GIT_CHANGELOG}\"" \"${GIT_PUSH}\" >> Makefile |
echo " @./duilder git \"\$(PRJ)\" \"${GIT_DEST}\" \"${EXPORT_GIT}\" \"${GIT_CHANGELOG}\"" \"${GIT_PUSH}\" >> Makefile |
624 |
643 |
echo " @./duilder tar \"\$(PRJ)\" \"\$(VER)\" \"${EXPORT_PATH}\" \"${EXCLUDE}\"" >> Makefile |
echo " @./duilder tar \"\$(PRJ)\" \"\$(VER)\" \"${EXPORT_PATH}\" \"${EXCLUDE}\"" >> Makefile |
625 |
644 |
echo " @./duilder srpm \"\$(PRJ)\" \"\$(VER)\" \"${EXPORT_PATH}\" \"${BUILD_SRPM}\" \"${SRPM_DEST}\" \"${SRPM_POST_RUN}\"" >> Makefile |
echo " @./duilder srpm \"\$(PRJ)\" \"\$(VER)\" \"${EXPORT_PATH}\" \"${BUILD_SRPM}\" \"${SRPM_DEST}\" \"${SRPM_POST_RUN}\"" >> Makefile |
|
645 |
|
echo " @./duilder sdeb \"\$(PRJ)\" \"\$(VER)\" \"${EXPORT_PATH}\" \"${BUILD_SDEB}\" \"${SDEB_DEST}\" \"${SDEB_POST_RUN}\"" >> Makefile |
626 |
646 |
echo " @./duilder docs \"\$(PRJ)\" \"\$(VER)\" \"${EXPORT_PATH}\"" >> Makefile |
echo " @./duilder docs \"\$(PRJ)\" \"\$(VER)\" \"${EXPORT_PATH}\"" >> Makefile |
627 |
647 |
echo " @./duilder final \"\$(PRJ)\" \"\$(VER)\" \"${RELEASE_SCRIPT}\"" >> Makefile |
echo " @./duilder final \"\$(PRJ)\" \"\$(VER)\" \"${RELEASE_SCRIPT}\"" >> Makefile |
628 |
648 |
echo " @rm -f \"\$(PRJ)-\$(VER).tar.gz\"" >> Makefile |
echo " @rm -f \"\$(PRJ)-\$(VER).tar.gz\"" >> Makefile |
|
... |
... |
if [ ! -z "${CONFIG_H}" ]; then |
639 |
659 |
sed -f tmp.sed ${CONFIG_H}.in > ${CONFIG_H} |
sed -f tmp.sed ${CONFIG_H}.in > ${CONFIG_H} |
640 |
660 |
fi |
fi |
641 |
661 |
|
|
|
662 |
|
if [ "${BUILD_SDEB}" = "1" ]; then |
|
663 |
|
AUTOGENERATE="${AUTOGENERATE} debian/control.in debian/changelog.in" |
|
664 |
|
AUTOGENERATE="${AUTOGENERATE} debian/copyright.in debian/rules.in" |
|
665 |
|
fi |
|
666 |
|
|
|
667 |
|
echo "[*] Autogenerate files from .in..." |
|
668 |
|
for f in ${AUTOGENERATE}; do |
|
669 |
|
if [ -r "${f}" ]; then |
|
670 |
|
dst="${f//.in/}" |
|
671 |
|
echo " [*] Autogenerate ${dst} from ${f}..." |
|
672 |
|
sed -f tmp.sed "${f}" > "${dst}" |
|
673 |
|
chmod --reference="${f}" "${dst}" |
|
674 |
|
fi |
|
675 |
|
done |
|
676 |
|
|
642 |
677 |
rm -f tmp.sed |
rm -f tmp.sed |
643 |
678 |
|
|
644 |
679 |
if [ "`basename ${0}`" = "duilderx" ]; then |
if [ "`basename ${0}`" = "duilderx" ]; then |
File duilder.conf changed (mode: 100644) (index 741ea33..31a6abe) |
... |
... |
GIT_CHANGELOG="1" |
9 |
9 |
BUILD_SRPM="1" |
BUILD_SRPM="1" |
10 |
10 |
SRPM_DEST="../dinorepo/fedora/SRPMS" |
SRPM_DEST="../dinorepo/fedora/SRPMS" |
11 |
11 |
BUILD_TGZ="1" |
BUILD_TGZ="1" |
12 |
|
BUILD_DEB="1" |
|
|
12 |
|
BUILD_SDEB="1" |
|
13 |
|
SDEB_DEST="../dinorepo/debian/SDEB" |
13 |
14 |
RELEASE_SCRIPT="/usr/local/bin/duilder_release" |
RELEASE_SCRIPT="/usr/local/bin/duilder_release" |
14 |
15 |
CC_SWITCHES="-fstack-reuse=all -flto -Wtrampolines -Wl,-z,noexecstack" |
CC_SWITCHES="-fstack-reuse=all -flto -Wtrampolines -Wl,-z,noexecstack" |
15 |
16 |
CC_SWITCHES="${CC_SWITCHES} -Wl,-z,now -Wl,-z,relro -Wl,-O1 -Wl,-z,noexecstack" |
CC_SWITCHES="${CC_SWITCHES} -Wl,-z,now -Wl,-z,relro -Wl,-O1 -Wl,-z,noexecstack" |
|
... |
... |
CC_SWITCHES="${CC_SWITCHES} -Wconversion -Wcast-align -Wformat=2" |
18 |
19 |
CC_SWITCHES="${CC_SWITCHES} -Wformat-security -fno-common" |
CC_SWITCHES="${CC_SWITCHES} -Wformat-security -fno-common" |
19 |
20 |
CC_SWITCHES="${CC_SWITCHES} -Wmissing-prototypes -Wmissing-declarations" |
CC_SWITCHES="${CC_SWITCHES} -Wmissing-prototypes -Wmissing-declarations" |
20 |
21 |
CC_SWITCHES="${CC_SWITCHES} -Wstrict-overflow -Wstrict-prototypes" |
CC_SWITCHES="${CC_SWITCHES} -Wstrict-overflow -Wstrict-prototypes" |
|
22 |
|
|
|
23 |
|
HOME_PAGE="https://rocketgit.com/user/catalinux/dupdump" |
|
24 |
|
AUTOGENERATE="" |
|
25 |
|
MAINTAINER_NAME="Catalin(ux) M. BOIE" |
|
26 |
|
MAINTAINER_EMAIL="catab@embedromix.ro" |