Initial commit

main
earnest ma 2021-07-26 13:41:48 -04:00
commit 6a80bc68a8
No known key found for this signature in database
GPG Key ID: 6B361FA81C5FB695
3 changed files with 118 additions and 0 deletions

18
LICENSE Normal file
View File

@ -0,0 +1,18 @@
Copyright © 2021 earnest ma <me@earne.link>
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the “Software”), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

32
README.md Normal file
View File

@ -0,0 +1,32 @@
# aptpkg
[![This project is considered experimental](https://img.shields.io/badge/Status-experimental-red.svg)](https://www.arp242.net/status/experimental)
[![sr.ht Project hub](https://img.shields.io/badge/sr.ht-Project%20hub-grey)](https://sr.ht/~earnestma/aptpkg)
- **[Packaging git repository](https://git.sr.ht/~earnestma/aptpkg-pkgs)**
- **[Package archive setup/ info](https://man.sr.ht/~earnestma/aptpkg)**
Easily create debian packages.
## Prerequisites
- ubuntu-dev-tools
- git, wget, bash
## Usage
See the [wiki](https://man.sr.ht/~earnestma/aptpkg) or run `./aptpkg --help` for
more information.
## Contribute
Send patches to [this mailing
list](https://lists.sr.ht/~earnestma/aptpkg-devel); you can follow [this
guide](https://git-send-email.io) if you don't know how.
File **confirmed** bugs/ feature requests
[here](https://todo.sr.ht/~earnestma/aptpkg)!
## License
`aptpkg` is published under an MIT License. See the LICENSE file for copyright
and license details.

68
aptpkg Executable file
View File

@ -0,0 +1,68 @@
#!/usr/bin/bash
# Init variables
APTPKG_VERSION="0.1.0-dev"
# Show help
show_help(){
cat > /dev/stdout <<EOF
aptpkg v$APTPKG_VERSION
Easily create debian packages.
Full documentation is being worked on and will be available at
Usage:
aptpkg [directory]
aptpkg -h, --help Show help
EOF
}
# Incorrect aptpkg usage: explain, show help, and exit
error_usage_die(){
echo "ERROR: " "$1"
show_help
exit 1
}
# Check that "build" file exists in directory
check(){
if ! [ -f "$1/build" ]; then
echo "No package of that name exists."
exit 1
fi
}
# Download a debian package
build_deb(){
echo "Getting $source"
wget "$source" -qO dist/"$name"_"$version"-"$rev"-amd64.deb
}
# Determine which function to run
load_build(){
# shellcheck disable=SC1090
source "$1/build"
case "$type" in
deb)
build_deb ;;
esac
}
# Run!
mkdir -p dist
if [ $# -ne 1 ]; then
error_usage_die "You must provide one directory"
fi
case $1 in
-h|--help)
show_help ;;
*)
check "$1"
load_build "$1" ;;
esac