I've read the docs and other tutorials to try to get fpm
to handle dependencies while building debian packages, but it fails every time.
my build.sh
#!/bin/bash
# constants
ITERATION=1
CODEVER=0.006
DIRBUILD=/home/chicks/Documents/build-proxwrap
DIRGIT=/home/chicks/Documents/git/wrap_proxmox
DEPS=(
"libio-prompt-perl (>= 0.997002-1)"
"perl-doc (>= 5.18.2-2ubuntu1.1)"
"liburi-escape-xs-perl (>= 0.11-1)"
"libjson-perl (>= 2.61-1)"
"libhttp-message-perl (>= 6.06-1)"
"libwww-perl (>= 6.05-2)"
)
PATH="$PATH:/home/chicks/.gem/ruby/2.3.0/bin"
# clean dirs
rm -rf $DIRBUILD
mkdir -p $DIRBUILD || exit 1
mkdir -p $DIRBUILD/usr/bin || exit 1
mkdir -p $DIRBUILD/opt/lib/perl5 || exit 1
ARG_DEPS=""
for index in `seq 1 5`
do
ARG_DEPS="$ARG_DEPS -d 'deb:${DEPS[$index]}'"
done
#echo $DIRGIT
echo $ARG_DEPS
# build directory tree
cd $DIRBUILD/usr/bin
for file in $(cd $DIRGIT/bin; ls); do
if echo $file | grep '.sh$' > /dev/null
then
echo leaving $file out of package
continue
fi
cat $DIRGIT/bin/$file | sed -e "s/use lib '..\/lib';/use lib '\/opt\/lib\/perl5';/" > $file
chmod +x $file
done
cd $DIRBUILD/opt/lib/perl5
cp -pr $DIRGIT/lib/* .
pwd
ls
# build package
cd $DIRGIT
OUTDEB=tm-proxwrap_${CODEVER}-${ITERATION}_amd64.deb
rm $OUTDEB
echo about to build $OUTDEB from $DIRBUILD
echo ""
echo running fpm -s dir -t deb -n tm_proxwrap -v $CODEVER $ARG_DEPS --iteration $ITERATION -C $DIRBUILD usr opt
fpm -s dir -t deb -n tm_proxwrap -v $CODEVER $ARG_DEPS --iteration $ITERATION -C $DIRBUILD usr opt
echo ""
ls -lh $OUTDEB
dpkg -c $OUTDEB
output with error message
I installed fpm 1.6.1 via gem
on Ubuntu 16.04 LTS.
$ ./build.sh
-d 'deb:perl-doc (>= 5.18.2-2ubuntu1.1)' -d 'deb:liburi-escape-xs-perl (>= 0.11-1)' -d 'deb:libjson-perl (>= 2.61-1)' -d 'deb:libhttp-message-perl (>= 6.06-1)' -d 'deb:libwww-perl (>= 6.05-2)'
leaving build.sh out of package
leaving install.sh out of package
/home/chicks/Documents/build-proxwrap/opt/lib/perl5
Net Telmate
rm: cannot remove 'tm-proxwrap_0.006-1_amd64.deb': No such file or directory
about to build tm-proxwrap_0.006-1_amd64.deb from /home/chicks/Documents/build-proxwrap
running fpm -s dir -t deb -n tm_proxwrap -v 0.006 -d 'deb:perl-doc (>= 5.18.2-2ubuntu1.1)' -d 'deb:liburi-escape-xs-perl (>= 0.11-1)' -d 'deb:libjson-perl (>= 2.61-1)' -d 'deb:libhttp-message-perl (>= 6.06-1)' -d 'deb:libwww-perl (>= 6.05-2)' --iteration 1 -C /home/chicks/Documents/build-proxwrap usr opt
All flags should be before the first argument (stray flags found: ["-d", "-d", "-d", "-d", "--iteration", "-C"] {:level=>:warn}
Invalid package configuration: Cannot package the path './(>=', does it exist? {:level=>:error}
I've gotten similar errors when leaving off deb:
. When I didn't have the version numbers included I needed the deb:
but that led to errors when trying to install the package because it couldn't find the dependencies. Other than dependencies it works well.
- is there a way to get
fpm
to accept my dependancies? - is there an easier system for building debian packages?
Even though it's echoing the dependency parameters with quotes, the error message makes it look like fpm is losing the quotes on your dependency names somewhere since it seems to be trying to use
./(>=
as a file. Tryto add an extra layer of quotes on them and see if that helps.