This commit is contained in:
Евгений Храмов 2023-04-13 13:56:11 +03:00
parent aed4e4b334
commit 146def9fbc
9 changed files with 124 additions and 134 deletions

@ -21,19 +21,18 @@ version() {
} }
scripts=( scripts=(
['postinstall']='postinstall.sh' ['postinstall']='postinstall.sh'
['postremove']='postremove.sh' ['postremove']='postremove.sh'
) )
prepare() { prepare() {
cd "$srcdir/hln-a" cd "$srcdir/hln-a"
pip3 install --upgrade --user click colorama click_completion pyTelegramBotAPI discord pip3 install --upgrade --user click colorama click_completion pyTelegramBotAPI discord
pip3 install --upgrade rcon pip3 install --upgrade rcon
} }
package() { package() {
install -Dm755 "${srcdir}/hln-a/hlna.py" "${pkgdir}/usr/bin/hlna.py" install -Dm755 "${srcdir}/hln-a/hlna.py" "${pkgdir}/usr/bin/hlna.py"
install -Dm755 "${srcdir}/hln-a/hlna_bot.py" "${pkgdir}/usr/bin/hlna-bot.py" install -Dm755 "${srcdir}/hln-a/hlna_bot.py" "${pkgdir}/usr/bin/hlna-bot.py"
install -Dm644 "${srcdir}/hln-a/LICENSE.md" "${pkgdir}/usr/share/licenses/hlna/license" install -Dm644 "${srcdir}/hln-a/LICENSE.md" "${pkgdir}/usr/share/licenses/hlna/license"
} }

@ -1,28 +1,27 @@
line1_to_add='alias hlna="hlna.py"' line1_to_add='alias hlna="hlna.py"'
line2_to_add='alias hlna-bot="hlna-bot.py"' line2_to_add='alias hlna-bot="hlna-bot.py"'
file_paths=( "/home/$SUDO_USER/.zshrc" "/home/$SUDO_USER/.bashrc" "/home/$SUDO_USER/.config/fish/config.fish" ) file_paths=("/home/$SUDO_USER/.zshrc" "/home/$SUDO_USER/.bashrc" "/home/$SUDO_USER/.config/fish/config.fish")
for file_path in "${file_paths[@]}" for file_path in "${file_paths[@]}"; do
do if [ -f "$file_path" ]; then
if [ -f "$file_path" ]; then # Check if the lines are already in the file
# Check if the lines are already in the file grep -qF "$line1_to_add" "$file_path"
grep -qF "$line1_to_add" "$file_path" if [ $? -ne 0 ]; then
if [ $? -ne 0 ]; then echo "$line1_to_add" >>"$file_path"
echo "$line1_to_add" >> "$file_path" echo "Alias hlna добавлен в $file_path"
echo "Alias hlna добавлен в $file_path" else
else echo "Alias hlna уже есть в файле $file_path"
echo "Alias hlna уже есть в файле $file_path" fi
fi
grep -qF "$line2_to_add" "$file_path" grep -qF "$line2_to_add" "$file_path"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "$line2_to_add" >> "$file_path" echo "$line2_to_add" >>"$file_path"
echo "Alias hlna-bot добавлен в $file_path" echo "Alias hlna-bot добавлен в $file_path"
else else
echo "Alias hlna-bot уже есть в файле $file_path" echo "Alias hlna-bot уже есть в файле $file_path"
fi fi
else else
echo "$file_path не существует" echo "$file_path не существует"
fi fi
done done

@ -1,27 +1,26 @@
line1_to_remove='alias hlna="hlna.py"' line1_to_remove='alias hlna="hlna.py"'
line2_to_remove='alias hlna-bot="hlna-bot.py"' line2_to_remove='alias hlna-bot="hlna-bot.py"'
file_paths=( "/home/$SUDO_USER/.zshrc" "/home/$SUDO_USER/.bashrc" "/home/$SUDO_USER/.config/fish/config.fish" ) file_paths=("/home/$SUDO_USER/.zshrc" "/home/$SUDO_USER/.bashrc" "/home/$SUDO_USER/.config/fish/config.fish")
for file_path in "${file_paths[@]}" for file_path in "${file_paths[@]}"; do
do if [ -f "$file_path" ]; then
if [ -f "$file_path" ]; then # Check if the line is in the file
# Check if the line is in the file grep -qF "$line1_to_remove" "$file_path"
grep -qF "$line1_to_remove" "$file_path" if [ $? -eq 0 ]; then
if [ $? -eq 0 ]; then sed -i "/$line1_to_remove/d" "$file_path"
sed -i "/$line1_to_remove/d" "$file_path" echo "Alias hlna удалён из $file_path"
echo "Alias hlna удалён из $file_path" else
else echo "Alias hlna нет в $file_path"
echo "Alias hlna нет в $file_path" fi
fi
grep -qF "$line2_to_remove" "$file_path" grep -qF "$line2_to_remove" "$file_path"
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
sed -i "/$line2_to_remove/d" "$file_path" sed -i "/$line2_to_remove/d" "$file_path"
echo "Alias hlna-bot удалён из $file_path" echo "Alias hlna-bot удалён из $file_path"
else else
echo "Alias hlna-bot нет в $file_path" echo "Alias hlna-bot нет в $file_path"
fi fi
else else
echo "$file_path не существует" echo "$file_path не существует"
fi fi
done done

@ -1,4 +1,3 @@
name='hlna-git' name='hlna-git'
version='latest' version='latest'
release='1' release='1'
@ -22,18 +21,17 @@ version() {
} }
scripts=( scripts=(
['postinstall']='postinstall.sh' ['postinstall']='postinstall.sh'
['postremove']='postremove.sh' ['postremove']='postremove.sh'
) )
prepare() { prepare() {
pip3 install --upgrade --user click colorama click_completion pyTelegramBotAPI discord pip3 install --upgrade --user click colorama click_completion pyTelegramBotAPI discord
pip3 install --upgrade rcon pip3 install --upgrade rcon
} }
package() { package() {
install -Dm755 "${srcdir}/hln-a/hlna.py" "${pkgdir}/usr/bin/hlna.py" install -Dm755 "${srcdir}/hln-a/hlna.py" "${pkgdir}/usr/bin/hlna.py"
install -Dm755 "${srcdir}/hln-a/hlna_bot.py" "${pkgdir}/usr/bin/hlna-bot.py" install -Dm755 "${srcdir}/hln-a/hlna_bot.py" "${pkgdir}/usr/bin/hlna-bot.py"
install -Dm644 "${srcdir}/hln-a/LICENSE.md" "${pkgdir}/usr/share/licenses/hlna/license" install -Dm644 "${srcdir}/hln-a/LICENSE.md" "${pkgdir}/usr/share/licenses/hlna/license"
} }

@ -1,28 +1,27 @@
line1_to_add='alias hlna="hlna.py"' line1_to_add='alias hlna="hlna.py"'
line2_to_add='alias hlna-bot="hlna-bot.py"' line2_to_add='alias hlna-bot="hlna-bot.py"'
file_paths=( "/home/$SUDO_USER/.zshrc" "/home/$SUDO_USER/.bashrc" "/home/$SUDO_USER/.config/fish/config.fish" ) file_paths=("/home/$SUDO_USER/.zshrc" "/home/$SUDO_USER/.bashrc" "/home/$SUDO_USER/.config/fish/config.fish")
for file_path in "${file_paths[@]}" for file_path in "${file_paths[@]}"; do
do if [ -f "$file_path" ]; then
if [ -f "$file_path" ]; then # Check if the lines are already in the file
# Check if the lines are already in the file grep -qF "$line1_to_add" "$file_path"
grep -qF "$line1_to_add" "$file_path" if [ $? -ne 0 ]; then
if [ $? -ne 0 ]; then echo "$line1_to_add" >>"$file_path"
echo "$line1_to_add" >> "$file_path" echo "Alias hlna добавлен в $file_path"
echo "Alias hlna добавлен в $file_path" else
else echo "Alias hlna уже есть в файле $file_path"
echo "Alias hlna уже есть в файле $file_path" fi
fi
grep -qF "$line2_to_add" "$file_path" grep -qF "$line2_to_add" "$file_path"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "$line2_to_add" >> "$file_path" echo "$line2_to_add" >>"$file_path"
echo "Alias hlna-bot добавлен в $file_path" echo "Alias hlna-bot добавлен в $file_path"
else else
echo "Alias hlna-bot уже есть в файле $file_path" echo "Alias hlna-bot уже есть в файле $file_path"
fi fi
else else
echo "$file_path не существует" echo "$file_path не существует"
fi fi
done done

@ -1,27 +1,26 @@
line1_to_remove='alias hlna="hlna.py"' line1_to_remove='alias hlna="hlna.py"'
line2_to_remove='alias hlna-bot="hlna-bot.py"' line2_to_remove='alias hlna-bot="hlna-bot.py"'
file_paths=( "/home/$SUDO_USER/.zshrc" "/home/$SUDO_USER/.bashrc" "/home/$SUDO_USER/.config/fish/config.fish" ) file_paths=("/home/$SUDO_USER/.zshrc" "/home/$SUDO_USER/.bashrc" "/home/$SUDO_USER/.config/fish/config.fish")
for file_path in "${file_paths[@]}" for file_path in "${file_paths[@]}"; do
do if [ -f "$file_path" ]; then
if [ -f "$file_path" ]; then # Check if the line is in the file
# Check if the line is in the file grep -qF "$line1_to_remove" "$file_path"
grep -qF "$line1_to_remove" "$file_path" if [ $? -eq 0 ]; then
if [ $? -eq 0 ]; then sed -i "/$line1_to_remove/d" "$file_path"
sed -i "/$line1_to_remove/d" "$file_path" echo "Alias hlna удалён из $file_path"
echo "Alias hlna удалён из $file_path" else
else echo "Alias hlna нет в $file_path"
echo "Alias hlna нет в $file_path" fi
fi
grep -qF "$line2_to_remove" "$file_path" grep -qF "$line2_to_remove" "$file_path"
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
sed -i "/$line2_to_remove/d" "$file_path" sed -i "/$line2_to_remove/d" "$file_path"
echo "Alias hlna-bot удалён из $file_path" echo "Alias hlna-bot удалён из $file_path"
else else
echo "Alias hlna-bot нет в $file_path" echo "Alias hlna-bot нет в $file_path"
fi fi
else else
echo "$file_path не существует" echo "$file_path не существует"
fi fi
done done

@ -13,11 +13,11 @@ sources=("https://github.com/logseq/logseq/releases/download/${version}/logseq-l
checksums=('SKIP') checksums=('SKIP')
package() { package() {
cd "${srcdir}/Logseq-linux-x64" cd "${srcdir}/Logseq-linux-x64"
install -Dm644 "${scriptdir}/logseq-desktop.desktop" "${pkgdir}/usr/share/applications/logseq-desktop.desktop" install -Dm644 "${scriptdir}/logseq-desktop.desktop" "${pkgdir}/usr/share/applications/logseq-desktop.desktop"
install -Dm644 "${srcdir}/Logseq-linux-x64/resources/app/icons/logseq.png" "${pkgdir}/usr/share/pixmaps/logseq.png" install -Dm644 "${srcdir}/Logseq-linux-x64/resources/app/icons/logseq.png" "${pkgdir}/usr/share/pixmaps/logseq.png"
install -d ${pkgdir}/opt/logseq install -d ${pkgdir}/opt/logseq
cp -r "${srcdir}/Logseq-linux-x64" "${pkgdir}/opt/logseq" cp -r "${srcdir}/Logseq-linux-x64" "${pkgdir}/opt/logseq"
install -d "${pkgdir}/usr/bin" install -d "${pkgdir}/usr/bin"
ln -s "/opt/logseq/Logseq-linux-x64/Logseq" "${pkgdir}/usr/bin/logseq" ln -s "/opt/logseq/Logseq-linux-x64/Logseq" "${pkgdir}/usr/bin/logseq"
} }

@ -12,8 +12,7 @@ deps_amd64=('libgcc(x86-32)')
deps_amd64_arch=('lib32-gcc-libs') deps_amd64_arch=('lib32-gcc-libs')
deps_amd64_rosa=('lib64gcc1') deps_amd64_rosa=('lib64gcc1')
sources=("https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz")
sources=("https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz")
checksums=('SKIP') checksums=('SKIP')
prepare() { prepare() {
@ -23,8 +22,8 @@ prepare() {
package() { package() {
install -Dm755 "${scriptdir}/steamcmd" "${pkgdir}/usr/bin/steamcmd" install -Dm755 "${scriptdir}/steamcmd" "${pkgdir}/usr/bin/steamcmd"
install -Dm755 "${srcdir}/steamcmd.sh" "${pkgdir}/usr/share/steamcmd/steamcmd.sh" install -Dm755 "${srcdir}/steamcmd.sh" "${pkgdir}/usr/share/steamcmd/steamcmd.sh"
install -Dm755 "${srcdir}/linux32/crashhandler.so" "${pkgdir}/usr/share/steamcmd/linux32/crashhandler.so" install -Dm755 "${srcdir}/linux32/crashhandler.so" "${pkgdir}/usr/share/steamcmd/linux32/crashhandler.so"
install -Dm755 "${srcdir}/linux32/libstdc++.so.6" "${pkgdir}/usr/share/steamcmd/linux32/libstdc++.so.6" install -Dm755 "${srcdir}/linux32/libstdc++.so.6" "${pkgdir}/usr/share/steamcmd/linux32/libstdc++.so.6"
install -Dm755 "${srcdir}/linux32/steamcmd" "${pkgdir}/usr/share/steamcmd/linux32/steamcmd" install -Dm755 "${srcdir}/linux32/steamcmd" "${pkgdir}/usr/share/steamcmd/linux32/steamcmd"
install -Dm755 "${srcdir}/linux32/steamerrorreporter" "${pkgdir}/usr/share/steamcmd/linux32/steamerrorreporter" install -Dm755 "${srcdir}/linux32/steamerrorreporter" "${pkgdir}/usr/share/steamcmd/linux32/steamerrorreporter"
} }

@ -4,21 +4,19 @@
# create a fake Steam installation to avoid # create a fake Steam installation to avoid
# that steamcmd uses "/home/$user/Steam" instead # that steamcmd uses "/home/$user/Steam" instead
if [ ! -e ~/.steam ] if [ ! -e ~/.steam ]; then
then mkdir -p ~/.steam/appcache/
mkdir -p ~/.steam/appcache/ mkdir -p ~/.steam/config/
mkdir -p ~/.steam/config/ mkdir -p ~/.steam/logs/
mkdir -p ~/.steam/logs/ mkdir -p ~/.steam/SteamApps/common/
mkdir -p ~/.steam/SteamApps/common/ ln -s ~/.steam ~/.steam/root
ln -s ~/.steam ~/.steam/root ln -s ~/.steam ~/.steam/steam
ln -s ~/.steam ~/.steam/steam
fi fi
if [ ! -e ~/.steam/steamcmd ] if [ ! -e ~/.steam/steamcmd ]; then
then mkdir -p ~/.steam/steamcmd/linux32
mkdir -p ~/.steam/steamcmd/linux32 # steamcmd will replace these files with newer ones itself on first run
# steamcmd will replace these files with newer ones itself on first run cp /usr/share/steamcmd/steamcmd.sh ~/.steam/steamcmd/steamcmd.sh
cp /usr/share/steamcmd/steamcmd.sh ~/.steam/steamcmd/steamcmd.sh cp /usr/share/steamcmd/linux32/steamcmd ~/.steam/steamcmd/linux32/steamcmd
cp /usr/share/steamcmd/linux32/steamcmd ~/.steam/steamcmd/linux32/steamcmd
fi fi
exec ~/.steam/steamcmd/steamcmd.sh $@ exec ~/.steam/steamcmd/steamcmd.sh $@