1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 inherit flag-o-matic toolchain-funcs user
7 DESCRIPTION="fax and voice modem programs"
8 HOMEPAGE="http://mgetty.greenie.net/"
9 SRC_URI="ftp://mgetty.greenie.net/pub/mgetty/source/1.2/${P}.tar.gz"
22 fax? ( media-libs/netpbm app-text/ghostscript-gpl )
27 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
28 IUSE="+fax fidonet split-usr"
32 enewuser fax -1 -1 /dev/null fax
36 "${FILESDIR}"/${PN}-1.1.36-callback.patch
37 "${FILESDIR}"/${PN}-1.1.36-tmpfile.patch
38 "${FILESDIR}"/${PN}-1.1.37-qa-fixes.patch
39 "${FILESDIR}"/${PN}-1.2.1-Lucent.c.patch
40 "${FILESDIR}"/${PN}-1.2.1-gentoo.patch
46 chmod +x mkidirs || die
48 # don't install fax related files - bug #195467
49 use fax || eapply "${FILESDIR}/${PN}-1.1.37-nofax.patch"
51 sed -i -e 's:/usr/local/lib/mgetty+sendfax:/etc/mgetty+sendfax:' faxrunq.config || die 'changing mgetty config dir failed'
52 sed -i -e 's:/usr/local/bin/g3cat:/usr/bin/g3cat:' faxrunq.config fax/faxspool.rules || die 'changing g3cat path failed'
54 sed -e "/^doc-all:/s/mgetty.asc mgetty.info mgetty.dvi mgetty.ps/mgetty.info/" \
55 -i doc/Makefile || die 'first sed on doc/Makefile failed'
59 -e 's:^CFLAGS=:CFLAGS?=:g' \
63 -e 's:^CFLAGS=:CFLAGS+= -I..:g' \
64 -e 's:^RANLIB=:RANLIB?=:g' \
69 tc-export AR CC RANLIB
70 use fidonet && append-cppflags "-DFIDO"
71 append-cppflags "-DAUTO_PPP"
73 sed -e 's:var/log/mgetty:var/log/mgetty/mgetty:' \
74 -e 's:var/log/sendfax:var/log/mgetty/sendfax:' \
75 -e 's:\/\* \(\#define CNDFILE "dialin.config"\) \*\/:\1:' \
76 -e 's:\(\#define FAX_NOTIFY_PROGRAM\).*:\1 "/etc/mgetty+sendfax/new_fax":' \
77 policy.h-dist > policy.h || die 'creating policy.h failed'
80 -e "s/\$(CFLAGS) -o newslock/${CFLAGS} ${LDFLAGS} -Wall -o newslock/" \
81 -e "s/\$(LDLAGS)/${LDFLAGS}/" \
82 {,fax/}Makefile || die
87 for target in mgetty sedscript all vgetty;do
88 VARTEXFONTS="${T}"/fonts emake prefix=/usr \
89 CONFDIR=/etc/mgetty+sendfax \
90 CFLAGS="${CFLAGS} ${CPPFLAGS}" \
91 LDFLAGS="${LDFLAGS}" \
97 # parallelization issue: vgetty-install target fails if install target
100 for target in install "vgetty-install install-callback"; do
101 emake prefix="${D}/usr" \
102 INFODIR="${D}/usr/share/info" \
103 CONFDIR="${D}/etc/mgetty+sendfax" \
104 MAN1DIR="${D}/usr/share/man/man1" \
105 MAN4DIR="${D}/usr/share/man/man4" \
106 MAN5DIR="${D}/usr/share/man/man5" \
107 MAN8DIR="${D}/usr/share/man/man8" \
108 SBINDIR="${D}/usr/sbin" \
109 BINDIR="${D}/usr/bin" \
110 VOICE_DIR="${D}/var/spool/voice" \
113 spool="${D}/var/spool" \
117 keepdir /var/log/mgetty
119 #Install mgetty into /sbin (#119078)
120 if use split-usr; then
122 mv "${D}"/usr/sbin/mgetty "${D}"/sbin || die
123 dosym ../../sbin/mgetty /usr/sbin/mgetty
126 #Don't install ct (#106337)
127 rm "${D}"/usr/bin/ct || die "failed to remove useless ct program"
129 dodoc BUGS ChangeLog README.1st Recommend THANKS TODO \
130 doc/*.txt doc/modems.db
131 doinfo doc/mgetty.info
134 dodoc voice/{Readme,Announce,ChangeLog,Credits}
140 mv samples/new_fax.all samples_new_fax.all || die "move failed."
144 docinto samples/new_fax
145 dodoc samples_new_fax.all/*
149 insinto /usr/share/${PN}/frontends
150 doins -r frontends/{voice,network}
152 insinto /usr/share/${PN}
155 insinto /usr/share/${PN}
157 insinto /usr/share/${PN}/voice
158 doins -r voice/{contrib,Perl,scripts}
160 diropts -m 0750 -o fax -g fax
161 dodir /var/spool/voice
162 keepdir /var/spool/voice/incoming
163 keepdir /var/spool/voice/messages
166 dodir /var/spool/fax/outgoing
167 keepdir /var/spool/fax/outgoing/locks
168 keepdir /var/spool/fax/incoming
173 elog "Users who wish to use the fax or voicemail capabilities must be members"
174 elog "of the group fax in order to access files"
176 elog "If you want to grab voice messages from a remote location, you must save"
177 elog "the password in /var/spool/voice/.code file"