---
Just refamiliarizing myself with git send-email. I haven't tested this
yet and it might not work.
aptpkg | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/aptpkg b/aptpkg
index dd82552..251359b 100755
--- a/aptpkg
+++ b/aptpkg
@@ -35,12 +35,44 @@ check(){
fi
}
+# Generate the debian control file
+gen_control_file(){
+ mkdir -p "$1"/debian
+ echo "Package: $name
+Version: $version-$rev
+Architecture: amd64
+Maintainer: $(grep -am 1 -hr "Maintainer: " "$1"/build | sed 's/# Maintainer: //')
+Homepage: $url
+Description: $description
+" > "$builddir"/debian/control
+}
+
# Download a debian package
build_deb(){
echo "Getting $source"
wget "$source" -qO dist/"$name"_"$version"-"$rev"-amd64.deb
}
+# Download and build using files
+build_file(){
+ builddir=${name}_${version}-${rev}_amd64
+
+ cd "$1"
+ mkdir -p "$builddir"
+
+ download # and verifying function
+ steps # adjust and move everything into $builddir correctly
+
+ gen_control_file "$@"
+
+ [ -f preinst ] && cp preinst "$builddir"/debian/
+ [ -f postinst ] && cp postinst "$builddir"/debian/
+
+ cd -
+
+ dpkg-deb --build "$1"/"$builddir" dist/
+}
+
# Determine which function to run
load_build(){
mkdir -p dist
@@ -51,6 +83,8 @@ load_build(){
case "$type" in
deb)
build_deb ;;
+ file)
+ build_file "$@" ;;
esac
}
--
2.30.2