5 echo "$(basename $0): error: $1" > /dev
/stderr
;
8 [ -f "Makefile" ] ||
{ err_mess
"makefile not found"; exit 1; }
9 [ -f "configure.ac" ] ||
{ err_mess
"configure.ac not found"; exit 1; }
19 default
) err_mess
"unknown distro: $DISTRO";
24 BASE_NAME
=$
(head -n 50 configure.ac |
grep "m4_define(\[library_base_name\], \[.*\])" |
sed "s/m4_define(\[library_base_name\], \[\(.*\)\])/\1/")
25 API_VERSION
=$
(head -n 50 configure.ac |
grep "m4_define(\[api_version\], \[.*\])" |
sed "s/m4_define(\[api_version\], \[\(.*\)\])/\1/")
27 MAJOR_VER
=$
(head -n 50 configure.ac |
grep "m4_define(\[package_major_version\], \[.*\])" |
sed "s/m4_define(\[package_major_version\], \[\(.*\)\])/\1/")
28 MINOR_VER
=$
(head -n 50 configure.ac |
grep "m4_define(\[package_minor_version\], \[.*\])" |
sed "s/m4_define(\[package_minor_version\], \[\(.*\)\])/\1/")
29 MICRO_VER
=$
(head -n 50 configure.ac |
grep "m4_define(\[package_micro_version\], \[.*\])" |
sed "s/m4_define(\[package_micro_version\], \[\(.*\)\])/\1/")
31 NAME
="lib${BASE_NAME}"
32 NAME1
="lib${BASE_NAME}-${API_VERSION}-${MAJOR_VER}"
33 NAMEDEV1
="${NAME1}-dev"
34 NAMEDBG1
="${NAME1}-dbg"
36 VER
="${MAJOR_VER}.${MINOR_VER}.${MICRO_VER}"
38 DEBIAN_IN_DIR
="debian.in"
39 REL_SUB_VER_FILE
="${DEBIAN_IN_DIR}/${DISTRO}/release_subv"
41 [ -f "$REL_SUB_VER_FILE" ] ||
{ err_mess
"release_subv not found"; exit 1; }
43 REL_SUB_VER
="$(cat "${REL_SUB_VER_FILE}")";
44 echo "$REL_SUB_VER" |
grep -q "[[:digit:]]\+" ||
{ err_mess
"invalid release subversion: $REL_SUB_VER"; exit 1;}
46 NAME_HYPHEN
="${NAME}-${API_VERSION}-${VER}"
48 RESULTS_DIR
="/var/cache/pbuilder_${DISTRO}/result"
49 BUILD_DIR
="${HOME}/deb_builds/${DISTRO}/${NAME_HYPHEN}"
50 DEB_DIR_TEMPL
="${DEBIAN_IN_DIR}/${DISTRO}/debian.template"
52 if [ -f "$DEB_DIR_TEMPL/changelog" ]
54 echo "Changelog found:"
55 cat "$DEB_DIR_TEMPL/changelog" |
sed "s/.*/ > &/"
58 while [[ $ANSW != yes && $ANSW != no
]]
60 echo -n "Delete it? (yes/no) "
67 rm -f "$DEB_DIR_TEMPL/changelog" ||
exit 1;
70 echo "0" > "${REL_SUB_VER_FILE}" ||
exit 0
72 if [ -d "${BUILD_DIR}" ]
74 echo "Build directory found:"
76 ls -1 ${BUILD_DIR} |
sed "s/.*/ > &/"
79 while [[ $ANSW != yes && $ANSW != no
]]
81 echo -n "Delete it? (yes/no) "
88 rm -fr "${BUILD_DIR}" ||
exit 1;