diff options
author | 7Ji | 2022-04-13 20:03:30 +0800 |
---|---|---|
committer | 7Ji | 2022-04-13 20:03:30 +0800 |
commit | c8257bf343b60805a62c3e7555a2efe5cfa279a8 (patch) | |
tree | d4fc72e4823253eb951dfade40b547bbc3570549 | |
download | aur-c8257bf343b60805a62c3e7555a2efe5cfa279a8.tar.gz |
Init commit
-rw-r--r-- | .SRCINFO | 21 | ||||
-rw-r--r-- | 0001-beep-main.c-yolo-it-when-running-with-sudo.patch | 39 | ||||
-rw-r--r-- | 0002-GNUmakefile-fix-install-dir-to-usr.patch | 25 | ||||
-rw-r--r-- | PKGBUILD | 35 |
4 files changed, 120 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..c050b0212537 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,21 @@ +pkgbase = beep-sudoable + pkgdesc = Advanced PC speaker beeping program, patched so you can run it with sudo + pkgver = 1.4.12 + pkgrel = 1 + url = https://github.com/spkr-beep/beep + arch = x86_64 + license = GPL2 + depends = glibc + provides = beep + conflicts = beep + source = https://github.com/spkr-beep/beep/archive/v1.4.12/beep-1.4.12.tar.gz + source = 0001-beep-main.c-yolo-it-when-running-with-sudo.patch + source = 0002-GNUmakefile-fix-install-dir-to-usr.patch + sha512sums = 18fed77bc4820ecc84ac12e903d516d5228fa2038df1788cc68db76e40b3c47a271911cc45bc48ce94e3f215803c5c05cb6c08ebb47ae6d7fcf1e0bc1ac169cd + sha512sums = 18208e0b8817aeb6793423e645932474b098703f042ff07630bb50da7f2b0f3c5c1b180e5f3e89784654cdff0fc4f1d2baca20e4a450f314d583bda9a0c2976f + sha512sums = 36f3d54cdf7b4c507834de7db1bfcb46e0c3d9821afc03be024f49925f260a208ef51a6b010015cfc7b46edb83f903bc75a3e3ca8b4819e39a4daeafda16a224 + b2sums = 06f21cf3c40389acca50e6e420af4e738b7484e096bb689345fedb37684b15733dbb38e8a5d0d360f23e020cebe9ba321984ee43f41b0ad980648414ddbb9375 + b2sums = 747710350428104c3cef987b4e0170a5396244023851a1fbe0faa4b1ffa8a847b557326bf46eedfffd82cc2c99e3de68e63488e4febbd2ad08566a812643d1d0 + b2sums = b5f5c3960567aa27b9dd61d67ed9b56a64d5c8ff06fccbcc40f3316d9c6e5a7f6341b83412fa76d904c83cc870aa8e36485d6ab70507e64de2787259df77f2fc + +pkgname = beep-sudoable diff --git a/0001-beep-main.c-yolo-it-when-running-with-sudo.patch b/0001-beep-main.c-yolo-it-when-running-with-sudo.patch new file mode 100644 index 000000000000..a603fdfc5c0a --- /dev/null +++ b/0001-beep-main.c-yolo-it-when-running-with-sudo.patch @@ -0,0 +1,39 @@ +From 35099f763e19c054c4d01b83d25a5e8506ed0a18 Mon Sep 17 00:00:00 2001 +From: 7Ji <pugokushin@gmail.com> +Date: Wed, 13 Apr 2022 19:35:03 +0800 +Subject: [PATCH] beep-main.c: yolo it when running with sudo + +--- + beep-main.c | 16 ---------------- + 1 file changed, 16 deletions(-) + +diff --git a/beep-main.c b/beep-main.c +index 6b890ff..889a38b 100644 +--- a/beep-main.c ++++ b/beep-main.c +@@ -475,22 +475,6 @@ int main(const int argc, char *const argv[]) + exit(EXIT_FAILURE); + } + +- /* Bail out if running as root under sudo. +- */ +- if ((getuid() == 0) || (geteuid() == 0) || +- (getgid() == 0) || (getegid() == 0)) { +- LOG_VERBOSE("Running with root permissions. " +- "Checking for SUDO_* in environment."); +- if (getenv("SUDO_COMMAND") || getenv("SUDO_USER") || +- getenv("SUDO_UID") || getenv("SUDO_GID")) { +- LOG_ERROR("Running as root under sudo, " +- "which is not supported for security reasons."); +- LOG_ERROR("Set up permissions for the pcspkr evdev device " +- "file and run as non-root user instead."); +- exit(EXIT_FAILURE); +- } +- } +- + /* Parse command line */ + beep_parms_T *parms = (beep_parms_T *)malloc(sizeof(beep_parms_T)); + if (NULL == parms) { +-- +2.35.1 + diff --git a/0002-GNUmakefile-fix-install-dir-to-usr.patch b/0002-GNUmakefile-fix-install-dir-to-usr.patch new file mode 100644 index 000000000000..78a6146b8a7e --- /dev/null +++ b/0002-GNUmakefile-fix-install-dir-to-usr.patch @@ -0,0 +1,25 @@ +From f2ad417ec3260fdad18638d48bd1a26d21535287 Mon Sep 17 00:00:00 2001 +From: 7Ji <pugokushin@gmail.com> +Date: Wed, 13 Apr 2022 19:50:38 +0800 +Subject: [PATCH 2/2] GNUmakefile: fix install dir to /usr + +--- + GNUmakefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/GNUmakefile b/GNUmakefile +index a27b453..027b81e 100644 +--- a/GNUmakefile ++++ b/GNUmakefile +@@ -35,7 +35,7 @@ PACKAGE_VERSION = 1.4.12 + + # We use GNU makefile conventions for directory names. + +-prefix = /usr/local ++prefix = /usr + exec_prefix = $(prefix) + bindir = $(exec_prefix)/bin + sbindir = $(exec_prefix)/sbin +-- +2.35.1 + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..e6ad16023880 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,35 @@ +# Maintainer: 7Ji <pugokushin@gmail.com> +# Contributor: Levente Polyak <anthraxx[at]archlinux[dot]org> +# Contributor: Eric BĂ©langer <eric@archlinux.org> + +pkgname=beep-sudoable +pkgver=1.4.12 +pkgrel=1 +pkgdesc='Advanced PC speaker beeping program, patched so you can run it with sudo' +url='https://github.com/spkr-beep/beep' +arch=('x86_64') +license=('GPL2') +depends=('glibc') +provides=('beep') +conflicts=('beep') +source=(${url}/archive/v${pkgver}/beep-${pkgver}.tar.gz 0001-beep-main.c-yolo-it-when-running-with-sudo.patch 0002-GNUmakefile-fix-install-dir-to-usr.patch) +sha512sums=('18fed77bc4820ecc84ac12e903d516d5228fa2038df1788cc68db76e40b3c47a271911cc45bc48ce94e3f215803c5c05cb6c08ebb47ae6d7fcf1e0bc1ac169cd' + '18208e0b8817aeb6793423e645932474b098703f042ff07630bb50da7f2b0f3c5c1b180e5f3e89784654cdff0fc4f1d2baca20e4a450f314d583bda9a0c2976f' + '36f3d54cdf7b4c507834de7db1bfcb46e0c3d9821afc03be024f49925f260a208ef51a6b010015cfc7b46edb83f903bc75a3e3ca8b4819e39a4daeafda16a224') +b2sums=('06f21cf3c40389acca50e6e420af4e738b7484e096bb689345fedb37684b15733dbb38e8a5d0d360f23e020cebe9ba321984ee43f41b0ad980648414ddbb9375' + '747710350428104c3cef987b4e0170a5396244023851a1fbe0faa4b1ffa8a847b557326bf46eedfffd82cc2c99e3de68e63488e4febbd2ad08566a812643d1d0' + 'b5f5c3960567aa27b9dd61d67ed9b56a64d5c8ff06fccbcc40f3316d9c6e5a7f6341b83412fa76d904c83cc870aa8e36485d6ab70507e64de2787259df77f2fc') + +prepare() { + patch -d "beep-${pkgver}" -Np1 -i "${srcdir}/0001-beep-main.c-yolo-it-when-running-with-sudo.patch" + patch -d "beep-${pkgver}" -Np1 -i "${srcdir}/0002-GNUmakefile-fix-install-dir-to-usr.patch" +} +build() { + cd "beep-${pkgver}" + make +} + +package() { + cd "beep-${pkgver}" + make DESTDIR="${pkgdir}" install +} |