Tuesday, February 16, 2010

checkinstall with non-root

i wanted to use checkinstall as a non-root user, with sudo, and i found a way to make it work. i made a directory called checkinstall/packagename and cd'ed to it (this helps checkinstall get the right package name). then i ran 'checkinstall easy_install packagename' and it it worked great, once i had the following change: after this part of the checkinstall script
echogn "Installing Debian package..."
dpkg -i $DPKG_FLAGS "$DEBPKG" &> ${TMP_DIR}/dpkginstall.log
okfail
i put in this:
# added this to try sudo
if [ $? -gt 0 ]; then
echo "sudo dpkg -i $DPKG_FLAGS \"$DEBPKG\" &> ${TMP_DIR}/dpkginstall.log"
echogn "Installing Debian package with sudo..."
echo
sudo dpkg -i $DPKG_FLAGS "$DEBPKG" &> ${TMP_DIR}/dpkginstall.log
okfail
fi
since i'm installing stuff in my home dir, i have to answer yes when checkinstall asks if i want to see these files (so they can get included in the package and not excluded as config files as checkinstall expects).
now it all works (tested with easy_install) and it shows up in synaptic and everything.
also, i found what i am pretty sure is a bug. pretty obvious, so i'm surprised no one else seems to have posted anywhere about it. i changed the line
grep '^/home' ${TMP_DIR}/newfile > /${TMP_DIR}/unwanted
to
grep '^/home' ${TMP_DIR}/newfiles > /${TMP_DIR}/unwanted

No comments: