Kaydet (Commit) bd9b98ed authored tarafından sulincix's avatar sulincix

debian package support

üst e27f3257
...@@ -3,6 +3,7 @@ name="example" ...@@ -3,6 +3,7 @@ name="example"
version="1.0" version="1.0"
summary="example package" summary="example package"
description="example package for build test" description="example package for build test"
depends=("hello")
license="gplv3" license="gplv3"
release="1" release="1"
#source=(http://ftp.gnu.org/gnu/bash/bash-5.0.tar.gz) #source=(http://ftp.gnu.org/gnu/bash/bash-5.0.tar.gz)
......
...@@ -6,3 +6,15 @@ if [ "$TARGET" == "" ] ; then ...@@ -6,3 +6,15 @@ if [ "$TARGET" == "" ] ; then
export TARGET=inary export TARGET=inary
fi fi
fi fi
if [ "$TARGET" == "debian" ] ; then
if [ "$arch" == "" ] ; then
[ "$(uname -m)" == "x86_64" ] && export arch="amd64"
[ "$(uname -m)" == "i686" ] && export arch="i386"
[ "$(uname -m)" == "aarch64" ] && export arch="arm64"
[ "$(uname -m)" == "armhf" ] && export arch="arm"
fi
elif [ "$TARGET" == "inary" ] ; then
if [ "$arch" == "" ] ; then
export arch="$(uname -m)"
fi
fi
#!/bin/bash
_write_metadata(){
echo -e "Package: $name"
echo -e "Source: $source"
echo -e "Version: $version"
echo -e "Architecture: $arch"
echo -e "Maintainer: $maintainer <$email>"
echo -e "Installed-Size: 1"
echo -ne "Depends: "
for dep in ${depends[@]:0:${#depends[@]}-1}
do
echo -ne " $dep,"
done
echo -e "${depends[@]:-1}"
echo -e "Section: $partof"
echo -e "Homepage: $homepage"
echo -e "Description: $description"
}
_create_metadata(){
mkdir -p $PKGDIR/DEBIAN
_write_metadata > $PKGDIR/DEBIAN/control
cd $INSTALLDIR
touch $PKGDIR/DEBIAN/md5sums
find . | while read line
do
[ -f $line ] && md5sum $line | sed "s|^\./||g" >> $PKGDIR/DEBIAN/md5sums
done
}
_package(){
cd $INSTALLDIR
tar --gzip -cvf $PKGDIR/data.tar.gz ./*
cd $PKGDIR/DEBIAN
tar --gzip -cvf $PKGDIR/control.tar.gz *
echo "2.0" > $PKGDIR/debian-binary
cd $PKGDIR
ar r "$CURDIR/${name}_${arch}_${version}.deb" debian-binary control.tar.gz data.tar.gz
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment