Template to bootstrap configure/automake projects for C++, libtool, Qt, NodeJS, PHP, Shell-Scripts, etc.
Extends autotools, by building packages for Debian and RPM, specifying generic library dependencies, creating desktop applications with icons, etc.
https://mrw.sh/development/bootstrap-build-environment
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.8 KiB
39 lines
1.8 KiB
#! /bin/bash -ex |
|
|
|
## @id $Id$ |
|
|
|
## Resolve RPM Build Dependencies |
|
## Installs all the required packages |
|
## Call: ./resolve-rpmbuilddeps 'name of build schroot' |
|
## e.g. call: ./resolve-rpmbuilddeps opensuse-13.2_x86_64 |
|
|
|
## 1 2 3 4 5 6 7 8 |
|
## 45678901234567890123456789012345678901234567890123456789012345678901234567890 |
|
|
|
INSTALL_TOOL=${INSTALL_TOOL:-$((test -x /usr/bin/zypper && echo zypper) || (test -x /usr/bin/dnf && echo dnf) || (test -x /usr/bin/yum && echo yum))} |
|
SCHROOTNAME="$1" |
|
PACKAGE_NAME=$(sed -n 's/^ *m4_define(x_package_name, \(.*\)).*/\1/p' configure.ac) |
|
|
|
if test -n "${SCHROOTNAME}"; then |
|
schroot -c ${SCHROOTNAME} -u root -- ${INSTALL_TOOL} install -y rpm-build automake libtool subversion gcc-c++ pkgconfig |
|
schroot -c ${SCHROOTNAME} -u root -- ./bootstrap.sh -c |
|
TGZFILE=$(grep PACKAGE_STRING= configure | sed "s, ,-,g;s,PACKAGE_STRING=',,g;s,',.tar.gz,g") |
|
touch $TGZFILE |
|
FILES=$(LANG= schroot -c ${SCHROOTNAME} -- rpmbuild -bb --clean --nobuild --define "_topdir ." --define "_sourcedir ." ${PACKAGE_NAME}.spec 2>&1 | sed -n 's, is needed by.*,,p') |
|
rm $TGZFILE |
|
if test -n "${FILES}"; then |
|
schroot -c ${SCHROOTNAME} -u root -- ${INSTALL_TOOL} install -y ${FILES} |
|
fi |
|
else |
|
${INSTALL_TOOL} install -y rpm-build automake libtool subversion gcc-c++ pkgconfig |
|
./bootstrap.sh -c |
|
TGZFILE=$(grep PACKAGE_STRING= configure | sed "s, ,-,g;s,PACKAGE_STRING=',,g;s,',.tar.gz,g") |
|
touch $TGZFILE |
|
FILES=$(LANG= rpmbuild -bb --clean --nobuild --define "_topdir ." --define "_sourcedir ." ${PACKAGE_NAME}.spec 2>&1 | sed -n 's, is needed by.*,,p') |
|
rm $TGZFILE |
|
if test -n "${FILES}"; then |
|
${INSTALL_TOOL} install -y ${FILES} |
|
fi |
|
fi |
|
|
|
echo "**** Success: All Dependencies Resolved"
|
|
|