/[gentoo-x86]/net-misc/rancid-git/rancid-git-2.3.8.ebuild
Gentoo

Contents of /net-misc/rancid-git/rancid-git-2.3.8.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Fri Mar 20 15:58:55 2015 UTC (4 years, 10 months ago) by jlec
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +5 -5 lines
Fix tcl/tk slotting

(Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key B9D4F231BD1558AB!)

1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-misc/rancid-git/rancid-git-2.3.8.ebuild,v 1.1 2013/08/02 22:45:58 xmw Exp $
4
5 EAPI=5
6
7 inherit autotools eutils readme.gentoo user
8
9 DESCRIPTION="Really Awesome New Cisco confIg Differ with git extensions and support for colorized emails!"
10 HOMEPAGE="http://dotwaffle.github.com/rancid-git"
11 #SRC_URI="ftp://ftp.shrubbery.net/pub/${PN}/${P}.tar.gz"
12 SRC_URI="https://github.com/dotwaffle/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
13 LICENSE="BSD-4"
14
15 SLOT="0"
16 RESTRICT="mirror"
17 KEYWORDS="~amd64 ~x86"
18 IUSE="+git cvs subversion"
19 REQUIRED_USE="^^ ( git cvs subversion )"
20
21 # app-arch/par is blocker, due to bug #455838
22 DEPEND="!app-arch/par
23 dev-lang/perl
24 dev-lang/tcl:0=
25 dev-tcltk/expect
26 sys-apps/diffutils
27 git? ( dev-vcs/git )
28 cvs? ( dev-vcs/cvs )
29 subversion? ( dev-vcs/subversion )
30 || (
31 net-misc/netkit-telnetd
32 net-misc/telnet-bsd
33 )"
34 RDEPEND="${DEPEND}"
35
36 src_prepare() {
37 epatch "${FILESDIR}"/${P/-git}-mailprefix.patch
38 epatch "${FILESDIR}"/${P/-git}-config.patch
39 epatch "${FILESDIR}"/${P/-git}-buildsystem.patch
40
41 # respect CFLAGS, bug #455840
42 sed -i -e '/^CFLAGS/d' bin/Makefile.am || die 'sed on bin/Makefile.am failed'
43
44 eautoreconf
45 }
46
47 src_configure() {
48 econf \
49 --localstatedir="${EPREFIX}"/var/${PN} \
50 --enable-conf-install \
51 --docdir="${EPREFIX}"/usr/share/doc/${PF} \
52 --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html \
53 $(use_with subversion svn fsfs) \
54 $(use_with git)
55 }
56
57 src_install() {
58 default
59
60 if use subversion ; then
61 sed -e 's/^RCSSYS=cvs/RCSSYS=svn/' \
62 -i "${D}"/etc/rancid.conf || die
63 fi
64
65 echo "CONFIG_PROTECT=\"${EPREFIX}/var/rancid/.cloginrc\"" > "${T}"/99${PN}
66 doenvd "${T}"/99${PN}
67
68 readme.gentoo_src_install
69 }
70
71 pkg_preinst() {
72 enewgroup ${PN}
73 enewuser ${PN} -1 /bin/bash "${EPREFIX}"/var/rancid ${PN}
74
75 keepdir /var/${PN}{,/logs}
76 touch "${ED}"/var/${PN}/.cloginrc
77
78 fperms ug=rwX,o= /var/${PN}/{,logs,.cloginrc}
79 fowners ${PN}:${PN} /var/${PN}/{,logs,.cloginrc}
80 }
81
82 DISABLE_AUTOFORMATTING="yes"
83 DOC_CONTENTS="Micro-HOWTO on how to get running:
84
85 1) Modify MAILPREFIX, ADMINMAILPREFIX, and LIST_OF_GROUPS
86 in /etc/rancid.conf:
87 MAILPREFIX=\"rancid-\"
88 ADMINMAILPREFIX=\"rancid-admin-\"
89 LIST_OF_GROUPS=\"routers switches\"
90
91 2) Setup email aliases for rancid:
92 you will need to define mail aliases for {MAILPREFIX}{GROUP}
93 and {ADMINMAILPREFIX}{GROUP} for each group you defined above
94 How to do this depends on your mailserver
95
96 3) Run rancid-cvs as the rancid user to initialise directories and
97 repositories; eg. su -c /usr/bin/rancid-cvs - rancid
98 Note the command is the same even if you are using subversion
99
100 4) Populate /var/rancid/{GROUPNAME}/router.db with nodes
101 see man 5 router.db for detailed formatting information
102
103 5) Populate /var/rancid/.cloginrc with credentials
104 see /usr/share/rancid/cloginrc.sample for an example
105
106 6) Test clogin access with: clogin -f /var/rancid/.clogin hostname
107
108 7) Add a cronjob for the rancid user to regularly call rancid-run
109 eg: run crontab -u rancid -e and add the lines below
110 # run rancid once an hour
111 0 * * * * /usr/bin/rancid-run
112 # cleanup old logfiles generated by rancid once a day
113 50 23 * * * /usr/bin/find /var/rancid/logs -type f -mtime +2 -exec rm {} \;
114 "

  ViewVC Help
Powered by ViewVC 1.1.20