summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorElrondo462017-11-15 14:00:13 +0100
committerElrondo462017-11-15 14:00:13 +0100
commit2a9c9a1ac2287e796d73fcefbaa5113267c6ab76 (patch)
tree76f8cf5df4d897abf5d089091c67167e3be5ee3b
downloadaur-2a9c9a1ac2287e796d73fcefbaa5113267c6ab76.tar.gz
First Version
-rw-r--r--.SRCINFO18
-rw-r--r--PKGBUILD23
-rw-r--r--amar.desktop12
-rw-r--r--amar.pngbin0 -> 888 bytes
-rw-r--r--amar.py122
5 files changed, 175 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..29db2c63b949
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,18 @@
+pkgbase = amar-installer
+ pkgdesc = Install AMAR repository
+ pkgver = 1.0
+ pkgrel = 1
+ url = https://www.tuxnvape.fr/
+ arch = x86_64
+ license = GPL3
+ depends = tk
+ depends = python-pillow
+ source = amar.py
+ source = amar.png
+ source = amar.desktop
+ sha256sums = 2032a352c85fc9945bc0b3cb7fd5cde97b7eeb239cc2235e8fa3585029fe2af0
+ sha256sums = 874700067f446dff59f8e4e6c3b14519ca8afdf31742af629343c80002c71376
+ sha256sums = 0f2f75e7aaf1375b14570067563330f438e2a20158642b76c16a4ff4a8bb3158
+
+pkgname = amar-installer
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..780a70fd503d
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,23 @@
+# Maintainer: Elrondo46 TuxnVape <elrond94@hotmail.com>
+
+pkgname=amar-installer
+pkgver=1.0
+pkgrel=1
+pkgdesc="Install AMAR repository"
+arch=('x86_64')
+license=('GPL3')
+url="https://www.tuxnvape.fr/"
+depends=('tk' 'python-pillow')
+source=("amar.py"
+ "amar.png"
+ "amar.desktop")
+sha256sums=('2032a352c85fc9945bc0b3cb7fd5cde97b7eeb239cc2235e8fa3585029fe2af0'
+ '874700067f446dff59f8e4e6c3b14519ca8afdf31742af629343c80002c71376'
+ '0f2f75e7aaf1375b14570067563330f438e2a20158642b76c16a4ff4a8bb3158')
+
+package() {
+ install -Dm644 "amar.desktop" "${pkgdir}/usr/share/applications/amar.desktop"
+ install -Dm644 "amar.py" "${pkgdir}/usr/bin/amar.py"
+ install -Dm644 "amar.png" "${pkgdir}/usr/share/icons/amar.png"
+}
+
diff --git a/amar.desktop b/amar.desktop
new file mode 100644
index 000000000000..f630754bb45b
--- /dev/null
+++ b/amar.desktop
@@ -0,0 +1,12 @@
+[Desktop Entry]
+Version=1.0
+Name=Amar Installer
+Type=Application
+Comment=Install AMAR
+Terminal=false
+Exec=python /usr/bin/amar.py
+Icon=amar
+StartupNotify=true
+Categories=System;
+GenericName=Amar Installer
+Keywords=amar
diff --git a/amar.png b/amar.png
new file mode 100644
index 000000000000..02f24fb0ec02
--- /dev/null
+++ b/amar.png
Binary files differ
diff --git a/amar.py b/amar.py
new file mode 100644
index 000000000000..e13d5e20fe4e
--- /dev/null
+++ b/amar.py
@@ -0,0 +1,122 @@
+#!usr/bin/env/ python
+# coding: utf-8
+"""
+Projet AMAR
+Remerciements : Baba, Fredo, Rhylx, Francky, hRF...
+Date : 14 Oct 2K17
+version : b2
+gksudo -s python amar.py
+"""
+
+import os
+import sys
+from PIL import Image #importation des modules nécessaires
+import subprocess
+from tkinter import *
+
+if sys.version_info[0] == 3:
+ from tkinter import messagebox
+else:
+ import tkMessageBox as messagebox
+
+if os.getuid() != 0:
+ os.system ("gksudo python /usr/bin/amar.py")
+ #print("Utiliser le script en tant qu'administrateur, lancer le avec 'gksudo -s python amar.py'")
+ sys.exit(1)
+
+pacmanfichier = "/etc/pacman.conf"
+
+try:
+ with open(pacmanfichier, 'r') as searchfile:
+ for line in searchfile:
+ if 'amar' in line:
+ etatamar = 1
+ searchfile.close()
+except OSError:
+ print("pacman.conf non acessible, donnez le chemin vers votre fichier")
+ sys.exit(1)
+
+configamar = "\n#Do not disable AMAR manually if you use the app\n[AMAR]\nSigLevel = Never\nServer = https://amar.lagout.org/x86_64/\n"
+etatamar = 0
+
+
+def pressA():
+ A.config(state=DISABLED)
+ B.config(state=ACTIVE)
+ try:
+ with open(pacmanfichier, "a") as ecrire:
+ ecrire.write(configamar)
+ ecrire.close()
+ os.system("sudo pacman -Syy")
+ INFO.config(text="Actif", fg="green") # on active le depot AMAR, donc on ecrit sur le fichier.
+ etatamar = 1
+ ecrire.close()
+ except OSError:
+ messagebox.showerror("Erreur", "Ficher pacman.conf non accessible en écrture\nVérifier vos droit et relancer"
+ " le script\nVérifier aussi que vous ne faite une mise à jours en même temps")
+
+
+def pressB():
+ A.config(state=ACTIVE)
+ B.config(state=DISABLED)
+ try:
+ with open((pacmanfichier), "r") as f:
+ lines = f.readlines()
+ lines.remove("#Do not disable AMAR manually if you use the app\n")
+ lines.remove("[AMAR]\n")
+ lines.remove("SigLevel = Never\n")
+ lines.remove("Server = https://amar.lagout.org/x86_64/\n")
+ with open((pacmanfichier), "w") as new_f:
+ for line in lines:
+ new_f.write(line)
+ os.system ("sudo pacman -Syy")
+ INFO.config(text="Inactif", fg="red") # on active le depot AMAR, donc on ecrit sur le fichier.
+ etatamar = 0
+ f.close()
+ new_f.close()
+ except OSError:
+ messagebox.showerror("Erreur", "Ficher pacman.conf non accessible en écrture\nVérifier vos droit et relancer"
+ " le script\nVérifier aussi que vous ne faite une mise à jours en même temps")
+
+
+win = Tk()
+win.title("TNV A.M.A.R - Configuration")
+win.geometry("620x280")
+tux = PhotoImage(file="/usr/share/icons/amar.png") # lien vers l'icone de la fenetre
+win.tk.call('wm', 'iconphoto', win._w, tux) # application de la fenetre
+
+TEXTE = Label(win, text='TNV AMAR', fg="blue")
+TEXTE2 = Label(win, text="Le dépôt AMAR (Arch/Manjaro Alternate Repository) est un dépôt tiers donnant\n"
+ "accès à des logiciels supplémentaires non-accessibles via les dépôts officiels."
+ "\n\nCe dépôt a été créé afin de pouvoir donner accès simplement à des logiciels dont"
+ " l'installation\nvia AUR est problématique ou des logiciels qui ne concernent que"
+ " Manjaro\net qui sont expulsés d'AUR pour cette raison.", fg="purple")
+TEXTE.pack(side=TOP, padx=5, pady=3) # Titre de l'application de texte
+TEXTE2.pack(side=TOP, padx=5, pady=10) # Titre de l'application de texte
+
+A = Button(win, text='ACTIVER', height=2, width=30, command=pressA)
+B = Button(win, text='DESACTIVER', height=2, width=30, command=pressB)
+
+INFO = Label(win, text='', fg="black") # Informations qui changent en fonction du bouton appuyé par l'utilisateur
+MESSAGE = Label(win, text='ETAT DU DEPÔT', fg="blue")
+
+INFO.pack(side=BOTTOM) # on ferme les boutons en décidant de leur amplacement
+MESSAGE.pack(side=BOTTOM)
+
+if etatamar:
+ A.pack()
+ A.config(state=DISABLED)
+ B.pack()
+ B.config(state=ACTIVE)
+else:
+ A.pack()
+ A.config(state=ACTIVE)
+ B.pack()
+ B.config(state=DISABLED)
+
+if etatamar == 0:
+ INFO.config(text="Inactif", fg="red") # on active le depot AMAR, donc on ecrit sur le fichier.
+else:
+ INFO.config(text="Actif", fg="green") # on active le depot AMAR, donc on ecrit sur le fichier.
+
+win.mainloop()