Gentoo Archives: gentoo-commits

From: Jason Zaman <perfinion@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/mcstrans/, sys-apps/mcstrans/files/
Date: Wed, 26 Apr 2017 18:15:03
Message-Id: 1493230454.24edb9749c6742ef94607ec7d0df94d7d740549d.perfinion@gentoo
1 commit: 24edb9749c6742ef94607ec7d0df94d7d740549d
2 Author: Jason Zaman <perfinion <AT> gentoo <DOT> org>
3 AuthorDate: Wed Apr 26 18:02:52 2017 +0000
4 Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org>
5 CommitDate: Wed Apr 26 18:14:14 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=24edb974
7
8 sys-apps/mcstrans: New Package split from policycoreutils
9
10 Package-Manager: Portage-2.3.3, Repoman-2.3.1
11
12 sys-apps/mcstrans/files/mcstransd.init | 31 ++++++++++++++++++
13 sys-apps/mcstrans/mcstrans-9999.ebuild | 57 ++++++++++++++++++++++++++++++++++
14 sys-apps/mcstrans/metadata.xml | 14 +++++++++
15 3 files changed, 102 insertions(+)
16
17 diff --git a/sys-apps/mcstrans/files/mcstransd.init b/sys-apps/mcstrans/files/mcstransd.init
18 new file mode 100755
19 index 00000000000..7c90e771b38
20 --- /dev/null
21 +++ b/sys-apps/mcstrans/files/mcstransd.init
22 @@ -0,0 +1,31 @@
23 +#!/sbin/openrc-run
24 +# Copyright 2006-2017 Gentoo Foundation
25 +# Distributed under the terms of the GNU General Public License v2
26 +
27 +is_selinux_enabled() {
28 + local SE_ENABL="/usr/sbin/selinuxenabled"
29 +
30 + if [ -x "$SE_ENABL" ]; then
31 + $SE_ENABL && return 0 || return 1
32 + else
33 + ewarn "mcstransd: Unable to determine SELinux status"
34 + return 1
35 + fi
36 +}
37 +
38 +start() {
39 + if is_selinux_enabled; then
40 + ebegin "Starting mcstransd"
41 + checkpath -q -d -m 0755 /run/setrans
42 + start-stop-daemon --start --quiet --exec /sbin/mcstransd
43 + eend $?
44 + fi
45 +}
46 +
47 +stop() {
48 + if is_selinux_enabled; then
49 + ebegin "Stopping mcstransd"
50 + start-stop-daemon --stop --quiet --name mcstransd
51 + eend $?
52 + fi
53 +}
54
55 diff --git a/sys-apps/mcstrans/mcstrans-9999.ebuild b/sys-apps/mcstrans/mcstrans-9999.ebuild
56 new file mode 100644
57 index 00000000000..edb29454163
58 --- /dev/null
59 +++ b/sys-apps/mcstrans/mcstrans-9999.ebuild
60 @@ -0,0 +1,57 @@
61 +# Copyright 1999-2017 Gentoo Foundation
62 +# Distributed under the terms of the GNU General Public License v2
63 +
64 +EAPI="6"
65 +
66 +inherit toolchain-funcs
67 +
68 +MY_RELEASEDATE="20161014"
69 +
70 +MY_P="${P//_/-}"
71 +IUSE=""
72 +
73 +if [[ ${PV} == *9999 ]] ; then
74 + inherit git-r3
75 + EGIT_REPO_URI="https://github.com/SELinuxProject/selinux.git"
76 + S="${WORKDIR}/${MY_P}/${PN}"
77 +else
78 + SRC_URI="https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/${MY_RELEASEDATE}/${MY_P}.tar.gz"
79 + KEYWORDS="~amd64 ~arm ~arm64 ~mips ~x86"
80 + S="${WORKDIR}/${MY_P}"
81 +fi
82 +
83 +DESCRIPTION="SELinux context translation to human readable names"
84 +HOMEPAGE="https://github.com/SELinuxProject/selinux/wiki"
85 +
86 +LICENSE="GPL-2"
87 +SLOT="0"
88 +
89 +DEPEND=">=sys-libs/libsepol-${PV}:=
90 + >=sys-libs/libselinux-${PV}:=
91 + dev-libs/libpcre:=
92 + >=sys-libs/libcap-1.10-r10:="
93 +
94 +RDEPEND="${DEPEND}
95 + !<sys-apps/policycoreutils-2.7_pre"
96 +
97 +src_prepare() {
98 + default
99 +
100 + sed -i 's/-Werror//g' "${S}"/*/Makefile || die "Failed to remove Werror"
101 +}
102 +
103 +src_compile() {
104 + emake \
105 + CC="$(tc-getCC)" \
106 + LIBDIR="\$(PREFIX)/$(get_libdir)"
107 +}
108 +
109 +src_install() {
110 + emake DESTDIR="${D}" \
111 + LIBDIR="\$(PREFIX)/$(get_libdir)" \
112 + install
113 +
114 + rm -rf "${D}/etc/rc.d" || die
115 +
116 + newinitd "${FILESDIR}/mcstransd.init" mcstransd
117 +}
118
119 diff --git a/sys-apps/mcstrans/metadata.xml b/sys-apps/mcstrans/metadata.xml
120 new file mode 100644
121 index 00000000000..4236a792e95
122 --- /dev/null
123 +++ b/sys-apps/mcstrans/metadata.xml
124 @@ -0,0 +1,14 @@
125 +<?xml version="1.0" encoding="UTF-8"?>
126 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
127 +<pkgmetadata>
128 + <maintainer type="project">
129 + <email>selinux@g.o</email>
130 + <name>SELinux Team</name>
131 + </maintainer>
132 + <longdescription>
133 + MCS translation daemon translates SELinux contexts to human readable format
134 + </longdescription>
135 + <upstream>
136 + <remote-id type="github">SELinuxProject/selinux</remote-id>
137 + </upstream>
138 +</pkgmetadata>