Gentoo Archives: gentoo-commits

From: Pacho Ramos <pacho@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/capi4hylafax/
Date: Sun, 27 Nov 2016 20:03:56
Message-Id: 1480277016.cab796643abd3d06b9e2ed02f542a4ea6ab55eb9.pacho@gentoo
1 commit: cab796643abd3d06b9e2ed02f542a4ea6ab55eb9
2 Author: Pacho Ramos <pacho <AT> gentoo <DOT> org>
3 AuthorDate: Sun Nov 27 18:49:36 2016 +0000
4 Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org>
5 CommitDate: Sun Nov 27 20:03:36 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cab79664
7
8 net-misc/capi4hylafax: Use net-libs/libcapi (#595674)
9
10 Package-Manager: portage-2.3.2
11
12 .../capi4hylafax-01.03.00.99.300.20-r2.ebuild | 156 +++++++++++++++++++++
13 1 file changed, 156 insertions(+)
14
15 diff --git a/net-misc/capi4hylafax/capi4hylafax-01.03.00.99.300.20-r2.ebuild b/net-misc/capi4hylafax/capi4hylafax-01.03.00.99.300.20-r2.ebuild
16 new file mode 100644
17 index 00000000..b1601dc
18 --- /dev/null
19 +++ b/net-misc/capi4hylafax/capi4hylafax-01.03.00.99.300.20-r2.ebuild
20 @@ -0,0 +1,156 @@
21 +# Copyright 1999-2016 Gentoo Foundation
22 +# Distributed under the terms of the GNU General Public License v2
23 +# $Id$
24 +
25 +EAPI=6
26 +inherit eutils versionator autotools
27 +
28 +FAX_SPOOL_DIR="${ROOT}/var/spool/fax"
29 +
30 +MY_PV1="$(get_version_component_range 1-4)"
31 +MY_PV2="$(get_version_component_range 5)"
32 +MY_PV3="$(get_version_component_range 6)"
33 +MY_P="${PN}_${MY_PV1}.svn.${MY_PV2}"
34 +
35 +DESCRIPTION="capi4hylafax adds a faxcapi modem to the hylafax enviroment"
36 +SRC_URI="mirror://debian/pool/main/c/capi4hylafax/${MY_P}.orig.tar.gz
37 + mirror://debian/pool/main/c/capi4hylafax/${MY_P}-${MY_PV3}.debian.tar.gz"
38 +HOMEPAGE="http://packages.qa.debian.org/c/capi4hylafax.html"
39 +
40 +S="${WORKDIR}/${PN}-svn"
41 +
42 +SLOT="0"
43 +LICENSE="GPL-2"
44 +KEYWORDS="~amd64 ~x86"
45 +
46 +RDEPEND="
47 + app-shells/bash:0
48 + net-libs/libcapi
49 + media-libs/tiff:0
50 + virtual/jpeg:0
51 + sys-libs/zlib
52 +"
53 +DEPEND="${RDEPEND}
54 + dev-util/dialog
55 +"
56 +
57 +DOCS=( AUTHORS ChangeLog Readme_src )
58 +HTML_DOCS=( README.html LIESMICH.html )
59 +
60 +src_prepare() {
61 + EPATCH_SOURCE="${WORKDIR}/debian/patches" EPATCH_SUFFIX="patch" \
62 + EPATCH_FORCE="yes" epatch
63 +
64 + eapply_user
65 +
66 + eautoreconf
67 +
68 + mv ../debian . || die
69 +
70 + # fix location of fax spool
71 + sed -e "s:/var/spool/hylafax:${FAX_SPOOL_DIR}:g" \
72 + -i config.faxCAPI \
73 + -i Readme_src \
74 + -i src/defaults.h.in \
75 + -i debian/*.1 || die
76 +
77 + # fix location of fax config
78 + sed -i -e "s:/etc/hylafax:${FAX_SPOOL_DIR}/etc:g" setupconffile || die
79 +
80 + # fix name and location of logfile
81 + sed -e "s:/var/spool/fax/log/capi4hylafax:/var/log/${PN}.log:" \
82 + -i config.faxCAPI || die
83 +
84 + sed -e "s:/tmp/capifax.log:/var/log/${PN}.log:" \
85 + -i src/defaults.h.in config.faxCAPI || die
86 +
87 + # patch man pages
88 + sed -e "s:/usr/share/doc/capi4hylafax/:/usr/share/doc/${PF}/html/:g" \
89 + -e "s:c2send:c2faxsend:g" \
90 + -e "s:c2recv:c2faxrecv:g" \
91 + -e "s:CAPI4HYLAFAXCONFIG \"1\":C2FAXADDMODEM \"8\":g" \
92 + -e "s:capi4hylafaxconfig:c2faxaddmodem:g" \
93 + -i debian/*.1 || die
94 +
95 + cp -f debian/capi4hylafaxconfig.1 debian/c2faxaddmodem.8 || die
96 +}
97 +
98 +src_configure() {
99 + econf --with-hylafax-spooldir="${FAX_SPOOL_DIR}"
100 +}
101 +
102 +src_install() {
103 + keepdir "${FAX_SPOOL_DIR}"/{etc,recvq,pollq,log,status}
104 + fowners uucp:uucp "${FAX_SPOOL_DIR}" "${FAX_SPOOL_DIR}"/{etc,recvq,pollq,log,status}
105 + fperms 0700 "${FAX_SPOOL_DIR}"
106 +
107 + default
108 +
109 + # install setup script
110 + newsbin setupconffile c2faxaddmodem
111 +
112 + # install sample config
113 + insinto "${FAX_SPOOL_DIR}/etc"
114 + newins config.faxCAPI config.faxCAPI.default
115 +
116 + # install docs
117 + newdoc debian/changelog ChangeLog.debian
118 +
119 + # install man pages
120 + doman debian/c2fax*.[18]
121 +
122 + # install examples
123 + insinto /usr/share/doc/${PF}/examples
124 + doins sample_faxrcvd config.faxCAPI fritz_pic.tif GenerateFileMail.pl
125 + newins sample_AVMC4_config.faxCAPI config.faxCAPI_AVMC4
126 + newins debian/faxsend sample_faxsend
127 +
128 + # finally install init-script + config
129 + newinitd "${FILESDIR}/${PN}.initd" ${PN}
130 + newconfd "${FILESDIR}/${PN}.confd" ${PN}
131 +}
132 +
133 +pkg_postinst() {
134 + einfo
135 + elog "To use capi4hylafax:"
136 + elog "Make sure that your isdn/capi devices are owned by"
137 + elog "the \"uucp\" user (see udev or devfsd config)."
138 + elog "Modify ${FAX_SPOOL_DIR}/etc/config.faxCAPI"
139 + elog "to suit your system."
140 +
141 + if [ -n "${REPLACING_VERSIONS}" ]; then
142 + elog
143 + elog "If you're upgrading from a previous version"
144 + elog "please check for new or changed options."
145 + elog "A sample default config is installed as:"
146 + elog "${FAX_SPOOL_DIR}/etc/config.faxCAPI.default"
147 + else
148 + elog
149 + elog "Please run package config to install a default configuration."
150 + fi
151 +
152 + elog
153 + elog "You should also check special options in:"
154 + elog "/etc/conf.d/${PN}"
155 + elog
156 + elog "The following optional dependency is also available:"
157 + optfeature "hylafax integration" net-misc/hylafax
158 + elog
159 + elog "Then append the following line to your hylafax"
160 + elog "config file (${FAX_SPOOL_DIR}/etc/config):"
161 + elog "SendFaxCmd: /usr/bin/c2faxsend"
162 + einfo
163 +}
164 +
165 +pkg_config() {
166 + local config_file="${FAX_SPOOL_DIR}/etc/config.faxCAPI"
167 + if [ -e "${config_file}" ]; then
168 + eerror "The configuration file already exists. Please either update"
169 + eerror "or remove this file and re-run package configuration."
170 + eerror "Configuration file location: ${config_file}"
171 + else
172 + elog "Installing template configuration file to ${config_file}"
173 + cp -f "${FAX_SPOOL_DIR}/etc/config.faxCAPI.default" \
174 + "${config_file}" || die
175 + fi
176 +}