Skip to content

Commit

Permalink
Initial support for python.py, add arm pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Nov 21, 2012
1 parent 8428d5b commit 131967d
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 21 deletions.
4 changes: 4 additions & 0 deletions pkg/arm-1.4.5.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
URL=http://www.atagar.com/arm/resources/static/arm-1.4.5.0.tar.bz2
DESC="Anonymizing Relay Monitor"
PKGDIRNAME=arm
TYPE=tar
56 changes: 35 additions & 21 deletions slpm
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ BIN="`readlink $0`"
ARG0="`whereami $BIN`"
ROOT="`dirname $ARG0`"
IGNEXE=0
PYTHON=python
USRDIR="${HOME}/.slpm"
WRKDIR="${ROOT}/_work"
TMPDIR="${ROOT}/_work/tmp"
Expand Down Expand Up @@ -146,11 +147,11 @@ tar_fetch() {
echo "==> Error uncompressing"
exit 1
fi
:> "$WRKDIR/$PKG/.slpm_workdir_done"
if [ "${PKGDIRNAME}" -a ! "${PKG}" = "${PKGDIRNAME}" ]; then
if [ -n "${PKGDIRNAME}" -a ! "${PKG}" = "${PKGDIRNAME}" ]; then
# hack to rename PKGDIR
mv ${PKGDIRNAME} ${PKG}
fi
:> "$WRKDIR/$PKG/.slpm_workdir_done"
fi
}

Expand Down Expand Up @@ -207,12 +208,17 @@ pkg_build() {
if [ -n "${PKGCONFIGURE}" ]; then
${PKGCONFIGURE}
else
[ -f ${CONFIGURE} ] && chmod +x ${CONFIGURE}
if [ -x "${CONFIGURE}" ]; then
${CONFIGURE} "--prefix=${PREFIX}" ${CFGARGS} ${USER_CFGARGS}
if [ ! $? = 0 ]; then
echo "=> Configure stage failed :("
exit 1
if [ -f "setup.py" ]; then
python setup.py build
:> .slpm_build_done
else
[ -f ${CONFIGURE} ] && chmod +x ${CONFIGURE}
if [ -x "${CONFIGURE}" ]; then
${CONFIGURE} "--prefix=${PREFIX}" ${CFGARGS} ${USER_CFGARGS}
if [ ! $? = 0 ]; then
echo "=> Configure stage failed :("
exit 1
fi
fi
fi
fi
Expand Down Expand Up @@ -245,11 +251,15 @@ pkg_install() {
echo "=> Running pre install script '${INSTALL_PRE}'"
(cd ${DESTDIR}/${PREFIX} ; eval $INSTALL_PRE)
fi
echo "=> Running: ${PKGINSTALL} ${PKGINSTALL_ARGS}"
for a in ${PKGINSTALL_ARGS} ; do
eval export ${a}
done
eval ${PKGINSTALL} ${PKGINSTALL_ARGS}
if [ -f setup.py ]; then
${PYTHON} setup.py install --root "${DESTDIR}/${PREFIX}"
else
echo "=> Running: ${PKGINSTALL} ${PKGINSTALL_ARGS}"
for a in ${PKGINSTALL_ARGS} ; do
eval export ${a}
done
eval ${PKGINSTALL} ${PKGINSTALL_ARGS}
fi
if [ -n "${INSTALL_POST}" ]; then
echo "=> Running post install script '${INSTALL_POST}'"
(cd ${DESTDIR}/${PREFIX} ; eval $INSTALL_POST)
Expand Down Expand Up @@ -326,14 +336,18 @@ pkg_register() {
fi
#PKGINSTALL_ARGS="DESTDIR=${DESTDIR} INSTALL_ROOT=${DESTDIR} PREFIX=${PREFIX} prefix=${PREFIX} exec_prefix=${PREFIX}"
PKGINSTALL_ARGS="PREFIX=/ DESTDIR=${WRKDIR}/.tmp/${PKG} prefix=/ exec_prefix=${PREFIX}"
for a in ${PKGINSTALL_ARGS} ; do
eval export ${a}
done
eval ${PKGINSTALL} ${PKGINSTALL_ARGS}
echo "=> Running ${PKGINSTALL} ${PKGINSTALL_ARGS}"
DD=${WRKDIR}/.tmp/${PKG}
eval DESTDIR=${DD} INSTALL_ROOT=${DD} \
${PKGINSTALL} PREFIX=/ "DESTDIR=${WRKDIR}/.tmp/${PKG}" prefix=/ || exit 1
if [ -f setup.py ]; then
${PYTHON} setup.py install --root "${WRKDIR}/.tmp/${PKG}" || exit 1
else
for a in ${PKGINSTALL_ARGS} ; do
eval export ${a}
done
eval ${PKGINSTALL} ${PKGINSTALL_ARGS}
echo "=> Running ${PKGINSTALL} ${PKGINSTALL_ARGS}"
DD=${WRKDIR}/.tmp/${PKG}
eval DESTDIR=${DD} INSTALL_ROOT=${DD} \
${PKGINSTALL} PREFIX=/ "DESTDIR=${WRKDIR}/.tmp/${PKG}" prefix=/ || exit 1
fi
#-if [ ! $? = 0 ]; then
#- echo "=> Install fail"
#- exit 1
Expand Down

0 comments on commit 131967d

Please sign in to comment.