nailgun-net-check RPM building added.

This commit is contained in:
ashaposhnikov 2012-12-07 12:20:44 +00:00 committed by default
parent 67c5037f09
commit ce0599ff4a
11 changed files with 111 additions and 21 deletions

View File

@ -13,7 +13,7 @@ YUM_PACKAGES:=openssh-server wget cronie-noanacron crontabs ntp \
bash net-tools dhclient rsyslog iputils openssh-clients vim-minimal\
rubygems mcollective vconfig tcpdump scapy mingetty ntp
YUM_BUILD_PACKAGES:=ruby-devel make gcc flex byacc python-devel \
YUM_BUILD_PACKAGES:=ruby-devel.x86_64 make gcc flex byacc python-devel.x86_64 \
glibc-devel glibc-headers kernel-headers
NAILGUN_DIR:=$(INITRAM_DIR)/opt/nailgun
@ -91,13 +91,6 @@ $(BS_DIR)/init.done: $(LOCAL_MIRROR)/repo.done $(INITRAM_DIR)/etc/yum.repos.d/mi
sudo rm $(INITRAM_DIR)/etc/resolv.conf
sudo mkdir -p $(INITRAM_DIR)/src
cd $(INITRAM_DIR)/src && sudo wget -c http://pypcap.googlecode.com/files/pypcap-1.1.tar.gz \
http://www.tcpdump.org/release/libpcap-1.3.0.tar.gz
cd $(INITRAM_DIR)/src && sudo tar zxf libpcap-1.3.0.tar.gz
cd $(INITRAM_DIR)/src && sudo tar zxf pypcap-1.1.tar.gz
(cd $(INITRAM_DIR)/src && sudo patch -p1) < bootstrap/pypcap.diff
$(CHROOT_CMD) /bin/sh -c "cd /src/libpcap-1.3.0 && ./configure && make"
$(CHROOT_CMD) /bin/sh -c "cd /src/pypcap-1.1 && make && make install"
$(YUM) erase $(YUM_BUILD_PACKAGES)
sudo rm -f $(INITRAM_DIR)/etc/yum.repos.d/Cent*
sudo cp $(INITRAM_DIR)/sbin/init $(INITRAM_DIR)/init

View File

@ -19,8 +19,6 @@ $/isoroot-centos.done: \
$(ISOROOT)/.treeinfo
mkdir -p $(ISOROOT)/Packages
find $(CENTOS_REPO_DIR)Packages -name '*.rpm' -exec cp -n {} $(ISOROOT)/Packages \;
find $(BUILD_DIR)/rpm/RPMS -name '*.rpm' -exec cp -n {} $(ISOROOT)/Packages \;
rm $(ISOROOT)/Packages/*.i686.rpm
createrepo -g `readlink -f "$(ISOROOT)/repodata/comps.xml"` -u media://`head -1 $(ISOROOT)/.discinfo` $(ISOROOT)
$(ACTION.TOUCH)

View File

@ -21,6 +21,7 @@ cachedir=$(CENTOS_REPO_DIR)cache
keepcache=0
debuglevel=6
logfile=$(CENTOS_REPO_DIR)yum.log
exclude=*.i686.rpm
exactarch=1
obsoletes=1
gpgcheck=0
@ -171,11 +172,14 @@ $/cache-extra.done: \
$/cache.done: $/cache-extra.done $/cache-boot.done
$(ACTION.TOUCH)
$(addprefix $(CENTOS_REPO_DIR)Packages/repodata/,$(METADATA_FILES)): $/cache.done $(CENTOS_REPO_DIR)repodata/comps.xml
$(addprefix $(CENTOS_REPO_DIR)Packages/repodata/,$(METADATA_FILES)): \
$/cache.done \
$(CENTOS_REPO_DIR)repodata/comps.xml \
$(BUILD_DIR)/rpm/rpm.done
createrepo -g `readlink -f "$(CENTOS_REPO_DIR)repodata/comps.xml"` -o $(CENTOS_REPO_DIR)Packages $(CENTOS_REPO_DIR)Packages
$/repo.done: $(addprefix $(CENTOS_REPO_DIR)Packages/repodata/,$(METADATA_FILES))
touch $@
$(ACTION.TOUCH)
# centos isolinux files

View File

@ -2,14 +2,46 @@
$/%: /:=$/
SANDBOX:=$/SANDBOX/
CHROOT_BOX:=sudo chroot $(SANDBOX)
SRC_DIR:=$/SOURCES/
SAND_YUM:=sudo yum --installroot=`readlink -f $(SANDBOX)` -y --nogpgcheck
SAND_RPM:=sudo rpm --root=`readlink -f $(SANDBOX)`
SAND_REQ:=rpm-build tar gcc flex make byacc python-devel.x86_64 glibc-devel \
glibc-headers kernel-headers
$/prep.done: $(LOCAL_MIRROR)/src.done
@mkdir -p $/SOURCES
cp -f $(LOCAL_MIRROR)/src/* $/SOURCES/
cp -f bin/agent bin/nailgun-agent.cron $/SOURCES/
.PHONY: clean clean_rpm
clean: clean_rpm
clean_rpm:
sudo rm -rf $(BUILD_DIR)/rpm
define yum_local_repo
[mirror]
name=Mirantis mirror
baseurl=file://$(shell readlink -f -m $(RPM_DIR))/Packages
gpgcheck=0
enabled=1
endef
$(SANDBOX)/etc/yum.repos.d/mirror.repo: export contents:=$(yum_local_repo)
$(SANDBOX)/etc/yum.repos.d/mirror.repo:
mkdir -p $(@D) || echo "$(@D) already exists"
sudo sh -c "echo \"$${contents}\" > $@"
$/prep.done: $(LOCAL_MIRROR)/src.done \
$(SANDBOX)/etc/yum.repos.d/mirror.repo
mkdir -p $(SRC_DIR)
cp -f packages/rpm/patches/* $(SRC_DIR)
cp -f $(LOCAL_MIRROR)/src/* $(SRC_DIR)
cp -f bin/agent bin/nailgun-agent.cron $(SRC_DIR)
mkdir -p $/SOURCES/nailgun-mcagents
cp -f mcagent/* $/SOURCES/nailgun-mcagents
cp -f mcagent/* $(SRC_DIR)nailgun-mcagents
find $(LOCAL_MIRROR) -name centos-release* | head | xargs sudo rpm -i --root=$(SANDBOX) || echo "chroot already prepared"
sudo rm -f $(SANDBOX)/etc/yum.repos.d/Cent*
$(SAND_RPM) --rebuilddb
$(SAND_YUM) install $(SAND_REQ)
$(ACTION.TOUCH)
$/rpm-cirros.done: $/prep.done packages/rpm/specs/cirros-0.3.0.spec
@ -28,8 +60,20 @@ $/rpm-nailgun-mcagents.done: $/prep.done packages/rpm/specs/nailgun-mcagents.spe
rpmbuild -vv --define "_topdir `readlink -f $/`" -ba packages/rpm/specs/nailgun-mcagents.spec
$(ACTION.TOUCH)
$/rpm-nailgun-net-check.done: $/prep.done packages/rpm/specs/nailgun-net-check.spec
sudo mkdir -p $(SANDBOX)/tmp/SOURCES
sudo cp packages/rpm/nailgun-net-check/net_probe.py $(SANDBOX)/tmp/SOURCES
sudo cp packages/rpm/specs/nailgun-net-check.spec $(SANDBOX)/tmp
sudo cp packages/rpm/patches/* $(SANDBOX)/tmp/SOURCES
sudo cp $(LOCAL_MIRROR)/src/* $(SANDBOX)/tmp/SOURCES
$(CHROOT_BOX) rpmbuild -vv --define "_topdir /tmp" -ba /tmp/nailgun-net-check.spec
cp $(SANDBOX)/tmp/RPMS/x86_64/* $/RPMS/x86_64/
$(ACTION.TOUCH)
$(BUILD_DIR)/rpm/rpm.done: $/rpm-cirros.done \
$/rpm-rabbitmq-plugins.done \
$/rpm-nailgun-agent.done \
$/rpm-nailgun-mcagents.done
$/rpm-nailgun-mcagents.done \
$/rpm-nailgun-net-check.done
find $/RPMS -name '*.rpm' -exec cp -n {} $(CENTOS_REPO_DIR)/Packages \;
$(ACTION.TOUCH)

View File

@ -0,0 +1,47 @@
Name: nailgun-net-check
Summary: Network checking package for CentOS6.2
Version: 0.0.1
Release: 1
License: GPLv2
Source0: http://pypcap.googlecode.com/files/pypcap-%{pypcapver}.tar.gz
Source1: http://www.tcpdump.org/release/libpcap-%{libpcapver}.tar.gz
Patch1: pypcap.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-build
URL: http://github.com/Mirantis
%define pypcapver 1.1
%define libpcapver 1.3.0
%description
This is a network tool that helps to verify networks connectivity
between hosts in network.
%global _default_patch_fuzz 4
%prep
rm -rf %{name}-%{version}
mkdir %{name}-%{version}
tar zxf %{_sourcedir}/pypcap-%{pypcapver}.tar.gz
tar zxf %{_sourcedir}/libpcap-%{libpcapver}.tar.gz
%patch1 -p1
%build
cd libpcap-%{libpcapver}
%configure
make
cd ../pypcap-%{pypcapver}
make all
#make test
%install
mkdir -p %{buildroot}/usr/bin
cp %{_sourcedir}/net_probe.py %{buildroot}/usr/bin
cd pypcap-%{pypcapver}
python setup.py install --root=%{buildroot}
%files
%defattr(0755,root,root,-)
/*
%clean
rm -rf %{buildroot}

View File

@ -111,6 +111,7 @@ make
gcc
nailgun-agent
nailgun-mcagents
nailgun-net-check
# COBBLER EMBEDDED SNIPPET: 'puppet_install_if_enabled'
# LISTS puppet PACKAGE IF puppet_auto_setup VARIABLE IS SET TO 1

View File

@ -3,7 +3,6 @@ amq-protocol 0.9.5
amq-client 0.9.5
bundler 1.2.1
bunny 0.8.0
chef 10.12.0
daemons 1.1.9
eventmachine 1.0.0
highline 1.6.13

View File

@ -4,6 +4,7 @@ avahi
bind-utils
byacc
cman
centos-release
cobbler
cobbler-web
cronie
@ -42,13 +43,14 @@ puppet-2.7.19
puppet-server-2.7.19
python-amqp
python-cinder
python-devel
python-devel.x86_64
python-virtualenv
rabbitmq-server
rpm-build
rsyslog
ruby
ruby-augeas
ruby-devel
ruby-devel.x86_64
ruby-mysql
ruby-rdoc
ruby-ri

View File

@ -1,3 +1,5 @@
http://www.rabbitmq.com/releases/plugins/v2.6.1/amqp_client-2.6.1.ez
http://www.rabbitmq.com/releases/plugins/v2.6.1/rabbitmq_stomp-2.6.1.ez
https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-uec.tar.gz
http://www.tcpdump.org/release/libpcap-1.3.0.tar.gz
http://pypcap.googlecode.com/files/pypcap-1.1.tar.gz