diff options
author | TGS | 2017-01-14 23:27:33 -0500 |
---|---|---|
committer | TGS | 2017-01-14 23:27:33 -0500 |
commit | 7c82da86c1f219227155f8107edb802696e191d3 (patch) | |
tree | cef4b3e8af0419c54b4fcf461f5443590e65c579 | |
parent | 75c9ece4ddde81de9b23e7c2dc6edffdd6d64854 (diff) | |
download | aur-7c82da86c1f219227155f8107edb802696e191d3.tar.gz |
Change installation method to fakeroot instructions in $pkgdir (it is
important not to delete from /usr/bin)
Other changes:
- libappindicator-gtk3 is now an optional dependency for displaying the
tray icon.
- Documentation has been updated. A screenshot of the tray icon being
shown on Arch Linux has also been added.
- Tray icon now works on all systems using GTK3, not just Ubuntu - see
the screenshot! :D
- This package now uses taner1's fork instead of the official to enable
manual fan control from 40% to 100%
- Makefile is no longer used because it uses the sudo command. Now all
files will be built from source (gcc) with developer-defined flags
instead of using the binary already built by gcc, my mistake.
- I was unaware that the makefile was not compiling from source.
- This solution uses proper libraries in the compile flags from
the instructions in the source code.
- Stickybits u+s fix the tray icon appearance upon package
installation (because after fakeroot installs it, owner is set to root
rather than user). Running the fan control utility no longer requires
root.
- I was going to create a separate Makefile, but it is not
needed because the installation can be done with only 2 commands, and
the PKGBUILD is supposed to consolidate the installation process, not
create separate files.
- gcc is now a dependency for making the package.
- Fix license installation (license now installed in /usr/share/licenses/clevo-indicator-git)
Enjoy! :D
~ TGS (Tech Guy Software) @ techware.me
-rw-r--r-- | .SRCINFO | 14 | ||||
-rw-r--r-- | PKGBUILD | 86 | ||||
-rw-r--r-- | README.md | 28 | ||||
-rw-r--r-- | clevo-indicator-git.install | 9 |
4 files changed, 67 insertions, 70 deletions
@@ -1,16 +1,16 @@ pkgbase = clevo-indicator-git - pkgdesc = Command-line fan control utility for Clevo laptops - pkgver = r17.fa0a7af - pkgrel = 4 - url = https://github.com/SkyLandTW/clevo-indicator - install = clevo-indicator-git.install + pkgdesc = Command-line and system tray fan control utility for Clevo laptops + pkgver = r19.c59790a + pkgrel = 5 + url = https://github.com/taner1/clevo-indicator changelog = README.md arch = x86_64 license = custom:Unlicense makedepends = git - depends = libappindicator-gtk3 + makedepends = gcc + optdepends = libappindicator-gtk3: tray icon support provides = clevo-indicator - source = clevo-indicator-git::git+https://github.com/SkyLandTW/clevo-indicator.git + source = clevo-indicator-git::git+https://github.com/taner1/clevo-indicator.git md5sums = SKIP pkgname = clevo-indicator-git @@ -1,33 +1,30 @@ -# This is an example PKGBUILD file. Use this as a start to creating your own, -# and remove these comments. For more information, see 'man PKGBUILD'. -# NOTE: Please fill out the license field for your package! If it is unknown, -# then please put 'unknown'. - # PKGBUILD prototype location: /usr/share/pacman/PKGBUILD.proto # .install prototype location: /usr/share/pacman/proto.install # Example: https://github.com/archlinuxarm/PKGBUILDs/blob/master/aur/libcrossguid-git/PKGBUILD # Git pkgver() examples: https://wiki.archlinux.org/index.php/VCS_package_guidelines#The_pkgver.28.29_function +# Uses taner1's newer fork (allows setting fan speeds from 40% to 100%) + # Maintainer: Tech Guy Software <techguy100official at gmail dot com> pkgname=clevo-indicator-git -pkgver=r17.fa0a7af -pkgrel=4 +pkgver=r19.c59790a +pkgrel=5 #epoch= -pkgdesc="Command-line fan control utility for Clevo laptops" +pkgdesc="Command-line and system tray fan control utility for Clevo laptops" arch=('x86_64') -url="https://github.com/SkyLandTW/clevo-indicator" +url="https://github.com/taner1/clevo-indicator" license=('custom:Unlicense') #groups=() -depends=('libappindicator-gtk3') -makedepends=('git') +depends=() +optdepends=('libappindicator-gtk3: tray icon support') +makedepends=('git' 'gcc') provides=('clevo-indicator') #conflicts=() #replaces=() #backup=() #options=() -install=clevo-indicator-git.install changelog=README.md -source=("${pkgname%}::git+https://github.com/SkyLandTW/clevo-indicator.git") +source=("${pkgname%}::git+https://github.com/taner1/clevo-indicator.git") md5sums=('SKIP') #noextract=() #validpgpkeys=() @@ -35,44 +32,43 @@ md5sums=('SKIP') pkgver() { # Return most recent git revisions and shortened MD5 from package directory # as a formatted string - cd "$srcdir"/$pkgname + cd "$srcdir"/"$pkgname" printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" } -prepare() { - cd "$pkgname" - #patch -p1 -i "$srcdir/$pkgname-$pkgver.patch" -} - -build() { - cd "$pkgname" - #./configure --prefix=/usr -} - package() { - # make from source and install to /usr/local/bin - cd "$pkgname" - make install + # make from source and install built binary to fakeroot $pkgdir/usr/bin + echo "--> Compiling from source and adding to fakeroot \$pkgdir/usr/bin..." + cd "$srcdir"/"$pkgname" + + # We are not using the package's makefile for install, it uses sudo. Instead just compile using gcc, + # copy the clevo-indicator binary in $srcdir/$pkgname/bin/clevo-indicator and copy to $pkgdir/usr/bin/clevo-indicator using install command + mkdir -p bin - # the package's makefile installs to /usr/local/bin, we don't want that, there is no option other than to move it or create a separate fork of the project - # https://bbs.archlinux.org/viewtopic.php?id=158031 - # per the AUR package etiquette, /usr/bin is preferred + # Fixes from: https://ubuntuforums.org/showthread.php?t=2053347 and https://stackoverflow.com/questions/10721623/echo-style-appending-but-to-the-beginning-of-a-file + # This fixes the issue with the tray indicator on GTK3 and KDE! (since libappindicator works with KDE) + # look into clevo-indicator.c file for correct gcc testing command + mkdir -p "$pkgdir/usr/bin" + gcc src/clevo-indicator.c -o bin/clevo-indicator `pkg-config --cflags --libs appindicator3-0.1` -lm + install -m 555 "bin/clevo-indicator" "$pkgdir/usr/bin/clevo-indicator" - # move clevo-indicator binary to /usr/bin for execution - # in command line - echo "--> Removing existing binaries..." - sudo rm -f "/usr/bin/clevo-indicator" + # copy Unlicense license to fakeroot /usr/share/licenses/clevo-indicator-git + echo "--> Installing license to fakeroot \$pkgdir/usr/share/licenses/clevo-indicator-git..." + mkdir -p "$pkgdir/usr/share/licenses/clevo-indicator-git" + cp LICENSE "$pkgdir/usr/share/licenses/clevo-indicator-git" - echo "--> Moving built binary to /usr/bin..." - sudo mv /usr/local/bin/clevo-indicator /usr/bin/ + # stickybit flags (sudo if user runs the command) - required for the tray icon to work - root will be the owner after install, so the stickybit will work + # https://unix.stackexchange.com/questions/79395/how-does-the-sticky-bit-work + chmod u+s $pkgdir/usr/bin/clevo-indicator - echo "--> Installation successful! Run the fan control utility using the command \"clevo-indicator\" as the root user." + # LEGACY - v1 to v2 (do not use package's makefile since it uses sudo!) + # the package's makefile installs to /usr/local/bin, we don't want that + # per the AUR package etiquette, /usr/bin is preferred + # ${DSTDIR}/bin/ in the Makefile -- make install to fakeroot /usr and the file will install to /usr/bin + #make DSTDIR="$pkgdir/usr" install + # change owner since makefile automatically runs as root + #chown $(whoami) $pkgdir/usr/bin/clevo-indicator + #chmod +wx $pkgdir/usr/bin/clevo-indicator + + echo "--> Packaging successful! After install, run the fan control utility using the command \"clevo-indicator\" and a tray icon will appear." } - -# makepkgclean() { -# echo "--> Cleaning up files created by makepkg..." -# makepkg -Code -# echo "--> Removing command-line script/binary from /usr/local/bin directory..." -# cd "/usr/local/bin" -# sudo rm -rf "$pkgname" -#} diff --git a/README.md b/README.md index c9b457567a97..8b27c1f6c146 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,40 @@ # clevo-indicator-git -This is an Arch Linux package forked from SkyLandTW's repository that lets -you control the fan of Clevo laptops using reversed-engineering port -information from ECView. +This is an Arch Linux package forked from taner1's repository that lets you control the fan of Clevo laptops using reversed-engineering port information from ECView. ## Packages Used -libappindicator-gtk3 to display the tray icon (the tray icon doesn't show -up on KDE, tested on Arch Linux) +libappindicator-gtk3 to display the tray icon (works with all systems using GTK3) ## AUR link https://aur.archlinux.org/packages/clevo-indicator-git/ ### Install instructions #### Build and Install from the AUR (Arch Linux) +The instructions for building and installing from the AUR are located here: https://wiki.archlinux.org/index.php/Arch_User_Repository#Installing_packages + +The package is called clevo-indicator-git. You will need the `git` package (sudo pacman -S git) to clone the AUR repository and source repository for installing! + +Basically, run the following commands (as a normal user, not as root): ```shell -sudo pacman -S clevo-indicator-git +mkdir -p ~/Documents/aur +cd ~/Documents/aur +pacman -S --needed base-devel # run if these tools are not installed on your Arch Linux system already +git clone https://aur.archlinux.org/clevo-indicator-git.git +tar -xvf clevo-indicator-git.tar.gz +cd clevo-indicator-git +makepkg -si # or makepkg -s and sudo pacman -U [makepkg output .tar.gz] ``` -This package pulls upstream git commits from the repository https://github.com/SkyLandTW/clevo-indicator. +You can also use pamac, a GUI installer for AUR packages (which is installed by default on some Arch Linux distros, e.g. Antergos and Manjaro). + +This package pulls the files from the latest git commit from the repository https://github.com/taner1/clevo-indicator, runs the makefile, and installs them to /usr/bin/clevo-indicator for use in the command line. **WARNING: THIS METHOD MAY BE UNSTABLE OR BREAK AT ANY TIME** -#### Build and Install from Source (Ubuntu/Arch Linux) +#### Build and Install from Source (Ubuntu/Arch Linux/other distros) ```shell sudo apt-get install libappindicator-gtk3 -git clone git@github.com:SkyLandTW/clevo-indicator.git +git clone git@github.com:taner1/clevo-indicator.git cd clevo-indicator make install ``` diff --git a/clevo-indicator-git.install b/clevo-indicator-git.install deleted file mode 100644 index 2c5d207b5d87..000000000000 --- a/clevo-indicator-git.install +++ /dev/null @@ -1,9 +0,0 @@ -# Maintainer: Tech Guy Software <techguy100official at gmail dot com> - -## arg 1: the old package version -pre_remove() { - echo "-> Removing existing installation from /usr/bin..." - # remove the clevo-indicator-git directory from /usr/bin - sudo rm -f /usr/bin/clevo-indicator - echo "-> Success cleaning up existing install!" -} |