forked from amazonlinux/amazon-ec2-net-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ec2-net-utils.spec
144 lines (127 loc) · 4.66 KB
/
ec2-net-utils.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
%if 0%{?amzn} >= 2 || 0%{?fedora} >= 17 || 0%{?rhel} >= 7
%global systemd 1
%else
%global systemd 0
%endif
Name: ec2-net-utils
Summary: A set of network tools for managing ENIs
Version: 1.2
Release: 1.1%{?dist}
License: MIT and GPLv2
Group: System Tools
Source0: 53-ec2-network-interfaces.rules.systemd
Source1: 53-ec2-network-interfaces.rules.upstart
Source2: 75-persistent-net-generator.rules
Source3: ec2net-functions
Source4: ec2net.hotplug
Source5: ec2ifup
Source6: ec2ifdown
Source7: ec2dhcp.sh
Source8: ec2ifup.8
Source9: ec2ifscan
Source10: ec2ifscan.8
Source11: ixgbevf.conf
Source12: elastic-network-interfaces.conf
Source13: ec2net-scan.service
Source14: write_net_rules
Source15: rule_generator.functions
Source16: [email protected]
URL: http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1825
BuildArch: noarch
Requires: curl
Requires: iproute
%if %{systemd}
%{?systemd_requires}
BuildRequires: systemd-units
Requires: systemd-units
%endif # systemd
Requires: dhclient
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
%description
ec2-net-utils contains a set of utilities for managing elastic network
interfaces.
%prep
%build
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/udev/rules.d/
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/network-scripts/
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/dhcp/dhclient.d/
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man8/
install -m644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/udev/rules.d/
install -m644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/network-scripts/
install -m755 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/network-scripts/
install -m755 %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/dhcp/dhclient.d/
%if %{systemd}
install -d -m755 $RPM_BUILD_ROOT%{_sbindir}
install -m755 %{SOURCE5} $RPM_BUILD_ROOT%{_sbindir}/
install -m755 %{SOURCE6} $RPM_BUILD_ROOT%{_sbindir}/
install -m755 %{SOURCE9} $RPM_BUILD_ROOT%{_sbindir}/
install -m644 %{SOURCE0} $RPM_BUILD_ROOT%{_sysconfdir}/udev/rules.d/53-ec2-network-interfaces.rules
install -d -m755 $RPM_BUILD_ROOT%{_unitdir}
install -m644 %{SOURCE13} $RPM_BUILD_ROOT%{_unitdir}/ec2net-scan.service
install -m644 %{SOURCE16} $RPM_BUILD_ROOT%{_unitdir}/[email protected]
install -d -m755 $RPM_BUILD_ROOT/usr/lib/udev
install -m644 %{SOURCE14} $RPM_BUILD_ROOT/usr/lib/udev
install -m644 %{SOURCE15} $RPM_BUILD_ROOT/usr/lib/udev
%else
install -d -m755 $RPM_BUILD_ROOT/sbin
install -m755 %{SOURCE5} $RPM_BUILD_ROOT/sbin/
install -m755 %{SOURCE6} $RPM_BUILD_ROOT/sbin/
install -m755 %{SOURCE9} $RPM_BUILD_ROOT/sbin/
install -m644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/udev/rules.d/53-ec2-network-interfaces.rules
install -d -m755 $RPM_BUILD_ROOT$RPM_BUILD_ROOT%{_sysconfdir}/init
install -m644 %{SOURCE12} $RPM_BUILD_ROOT%{_sysconfdir}/init
%endif # systemd
install -m644 %{SOURCE8} $RPM_BUILD_ROOT%{_mandir}/man8/ec2ifup.8
ln -s ./ec2ifup.8.gz $RPM_BUILD_ROOT%{_mandir}/man8/ec2ifdown.8.gz
install -m644 %{SOURCE10} $RPM_BUILD_ROOT%{_mandir}/man8/ec2ifscan.8
# add module configs
install -m644 -D %{SOURCE11} $RPM_BUILD_ROOT/etc/modprobe.d/ixgbevf.conf
%clean
rm -rf $RPM_BUILD_ROOT
%if %{with systemd}
%post
%systemd_post ec2net-scan.service
%systemd_post [email protected]
%preun
%systemd_preun ec2net-scan.service
%systemd_preun [email protected]
%endif # systemd
%files
%{_sysconfdir}/udev/rules.d/53-ec2-network-interfaces.rules
%{_sysconfdir}/udev/rules.d/75-persistent-net-generator.rules
%{_sysconfdir}/modprobe.d/ixgbevf.conf
%{_sysconfdir}/sysconfig/network-scripts/ec2net-functions
%{_sysconfdir}/sysconfig/network-scripts/ec2net.hotplug
%{_sysconfdir}/dhcp/dhclient.d/ec2dhcp.sh
%if %{systemd}
%{_sbindir}/ec2ifup
%{_sbindir}/ec2ifdown
%{_sbindir}/ec2ifscan
%attr(0644,root,root) %{_unitdir}/ec2net-scan.service
%attr(0644,root,root) %{_unitdir}/[email protected]
%attr(755, -, -) %{_prefix}/lib/udev/write_net_rules
%{_prefix}/lib/udev/rule_generator.functions
%else
/sbin/ec2ifup
/sbin/ec2ifdown
/sbin/ec2ifscan
%{_sysconfdir}/init/elastic-network-interfaces.conf
%endif # systemd
%doc %{_mandir}/man8/ec2ifup.8.gz
%doc %{_mandir}/man8/ec2ifdown.8.gz
%doc %{_mandir}/man8/ec2ifscan.8.gz
%changelog
* Tue Jul 17 2018 Frederick Lefebvre <[email protected]>
- Re-license under MIT
* Wed Jun 06 2018 Chad Miller <[email protected]>
- Loop to get correct MAC address from sysfs when it's
all 00s
* Mon Dec 04 2017 Frederick Lefebvre <[email protected]>
- Add systemd support
* Wed Sep 22 2010 Nathan Blackham <[email protected]>
- move to ec2-utils
- add udev code for symlinking xvd* devices to sd*
* Tue Sep 07 2010 Nathan Blackham <[email protected]>
- initial packaging of script as an rpm