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"
23 fax? ( media-libs/netpbm app-text/ghostscript-gpl )
28 KEYWORDS="~alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86"
33 enewuser fax -1 -1 /dev/null fax
37 "${FILESDIR}"/${PN}-1.1.36-callback.patch
38 "${FILESDIR}"/${PN}-1.1.36-tmpfile.patch
39 "${FILESDIR}"/${PN}-1.1.37-qa-fixes.patch
40 "${FILESDIR}"/${PN}-1.2.1-Lucent.c.patch
41 "${FILESDIR}"/${PN}-1.2.1-gentoo.patch
49 # don't install fax related files - bug #195467
50 use fax || eapply "${FILESDIR}/${PN}-1.1.37-nofax.patch"
52 sed -i -e 's:/usr/local/lib/mgetty+sendfax:/etc/mgetty+sendfax:' faxrunq.config || die 'changing mgetty config dir failed'
53 sed -i -e 's:/usr/local/bin/g3cat:/usr/bin/g3cat:' faxrunq.config fax/faxspool.rules || die 'changing g3cat path failed'
55 sed -e "/^doc-all:/s/mgetty.asc mgetty.info mgetty.dvi mgetty.ps/mgetty.info/" \
56 -i doc/Makefile || die 'first sed on doc/Makefile failed'
60 -e 's:^CFLAGS=:CFLAGS?=:g' \
64 -e 's:^CFLAGS=:CFLAGS+= -I..:g' \
65 -e 's:^RANLIB=:RANLIB?=:g' \
70 tc-export AR CC RANLIB
71 use fidonet && append-cppflags "-DFIDO"
72 append-cppflags "-DAUTO_PPP"
74 sed -e 's:var/log/mgetty:var/log/mgetty/mgetty:' \
75 -e 's:var/log/sendfax:var/log/mgetty/sendfax:' \
76 -e 's:\/\* \(\#define CNDFILE "dialin.config"\) \*\/:\1:' \
77 -e 's:\(\#define FAX_NOTIFY_PROGRAM\).*:\1 "/etc/mgetty+sendfax/new_fax":' \
78 policy.h-dist > policy.h || die 'creating policy.h failed'
81 -e "s/\$(CFLAGS) -o newslock/${CFLAGS} ${LDFLAGS} -Wall -o newslock/" \
82 -e "s/\$(LDLAGS)/${LDFLAGS}/" \
83 {,fax/}Makefile || die
88 for target in mgetty sedscript all vgetty;do
89 VARTEXFONTS="${T}"/fonts emake prefix=/usr \
90 CONFDIR=/etc/mgetty+sendfax \
91 CFLAGS="${CFLAGS} ${CPPFLAGS}" \
92 LDFLAGS="${LDFLAGS}" \
98 # parallelization issue: vgetty-install target fails if install target
101 for target in install "vgetty-install install-callback"; do
102 emake prefix="${D}/usr" \
103 INFODIR="${D}/usr/share/info" \
104 CONFDIR="${D}/etc/mgetty+sendfax" \
105 MAN1DIR="${D}/usr/share/man/man1" \
106 MAN4DIR="${D}/usr/share/man/man4" \
107 MAN5DIR="${D}/usr/share/man/man5" \
108 MAN8DIR="${D}/usr/share/man/man8" \
109 SBINDIR="${D}/usr/sbin" \
110 BINDIR="${D}/usr/bin" \
111 VOICE_DIR="${D}/var/spool/voice" \
114 spool="${D}/var/spool" \
118 keepdir /var/log/mgetty
120 #Install mgetty into /sbin (#119078)
122 mv "${D}"/usr/sbin/mgetty "${D}"/sbin && \
123 dosym /sbin/mgetty /usr/sbin/mgetty
124 #Don't install ct (#106337)
125 rm "${D}"/usr/bin/ct || die "failed to remove useless ct program"
127 dodoc BUGS ChangeLog README.1st Recommend THANKS TODO \
128 doc/*.txt doc/modems.db
129 doinfo doc/mgetty.info
132 dodoc voice/{Readme,Announce,ChangeLog,Credits}
138 mv samples/new_fax.all samples_new_fax.all || die "move failed."
142 docinto samples/new_fax
143 dodoc samples_new_fax.all/*
147 insinto /usr/share/${PN}/frontends
148 doins -r frontends/{voice,network}
150 insinto /usr/share/${PN}
153 insinto /usr/share/${PN}
155 insinto /usr/share/${PN}/voice
156 doins -r voice/{contrib,Perl,scripts}
158 diropts -m 0750 -o fax -g fax
159 dodir /var/spool/voice
160 keepdir /var/spool/voice/incoming
161 keepdir /var/spool/voice/messages
164 dodir /var/spool/fax/outgoing
165 keepdir /var/spool/fax/outgoing/locks
166 keepdir /var/spool/fax/incoming
171 elog "Users who wish to use the fax or voicemail capabilities must be members"
172 elog "of the group fax in order to access files"
174 elog "If you want to grab voice messages from a remote location, you must save"
175 elog "the password in /var/spool/voice/.code file"