Gentoo Archives: gentoo-commits

From: Joonas Niilola <juippis@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-dialup/mgetty/
Date: Thu, 01 Aug 2019 06:07:46
Message-Id: 1564639635.032f54df1ef7a27bb5e86e823c65c8bf68b3f789.juippis@gentoo
1 commit: 032f54df1ef7a27bb5e86e823c65c8bf68b3f789
2 Author: Alexander Tsoy <alexander <AT> tsoy <DOT> me>
3 AuthorDate: Wed Jul 31 22:01:02 2019 +0000
4 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
5 CommitDate: Thu Aug 1 06:07:15 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=032f54df
7
8 net-dialup/mgetty: add support for /usr merge
9
10 Closes: https://bugs.gentoo.org/690362
11 Package-Manager: Portage-2.3.66, Repoman-2.3.11
12 Signed-off-by: Alexander Tsoy <alexander <AT> tsoy.me>
13 Closes: https://github.com/gentoo/gentoo/pull/12493
14 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
15
16 net-dialup/mgetty/mgetty-1.2.1-r1.ebuild | 178 +++++++++++++++++++++++++++++++
17 1 file changed, 178 insertions(+)
18
19 diff --git a/net-dialup/mgetty/mgetty-1.2.1-r1.ebuild b/net-dialup/mgetty/mgetty-1.2.1-r1.ebuild
20 new file mode 100644
21 index 00000000000..a188806c1cf
22 --- /dev/null
23 +++ b/net-dialup/mgetty/mgetty-1.2.1-r1.ebuild
24 @@ -0,0 +1,178 @@
25 +# Copyright 1999-2019 Gentoo Authors
26 +# Distributed under the terms of the GNU General Public License v2
27 +
28 +EAPI=6
29 +inherit flag-o-matic toolchain-funcs user
30 +
31 +DESCRIPTION="fax and voice modem programs"
32 +HOMEPAGE="http://mgetty.greenie.net/"
33 +SRC_URI="ftp://mgetty.greenie.net/pub/mgetty/source/1.2/${P}.tar.gz"
34 +
35 +DEPEND="
36 + dev-lang/perl
37 + sys-apps/groff
38 + sys-apps/texinfo
39 + virtual/awk
40 + fax? (
41 + !net-misc/efax
42 + !net-misc/hylafax
43 + )
44 +"
45 +RDEPEND="${DEPEND}
46 + fax? ( media-libs/netpbm app-text/ghostscript-gpl )
47 +"
48 +
49 +SLOT="0"
50 +LICENSE="GPL-2"
51 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
52 +IUSE="+fax fidonet split-usr"
53 +
54 +pkg_setup() {
55 + enewgroup fax
56 + enewuser fax -1 -1 /dev/null fax
57 +}
58 +
59 +PATCHES=(
60 + "${FILESDIR}"/${PN}-1.1.36-callback.patch
61 + "${FILESDIR}"/${PN}-1.1.36-tmpfile.patch
62 + "${FILESDIR}"/${PN}-1.1.37-qa-fixes.patch
63 + "${FILESDIR}"/${PN}-1.2.1-Lucent.c.patch
64 + "${FILESDIR}"/${PN}-1.2.1-gentoo.patch
65 +)
66 +
67 +src_prepare() {
68 + default
69 +
70 + chmod +x mkidirs || die
71 +
72 + # don't install fax related files - bug #195467
73 + use fax || eapply "${FILESDIR}/${PN}-1.1.37-nofax.patch"
74 +
75 + sed -i -e 's:/usr/local/lib/mgetty+sendfax:/etc/mgetty+sendfax:' faxrunq.config || die 'changing mgetty config dir failed'
76 + sed -i -e 's:/usr/local/bin/g3cat:/usr/bin/g3cat:' faxrunq.config fax/faxspool.rules || die 'changing g3cat path failed'
77 +
78 + sed -e "/^doc-all:/s/mgetty.asc mgetty.info mgetty.dvi mgetty.ps/mgetty.info/" \
79 + -i doc/Makefile || die 'first sed on doc/Makefile failed'
80 +
81 + sed -i \
82 + -e 's:^CC=:CC?=:g' \
83 + -e 's:^CFLAGS=:CFLAGS?=:g' \
84 + {,*/}Makefile || die
85 + sed -i \
86 + -e 's:^AR=:AR?=:g' \
87 + -e 's:^CFLAGS=:CFLAGS+= -I..:g' \
88 + -e 's:^RANLIB=:RANLIB?=:g' \
89 + */Makefile || die
90 +}
91 +
92 +src_configure() {
93 + tc-export AR CC RANLIB
94 + use fidonet && append-cppflags "-DFIDO"
95 + append-cppflags "-DAUTO_PPP"
96 +
97 + sed -e 's:var/log/mgetty:var/log/mgetty/mgetty:' \
98 + -e 's:var/log/sendfax:var/log/mgetty/sendfax:' \
99 + -e 's:\/\* \(\#define CNDFILE "dialin.config"\) \*\/:\1:' \
100 + -e 's:\(\#define FAX_NOTIFY_PROGRAM\).*:\1 "/etc/mgetty+sendfax/new_fax":' \
101 + policy.h-dist > policy.h || die 'creating policy.h failed'
102 +
103 + sed -i \
104 + -e "s/\$(CFLAGS) -o newslock/${CFLAGS} ${LDFLAGS} -Wall -o newslock/" \
105 + -e "s/\$(LDLAGS)/${LDFLAGS}/" \
106 + {,fax/}Makefile || die
107 +}
108 +
109 +src_compile() {
110 + local target
111 + for target in mgetty sedscript all vgetty;do
112 + VARTEXFONTS="${T}"/fonts emake prefix=/usr \
113 + CONFDIR=/etc/mgetty+sendfax \
114 + CFLAGS="${CFLAGS} ${CPPFLAGS}" \
115 + LDFLAGS="${LDFLAGS}" \
116 + ${target}
117 + done
118 +}
119 +
120 +src_install () {
121 + # parallelization issue: vgetty-install target fails if install target
122 + # isn't finished
123 + local target
124 + for target in install "vgetty-install install-callback"; do
125 + emake prefix="${D}/usr" \
126 + INFODIR="${D}/usr/share/info" \
127 + CONFDIR="${D}/etc/mgetty+sendfax" \
128 + MAN1DIR="${D}/usr/share/man/man1" \
129 + MAN4DIR="${D}/usr/share/man/man4" \
130 + MAN5DIR="${D}/usr/share/man/man5" \
131 + MAN8DIR="${D}/usr/share/man/man8" \
132 + SBINDIR="${D}/usr/sbin" \
133 + BINDIR="${D}/usr/bin" \
134 + VOICE_DIR="${D}/var/spool/voice" \
135 + PHONE_GROUP=fax \
136 + PHONE_PERMS=755 \
137 + spool="${D}/var/spool" \
138 + ${target}
139 + done
140 +
141 + keepdir /var/log/mgetty
142 +
143 + #Install mgetty into /sbin (#119078)
144 + if use split-usr; then
145 + dodir /sbin
146 + mv "${D}"/usr/sbin/mgetty "${D}"/sbin || die
147 + dosym ../../sbin/mgetty /usr/sbin/mgetty
148 + fi
149 +
150 + #Don't install ct (#106337)
151 + rm "${D}"/usr/bin/ct || die "failed to remove useless ct program"
152 +
153 + dodoc BUGS ChangeLog README.1st Recommend THANKS TODO \
154 + doc/*.txt doc/modems.db
155 + doinfo doc/mgetty.info
156 +
157 + docinto vgetty
158 + dodoc voice/{Readme,Announce,ChangeLog,Credits}
159 +
160 + docinto vgetty/doc
161 + dodoc voice/doc/*
162 +
163 + if use fax; then
164 + mv samples/new_fax.all samples_new_fax.all || die "move failed."
165 + docinto samples
166 + dodoc samples/*
167 +
168 + docinto samples/new_fax
169 + dodoc samples_new_fax.all/*
170 + fi
171 +
172 + if ! use fax; then
173 + insinto /usr/share/${PN}/frontends
174 + doins -r frontends/{voice,network}
175 + else
176 + insinto /usr/share/${PN}
177 + doins -r frontends
178 + fi
179 + insinto /usr/share/${PN}
180 + doins -r patches
181 + insinto /usr/share/${PN}/voice
182 + doins -r voice/{contrib,Perl,scripts}
183 +
184 + diropts -m 0750 -o fax -g fax
185 + dodir /var/spool/voice
186 + keepdir /var/spool/voice/incoming
187 + keepdir /var/spool/voice/messages
188 + if use fax; then
189 + dodir /var/spool/fax
190 + dodir /var/spool/fax/outgoing
191 + keepdir /var/spool/fax/outgoing/locks
192 + keepdir /var/spool/fax/incoming
193 + fi
194 +}
195 +
196 +pkg_postinst() {
197 + elog "Users who wish to use the fax or voicemail capabilities must be members"
198 + elog "of the group fax in order to access files"
199 + elog
200 + elog "If you want to grab voice messages from a remote location, you must save"
201 + elog "the password in /var/spool/voice/.code file"
202 +}