Gentoo Archives: gentoo-commits

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