-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate-aur-pkg.sh
executable file
·77 lines (68 loc) · 1.72 KB
/
create-aur-pkg.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/sh -e
gitapps_dir=${gitapps_dir:-/mnt/Data/gitapps}
TARGET_DIR=${TARGET_DIR:-${gitapps_dir}/AUR}
for pkgname in "$@"; do
gitless_name=$(echo "${pkgname}" | sed 's/-git$//')
git_pkg=true
if [ "${pkgname}" = "${gitless_name}" ]; then
git_pkg=false
fi
cd "${TARGET_DIR}"
mkdir -p "${pkgname}"
cd "${pkgname}"
git init -b master
git remote add origin ssh://aur@aur.archlinux.org/"${pkgname}".git
{
echo "${pkgname}*"
echo "src"
echo "pkg"
} > .gitignore
{
if ${git_pkg}; then
makedep_git=git
# shellcheck disable=SC2016
source_git='"${pkgname}"::"git+${url}"'
checksum_git=SKIP
fi
echo "# Maintainer: Mazhar Hussain <realmazharhussain@gmail.com>"
echo "pkgname=${pkgname}"
echo "pkgdesc=''"
echo "url="
echo "pkgver=1.0"
echo "pkgrel=1"
echo "arch=(any)"
echo "license=()"
if ${git_pkg}; then
echo "provides=(${gitless_name})"
echo "conflicts=(${gitless_name})"
fi
echo "depends=()"
echo "makedepends=(${makedep_git})"
echo "checkdepends=()"
echo "source=(${source_git})"
echo "sha256sums=(${checksum_git})"
if ${git_pkg}; then
echo
echo 'pkgver() {'
# shellcheck disable=SC2016
echo ' cd "${srcdir}/${pkgname}"'
echo ' git describe --tags --long | sed -e "s/^v//" -e "s/-/+/g"'
echo '}'
fi
echo
echo 'build() {'
# shellcheck disable=SC2016
echo ' cd "${srcdir}/${pkgname}"'
echo '}'
echo
echo 'check() {'
# shellcheck disable=SC2016
echo ' cd "${srcdir}/${pkgname}"'
echo '}'
echo
echo 'package() {'
# shellcheck disable=SC2016
echo ' cd "${srcdir}/${pkgname}"'
echo '}'
} > PKGBUILD
done