Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:garloff:OTC
bms-network-config
bms-network-config.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bms-network-config.spec of Package bms-network-config
%if 0%{?suse_version} >= 1000 # SUSE %if 0%{?suse_version} < 1200 %define dist suse114 %define distpy suse11 %define nosystemd 1 %else %define distpy suse12 %define nosystemd 0 %endif %else # REDHAT/CentOS/Oracle/Euler %if 0%{?rhel_version} < 700 && 0%{?centos_version} < 700 %define nosystemd 1 %define dist rhel6x %define distpy centosRedhat6 %else %define nosystemd 0 %define distpy centosRedhat7 %endif %endif Name: bms-network-config Version: 1.0 Release: 7 Summary: OTC Bare Metal Network Device Configuration Scripts Group: Development/Tools License: GPL URL: https://github.com/bms-network/bms-network-config Source0: bms-network-config-%{version}.tar.gz Source1: bms-disable-cloudinit-network Source2: bms-network-disable-cloudinit.service Patch0: disable-auth-keys.diff Patch1: initscript-tweaks.diff Patch2: bms-before-cloudinit.diff Patch12: bms-before-cloudinit.diff.rhel73 Patch3: phy-slaves-dhcp-none.diff Patch4: bms-network-nonetdatasrc.diff Patch5: bms-network-lesswait.diff Patch6: bms-networkmanager-keep.diff Patch7: mov-opt-otc.diff Autoreqprov: on BuildRequires: python BuildRequires: dos2unix %if 0%{?suse_version} >= 1210 BuildRequires: systemd-rpm-macros %endif %if %{nosystemd} != 1 BuildRequires: systemd %endif #Requires(post): cloud-init #BuildRequires: udev #%if 0%{?suse_version} >= 1000 #BuildRequires: sysconfig #%fi %if 0%{?suse_version} >= 1000 PreReq: %insserv_prereq %endif Requires: python Requires: cloud-init Requires: python-six BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch %description OTC Bare Metal Network Device Configuration Scripts bms-network-config is needed on OTC's Bare Metal (Ironic) Service to configure the network interfaces. It evaluates the configuration passed via the meta-data service and configures the Network Interface according to it. Unfortunately, this can not easily be achieved inside the oldish cloud-init shipped in current distributions, thus the separate package that gets invoked on system startup. %prep %setup -n bms-network-config-%{version} # Cleanup # These are identical to network_config.py.centosRedhat7, should not have been put into the tarball rm bms-network_config.py network_config.py.euleros22 network_config.py.oracle7 # Initscript is duplicate as well rm bms-network-config dos2unix * chmod -x bms-network-config.conf bms-network-config.service chmod +x network_config.py.* #Not yet ... %patch0 -p1 %patch1 -p1 %if 0%{?centos_version} == 700 %patch12 -p1 %else %patch2 -p1 %endif %patch3 -p1 %if 0%{?centos_version} != 700 %patch4 -p1 %endif %patch5 -p1 # Disable temporarily for testing %patch6 -p1 %patch7 -p1 %if 0%{?suse_version} == 0 sed -i 's@ExecStart=/usr/bin/bms-network_config@ExecStart=/usr/bin/bms-network_config rhel@' bms-network-config.service %endif echo "Building for Dist %{dist}/%{distpy}, nosystemd %{nosystemd}" %build #sed -i 's/network-config/bms-network-config/g' bms-network-config #sed -i 's/network_config/bms_network_config/g' bms-network-config cp -p network_config.py.%distpy bms-network_config.py #dos2unix bms-network_config.py %if 0%{?centos_version} == 700 sed -i 's/cloud-init.target/multi-user.target/' %{S:2} %endif %install #cd %{name}-%{version} mkdir -p ${RPM_BUILD_ROOT}/usr/bin mkdir -p ${RPM_BUILD_ROOT}/opt/otc/network_config mkdir -p ${RPM_BUILD_ROOT}/%{_initddir} mkdir -p ${RPM_BUILD_ROOT}/%{_sbindir} %if %{nosystemd} == 1 cp -p bms-network-config-%{dist} $RPM_BUILD_ROOT/%{_initddir}/bms-network-config %if 0%{?suse_version} >= 1000 ln -sf "%{_initddir}/bms-network-config" "${RPM_BUILD_ROOT}/%{_sbindir}/rcbms-network-config" %endif %else # Systemd mkdir -p %{buildroot}%{_unitdir} install -m 0644 bms-network-config.service %{buildroot}%{_unitdir}/ %endif install -m 0750 bms-network_config.py $RPM_BUILD_ROOT/opt/otc/network_config/bms-network_config.py install -m 0640 bms-network-config.conf $RPM_BUILD_ROOT/opt/otc/network_config/bms-network-config.conf ln -sf /opt/otc/network_config/bms-network_config.py $RPM_BUILD_ROOT/usr/bin/bms-network_config # FIXME: This workaround might be needed elsewhere too %if 0%{?suse_version} > 1200 #|| 0%{?centos_version} >= 700 || 0%{?rhel_version} >= 700 mkdir -p $RPM_BUILD_ROOT/etc/cloud/cloud.cfg.d/ touch $RPM_BUILD_ROOT/etc/cloud/cloud.cfg.d/10_bms_netdisable.cfg touch $RPM_BUILD_ROOT/etc/cloud/cloud.cfg.d/11_bms_configdrivedisable.cfg install -m 0755 %{S:1} $RPM_BUILD_ROOT/usr/bin install -m 0644 %{S:2} %{buildroot}%{_unitdir}/ %endif %clean rm -rf $RPM_BUILD_ROOT #%pre # %post %if 0%{?suse_version} >= 1000 && 0%{?suse_version} < 1200 %{fillup_and_insserv -f -y bms-network-config} %else if [ $1 -eq 1 ] ; then %if %{nosystemd} == 1 chkconfig -a bms-network-config chkconfig bms-network-config on %else systemctl enable bms-network-config.service %if 0%{?suse_version} > 1200 #|| 0%{?centos_version} >= 700 || 0%{?rhel_version} >= 700 systemctl enable bms-network-disable-cloudinit.service %endif %endif fi %endif %preun %if 0%{?suse_version} >= 1000 && 0%{?suse_version} < 1200 %stop_on_removal bms-network-config %else if [ $1 -eq 0 ] ; then %if %{nosystemd} == 1 service bms-network-config stop chkconfig --del bms-network-config %else systemctl --no-reload disable bms-network-config.service %if 0%{?suse_version} > 1200 #|| 0%{?centos_version} >= 700 || 0%{?rhel_version} >= 700 systemctl --no-reload disable bms-network-disable-cloudinit.service rm -f /etc/cloud/cloud.cfg.d/10_bms_netdisable.cfg %endif %endif fi %endif %postun %if 0%{?suse_version} >= 1000 && 0%{?suse_version} < 1200 %restart_on_update bms-network-config %insserv_cleanup %else %if %{nosystemd} != 1 systemctl daemon-reload >/dev/null 2>&1 || : %endif %endif %files %defattr(-,root,root) /opt/otc/network_config/* /usr/bin/bms-network_config %if %{nosystemd} == 1 %attr(0755, root, root) %{_initddir}/bms-network-config %if 0%{?suse_version} >= 1000 %{_sbindir}/rcbms-network-config %endif %else %attr(0644, root, root) %{_unitdir}/bms-network-config.service %endif %dir /opt/otc/network_config %dir /opt/otc %if 0%{?suse_version} > 1200 #|| 0%{?centos_version} >= 700 || 0%{?rhel_version} >= 700 %ghost %config /etc/cloud/cloud.cfg.d/10_bms_netdisable.cfg %ghost %config /etc/cloud/cloud.cfg.d/11_bms_configdrivedisable.cfg %attr(0755, root, root) /usr/bin/bms-disable-cloudinit-network %attr(0644, root, root) %{_unitdir}/bms-network-disable-cloudinit.service %dir /etc/cloud %dir /etc/cloud/cloud.cfg.d %endif %changelog * Mon May 22 2017 huawei - Init
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor