This repository has been archived by the owner on May 10, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 92
/
rancid-git.spec
242 lines (187 loc) · 7.47 KB
/
rancid-git.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
%global commit cc801e15d45280624e192389e2e242c0bf961b87
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Name: rancid-git
Version: 2.3.9
Release: 4.2%{?dist}
Summary: Really Awesome New Cisco confIg Differ (w/ git support)
Group: Applications/Internet
License: BSD with advertising
URL: https://github.com/dotwaffle/rancid-git
Source: https://github.com/dotwaffle/rancid-git/archive/%{commit}/%{name}-%{commit}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: telnet
BuildRequires: rsh
BuildRequires: openssh-clients
BuildRequires: expect >= 5.40
BuildRequires: cvs
BuildRequires: subversion
BuildRequires: git
BuildRequires: perl
BuildRequires: iputils
BuildRequires: automake
BuildRequires: libtool
BuildRequires: make
Obsoletes: rancid
Provides: rancid
Requires: shadow-utils
Requires: findutils
Requires: expect >= 5.40
Requires: perl
Requires: perl-CGI
Requires: perl-LockFile-Simple
Requires: perl-MailTools
Requires: iputils
Requires: logrotate
Requires: git
Requires: perl-Socket6
Requires: python-pip
Requires: diffstat
%description
RANCID monitors a router's (or more generally a device's) configuration,
including software and hardware (cards, serial numbers, etc) and uses CVS
(Concurrent Version System), Subversion, or git to maintain history of changes.
%prep
%setup -q -n %{name}-%{commit}
%build
aclocal; autoheader; automake; autoconf
%configure --sysconfdir=%{_sysconfdir}/rancid --bindir=%{_libexecdir}/rancid --enable-conf-install
make %{?_smp_mflags}
%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot} INSTALL="install -p"
install -d -m 0755 %{buildroot}/%{_localstatedir}/rancid
install -d -m 0755 %{buildroot}/%{_localstatedir}/log/rancid
install -d -m 0755 %{buildroot}/%{_localstatedir}/log/rancid/old
install -d -m 0755 %{buildroot}/%{_bindir}/
#symlink some bins from _libexecdir/rancid to _bindir
for base in \
rancid rancid-cvs rancid-fe rancid-run
do
ln -sf %{_libexecdir}/rancid/${base} \
%{buildroot}/%{_bindir}/${base}
done
%clean
rm -rf %{buildroot}
%pre
getent group rancid >/dev/null || groupadd -r rancid
getent passwd rancid >/dev/null || \
useradd -r -g rancid -d %{_localstatedir}/rancid -s /bin/bash -k /etc/skel -m -c "RANCID" rancid
exit 0
%postun
# Only run if erasing not on update
if [ "$1" = "0" ]; then
# Save folder when erasing
if [ -d %{_localstatedir}/rancid ]; then
# Backup rancid.rpmsave if it exists
if [ -d %{_localstatedir}/rancid.rpmsave ]; then
mv %{_localstatedir}/rancid.rpmsave %{_localstatedir}/rancid.rpmsave.$(date +%s)
fi
mv %{_localstatedir}/rancid %{_localstatedir}/rancid.rpmsave
chown -R root:root %{_localstatedir}/rancid.rpmsave
echo "warning: %{_localstatedir}/rancid saved as %{_localstatedir}/rancid.rpmsave"
fi
getent passwd rancid >/dev/null && userdel rancid
fi
%files
%defattr(-,root,root,-)
%doc CHANGES cloginrc.sample COPYING FAQ README README.lg Todo
#%%{_sysconfdir}-files
%attr(0750,root,rancid) %dir %{_sysconfdir}/rancid
%attr(0640,root,rancid) %config(noreplace) %{_sysconfdir}/rancid/*
#_libexecdir/rancid-files
%dir %{_libexecdir}/rancid/
%{_libexecdir}/rancid/*
#_bindir-files
%{_bindir}/*
#_mandir-files
%{_mandir}/*/*
#_datadir/rancid-files
%dir %{_datadir}/rancid/
%{_datadir}/rancid/*
#_localstatedir-directories
%attr(0750,root,rancid) %dir %{_localstatedir}/log/rancid
%attr(0750,root,rancid) %dir %{_localstatedir}/log/rancid/old
%attr(0770,root,rancid) %dir %{_localstatedir}/rancid/
%changelog
* Thu Feb 18 2016 Sam Doran <[email protected]> 2.3.9-4.2
- Account for date in prompt when processing Arista configs (from upstream 3.2)
- Improve processing of Nexus devices (from upstream 3.3)
* Wed Feb 03 2016 Sam Doran <[email protected]> 2.3.9-4.1
- Modify email subject and commit messages so they make more sense
- Correct regexp for removing ASA/PIX keys
- Properly remove ASA community strings in ASA 8.x
* Tue Feb 02 2016 Sam Doran <[email protected]> 2.3.9-4
- Use inet_pton from Socket6 module to preserve CentOS 6 compatibility.
See https://bugzilla.redhat.com/show_bug.cgi?id=1224143 for details.
* Wed Jan 20 2016 Frank Fegert <[email protected]> 2.3.9-4
- Merged changes from upstream rancid (version 3.2).
- Improved handling of Dell PowerConnect M-Series switch devices.
* Mon Nov 16 2015 Ryan Chapman <[email protected]> 2.3.9-4
- Improved ip address sorting (from upstream v3.2).
* Fri Oct 30 2015 John Siegrist <[email protected]> 2.3.9-3
- Add make as missing BuildRequires dependency
* Fri Oct 02 2015 Sam Doran <[email protected]> 2.3.9-2
- Add BNT/HP Blade Switch support
* Wed Mar 18 2015 Jesse Norell <[email protected]> 2.3.9-1
- Add Ubiquiti EdgeOS support
* Wed Mar 04 2015 Jesse Norell <[email protected]> 2.3.9-1
- Add Telco Systems support
- Add ZxXel switches suppor
* Tue Feb 03 2015 Jesse Norell <[email protected]> 2.3.9-1
- Add pfSense support
* Tue Feb 03 2015 Simone Caronni <[email protected]> 2.3.9-1
- Add VyOS support
* Tue Apr 22 2014 Tore Anderson <[email protected]> 2.3.9-1
- Add Cisco UCS support
* Mon Apr 07 2014 Sam Doran <[email protected]> 2.3.9-1
- Check for VDOM in fnlogin before running commands
* Fri Apr 04 2014 Sam Doran <[email protected]> 2.3.9-0
- Change postun script to save /var/rancid on removal and not delete on update
- Change perms on /var/rancid to 770
* Wed Mar 26 2014 Sam Doran <[email protected]> 2.3.8-4
- Change source url to match Fedora documentation
* Wed Mar 12 2014 Sam Doran <[email protected]> 2.3.8-4
- Add postun section to remove rancid user and /var/rancid
* Wed Jun 05 2013 Paul Morgan <[email protected]> 2.3.8-3
- use tito to build rpm
- fix rpm spec file
* Wed Dec 19 2012 Jonathan Thurman <[email protected]> 2.3.8-2
- Patch to ignore .dat files of flash
* Mon Dec 17 2012 Jonathan Thurman <[email protected]> 2.3.8-1
- Rebuild with git support from upstream 2.3.8 release
* Sun Jan 23 2011 Peter Robinson <[email protected]> 2.3.6-1
- New upstream 2.3.6 release
* Tue Sep 28 2010 Peter Robinson <[email protected]> 2.3.4-1
- New upstream 2.3.4 release
* Wed Jul 22 2009 Gary T. Giesen <[email protected]> 2.3.2-3
- Changed GECOS name for rancid user
* Wed Jul 22 2009 Gary T. Giesen <[email protected]> 2.3.2-2
- Added logrotate (and updated crontab to let logrotate handle log file
cleanup
- Removed Requires: for rsh, telnet, and openssh-clients
- Removed Requires: for cvs
- Cleaned up file permissions
- Added shell for rancid user for CVS tree creation and troubleshooting
- Patch cron file for installation path
- Removed installation of CVS root to permit SVN use
- Moved from libdir to libexecdir
* Thu Jul 16 2009 Gary T. Giesen <[email protected]> 2.3.2-1
- Updated to 2.3.2 stable
- Removed versioned expect requirement so all supported Fedora/EPEL releases
now meet the minimum
- Spec file cleanup/style changes
* Wed Oct 08 2008 Aage Olai Johnsen <[email protected]> 2.3.2-0.6a8
- Some fixes (#451189)
* Tue Sep 30 2008 Aage Olai Johnsen <[email protected]> 2.3.2-0.5a8
- Some fixes (#451189)
* Tue Sep 30 2008 Aage Olai Johnsen <[email protected]> 2.3.2-0.4a8
- More fixes (#451189)
- Patched Makefiles - Supplied by Mamoru Tasaka ([email protected])
* Tue Sep 23 2008 Aage Olai Johnsen <[email protected]> 2.3.2-0.3a8
- More fixes (#451189)
* Wed Jul 09 2008 Aage Olai Johnsen <[email protected]> 2.3.2a8-0.2a8
- Plenty of fixes (#451189)
- Patched rancid.conf-file
- Added cronjob
* Sat May 31 2008 Aage Olai Johnsen <[email protected]> 2.3.2a8-0.1
- Initial RPM release