Browse Source

Post-install script for the deb package added

* Ownership of the system files changed to 'root:root'
* Bash variables enquoted to make them more secure
pull/218/head
Kirill Feoktistov 2 years ago committed by Timofey Titovets
parent
commit
9e989fb4aa
  1. 25
      package.sh

25
package.sh

@ -9,10 +9,14 @@ 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/
DEB_NAME="ananicy-${VERSION}_any"
# cleanup after previous installation
rm "./${DEB_NAME}.deb" && rm -rf "${DEB_NAME}"
mkdir -p "${DEB_NAME}"
make install PREFIX="${DEB_NAME}"
mkdir -p "${DEB_NAME}/DEBIAN/"
{
echo "Package: ananicy"
echo "Version: $VERSION"
@ -24,8 +28,17 @@ debian_package(){
echo "Installed-Size: 16"
echo "Maintainer: nefelim4ag@gmail.com"
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"
} > "${DEB_NAME}/DEBIAN/control"
POSTINST="${DEB_NAME}/DEBIAN/postinst"
touch "${POSTINST}" && chmod +x "${POSTINST}"
{
echo "#!/bin/sh"
echo "chown -R root:root /etc/ananicy.d"
echo "chown root:root /lib/systemd/system/ananicy.service"
echo "chown root:root /usr/bin/ananicy"
} > "${POSTINST}"
dpkg-deb --build "${DEB_NAME}"
}
archlinux_package(){

Loading…
Cancel
Save