You are not logged in.
Hello everyone,
today I made and submitted my first AUR package (https://aur.archlinux.org/packages/rpiplay-git/).
Unfortunately I couldn't find a way to add some informative console output, after the installation of the package has finished.
After installing the package with pacman in the terminal (with an aur-wrapper), I want to show the user some messages, that explain to them that they have to start the avahi system service and how to do that. Otherwise the program will not work correctly.
Does anyone have an idea or a link where this concept is explained? I already looked into pacman post_install (https://wiki.archlinux.org/index.php/PKGBUILD#install), but this looks more like a script for handling actual installation details and not for printing information.
Thank you for your help
!
Last edited by potatocup (2020-12-30 16:32:54)
Offline
post_install is the place to do it, echo what you want to convey there.
Offline
Perfect... after searching around so long, I find the answer myself 5 minutes after posting here... Sorry!
I found a package that also has this behavior (https://aur.archlinux.org/packages/flutter/), downloaded the files with pacman -G flutter and looked at their flutter.install file. There they do exactly what I was looking for; print informative messages to the user after install and upgrade.
The link to the Arch Wiki I posted before (https://wiki.archlinux.org/index.php/PKGBUILD#install) explains how to bind the script to your AUR package.
For anyone interested, this is how their script looks:
0 post_install() {
1 groupadd -f flutterusers
2 chgrp -R flutterusers /opt/flutter
3 chmod -R g+w /opt/flutter
4 printf "$(tput setaf 4)Flutter was installed on $(tput setaf 2)/opt/flutter$(tput sgr0)\n"
5 printf "$(tput setaf 4)$(tput sgr0)\n"
6 printf "$(tput setaf 4)If you intend to use it as a regular user, add your user into the group flutterusers:$(tput sgr0)\n"
7 printf "$(tput setaf 2)gpasswd -a <user> flutterusers$(tput sgr0)\n"
8 printf "$(tput setaf 4)$(tput sgr0)\n"
9 printf "$(tput setaf 4)You need to source $(tput setaf 2)/etc/profile$(tput setaf 4) or relogin to add flutter to your path.$(tput sgr0)\n"
10 printf "$(tput setaf 4)$(tput sgr0)\n"
11 printf "$(tput setaf 4)Re-login your terminal in to the group flutterusers:$(tput sgr0)\n"
12 printf "$(tput setaf 2)newgrp flutterusers$(tput sgr0)\n"
13 }
14
15 post_upgrade() {
16 post_install
17 }
18
19 post_remove() {
20 groupdel flutterusers
21 printf "$(tput setaf 4)If you had added/modified files or permissions in folder /opt/flutter is possible you need to delete it manually.$(tput sgr0)\n"
22 printf "$(tput setaf 2)rm -rf /opt/flutter$(tput sgr0)\n"
23 }Sorry for this meaningless post. Cheers
!
Offline
Yes, thank you @V1del!
Offline
Good to hear, please mark as [SOLVED] by editing the title in the first post.
Offline
@potatocup: there is also the Creating & Modifying Packages forum, where you can ask for tips or a review on your PKGBUILD by experienced Arch packagers.
Offline
Thank you @twelveeighty, I will check that out!
Offline