File duilder changed (mode: 100755) (index 8acd6af..7afe003) |
... |
... |
function duilder_git() |
50 |
50 |
|
|
51 |
51 |
echo "Generate GIT tree for HTTP transport..." |
echo "Generate GIT tree for HTTP transport..." |
52 |
52 |
if [ ! -d "${GIT_DEST}/${PRJ}.git" ]; then |
if [ ! -d "${GIT_DEST}/${PRJ}.git" ]; then |
53 |
|
git-clone --bare . "${GIT_DEST}/${PRJ}.git" |
|
|
53 |
|
git clone --bare . "${GIT_DEST}/${PRJ}.git" |
54 |
54 |
|
|
55 |
55 |
# Activate post-update hook |
# Activate post-update hook |
|
56 |
|
cp "${GIT_DEST}/${PRJ}.git/hooks/post-update.sample" \ |
|
57 |
|
"${GIT_DEST}/${PRJ}.git/hooks/post-update" |
56 |
58 |
chmod a+x "${GIT_DEST}/${PRJ}.git/hooks/post-update" |
chmod a+x "${GIT_DEST}/${PRJ}.git/hooks/post-update" |
57 |
59 |
|
|
58 |
60 |
# add project name and description |
# add project name and description |
|
... |
... |
function duilder_git() |
62 |
64 |
#touch "${GIT_DEST}/${PRJ}.git/git-daemon-export-ok |
#touch "${GIT_DEST}/${PRJ}.git/git-daemon-export-ok |
63 |
65 |
else |
else |
64 |
66 |
# --force? |
# --force? |
65 |
|
git-push -v --all "${GIT_DEST}/${PRJ}.git" |
|
66 |
|
git-push -v --tags "${GIT_DEST}/${PRJ}.git" |
|
|
67 |
|
git push -v --all "${GIT_DEST}/${PRJ}.git" |
|
68 |
|
git push -v --tags "${GIT_DEST}/${PRJ}.git" |
67 |
69 |
fi |
fi |
68 |
|
(cd "${GIT_DEST}/${PRJ}.git" && git-update-server-info) |
|
|
70 |
|
(cd "${GIT_DEST}/${PRJ}.git" && git update-server-info) |
69 |
71 |
|
|
70 |
72 |
|
|
71 |
73 |
if [ "${GIT_CHANGELOG}" = "1" ]; then |
if [ "${GIT_CHANGELOG}" = "1" ]; then |
|
... |
... |
function duilder_git() |
75 |
77 |
# get the list of tags |
# get the list of tags |
76 |
78 |
i=0 |
i=0 |
77 |
79 |
number_of_tags=0 |
number_of_tags=0 |
78 |
|
for tag in `git-tag -l`; do |
|
|
80 |
|
for tag in `git tag -l`; do |
79 |
81 |
if [ "${tag:0:1}" != "v" ]; then |
if [ "${tag:0:1}" != "v" ]; then |
80 |
82 |
# skip other kind of tags beside versions |
# skip other kind of tags beside versions |
81 |
83 |
continue |
continue |
82 |
84 |
fi |
fi |
83 |
85 |
|
|
84 |
86 |
tags[${i}]=${tag} |
tags[${i}]=${tag} |
85 |
|
tags_commit[${i}]=`git-show-ref ${tag} | cut -d' ' -f1` |
|
|
87 |
|
tags_commit[${i}]=`git show-ref ${tag} | cut -d' ' -f1` |
86 |
88 |
number_of_tags=$[${number_of_tags}+1] |
number_of_tags=$[${number_of_tags}+1] |
87 |
89 |
|
|
88 |
90 |
i=$[${i}+1] |
i=$[${i}+1] |
|
... |
... |
function duilder_git() |
90 |
92 |
|
|
91 |
93 |
# 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 |
92 |
94 |
prev="" |
prev="" |
93 |
|
git-log --pretty=oneline | cut -f1 | \ |
|
|
95 |
|
git log --pretty=oneline | cut -f1 | \ |
94 |
96 |
while read commit junk; do |
while read commit junk; do |
95 |
97 |
# test if it is a tag |
# test if it is a tag |
96 |
98 |
tag="" |
tag="" |
|
... |
... |
function duilder_git() |
112 |
114 |
echo "[*] Generating Changelog from ${tag} -> ${prev}..." |
echo "[*] Generating Changelog from ${tag} -> ${prev}..." |
113 |
115 |
echo "[${tag} -> ${prev}]" >> Changelog |
echo "[${tag} -> ${prev}]" >> Changelog |
114 |
116 |
echo >> Changelog |
echo >> Changelog |
115 |
|
git-shortlog ${tag}..${prev} | \ |
|
|
117 |
|
git shortlog ${tag}..${prev} | \ |
116 |
118 |
(IFS="" |
(IFS="" |
117 |
119 |
while read line; do |
while read line; do |
118 |
120 |
echo " ${line}" |
echo " ${line}" |
|
... |
... |
function duilder_srpm() |
143 |
145 |
echo "Building SRPM..." |
echo "Building SRPM..." |
144 |
146 |
rpmbuild -ts "${P}.tar.gz" |
rpmbuild -ts "${P}.tar.gz" |
145 |
147 |
|
|
146 |
|
if [ -d ~/rpmbuild ]; then |
|
147 |
|
PKG="${HOME}/rpmbuild/SRPMS/${P}-1.src.rpm" |
|
148 |
|
else |
|
149 |
|
PKG="/usr/src/redhat/SRPMS/${P}-1.src.rpm" |
|
150 |
|
fi |
|
|
148 |
|
PKG="${RPMBUILD}/SRPMS/${P}-1.src.rpm" |
151 |
149 |
|
|
152 |
150 |
if [ ! -z "${SRPM_DEST}" ]; then |
if [ ! -z "${SRPM_DEST}" ]; then |
153 |
151 |
echo "Copying [${PKG}] to [${SRPM_DEST}]..." |
echo "Copying [${PKG}] to [${SRPM_DEST}]..." |
|
... |
... |
function duilder_tar() |
176 |
174 |
echo "Generating tarball [${P}.tar.gz]..." |
echo "Generating tarball [${P}.tar.gz]..." |
177 |
175 |
ADD_EXCLUDE="" |
ADD_EXCLUDE="" |
178 |
176 |
if [ ! -z "${EXCLUDE}" ]; then |
if [ ! -z "${EXCLUDE}" ]; then |
179 |
|
ADD_EXCLUDE="--exclude-from ${EXCLUDE}" |
|
|
177 |
|
ADD_EXCLUDE="--exclude-from \"${P}/${EXCLUDE}\"" |
180 |
178 |
fi |
fi |
181 |
179 |
|
|
182 |
|
(cd .. && rm -f "${P}" && ln -s "${PRJ}" "${P}") |
|
183 |
|
tar czhf "${P}.tar.gz" \ |
|
|
180 |
|
(cd .. \ |
|
181 |
|
&& rm -rf "${P}" \ |
|
182 |
|
&& cp -a --link "${PRJ}" "${P}" \ |
|
183 |
|
&& tar czf "${PRJ}/${P}.tar.gz" \ |
184 |
184 |
--exclude-vcs \ |
--exclude-vcs \ |
185 |
|
--exclude ./Makefile \ |
|
186 |
|
--exclude "${P}.tar.gz" \ |
|
|
185 |
|
--exclude ${P}/Makefile \ |
187 |
186 |
${ADD_EXCLUDE} \ |
${ADD_EXCLUDE} \ |
188 |
|
-C .. "${P}" |
|
|
187 |
|
"${P}" \ |
|
188 |
|
&& rm -rf "${P}") |
189 |
189 |
echo "Done generating tarball!" |
echo "Done generating tarball!" |
190 |
190 |
|
|
191 |
|
rm -f "../${P}" |
|
192 |
|
|
|
193 |
191 |
echo "Copying source to ${EXPORT_PATH}/..." |
echo "Copying source to ${EXPORT_PATH}/..." |
194 |
192 |
mkdir -p "${EXPORT_PATH}" |
mkdir -p "${EXPORT_PATH}" |
195 |
193 |
cp -vp "${P}.tar.gz" "${EXPORT_PATH}/" |
cp -vp "${P}.tar.gz" "${EXPORT_PATH}/" |
|
... |
... |
function duilder_tar() |
197 |
195 |
|
|
198 |
196 |
#################################################################### |
#################################################################### |
199 |
197 |
|
|
|
198 |
|
# Variables |
|
199 |
|
if [ -d "${HOME}/rpmbuild" ]; then |
|
200 |
|
RPMBUILD="${HOME}/rpmbuild" |
|
201 |
|
else |
|
202 |
|
RPMBUILD="/usr/src/redhat" |
|
203 |
|
fi |
|
204 |
|
|
|
205 |
|
|
200 |
206 |
# Multiplexer |
# Multiplexer |
201 |
207 |
if [ "${1}" = "docs" ]; then |
if [ "${1}" = "docs" ]; then |
202 |
208 |
shift |
shift |
|
... |
... |
else |
337 |
343 |
fi |
fi |
338 |
344 |
echo "s#@MYSQL_FOUND@#${MYSQL_FOUND}#g" >> tmp.sed |
echo "s#@MYSQL_FOUND@#${MYSQL_FOUND}#g" >> tmp.sed |
339 |
345 |
|
|
|
346 |
|
echo -n "Searching for poll..." |
|
347 |
|
set +e |
|
348 |
|
echo -e "#include <poll.h> \n int main(void) { return poll(0, 0, 0); }" | gcc -x c -pipe - -o /dev/null 2>/dev/null |
|
349 |
|
E="${?}" |
|
350 |
|
set -e |
|
351 |
|
if [ "${E}" != "0" ]; then |
|
352 |
|
echo " not found." |
|
353 |
|
echo "s#@POLL_FOUND@#0#g" >> tmp.sed |
|
354 |
|
else |
|
355 |
|
echo " found." |
|
356 |
|
echo "s#@POLL_FOUND@#1#g" >> tmp.sed |
|
357 |
|
fi |
|
358 |
|
|
340 |
359 |
echo -n "Searching for epoll..." |
echo -n "Searching for epoll..." |
341 |
360 |
set +e |
set +e |
342 |
361 |
echo -e "#include <sys/epoll.h> \n int main(void) { return epoll_create(64); }" | gcc -x c -pipe - -o /dev/null 2>/dev/null |
echo -e "#include <sys/epoll.h> \n int main(void) { return epoll_create(64); }" | gcc -x c -pipe - -o /dev/null 2>/dev/null |
|
... |
... |
if [ -r "${PRJ}.spec.in" ]; then |
430 |
449 |
sed -f tmp.sed ${PRJ}.spec.in > ${PRJ}.spec |
sed -f tmp.sed ${PRJ}.spec.in > ${PRJ}.spec |
431 |
450 |
fi |
fi |
432 |
451 |
|
|
433 |
|
if [ -r config.h.in ]; then |
|
434 |
|
echo "Generate config.h file..." |
|
435 |
|
sed -f tmp.sed config.h.in > config.h |
|
|
452 |
|
if [ -z "${CONFIG_H}" ]; then |
|
453 |
|
CONFIG_H="config.h" |
436 |
454 |
fi |
fi |
|
455 |
|
echo "Generating ${CONFIG_H} file..." |
|
456 |
|
sed -f tmp.sed ${CONFIG_H}.in > ${CONFIG_H} |
437 |
457 |
|
|
438 |
458 |
rm -f tmp.sed |
rm -f tmp.sed |
439 |
459 |
|
|