From dcc519928dcad358ca62e4d55236f206e1e9a50c Mon Sep 17 00:00:00 2001
From: Dan Walsh <dwalsh@redhat.com>
Date: Fri, 11 Oct 2013 09:20:12 -0400
Subject: [PATCH 58/74] Mv some of the setup we were doing in the
 policycoreutils.spec file into the main code

Basically add an icon, setup the desktop environment, setup system-config-selinux to run
via pkexec.
---
 policycoreutils/gui/Makefile                      |  16 +++++-
 policycoreutils/gui/selinux-polgengui.8           |  35 +++++++++++
 policycoreutils/gui/selinux-polgengui.desktop     |  67 ++++++++++++++++++++++
 policycoreutils/gui/system-config-selinux         |   3 +
 policycoreutils/gui/system-config-selinux.8       |  37 ++++++++++++
 policycoreutils/gui/system-config-selinux.desktop |  67 ++++++++++++++++++++++
 policycoreutils/gui/system-config-selinux.png     | Bin 0 -> 1447 bytes
 7 files changed, 223 insertions(+), 2 deletions(-)
 create mode 100644 policycoreutils/gui/selinux-polgengui.8
 create mode 100644 policycoreutils/gui/selinux-polgengui.desktop
 create mode 100755 policycoreutils/gui/system-config-selinux
 create mode 100644 policycoreutils/gui/system-config-selinux.8
 create mode 100644 policycoreutils/gui/system-config-selinux.desktop
 create mode 100644 policycoreutils/gui/system-config-selinux.png

diff --git a/policycoreutils/gui/Makefile b/policycoreutils/gui/Makefile
index ea7d7e4..9d9f820 100644
--- a/policycoreutils/gui/Makefile
+++ b/policycoreutils/gui/Makefile
@@ -19,18 +19,30 @@ portsPage.py \
 semanagePage.py \
 statusPage.py \
 system-config-selinux.glade \
+system-config-selinux.png \
 usersPage.py
 
 all: $(TARGETS) system-config-selinux.py polgengui.py
 
 install: all
+	-mkdir -p $(MANDIR)/man8
 	-mkdir -p $(SHAREDIR)
 	-mkdir -p $(BINDIR)
+	-mkdir -p $(DATADIR)/pixmaps
+	-mkdir -p $(DATADIR)/icons/hicolor/24x24/apps
+	-mkdir -p $(SYSCONFDIR)
+	-mkdir -p $(DATADIR)/polkit-1/actions/
 	install -m 755 system-config-selinux.py $(SHAREDIR)
+	install -m 755 system-config-selinux $(BINDIR)
 	install -m 755 polgengui.py $(SHAREDIR)
-	install -m 755 sepolgen $(BINDIR)
 	install -m 644 $(TARGETS) $(SHAREDIR)
-
+	install -m 644 system-config-selinux.8 $(MANDIR)/man8
+	install -m 644 selinux-polgengui.8 $(MANDIR)/man8
+	install -m 644 system-config-selinux.png $(DATADIR)/pixmaps
+	install -m 644 system-config-selinux.png $(DATADIR)/icons/hicolor/24x24/apps
+	install -m 644 system-config-selinux.png $(DATADIR)/system-config-selinux
+	install -m 644 *.desktop $(DATADIR)/system-config-selinux
+	install -m 644 org.selinux.config.policy $(DATADIR)/polkit-1/actions/
 clean:
 
 indent:
diff --git a/policycoreutils/gui/selinux-polgengui.8 b/policycoreutils/gui/selinux-polgengui.8
new file mode 100644
index 0000000..52bf7dd
--- /dev/null
+++ b/policycoreutils/gui/selinux-polgengui.8
@@ -0,0 +1,35 @@
+.TH "selinux-polgengui" "8" "8 April 2013" "System Config Tools Manual" "System Config Tools Manual"
+
+.SH NAME
+selinux\-polgengui \- SELinux Policy Generation Tool
+
+.SH SYNOPSIS
+.B selinux-polgengui
+
+.SH DESCRIPTION
+\fBselinux-polgengui\fP is a graphical tool, which can be used to create a framework for building SELinux Policy.
+.SH OPTIONS
+None
+
+.SH FILES
+\fi/usr/bin/selinux-polgengui\fP
+
+.SH Examples
+To run the program type:
+
+selinux-polgengui
+
+.PP
+.SH "SEE ALSO"
+.TP
+selinux(1), sepolicy(8), sepolicy-generate(8)
+.PP
+
+.SH REPORTING BUGS
+Report bugs to <http://bugzilla.redhat.com>.
+
+.SH LICENSE AND AUTHORS
+\fBselinux-polgengui\fP is licensed under the GNU Public License and
+is copyrighted by Red Hat, Inc.
+.br
+This man page was written by Daniel Walsh <dwalsh@redhat.com>
diff --git a/policycoreutils/gui/selinux-polgengui.desktop b/policycoreutils/gui/selinux-polgengui.desktop
new file mode 100644
index 0000000..0c2f399
--- /dev/null
+++ b/policycoreutils/gui/selinux-polgengui.desktop
@@ -0,0 +1,67 @@
+[Desktop Entry]
+Name=SELinux Policy Generation Tool
+Name[bn_IN]=SELinux Policy নির্মাণের সামগ্রী
+Name[ca]=Eina de generació de polítiques del SELinux
+Name[da]=Regelsætgenereringsværktøj til SELinux
+Name[de]=Tool zur Erstellung von SELinux-Richtlinien
+Name[es]=Generador de Políticas de SELinux
+Name[fi]=SELinux-käytäntöjen generointityökalu
+Name[fr]=Outil de génération de stratégies SELinux
+Name[gu]=SELinux પોલિસી બનાવટ સાધન
+Name[hi]=SELinux पॉलिसी जनन औजार
+Name[it]=Tool di generazione della policy di SELinux
+Name[ja]=SELinux ポリシー生成ツール
+Name[kn]=SELinux ಪಾಲಿಸಿ ಉತ್ಪಾದನಾ ಉಪಕರಣ
+Name[ko]=SELinux 정책 생성 도구
+Name[ml]=SELinux പോളിസി ഉത്പാദന പ്രയോഗം
+Name[mr]=SELinux करार निर्माण साधन
+Name[nl]=SELinux tactiek generatie gereedschap
+Name[or]=SELinux ନୀତି ସୃଷ୍ଟି ଉପକରଣ
+Name[pa]=SELinux ਪਾਲਿਸੀ ਨਿਰਮਾਣ ਜੰਤਰ
+Name[pl]=Narzędzie tworzenia polityki SELinuksa
+Name[pt]=Ferramenta de Geração de Políticas SELinux
+Name[pt_BR]=Ferramenta de criação de políticas do SELinux
+Name[ru]=Средство создания политики SELinux
+Name[sv]=Genereringsverktyg för SELinuxpolicy
+Name[ta]=SELinux பாலிசி உற்பத்தி கருவி
+Name[te]=SELinux నిర్వహణ
+Name[uk]=Утиліта генерації правил SELinux
+Name[zh_CN]=SELinux 策略生成工具
+Name[zh_TW]=SELinux 政策產生工具（SELinux Policy Generation Tool）
+Comment=Generate SELinux policy modules
+Comment[bn_IN]=SELinux নিয়মনীতির মডিউল নির্মাণ করুন
+Comment[ca]=Genera els mòduls de les polítiques de SELinux
+Comment[da]=Generér SELinux-regelsætmodul
+Comment[de]=Tool zur Erstellung von SELinux-Richtlinien
+Comment[es]=Generar módulos de política de SELinux
+Comment[fi]=Generoi SELinuxin käytäntömoduuleja
+Comment[fr]=Génére des modules de stratégie SELinux
+Comment[gu]=SELinux પોલિસી મોડ્યુલોને ઉત્પન્ન કરો
+Comment[hi]=नया पॉलिसी मॉड्यूल उत्पन्न करें
+Comment[it]=Genera moduli della politica di SELinux
+Comment[ja]=新しいポリシーモジュールの作成
+Comment[kn]=SELinux ಪಾಲಿಸಿ ಘಟಕಗಳನ್ನು ಉತ್ಪಾದಿಸು
+Comment[ko]=SELinux 정책 모듈 생성
+Comment[ml]=SELinux യ പോളിസി ഘങ്ങള്‍ തയ്യാറാക്കുക
+Comment[mr]=SELinux करार घटके निर्माण करा
+Comment[nl]=Maak een SELinux tactiek module aan
+Comment[or]=SELinux ନୀତି ଏକକାଂଶ ସୃଷ୍ଟିକରନ୍ତୁ
+Comment[pa]=SELinux ਪਾਲਿਸੀ ਮੈਡਿਊਲ ਬਣਾਓ
+Comment[pl]=Tworzenie nowych modułów polityki SELinuksa
+Comment[pt]=Gerar módulos de políticas SELinux
+Comment[pt_BR]=Gerar módulos de política do SELinux
+Comment[ru]=Генерация модулей политики SELinux
+Comment[sv]=Generera SELinux-policymoduler
+Comment[ta]=SELinux கொள்கை தொகுதியை உருவாக்கவும்
+Comment[te]=SELinux పాలసీ మాడ్యూళ్ళను వుద్భవింపచేయుము
+Comment[uk]=Створення модулів контролю доступу SELinux
+Comment[zh_CN]=生成 SELinux 策略模块
+Comment[zh_TW]=產生 SELinux 政策模組
+StartupNotify=true
+Icon=system-config-selinux
+Exec=/usr/bin/selinux-polgengui
+Type=Application
+Terminal=false
+Categories=System;Security;
+X-Desktop-File-Install-Version=0.2
+Keywords=policy;security;selinux;avc;permission;mac;
diff --git a/policycoreutils/gui/system-config-selinux b/policycoreutils/gui/system-config-selinux
new file mode 100755
index 0000000..5be5ccd
--- /dev/null
+++ b/policycoreutils/gui/system-config-selinux
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec /usr/bin/pkexec /usr/share/system-config-selinux/system-config-selinux.py
diff --git a/policycoreutils/gui/system-config-selinux.8 b/policycoreutils/gui/system-config-selinux.8
new file mode 100644
index 0000000..eca2024
--- /dev/null
+++ b/policycoreutils/gui/system-config-selinux.8
@@ -0,0 +1,37 @@
+.TH "system-config-selinux" "8" "8 April 2013" "System Config Tools Manual" "System Config Tools Manual"
+
+.SH NAME
+system\-config\-selinux \- SELinux Management tool
+
+.SH SYNOPSIS
+.B system-config-selinux
+
+.SH DESCRIPTION
+\fBsystem-config-selinux\fP provides a graphical interface for managing the 
+SELinux configuration.
+
+.SH OPTIONS
+None
+
+.SH FILES
+\fi/usr/bin/system-config-selinux\fP
+
+.SH Examples
+To run the program type:
+
+system-config-selinux
+
+.PP
+.SH "SEE ALSO"
+.TP
+selinux(1), semanage(8)
+.PP
+
+.SH REPORTING BUGS
+Report bugs to <http://bugzilla.redhat.com>.
+
+.SH LICENSE AND AUTHORS
+\fBsystem-config-selinux\fP is licensed under the GNU Public License and
+is copyrighted by Red Hat, Inc.
+.br
+This man page was written by Daniel Walsh <dwalsh@redhat.com>
diff --git a/policycoreutils/gui/system-config-selinux.desktop b/policycoreutils/gui/system-config-selinux.desktop
new file mode 100644
index 0000000..8822ce2
--- /dev/null
+++ b/policycoreutils/gui/system-config-selinux.desktop
@@ -0,0 +1,67 @@
+[Desktop Entry]
+Name=SELinux Management
+Name[bn_IN]=SELinux পরিচালনা
+Name[da]=Håndtering af SELinux
+Name[de]=SELinux-Management
+Name[ca]=Gestió de SELinux
+Name[es]=Administración de SELinux
+Name[fi]=SELinuxin ylläpito
+Name[fr]=Gestion de SELinux
+Name[gu]=SELinux સંચાલન
+Name[hi]=SELinux प्रबंधन
+Name[jp]=SELinux 管理
+Name[it]=Gestione di SELinux
+Name[kn]=SELinux ವ್ಯವಸ್ಥಾಪನೆ
+Name[ko]=SELinux 관리
+Name[ml]=SELinux മാനേജ്മെന്റ്
+Name[mr]=SELinux मॅनेजमेंट
+Name[nl]=SELinux beheer
+Name[or]=SELinux ପରିଚାଳନା
+Name[pa]=SELinux ਮੈਨੇਜਮੈਂਟ
+Name[pl]=Zarządzanie SELinuksem
+Name[pt_BR]=Gerenciamento do SELinux
+Name[pt]=Gestão de SELinux
+Name[ru]=Управление SELinux
+Name[sv]=SELinux-hantering
+Name[ta]=SELinux மேலாண்மை
+Name[te]=SELinux నిర్వహణ
+Name[uk]=Керування SELinux
+Name[zh_CN]=SELinux 管理
+Name[zh_TW]=SELinux 管理
+Comment=Configure SELinux in a graphical setting
+Comment[bn_IN]=গ্রাফিক্যাল পরিবেশে SELinux কনফিগার করুন
+Comment[ca]=Configura SELinuc an mode de preferències gràfiques
+Comment[da]=Konfigurér SELinux i et grafisk miljø
+Comment[de]=SELinux in einer grafischen Einstellung konfigurieren
+Comment[es]=Defina SELinux en una configuración de interfaz gráfica
+Comment[fi]=Tee SELinuxin asetukset graafisesti
+Comment[fr]=Configure SELinux dans un environnement graphique
+Comment[gu]=ગ્રાફિકલ સુયોજનમાં SELinux ને રૂપરેખાંકિત કરો
+Comment[hi]=SELinux को आलेखी सेटिंग में विन्यस्त करें
+Comment[it]=Configura SELinux in una impostazione grafica
+Comment[jp]=グラフィカルな設定画面で SELinux を設定する
+Comment[ko]=SELinux를 그래픽 사용자 인터페이스로 설정
+Comment[kn]=SELinux ಅನ್ನು ಒಂದು ಚಿತ್ರಾತ್ಮಕ ಸಿದ್ದತೆಯಲ್ಲಿ ಸಂರಚಿಸಿ
+Comment[ml]=ഒരു ഗ്രാഫിക്കല്‍ സജ്ജീകരണത്തില്‍ SELinux ക്രമീകരിയ്ക്കുക
+Comment[mr]=ग्राफिकल सेटिंगमध्ये SELinux संरचीत करा
+Comment[nl]=Configureer SELinux in een grafische omgeving
+Comment[or]=SELinux କୁ ଆଲେଖିକ ସଂରଚନାରେ ବିନ୍ୟାସ କରନ୍ତୁ
+Comment[pa]=SELinux ਨੂੰ ਗਰਾਫੀਕਲ ਸੈਟਿੰਗ ਵਿੱਚ ਸੰਰਚਿਤ ਕਰੋ
+Comment[pl]=Konfiguracja SELinuksa w trybie graficznym
+Comment[pt]=Configurar o SELinux num ambiente gráfico
+Comment[pt_BR]=Configure o SELinux em uma configuração gráfica
+Comment[ru]=Настройка SELinux в графическом режиме
+Comment[sv]=Konfigurera SELinux i en grafisk miljö
+Comment[ta]=SELinuxஐ ஒரு வரைகலை அமைவில் கட்டமைக்கவும்
+Comment[te]=SELinuxను గ్రాఫికల్ అమర్పునందు ఆకృతీకరించుము
+Comment[uk]=Засіб для налаштування SELinux з графічним інтерфейсом
+Comment[zh_CN]=在图形设置中配置 SELinux
+Comment[zh_TW]=在圖形話設定中配置 SELinux
+StartupNotify=true
+Icon=system-config-selinux
+Exec=/usr/bin/system-config-selinux
+Type=Application
+Terminal=false
+Categories=System;Security;
+X-Desktop-File-Install-Version=0.2
+Keywords=policy;security;selinux;avc;permission;mac;
diff --git a/policycoreutils/gui/system-config-selinux.png b/policycoreutils/gui/system-config-selinux.png
new file mode 100644
index 0000000000000000000000000000000000000000..68ffcb77bd9f8cd01043f566e539ce2f8c4820f6
GIT binary patch
-- 
1.8.3.1

