forked from nefelim4ag/Ananicy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage.sh
executable file
·39 lines (36 loc) · 1.31 KB
/
package.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
#!/bin/bash -e
################################################################################
# echo wrappers
INFO(){ echo "INFO: $*";}
WARN(){ echo "WARN: $*";}
ERRO(){ echo "ERRO: $*"; exit 1;}
debian_package(){
cd "$(dirname "$0")"
VERSION=$(git tag --sort version:refname | tail -n 1)
[ -z "$VERSION" ] && ERRO "Can't get git tag, VERSION are empty!"
DEB_NAME=ananicy-${VERSION}_any
mkdir -p "$DEB_NAME"
make install PREFIX="$DEB_NAME"/
mkdir -p "$DEB_NAME"/DEBIAN/
{
echo "Package: ananicy"
echo "Version: $VERSION"
echo "Section: custom"
echo "Priority: optional"
echo "Architecture: all"
echo "Depends: coreutils, schedtool"
echo "Essential: no"
echo "Installed-Size: 16"
echo "Maintainer: [email protected]"
echo "Description: Ananicy (ANother Auto NICe daemon) — is a shell daemon created to manage processes' IO and CPU priorities, with community-driven set of rules for popular applications (anyone may add his own rule via github's pull request mechanism)."
} > "$DEB_NAME"/DEBIAN/control
dpkg-deb --build "$DEB_NAME"
}
archlinux_package(){
INFO "Use yaourt -S ananicy-git"
}
case $1 in
debian) debian_package ;;
archlinux) archlinux_package ;;
*) echo "$0 <debian|archlinux>" ;;
esac