Merge "Refactor how we are doing packaging"

This commit is contained in:
Jenkins 2015-04-21 15:31:05 +00:00 committed by Gerrit Code Review
commit 9cad15898f
63 changed files with 426 additions and 1228 deletions

View File

@ -87,7 +87,6 @@ include $(SOURCE_DIR)/sandbox.mk
include $(SOURCE_DIR)/repos.mk
include $(SOURCE_DIR)/image/module.mk
include $(SOURCE_DIR)/mirror/module.mk
include $(SOURCE_DIR)/puppet/module.mk
include $(SOURCE_DIR)/packages/module.mk
include $(SOURCE_DIR)/packages/openstack/module.mk
include $(SOURCE_DIR)/docker/module.mk

View File

@ -38,6 +38,7 @@ CURRENT_VERSION:=$(PRODUCT_VERSION)
# If it is set then diff $(BASE_VERSION)->$(CURRENT_VERSION)
BASE_VERSION:=6.0
PACKAGE_VERSION=6.0.0
# UPGRADE_VERSIONS?=\
# 6.0:5.1 \
# 5.1 \
@ -253,6 +254,13 @@ MIRROR_DOCKER?=$(MIRROR_BASE)/docker
MIRROR_CENTOS_KERNEL?=$(MIRROR_CENTOS)
endif
#This suffix is used to generate path
#to ubuntu mirror inside mirror
#DocumentRoot
MIRROR_UBUNTU_SUFFIX?=/pkgs/ubuntu
YUM_DOWNLOAD_SRC?=
MIRROR_CENTOS?=http://mirrors-local-msk.msk.mirantis.net/centos-$(PRODUCT_VERSION)/$(CENTOS_RELEASE)
@ -313,3 +321,9 @@ DOCKER_PREBUILT_SOURCE?=http://srv11-msk.msk.mirantis.net/docker-test/fuel-image
# Production variable (prod, dev, docker)
PRODUCTION?=docker
SANDBOX_MIRROR_CENTOS_UPSTREAM?=http://mirrors-local-msk.msk.mirantis.net/centos-$(PRODUCT_VERSION)/$(CENTOS_RELEASE)
SANDBOX_MIRROR_CENTOS_UPSTREAM_OS_BASEURL:=$(SANDBOX_MIRROR_CENTOS_UPSTREAM)/os/$(CENTOS_ARCH)/
SANDBOX_MIRROR_CENTOS_UPDATES_OS_BASEURL:=$(SANDBOX_MIRROR_CENTOS_UPSTREAM)/updates/$(CENTOS_ARCH)/
SANDBOX_MIRROR_EPEL?=http://mirror.yandex.ru/epel/
SANDBOX_MIRROR_EPEL_OS_BASEURL:=$(SANDBOX_MIRROR_EPEL)/$(CENTOS_MAJOR)/$(CENTOS_ARCH)/

View File

@ -72,6 +72,7 @@ cronie
crontabs
dnsmasq
fence-agents
fuel-library
httpd
logrotate
nginx

View File

@ -46,12 +46,10 @@ $(BUILD_DIR)/docker/$1.done: \
cp -a $(SOURCE_DIR)/docker/$1 $(BUILD_DIR)/docker/$1 && \
REPO_PORT=`sudo docker port $(REPO_CONTAINER) 80 | cut -d':' -f2` && \
sed -e "s/_PORT_/$$$${REPO_PORT}/" -i $(BUILD_DIR)/docker/$1/Dockerfile && \
mkdir -p $(BUILD_DIR)/docker/$1/etc/puppet/modules/ && \
mkdir -p $(BUILD_DIR)/docker/$1/etc/fuel && \
cp $(BUILD_DIR)/iso/isoroot/version.yaml $(BUILD_DIR)/docker/$1/etc/fuel/version.yaml && \
sed -e 's/production:.*/production: "docker-build"/' -i $(BUILD_DIR)/docker/$1/etc/fuel/version.yaml && \
cp $(SOURCE_DIR)/docker/docker-astute.yaml $(BUILD_DIR)/docker/$1/etc/fuel/astute.yaml && \
rsync -a $(BUILD_DIR)/repos/fuellib/deployment/puppet/* $(BUILD_DIR)/docker/$1/etc/puppet/modules/ && \
sudo docker build --force-rm -t fuel/$1_$(PRODUCT_VERSION) $(BUILD_DIR)/docker/$1
$$(ACTION.TOUCH)
endef

View File

@ -237,6 +237,8 @@ echo "cat /tmp/grub.script | chroot /mnt/sysimage /sbin/grub --no-floppy --batch
%packages --nobase --excludedocs
@Core
fuel-library
fuel-dockerctl
authconfig
bind-utils
cronie
@ -426,23 +428,23 @@ ln -s ${repodir}/ubuntu ${wwwdir}/ubuntu
# --------------------------
# create folders
mkdir -p /etc/puppet/${OPENSTACK_VERSION}/manifests/
mkdir -p /etc/puppet/${OPENSTACK_VERSION}/modules/
rm -rf /etc/puppet/modules/
#mkdir -p /etc/puppet/${OPENSTACK_VERSION}/manifests/
#mkdir -p /etc/puppet/${OPENSTACK_VERSION}/modules/
#rm -rf /etc/puppet/modules/
# TODO(ikalnitsky): investigate why we need this
cp ${SOURCE}/puppet-slave.tgz ${wwwdir}/
#cp ${SOURCE}/puppet-slave.tgz ${wwwdir}/
# place modules and manifests
tar zxf ${SOURCE}/puppet-slave.tgz -C /etc/puppet/${OPENSTACK_VERSION}/modules
cp /etc/puppet/${OPENSTACK_VERSION}/modules/osnailyfacter/examples/site.pp /etc/puppet/${OPENSTACK_VERSION}/manifests/site.pp
#tar zxf ${SOURCE}/puppet-slave.tgz -C /etc/puppet/${OPENSTACK_VERSION}/modules
#cp /etc/puppet/${OPENSTACK_VERSION}/modules/osnailyfacter/examples/site.pp /etc/puppet/${OPENSTACK_VERSION}/manifests/site.pp
cp ${SOURCE}/centos-versions.yaml ${SOURCE}/ubuntu-versions.yaml /etc/puppet/${OPENSTACK_VERSION}/manifests/
# make links for backward compatibility
pushd /etc/puppet
ln -s ${OPENSTACK_VERSION}/manifests/ /etc/puppet/manifests
ln -s ${OPENSTACK_VERSION}/modules/ /etc/puppet/modules
popd
#pushd /etc/puppet
#ln -s ${OPENSTACK_VERSION}/manifests/ /etc/puppet/manifests
#ln -s ${OPENSTACK_VERSION}/modules/ /etc/puppet/modules
#popd
cp ${SOURCE}/send2syslog.py /bin/send2syslog.py
mkdir -p /var/lib/hiera

View File

@ -112,9 +112,9 @@ endif
# we need to repack puppet artifact because artifact
# has puppet directory packed into it but we need to have an
# archive of puppet modules packed into it
$(ISOROOT)/puppet-slave.tgz: $(BUILD_DIR)/puppet/$(PUPPET_ART_NAME)
tar zxf $(BUILD_DIR)/puppet/$(PUPPET_ART_NAME) -C $(BUILD_DIR)/iso
tar zcf $(ISOROOT)/puppet-slave.tgz -C $(BUILD_DIR)/iso/puppet .
#$(ISOROOT)/puppet-slave.tgz: $(BUILD_DIR)/puppet/$(PUPPET_ART_NAME)
# tar zxf $(BUILD_DIR)/puppet/$(PUPPET_ART_NAME) -C $(BUILD_DIR)/iso
# tar zcf $(ISOROOT)/puppet-slave.tgz -C $(BUILD_DIR)/iso/puppet .
########################
# DOCKER
@ -147,8 +147,7 @@ $(BUILD_DIR)/iso/isoroot-files.done: \
$(ISOROOT)/version.yaml \
$(ISOROOT)/openstack_version \
$(ISOROOT)/centos-versions.yaml \
$(ISOROOT)/ubuntu-versions.yaml \
$(ISOROOT)/puppet-slave.tgz
$(ISOROOT)/ubuntu-versions.yaml
$(ACTION.TOUCH)
$(ISOROOT)/.discinfo: $(SOURCE_DIR)/iso/.discinfo ; $(ACTION.COPY)

View File

@ -1,17 +1,78 @@
.PHONY: mirror-ubuntu
.PHONY: mirror-ubuntu repo-ubuntu
mirror-ubuntu: $(BUILD_DIR)/mirror/ubuntu/mirror.done
repo-ubuntu: $(BUILD_DIR)/mirror/ubuntu/repo.done
define reprepro_dist_conf
Origin: Mirantis
Label: $(PRODUCT_NAME)$(PRODUCT_VERSION)
Suite: $(PRODUCT_NAME)$(PRODUCT_VERSION)
Codename: $(PRODUCT_NAME)$(PRODUCT_VERSION)
Description: Mirantis OpenStack mirror
Architectures: $(UBUNTU_ARCH)
Components: main restricted
DebIndices: Packages Release . .gz .bz2
Update: - $(PRODUCT_NAME)$(PRODUCT_VERSION)
endef
define reprepro_updates_conf
Suite: $(PRODUCT_NAME)$(PRODUCT_VERSION)
Name: $(PRODUCT_NAME)$(PRODUCT_VERSION)
Method: file:$(LOCAL_MIRROR_UBUNTU)
Components: main
Architectures: $(UBUNTU_ARCH)
VerifyRelease: blindtrust
endef
mirror-ubuntu: $(BUILD_DIR)/mirror/ubuntu/build.done
# Two operation modes:
# USE_MIRROR=none - mirroring mode, rsync full mirror from internal build server
# USE_MIRROR=<any_other_value> - ISO building mode, get repository for current product release only
$(BUILD_DIR)/mirror/ubuntu/build.done:
$(BUILD_DIR)/mirror/ubuntu/build.done: $(BUILD_DIR)/mirror/ubuntu/mirror.done
ifneq ($(BUILD_PACKAGES),0)
$(BUILD_DIR)/mirror/ubuntu/build.done: $(BUILD_DIR)/mirror/ubuntu/repo.done
endif
define config_reprepro
#Generate reprepro distributions config
cat > $(LOCAL_MIRROR_UBUNTU)/conf/distributions << EOF
$(reprepro_dist_conf)
EOF
#Generate reprepro updates config
cat > $(LOCAL_MIRROR_UBUNTU)/conf/updates << EOF
$(reprepro_updates_conf)
EOF
endef
$(BUILD_DIR)/mirror/ubuntu/reprepro.done: export config_reprepro:=$(config_reprepro)
$(BUILD_DIR)/mirror/ubuntu/reprepro.done: $(BUILD_DIR)/mirror/ubuntu/mirror.done
mkdir -p $(LOCAL_MIRROR_UBUNTU)/conf
sh -c "$${config_reprepro}"
#Import existing Ubuntu repository
cd $(LOCAL_MIRROR_UBUNTU) && reprepro --confdir=$(LOCAL_MIRROR_UBUNTU)/conf -V update
$(ACTION.TOUCH)
$(BUILD_DIR)/mirror/ubuntu/repo.done: $(BUILD_DIR)/mirror/ubuntu/mirror.done \
$(BUILD_DIR)/mirror/ubuntu/reprepro.done
#FIXME(aglarendil): do not touch upstream repo. instead - build new repo
#Import newly built packages
cd $(LOCAL_MIRROR_UBUNTU) && reprepro --confdir=$(LOCAL_MIRROR_UBUNTU)/conf -V includedeb $(PRODUCT_NAME)$(PRODUCT_VERSION) $(BUILD_DIR)/packages/deb/packages/*.deb
#Clean up reprepro data
rm -rf $(LOCAL_MIRROR_UBUNTU)/db
rm -rf $(LOCAL_MIRROR_UBUNTU)/lists
rm -rf $(LOCAL_MIRROR_UBUNTU)/conf
$(ACTION.TOUCH)
$(BUILD_DIR)/mirror/ubuntu/mirror.done:
mkdir -p $(LOCAL_MIRROR_UBUNTU)
ifeq (none,$(strip $(USE_MIRROR)))
set -ex; rsync -aPtvz $(MIRROR_FUEL_UBUNTU)::$(PRODUCT_NAME)-ubuntu $(LOCAL_MIRROR_UBUNTU)/
else
set -ex; debmirror --method=$(MIRROR_UBUNTU_METHOD) --progress --checksums --nocleanup --host=$(MIRROR_UBUNTU) --root=$(MIRROR_UBUNTU_ROOT) \
--arch=$(UBUNTU_ARCH) --dist=$(PRODUCT_NAME)$(PRODUCT_VERSION) --nosource --exclude=".*-dbg_.*\.deb\$$" --ignore-release-gpg --rsync-extra=none \
--arch=$(UBUNTU_ARCH) --dist=$(PRODUCT_NAME)$(PRODUCT_VERSION) --nosource --ignore-release-gpg --rsync-extra=none \
--section=$(MIRROR_UBUNTU_SECTION) $(LOCAL_MIRROR_UBUNTU)/
rm -rf $(LOCAL_MIRROR_UBUNTU)/.temp $(LOCAL_MIRROR_UBUNTU)/project
endif

View File

@ -0,0 +1,8 @@
use Parse::DebControl;
$parser = new Parse::DebControl;
$data = $parser->parse_file($ARGV[0]);
foreach my $a (@$data) {
next if exists $a->{"Source"};
print ${a}->{"Package"}."\n";
}

73
packages/deb/module.mk Normal file
View File

@ -0,0 +1,73 @@
.PHONY: clean clean-deb
clean: clean-deb
clean-deb:
-mount | grep '$(BUILD_DIR)/packages/deb' | while read entry; do \
set -- $$entry; \
mntpt="$$3"; \
sudo umount $$mntpt; \
done
sudo rm -rf $(BUILD_DIR)/packages/deb
$(BUILD_DIR)/packages/deb/buildd.tar.gz: SANDBOX_DEB_PKGS:=wget bzip2 apt-utils build-essential python-setuptools devscripts debhelper fakeroot
$(BUILD_DIR)/packages/deb/buildd.tar.gz: SANDBOX_UBUNTU:=$(BUILD_DIR)/packages/deb/chroot
$(BUILD_DIR)/packages/deb/buildd.tar.gz: export SANDBOX_UBUNTU_UP:=$(SANDBOX_UBUNTU_UP)
$(BUILD_DIR)/packages/deb/buildd.tar.gz: export SANDBOX_UBUNTU_DOWN:=$(SANDBOX_UBUNTU_DOWN)
$(BUILD_DIR)/packages/deb/buildd.tar.gz: $(BUILD_DIR)/mirror/ubuntu/mirror.done
sh -c "$${SANDBOX_UBUNTU_UP}"
sh -c "$${SANDBOX_UBUNTU_DOWN}"
sudo rm -f $(SANDBOX_UBUNTU)/var/cache/apt/archives/*.deb
sudo tar czf $@.tmp -C $(SANDBOX_UBUNTU) .
mv $@.tmp $@
# Usage:
# (eval (call build_deb,package_name))
define build_deb
$1-deb: $(BUILD_DIR)/packages/deb/$1.done
$(BUILD_DIR)/packages/deb/build.done: $(BUILD_DIR)/packages/deb/$1.done
$(BUILD_DIR)/mirror/ubuntu/repo.done: $(BUILD_DIR)/packages/deb/$1.done
$(BUILD_DIR)/packages/deb/$1.done: $(BUILD_DIR)/mirror/ubuntu/mirror.done
$(BUILD_DIR)/packages/deb/$1.done: $(BUILD_DIR)/packages/source_$1.done
$(BUILD_DIR)/packages/deb/$1.done: $(BUILD_DIR)/packages/deb/buildd.tar.gz
$(BUILD_DIR)/packages/deb/$1.done: SANDBOX_UBUNTU:=$(BUILD_DIR)/packages/deb/SANDBOX/$1
$(BUILD_DIR)/packages/deb/$1.done: SANDBOX_DEB_PKGS:=apt wget bzip2 apt-utils build-essential python-setuptools devscripts debhelper fakeroot
$(BUILD_DIR)/packages/deb/$1.done: export SANDBOX_UBUNTU_UP:=$$(SANDBOX_UBUNTU_UP)
$(BUILD_DIR)/packages/deb/$1.done: export SANDBOX_UBUNTU_DOWN:=$$(SANDBOX_UBUNTU_DOWN)
$(BUILD_DIR)/packages/deb/$1.done: $(BUILD_DIR)/repos/repos.done
mkdir -p $(BUILD_DIR)/packages/deb/packages $(BUILD_DIR)/packages/deb/sources
mkdir -p $$(SANDBOX_UBUNTU)/tmp/$1/
if [ ! -e "$$(SANDBOX_UBUNTU)/etc/debian_version" ]; then \
sudo tar xaf $(BUILD_DIR)/packages/deb/buildd.tar.gz -C $$(SANDBOX_UBUNTU); \
fi
sudo tar zxf $(BUILD_DIR)/packages/sources/$1/$1-$(PACKAGE_VERSION).tar.gz -C $$(SANDBOX_UBUNTU)/tmp/$1/
#sudo cp -r $(BUILD_DIR)/repos/$1/debian $$(SANDBOX_UBUNTU)/tmp/$1/
dpkg-checkbuilddeps $(BUILD_DIR)/repos/$1/debian/control 2>&1 | sed 's/^dpkg-checkbuilddeps: Unmet build dependencies: //g' | sed 's/([^()]*)//g;s/|//g' | sudo tee $$(SANDBOX_UBUNTU)/tmp/$1.installdeps
sudo chroot $$(SANDBOX_UBUNTU) /bin/sh -c "cat /tmp/$1.installdeps | xargs apt-get -y install"
sudo chroot $$(SANDBOX_UBUNTU) /bin/sh -c "cd /tmp/$1 ; DEB_BUILD_OPTIONS=nocheck debuild -us -uc -b -d"
cp $$(SANDBOX_UBUNTU)/tmp/*.deb $(BUILD_DIR)/packages/deb/packages
sudo sh -c "$$$${SANDBOX_UBUNTU_DOWN}"
$$(ACTION.TOUCH)
endef
define remove_deb
#FIXME(aglarendil): do not touch upstream repo. instead - build new repo
mkdir -p $(BUILD_DIR)/packages/deb
perl $(SOURCE_DIR)/packages/deb/genpkgnames.pl $(BUILD_DIR)/repos/$1/debian/control > $(BUILD_DIR)/packages/deb/$1.cleanup.list
cd $(LOCAL_MIRROR_UBUNTU) && cat $(BUILD_DIR)/packages/deb/$1.cleanup.list | \
xargs -n1 -I{} reprepro --confdir=$(LOCAL_MIRROR_UBUNTU)/conf remove $(PRODUCT_NAME)$(PRODUCT_VERSION) {} $(NEWLINE)
endef
$(BUILD_DIR)/mirror/ubuntu/repo.done: $(BUILD_DIR)/packages/deb/repocleanup.done
$(BUILD_DIR)/packages/deb/repocleanup.done: $(BUILD_DIR)/mirror/ubuntu/mirror.done
$(BUILD_DIR)/packages/deb/repocleanup.done: sources
$(foreach pkg,$(fuel_debian_packages),$(call remove_deb,$(pkg)))
$(ACTION.TOUCH)
$(BUILD_DIR)/packages/deb/build.done:
$(ACTION.TOUCH)
fuel_debian_packages:=nailgun astute fuel-library$(PRODUCT_VERSION)
$(eval $(foreach pkg,$(fuel_debian_packages),$(call build_deb,$(pkg))$(NEWLINE)))

View File

@ -1,17 +0,0 @@
fencing-agent (6.0.0-1) precise; urgency=low
* Update code from upstream
-- Igor Kalnitsky <ikalnitsky@mirantis.com> Wed, 26 Nov 2014 19:49:00 +0200
fencing-agent (0.1.0-ubuntu1) precise; urgency=low
* Update code from upstream
-- OSCI Jenkins <dburmistrov@mirantis.com> Wed, 03 Sep 2014 15:17:07 +0400
fencing-agent (0.1.0-1ubuntu0) precise; urgency=low
* Add fencing agent script as a separated task
-- Bogdan Dobrelya <bdobrelia@mirantis.com> Thu, 23 Jan 2014 18:55:00 +0400

View File

@ -1,18 +0,0 @@
Source: fencing-agent
Section: unknown
Priority: extra
Maintainer: Bogdan Dobrelya <bdobrelia@mirantis.com>
Build-Depends: debhelper (>= 8.0.0)
Standards-Version: 3.9.2
Homepage: mirantis.com
Package: fencing-agent
Architecture: all
Depends: ohai (<< 7),
ruby-httpclient,
ruby-rethtool,
ruby-cstruct,
ruby-json,
${misc:Depends}
Description: <insert up to 60 chars description>
<insert long description, indented with spaces>

View File

@ -1 +0,0 @@
fencing-agent.rb /opt/nailgun/bin

View File

@ -1,4 +0,0 @@
#!/usr/bin/make -f
%:
dh $@

View File

@ -1 +0,0 @@
3.0 (quilt)

View File

@ -1,23 +0,0 @@
nailgun-agent (6.0.0-1) precise; urgency=low
* Update code from upstream
-- Igor Kalnitsky <ikalnitsky@mirantis.com> Wed, 26 Nov 2014 19:49:00 +0200
nailgun-agent (3.9.2-ubuntu6) precise; urgency=low
* Update code from upstream
-- OSCI Jenkins <dburmistrov@mirantis.com> Wed, 03 Sep 2014 15:16:22 +0400
nailgun-agent (3.9.2-1ubuntu10) precise; urgency=low
* Add new version code
-- roman <roman@roman-System-Product-Name> Thu, 12 Sep 2013 16:44:14 +0400
nailgun-agent (3.9.2-1) unstable; urgency=low
* Initial release (Closes: #nnnn) <nnnn is the bug number of your ITP>
-- roman <roman@unknown> Tue, 10 Sep 2013 18:51:51 +0400

View File

@ -1,20 +0,0 @@
Source: nailgun-agent
Section: unknown
Priority: extra
Maintainer: rvyalov <rvyalov@mirantis.com>
Build-Depends: debhelper (>= 8.0.0)
Standards-Version: 3.9.2
Homepage: mirantis.com
#Vcs-Git: git://git.debian.org/collab-maint/nailgun-agent.git
#Vcs-Browser: http://git.debian.org/?p=collab-maint/nailgun-agent.git;a=summary
Package: nailgun-agent
Architecture: all
Depends: ohai (<< 7),
ruby-httpclient,
ruby-rethtool,
ruby-cstruct,
ruby-json,
${misc:Depends}
Description: <insert up to 60 chars description>
<insert long description, indented with spaces>

View File

@ -1 +0,0 @@
agent /opt/nailgun/bin

View File

@ -1 +0,0 @@
* * * * * root flock -w 0 -o /var/lock/agent.lock -c "/opt/nailgun/bin/agent 2>&1 | tee -a /var/log/nailgun-agent.log | /usr/bin/logger -t nailgun-agent"

View File

@ -1,4 +0,0 @@
#!/usr/bin/make -f
%:
dh $@

View File

@ -1 +0,0 @@
3.0 (quilt)

View File

@ -1,17 +0,0 @@
nailgun-mcagents (6.0.0-1) precise; urgency=low
* Update code from upstream
-- Igor Kalnitsky <ikalnitsky@mirantis.com> Wed, 26 Nov 2014 19:49:00 +0200
nailgun-mcagents (0.0.1-ubuntu1) precise; urgency=low
* Update code from upstream
-- OSCI Jenkins <dburmistrov@mirantis.com> Wed, 03 Sep 2014 15:20:13 +0400
nailgun-mcagents (0.0.1) unstable; urgency=low
* Initial release.
-- Mirantis Product <product@mirantis.com> Tue, 20 Aug 2013 22:20:46 +0400

View File

@ -1,12 +0,0 @@
Source: nailgun-mcagents
Section: admin
Priority: optional
Maintainer: flops.ru Signing key <admin@flops.ru>
Build-Depends: debhelper (>= 7)
Standards-Version: 3.9.2
Package: nailgun-mcagents
Architecture: all
Depends: ${misc:Depends}, ${shlibs:Depends}, mcollective
Description: NailGun mcagents
.

View File

@ -1,52 +0,0 @@
#!/usr/bin/make -f
include /usr/share/dpkg/pkg-info.mk
clean:
dh_testdir
dh_testroot
rm -f build-stamp
dh_clean
build-arch:
dh_testdir
mkdir -p debian/nailgun-mcagents/usr/share/mcollective/plugins/mcollective/agent/
tar -xzf mcagents.tar.gz -C debian/nailgun-mcagents/usr/share/mcollective/plugins/mcollective/agent/
build: build-arch build-indep
build-indep: build-stamp
build-stamp:
dh_testdir
touch build-stamp
install: build
dh_testdir
binary-arch: build install
dh_testdir
dh_testroot
dh_installdirs
dh_installchangelogs
dh_installdocs
dh_installexamples
dh_install
dh_installcron
dh_installdebconf
dh_installinit
dh_installman
dh_installlogrotate -a
dh_link
dh_compress
dh_fixperms
dh_makeshlibs
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install

View File

@ -1 +0,0 @@
3.0 (quilt)

View File

@ -1,17 +0,0 @@
nailgun-net-check (6.0.0-1) precise; urgency=low
* Update code from upstream
-- Igor Kalnitsky <ikalnitsky@mirantis.com> Wed, 26 Nov 2014 19:49:00 +0200
nailgun-net-check (0.2-ubuntu1) precise; urgency=low
* Update code from upstream
-- OSCI Jenkins <dburmistrov@mirantis.com> Wed, 03 Sep 2014 15:18:56 +0400
nailgun-net-check (0.2-0) unstable; urgency=low
* Initial release.
-- Mirantis Product <product@mirantis.com> Tue, 20 Aug 2013 22:20:46 +0400

View File

@ -1,12 +0,0 @@
Source: nailgun-net-check
Section: admin
Priority: optional
Maintainer: Mirantis Product <product@mirantis.com>
Build-Depends: debhelper (>= 8), python-setuptools
Standards-Version: 3.9.2
Package: nailgun-net-check
Architecture: all
Depends: ${misc:Depends}, ${python:Depends}, python-pypcap, vlan, python-scapy, cliff-tablib, python-stevedore, python-daemonize, python-yaml, tcpdump
Description: NailGun client net-check
.

View File

@ -1,4 +0,0 @@
#!/usr/bin/make -f
%:
dh $@ --with python2

View File

@ -1 +0,0 @@
3.0 (quilt)

View File

@ -1,11 +0,0 @@
python-tasklib (6.0.0-1) precise; urgency=low
* Update code from upstream
-- Igor Kalnitsky <ikalnitsky@mirantis.com> Wed, 26 Nov 2014 19:49:00 +0200
python-tasklib (0.1.0-1) unstable; urgency=low
* Initial release.
-- Mirantis Product <product@mirantis.com> Tue, 30 Sep 2014 14:36:29 +0400

View File

@ -1,13 +0,0 @@
Source: python-tasklib
Section: admin
Priority: optional
Maintainer: Mirantis Product <product@mirantis.com>
Build-Depends: debhelper (>= 8), python-setuptools
Standards-Version: 3.9.2
Package: python-tasklib
Architecture: all
Depends: ${misc:Depends}, ${python:Depends}, python-argparse, python-daemonize, python-yaml
Description: Fuel tasklib
Medium between configuration management providers and user.
For plagability, control and simple interface.

View File

@ -1,4 +0,0 @@
#!/usr/bin/make -f
%:
dh $@ --with python2

View File

@ -1 +0,0 @@
3.0 (quilt)

View File

@ -23,12 +23,6 @@ $(BUILD_DIR)/packages/sources/$1/$2: $(BUILD_DIR)/repos/repos.done
$(BUILD_DIR)/packages/source_$1.done: $(BUILD_DIR)/packages/sources/$1/$2
$(BUILD_DIR)/packages/sources/$1/$2: $(call find-files,$3)
mkdir -p $(BUILD_DIR)/packages/sources/$1
ifeq ($1,nailgun)
mkdir -p $(BUILD_DIR)/npm-cache
cd $3 && npm --cache $(BUILD_DIR)/npm-cache install && ./node_modules/.bin/gulp build --static-dir=compressed_static
rm -rf $3/static
mv $3/compressed_static $3/static
endif
cd $3 && python setup.py sdist -d $(BUILD_DIR)/packages/sources/$1
endef
@ -56,39 +50,42 @@ $(BUILD_DIR)/packages/sources/$1/$2: $(call find-files,$3)
cd $3 && gem build *.gemspec && cp $2 $(BUILD_DIR)/packages/sources/$1/$2
endef
PACKAGE_VERSION=6.0.0
define prepare_git_source
$(BUILD_DIR)/packages/sources/$1/$2: $(BUILD_DIR)/repos/repos.done
$(BUILD_DIR)/packages/source_$1.done: $(BUILD_DIR)/packages/sources/$1/$2
$(BUILD_DIR)/packages/sources/$1/$2:
mkdir -p $(BUILD_DIR)/packages/sources/$1
cd $3 && git archive --format tar --worktree-attributes $4 > $(BUILD_DIR)/packages/sources/$1/$1.tar\
&& git rev-parse $4 > $(BUILD_DIR)/packages/sources/$1/version.txt
cd $(BUILD_DIR)/packages/sources/$1 && tar -rf $1.tar version.txt
cd $(BUILD_DIR)/packages/sources/$1 && gzip -9 $1.tar && mv $1.tar.gz $2
endef
$(BUILD_DIR)/packages/source_%.done:
$(ACTION.TOUCH)
$(eval $(call prepare_file_source,fencing-agent,fencing-agent.rb,$(BUILD_DIR)/repos/nailgun/bin/fencing-agent.rb))
$(eval $(call prepare_file_source,fencing-agent,fencing-agent.cron,$(BUILD_DIR)/repos/nailgun/bin/fencing-agent.cron))
$(eval $(call prepare_python_source,fuel-agent,fuel-agent-$(PACKAGE_VERSION).tar.gz,$(BUILD_DIR)/repos/nailgun/fuel_agent))
$(eval $(call prepare_file_source,fuel-provisioning-scripts,download-debian-installer,$(BUILD_DIR)/repos/nailgun/bin/download-debian-installer))
$(eval $(call prepare_file_source,fuel-agent,fuel-agent.conf,$(BUILD_DIR)/repos/nailgun/fuel_agent/etc/fuel-agent/fuel-agent.conf.sample))
$(eval $(call prepare_python_source,fuel-package-updates,fuel-package-updates-$(PACKAGE_VERSION).tar.gz,$(BUILD_DIR)/repos/nailgun/fuel_upgrade_system/fuel_package_updates))
$(eval $(call prepare_tgz_source,fuel-agent,fuel-agent-cloud-init-templates.tar.gz,$(BUILD_DIR)/repos/nailgun/fuel_agent/cloud-init-templates))
$(eval $(call prepare_tgz_source,fuel-image,fuel-image-$(PACKAGE_VERSION).tar.gz,$(SOURCE_DIR)/image/ubuntu/build_on_masternode))
$(eval $(call prepare_python_source,fuel-ostf,fuel-ostf-$(PACKAGE_VERSION).tar.gz,$(BUILD_DIR)/repos/ostf))
$(eval $(call prepare_python_source,fuelmenu,fuelmenu-$(PACKAGE_VERSION).tar.gz,$(BUILD_DIR)/repos/nailgun/fuelmenu))
$(eval $(call prepare_file_source,nailgun-agent,agent,$(BUILD_DIR)/repos/nailgun/bin/agent))
$(eval $(call prepare_file_source,nailgun-agent,nailgun-agent.cron,$(BUILD_DIR)/repos/nailgun/bin/nailgun-agent.cron))
$(eval $(call prepare_tgz_source,nailgun-mcagents,mcagents.tar.gz,$(BUILD_DIR)/repos/astute/mcagents))
$(eval $(call prepare_tgz_source,ruby21-nailgun-mcagents,nailgun-mcagents.tar.gz,$(BUILD_DIR)/repos/astute/mcagents))
$(eval $(call prepare_python_source,nailgun-net-check,nailgun-net-check-$(PACKAGE_VERSION).tar.gz,$(BUILD_DIR)/repos/nailgun/network_checker))
$(eval $(call prepare_python_source,python-tasklib,tasklib-$(PACKAGE_VERSION).tar.gz,$(BUILD_DIR)/repos/nailgun/tasklib))
$(eval $(call prepare_python_source,nailgun,nailgun-$(PACKAGE_VERSION).tar.gz,$(BUILD_DIR)/repos/nailgun/nailgun))
$(eval $(call prepare_python_source,python-fuelclient,python-fuelclient-$(PACKAGE_VERSION).tar.gz,$(BUILD_DIR)/repos/python-fuelclient))
$(eval $(call prepare_python_source,shotgun,shotgun-$(PACKAGE_VERSION).tar.gz,$(BUILD_DIR)/repos/nailgun/shotgun))
$(eval $(call prepare_file_source,nailgun-redhat-license,get_redhat_licenses,$(SOURCE_DIR)/packages/rpm/nailgun-redhat-license/get_redhat_licenses))
$(eval $(call prepare_ruby21_source,ruby21-rubygem-astute,astute-$(PACKAGE_VERSION).gem,$(BUILD_DIR)/repos/astute))
#NAILGUN_PKGS
$(eval $(call prepare_git_source,nailgun,nailgun-$(PACKAGE_VERSION).tar.gz,$(BUILD_DIR)/repos/nailgun,HEAD))
#FUEL_OSTF_PKGS
$(eval $(call prepare_git_source,fuel-ostf,fuel-ostf-$(PACKAGE_VERSION).tar.gz,$(BUILD_DIR)/repos/fuel-ostf,HEAD))
#ASTUTE_PKGS
$(eval $(call prepare_git_source,astute,astute-$(PACKAGE_VERSION).tar.gz,$(BUILD_DIR)/repos/astute,HEAD))
#FUELLIB_PKGS
$(eval $(call prepare_git_source,fuel-library6.1,fuel-library6.1-$(PACKAGE_VERSION).tar.gz,$(BUILD_DIR)/repos/fuel-library6.1,HEAD))
#FUEL_PYTHON_PKGS
$(eval $(call prepare_git_source,python-fuelclient,python-fuelclient-$(PACKAGE_VERSION).tar.gz,$(BUILD_DIR)/repos/python-fuelclient,HEAD))
#FUEL-IMAGE PKGS
$(eval $(call prepare_git_source,fuel-main,fuel-main-$(PACKAGE_VERSION).tar.gz,$(BUILD_DIR)/repos/fuel-main,HEAD))
include $(SOURCE_DIR)/packages/rpm/module.mk
include $(SOURCE_DIR)/packages/deb/module.mk
.PHONY: packages packages-deb packages-rpm
ifneq ($(BUILD_PACKAGES),0)
$(BUILD_DIR)/packages/build.done: \
$(BUILD_DIR)/packages/rpm/build.done
$(BUILD_DIR)/packages/rpm/build.done \
$(BUILD_DIR)/packages/deb/build.done
endif
$(BUILD_DIR)/packages/build.done:
@ -96,7 +93,12 @@ $(BUILD_DIR)/packages/build.done:
packages: $(BUILD_DIR)/packages/build.done
packages-rpm: $(BUILD_DIR)/packages/rpm/build.done
packages-deb: $(BUILD_DIR)/packages/deb/build.done
#FIXME(aglarendil): make sources generation uniform
#$(BUILD_DIR)/packages/source_fuel-library.done: $(BUILD_DIR)/packages/source_fuel-library6.1.done
# ln -s $(BUILD_DIR)/packages/sources/fuel-library6.1 $(BUILD_DIR)/packages/sources/fuel-library
# $(ACTION.TOUCH)
###################################
#### LATE PACKAGES ################

View File

@ -0,0 +1,6 @@
import rpm
import sys
specfile = sys.argv[1]
spec = rpm.spec(specfile)
for pkg in spec.packages:
print pkg.header.format('%{name}')

View File

@ -12,7 +12,7 @@ clean-rpm:
RPM_SOURCES:=$(BUILD_DIR)/packages/rpm/SOURCES
$(BUILD_DIR)/packages/rpm/buildd.tar.gz: SANDBOX_PACKAGES:=ruby rpm-build tar python-setuptools python-pbr
$(BUILD_DIR)/packages/rpm/buildd.tar.gz: SANDBOX_PACKAGES:=ruby rpm-build tar python-setuptools python-pbr nodejs npm yum yum-utils git
$(BUILD_DIR)/packages/rpm/buildd.tar.gz: SANDBOX:=$(BUILD_DIR)/packages/rpm/SANDBOX/buildd
$(BUILD_DIR)/packages/rpm/buildd.tar.gz: export SANDBOX_UP:=$(SANDBOX_UP)
$(BUILD_DIR)/packages/rpm/buildd.tar.gz: export SANDBOX_DOWN:=$(SANDBOX_DOWN)
@ -31,50 +31,57 @@ $(BUILD_DIR)/packages/rpm/repo$2.done: $(BUILD_DIR)/packages/rpm/$1-repocleanup.
# You can use package name as a target, for example: make ruby21-rubygem-astute
# It will build astute rpm package
$1: $(BUILD_DIR)/packages/rpm/$1.done
$1-rpm: $(BUILD_DIR)/packages/rpm/$1.done
$(BUILD_DIR)/packages/rpm/$1.done: SANDBOX:=$(BUILD_DIR)/packages/rpm/SANDBOX/$1
$(BUILD_DIR)/packages/rpm/$1.done: export SANDBOX_DOWN:=$$(SANDBOX_DOWN)
$(BUILD_DIR)/packages/rpm/$1.done: $(BUILD_DIR)/packages/source_$1.done
$(BUILD_DIR)/packages/rpm/$1.done: $(BUILD_DIR)/packages/rpm/buildd.tar.gz
$(BUILD_DIR)/packages/rpm/$1.done: $(SOURCE_DIR)/packages/rpm/specs/$1.spec
ifneq (late,$(findstring late,$2))
$(BUILD_DIR)/packages/rpm/$1.done: SPECFILE:=$(BUILD_DIR)/repos/$1/specs/$1.spec
$(BUILD_DIR)/repos/$1/specs/$1.spec: $(BUILD_DIR)/repos/repos.done
$(BUILD_DIR)/repos/$1/specs/$1.spec: $(BUILD_DIR)/repos/$1.done
$(BUILD_DIR)/packages/rpm/$1.done: $(BUILD_DIR)/repos/$1/specs/$1.spec
else
$(BUILD_DIR)/packages/rpm/$1.done: SPECFILE:=$(SOURCE_DIR)/packages/rpm/specs/$1.spec
endif
$(BUILD_DIR)/packages/rpm/$1.done:
mkdir -p $(BUILD_DIR)/packages/rpm/RPMS/x86_64
mkdir -p $$(SANDBOX) && \
sudo tar xzf $(BUILD_DIR)/packages/rpm/buildd.tar.gz -C $$(SANDBOX) && \
sudo chroot $$(SANDBOX) bash -c "(mkdir -p '$$$${TEMP}'; mkdir -p /tmp/user/0)"
sudo mount --bind /proc $$(SANDBOX)/proc && \
sudo mount --bind /dev $$(SANDBOX)/dev && \
mkdir -p $$(SANDBOX)/tmp/SOURCES && \
sudo cp -r $(BUILD_DIR)/packages/sources/$1/* $$(SANDBOX)/tmp/SOURCES && \
sudo cp $(SOURCE_DIR)/packages/rpm/specs/$1.spec $$(SANDBOX)/tmp && \
sudo cp $$(SPECFILE) $$(SANDBOX)/tmp && \
sudo /bin/sh -c 'export TMPDIR=$$(SANDBOX)/tmp/yum TMP=$$(SANDBOX)/tmp/yum; yum-builddep -y -c $$(SANDBOX)/etc/yum.conf --installroot=$$(SANDBOX) $$(SANDBOX)/tmp/$1.spec' && \
sudo chroot $$(SANDBOX) rpmbuild --nodeps -vv --define "_topdir /tmp" -ba /tmp/$1.spec
cp $$(SANDBOX)/tmp/RPMS/*/$1-*.rpm $(BUILD_DIR)/packages/rpm/RPMS/x86_64
cp $$(SANDBOX)/tmp/RPMS/*/*.rpm $(BUILD_DIR)/packages/rpm/RPMS/x86_64
sudo sh -c "$$$${SANDBOX_DOWN}"
$$(ACTION.TOUCH)
ifneq (late,$(findstring late,$2))
$(BUILD_DIR)/packages/rpm/$1-repocleanup.done: SPECFILE:=$(BUILD_DIR)/repos/$1/specs/$1.spec
$(BUILD_DIR)/packages/rpm/$1-repocleanup.done: $(BUILD_DIR)/packages/source_$1.done
else
$(BUILD_DIR)/packages/rpm/$1-repocleanup.done: SPECFILE:=$(SOURCE_DIR)/packages/rpm/specs/$1.spec
endif
$(BUILD_DIR)/packages/rpm/$1-repocleanup.done: $(BUILD_DIR)/mirror/centos/repo.done
find $(LOCAL_MIRROR_CENTOS_OS_BASEURL)/Packages -regex '.*/$1-[^-]+-[^-]+' -delete
python $(SOURCE_DIR)/packages/rpm/genpkgnames.py $$(SPECFILE) | xargs -I{} sudo find $(LOCAL_MIRROR_CENTOS_OS_BASEURL)/Packages -regex '.*/{}-[^-]+-[^-]+' -delete
$$(ACTION.TOUCH)
endef
packages_list:=\
fencing-agent \
fuel-agent \
fuel-image \
fuel-package-updates \
fuel-provisioning-scripts \
fuelmenu \
nailgun-mcagents \
ruby21-nailgun-mcagents \
nailgun-net-check \
python-tasklib \
fuel-main \
fuel-library$(PRODUCT_VERSION) \
astute \
nailgun \
shotgun \
fuel-ostf \
nailgun-agent \
nailgun-redhat-license \
python-fuelclient \
ruby21-rubygem-astute
python-fuelclient
$(eval $(foreach pkg,$(packages_list),$(call build_rpm,$(pkg))$(NEWLINE)))
@ -108,6 +115,7 @@ $(BUILD_DIR)/packages/rpm/fuel-docker-images.done: \
$(BUILD_DIR)/packages/rpm/build.done: $(BUILD_DIR)/packages/rpm/repo.done
$(ACTION.TOUCH)
$(BUILD_DIR)/docker/build.done: $(BUILD_DIR)/packages/rpm/repo-late.done
#######################################
# This section is for building container

View File

@ -1,70 +0,0 @@
#!/usr/bin/env python
# Copyright 2013 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import sys
sys.path.insert(0, '/usr/share/rhsm/')
import json
import socket
import traceback
from rhsm.connection import UEPConnection
from subscription_manager.managercli import handle_exception
def get_licenses(username, password):
uep = UEPConnection(username=username, password=password)
owner_key = uep.getOwnerList(username)[0]['key']
pool_list = uep.getPoolsList(owner=owner_key)
avail_licenses = 0
licenses = []
for pool in pool_list:
license_info = {}
if 'OpenStack' in pool['productName']:
license_info['quantity'] = pool['quantity']
license_info['consumed'] = pool['consumed']
license_info['product_name'] = pool['productName']
license_info['id'] = pool['id']
license_info['active_subscription'] = pool['activeSubscription']
# subscriptionSubKey is master for physical hosts
# subscriptionSubKey is derived for virtual hosts
license_info['type'] = pool['subscriptionSubKey']
if pool['subscriptionSubKey'] == 'master':
license_info['free'] = int(pool['quantity']) - int(pool['consumed'])
if pool['activeSubscription']:
avail_licenses += license_info['free']
licenses.append(license_info)
return {
'openstack' : licenses,
'openstack_licenses_physical_hosts_count' : avail_licenses
}
if __name__ == "__main__":
username = sys.argv[1]
password = sys.argv[2]
try:
licenses = get_licenses(username, password)
print json.dumps(licenses)
except Exception, exc:
handle_exception(traceback.format_exc(), exc)

View File

@ -1,31 +0,0 @@
diff -u -r a/pypcap-1.1/pcap_ex.c b/pypcap-1.1/pcap_ex.c
--- a/pypcap-1.1/pcap_ex.c 2005-10-17 02:58:14.000000000 +0400
+++ b/pypcap-1.1/pcap_ex.c 2012-10-10 15:51:39.689673638 +0400
@@ -13,13 +13,14 @@
# include <unistd.h>
#endif
+#include "config.h"
+
#include <pcap.h>
#ifdef HAVE_PCAP_INT_H
# include <pcap-int.h>
#endif
#include "pcap_ex.h"
-#include "config.h"
/* XXX - hack around older Python versions */
#include "patchlevel.h"
diff -u -r a/pypcap-1.1/setup.py b/pypcap-1.1/setup.py
--- a/pypcap-1.1/setup.py 2005-10-17 03:07:03.000000000 +0400
+++ b/pypcap-1.1/setup.py 2012-10-10 15:51:39.689673638 +0400
@@ -46,7 +46,7 @@
incdirs = [ os.path.join(d, sd) ]
if os.path.exists(os.path.join(d, sd, 'pcap.h')):
cfg['include_dirs'] = [ os.path.join(d, sd) ]
- for sd in ('lib', ''):
+ for sd in ('lib', 'lib64', ''):
for lib in (('pcap', 'libpcap.a'),
('pcap', 'libpcap.dylib'),
('wpcap', 'wpcap.lib')):

View File

@ -1,32 +0,0 @@
Name: fencing-agent
Summary: Fencing agent
Version: 6.0.0
Release: 1
License: GPLv2
BuildRoot: %{_tmppath}/%{name}-%{version}
Source0: fencing-agent.rb
Source1: fencing-agent.cron
URL: http://mirantis.com
Requires: rubygem-ohai
%description
Agent for periodic checks for additional fencing criterias (free space, etc)
%prep
rm -rf %{name}-%{version}
mkdir %{name}-%{version}
cp %{SOURCE0} %{name}-%{version}
cp %{SOURCE1} %{name}-%{version}
%install
cd %{name}-%{version}
mkdir -p %{buildroot}/opt/nailgun/bin
mkdir -p %{buildroot}/etc/cron.d
install -m 755 %{SOURCE0} %{buildroot}/opt/nailgun/bin/fencing-agent.rb
install -m 644 %{SOURCE1} %{buildroot}/etc/cron.d/fencing-agent
%clean
rm -rf %{buildroot}
%files
/etc/cron.d/fencing-agent
/opt/nailgun/bin/fencing-agent.rb

View File

@ -1,89 +0,0 @@
%define name fuel-agent
%define version 6.0.0
%define release 1
Summary: Fuel-agent package
Name: %{name}
Version: %{version}
Release: %{release}
URL: http://mirantis.com
Source0: %{name}-%{version}.tar.gz
Source1: %{name}.conf
Source2: %{name}-cloud-init-templates.tar.gz
License: Apache
Group: Development/Libraries
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
Prefix: %{_prefix}
BuildRequires: python-setuptools
BuildRequires: python-pbr
BuildArch: noarch
Requires: PyYAML
Requires: bzip2
Requires: cloud-utils
Requires: coreutils
Requires: debootstrap
Requires: dmidecode
Requires: e2fsprogs
Requires: ethtool
Requires: gdisk
Requires: genisoimage
Requires: gzip
Requires: lvm2
Requires: mdadm
Requires: openssh-clients
Requires: parted
Requires: pciutils
Requires: python
Requires: python-argparse
Requires: python-babel
Requires: python-eventlet
Requires: python-iso8601
Requires: python-jinja2
Requires: python-jsonschema
Requires: python-oslo-config
Requires: python-oslo-serialization >= 1.0.0
Requires: python-pbr
Requires: python-requests
Requires: python-six
Requires: python-stevedore
Requires: python-urllib3
Requires: tar
Requires: udev
Requires: util-linux-ng
Requires: xfsprogs
Requires: xz
%description
Fuel-agent package
%prep
rm -rf %{name}-%{version}
tar -xzf %{SOURCE0}
rm -rf %{name}-cloud-init-templates
mkdir -p %{name}-cloud-init-templates
tar -xzf %{SOURCE2} -C %{name}-cloud-init-templates
%build
cd $RPM_BUILD_DIR/%{name}-%{version}
python setup.py build
%install
cd $RPM_BUILD_DIR/%{name}-%{version}
python setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES
# Install config file
install -d -m 755 %{buildroot}%{_sysconfdir}/fuel-agent
install -p -D -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/fuel-agent/fuel-agent.conf
# Install template file
install -d -m 755 %{buildroot}%{_datadir}/fuel-agent/cloud-init-templates
install -p -D -m 644 $RPM_BUILD_DIR/%{name}-cloud-init-templates/* %{buildroot}%{_datadir}/fuel-agent/cloud-init-templates
%clean
rm -rf $RPM_BUILD_ROOT
%files -f %{name}-%{version}/INSTALLED_FILES
%defattr(-,root,root)
%config(noreplace) %{_sysconfdir}/fuel-agent/fuel-agent.conf
%{_datadir}/fuel-agent/cloud-init-templates/*

View File

@ -1,111 +0,0 @@
%define name fuel-ostf
%define version 6.0.0
%define release 1
Summary: cloud computing testing
Name: %{name}
Version: %{version}
Release: %{release}
Source0: %{name}-%{version}.tar.gz
License: Apache
Group: Development/Libraries
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
Prefix: %{_prefix}
BuildRequires: python-setuptools
BuildArch: noarch
# fuel_health_reqs
Requires: python-amqplib >= 1.0.2
Requires: python-anyjson >= 0.3.3
Requires: python-argparse >= 1.2.1
Requires: python-oslo-config >= 1.1.1
Requires: python-ceilometerclient >= 1.0.9
Requires: python-cinderclient >= 1.0.6
Requires: python-keystoneclient >= 0.11
Requires: python-kombu >= 1:3.0.16
Requires: python-novaclient >= 1:2.15.0
Requires: python-heatclient >= 0.2.5
Requires: python-muranoclient >= 0.2.11
Requires: python-neutronclient >= 2.3.6
Requires: python-saharaclient >= 0.6
Requires: python-swiftclient >= 2.3.1
Requires: python-glanceclient >= 0.14.1
Requires: python-paramiko >= 1.10.1
Requires: python-requests >= 1.1
Requires: python-unittest2 >= 0.5.1
Requires: PyYAML >= 3.10
Requires: python-testresources >= 0.2.7
# fuel_ostf_reqs
Requires: python-keystonemiddleware >= 1.2.0
Requires: python-nose >= 1.3.0
Requires: python-sqlalchemy >= 0.7.8
Requires: python-sqlalchemy < 1.0
Requires: python-alembic >= 0.5.0
Requires: python-gevent >= 0.13.8
Requires: python-pecan >= 0.3.0
Requires: python-pecan < 0.6.0
Requires: python-psycopg2 >= 2.5.1
Requires: python-stevedore >= 0.10
Requires: python-oslo-serialization >= 1.0.0
# test_requires
#mock >= 1.0.1
#pep8 >= 1.4.6
#py >= 1.4.15
#Requires: python-six >= 1.4.1
#tox >= 1.5.0
#Requires: python-mako >= 0.8.1
#Requires: python-markupsafe >= 0.18
#Requires: python-webob >= 1.2.3
#Requires: python-webtest >= 2.0.6
#Requires: python-argparse >= 1.2.1
#Requires: python-beautifulsoup4 >= 4.2.1
#Requires: python-cliff >= 1.4
#Requires: python-cmd2 >= 0.6.5.1
#Requires: python-d2to1 >= 0.2.10
#Requires: python-distribute >= 0.7.3
#Requires: python-extras >= 0.0.3
#Requires: python-greenlet >= 0.4.1
#Requires: python-httplib2 >= 0.8
#Requires: python-iso8601 >= 0.1.4
#Requires: python-jsonpatch >= 1.1
#Requires: python-jsonpointer >= 1.0
#Requires: python-jsonschema >= 2.0.0
#Requires: python-logutils >= 0.3.3
#Requires: python-netaddr >= 0.7.10
#Requires: python-ordereddict >= 1.1
#Requires: python-pbr >= 0.5.21
#Requires: python-prettytable >= 0.7.2
#Requires: python-psycogreen >= 1.0
#Requires: python-pyopenssl >= 0.13
#Requires: python-crypto >= 2.6
#Requires: pyparsing >= 1.5.6
#Requires: python-mimeparse >= 0.1.4
#Requires: python-setuptools-git >= 1.0
#Requires: python-simplegeneric >= 0.8.1
#Requires: python-simplejson >= 3.3.0
#Requires: python-testtools >= 0.9.32
#Requires: python-waitress >= 0.8.5
#Requires: python-warlock >= 1.0.1
#Requires: python-wsgiref >= 0.1.2
%description
fuel-ostf-tests
%prep
%setup -n %{name}-%{version} -n %{name}-%{version}
%build
python setup.py build
%install
python setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES
%clean
rm -rf $RPM_BUILD_ROOT
%files -f INSTALLED_FILES
%defattr(-,root,root)

View File

@ -1,33 +0,0 @@
%define name fuel-provisioning-scripts
%define version 6.1.0
%define release 1
Summary: %{name} package
Name: %{name}
Version: %{version}
Release: %{release}
URL: http://mirantis.com
Source0: download-debian-installer
License: Apache
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
Prefix: %{_prefix}
BuildArch: noarch
Requires: wget
%description
This package provides a set of scripts which we need for provisioning.
%prep
%build
%install
install -p -D -m 755 %{SOURCE0} %{buildroot}%{_bindir}/download-debian-installer
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%{_bindir}/download-debian-installer

View File

@ -1,47 +0,0 @@
%define name fuelmenu
%define version 6.0.0
%define release 1
Summary: Console utility for pre-configuration of Fuel server
Name: %{name}
Version: %{version}
Release: %{release}
Source0: %{name}-%{version}.tar.gz
License: Apache
Group: Development/Libraries
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Prefix: %{_prefix}
BuildArch: noarch
Vendor: Matthew Mosesohn <mmosesohn@mirantis.com>
BuildRequires: python-setuptools
Requires: bind-utils
Requires: nailgun-net-check
Requires: ntp
Requires: python-setuptools
Requires: python-netaddr
Requires: python-netifaces
Requires: python-urwid >= 1.1.0
Requires: PyYAML
Requires: python-ordereddict
%description
Summary: Console utility for pre-configuration of Fuel server
%prep
%setup -n %{name}-%{version} -n %{name}-%{version}
%build
python setup.py build
%install
python setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES
mkdir -p $RPM_BUILD_ROOT/etc
install -d -m 755 $RPM_BUILD_ROOT/etc/fuel
install -m 0600 fuelmenu/settings.yaml $RPM_BUILD_ROOT/etc/fuel/astute.yaml
%clean
rm -rf $RPM_BUILD_ROOT
%files -f INSTALLED_FILES
%defattr(-,root,root)
%config(noreplace) /etc/fuel/astute.yaml

View File

@ -1,39 +0,0 @@
Name: nailgun-agent
Summary: Nailgun starup agent
Version: 6.0.0
Release: 1
License: GPLv2
BuildRoot: %{_tmppath}/%{name}-%{version}
Source0: agent
Source1: nailgun-agent.cron
URL: http://mirantis.com
Requires: rubygem-rethtool
Requires: rubygem-ohai
Requires: rubygem-httpclient
Requires: rubygem-ipaddress
Requires: rubygem-json
Requires: rubygems
%description
Nailgun starup agent that register node at Nailgun and make a little setup
of other services.
%prep
rm -rf %{name}-%{version}
mkdir %{name}-%{version}
cp %{SOURCE0} %{name}-%{version}
cp %{SOURCE1} %{name}-%{version}
%install
cd %{name}-%{version}
mkdir -p %{buildroot}/opt/nailgun/bin
mkdir -p %{buildroot}/etc/cron.d
install -m 755 %{SOURCE0} %{buildroot}/opt/nailgun/bin/agent
install -m 644 %{SOURCE1} %{buildroot}/etc/cron.d/nailgun-agent
%clean
rm -rf %{buildroot}
%files
/etc/cron.d/nailgun-agent
/opt/nailgun/bin/agent

View File

@ -1,28 +0,0 @@
Name: nailgun-mcagents
Summary: MCollective Agents
Version: 6.0.0
Release: 1
License: GPLv2
Source0: mcagents.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}
Requires: mcollective >= 2.2
URL: http://mirantis.com
%description
MCollective agents
%prep
rm -rf %{name}-%{version}
mkdir %{name}-%{version}
tar -xf %{SOURCE0} -C %{name}-%{version}
%install
cd %{name}-%{version}
mkdir -p %{buildroot}/usr/libexec/mcollective/mcollective/agent/
cp * %{buildroot}/usr/libexec/mcollective/mcollective/agent/
%clean
rm -rf %{buildroot}
%files
/usr/libexec/mcollective/mcollective/agent/*

View File

@ -1,44 +0,0 @@
%define name nailgun-net-check
%define version 6.0.0
%define release 1
Name: %{name}
Summary: Network checking package for CentOS6.2
Version: %{version}
Release: %{release}
License: GPLv2
Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
URL: http://github.com/Mirantis
BuildRequires: python-setuptools
Requires: vconfig
Requires: scapy
Requires: python-argparse
Requires: python-pypcap
Requires: python-cliff-tablib
Requires: python-stevedore
Requires: python-daemonize
Requires: python-yaml
Requires: tcpdump
%description
This is a network tool that helps to verify networks connectivity
between hosts in network.
%prep
%setup -n %{name}-%{version}
%build
python setup.py build
%install
python setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES
%clean
rm -rf $RPM_BUILD_ROOT
%files -f INSTALLED_FILES
%defattr(-,root,root)

View File

@ -1,28 +0,0 @@
Name: nailgun-redhat-license
Summary: Getting redhat licenses
Version: 6.0.0
Release: 1
License: Apache License 2.0
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-build
URL: http://github.com/Mirantis
Requires: subscription-manager
Source0: get_redhat_licenses
%description
This is python script that can be used to get redhat licenses.
%prep
rm -rf %{name}-%{version}
mkdir %{name}-%{version}
cp %{SOURCE0} %{name}-%{version}
%install
mkdir -p %{buildroot}/usr/bin
cp %{_sourcedir}/get_redhat_licenses %{buildroot}/usr/bin
%files
%defattr(0755,root,root,-)
/usr/bin/get_redhat_licenses
%clean
rm -rf %{buildroot}

View File

@ -1,74 +0,0 @@
%define name nailgun
%define version 6.0.0
%define release 1
Summary: Nailgun package
Name: %{name}
Version: %{version}
Release: %{release}
Source0: %{name}-%{version}.tar.gz
License: Apache
Group: Development/Libraries
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
Prefix: %{_prefix}
BuildRequires: python-setuptools
BuildArch: noarch
Requires: python-alembic >= 0.6.2
Requires: python-amqplib >= 1.0.2
Requires: python-anyjson >= 0.3.3
Requires: python-argparse >= 1.2.1
Requires: python-babel >= 1.3
Requires: python-crypto >= 2.6.1
Requires: python-decorator >= 3.4.0
Requires: python-fysom >= 1.0.11
Requires: python-iso8601 >= 0.1.9
Requires: python-jinja2 >= 2.7
Requires: python-jsonschema >= 2.3.0
Requires: python-keystoneclient >= 0.11
Requires: python-keystonemiddleware >= 1.2.0
Requires: python-kombu >= 1:3.0.16
Requires: python-mako >= 0.9.1
Requires: python-markupsafe >= 0.18
Requires: python-netaddr >= 0.7.10
Requires: python-netifaces >= 0.8
Requires: python-oslo-config >= 1:1.2.1
Requires: python-oslo-serialization >= 1.0.0
Requires: python-paste >= 1.7.5.1
Requires: python-ply >= 3.4
Requires: python-psycopg2 >= 2.5.1
Requires: python-requests >= 1.2.3
Requires: python-simplejson >= 3.3.0
Requires: python-six >= 1.5.2
Requires: python-sqlalchemy >= 0.7.9
Requires: python-stevedore >= 0.14
Requires: python-urllib3 >= 1.7
Requires: python-webpy >= 0.37
Requires: python-wsgilog >= 0.3
Requires: python-wsgiref >= 0.1.2
Requires: PyYAML >= 3.10
Requires: python-novaclient >= 2.17.0
Requires: python-networkx-core >= 1.8.0
Requires: python-cinderclient >= 1.0.7
Requires: pydot-ng >= 1.0.0
Requires: python-ordereddict >= 1.1
# Workaroud for babel bug
Requires: pytz
%description
Nailgun package
%prep
%setup -n %{name}-%{version} -n %{name}-%{version}
%build
python setup.py build
%install
python setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES
%clean
rm -rf $RPM_BUILD_ROOT
%files -f INSTALLED_FILES
%defattr(0755,root,root)

View File

@ -1,57 +0,0 @@
%define name python-fuelclient
%define unmangled_name python-fuelclient
%define version 6.0.0
%define release 1
Summary: Console utility for working with fuel rest api
Name: %{name}
Version: %{version}
Release: %{release}
Source0: %{unmangled_name}-%{version}.tar.gz
License: Apache
Group: Development/Libraries
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Prefix: %{_prefix}
BuildArch: noarch
BuildRequires: python-setuptools
BuildRequires: python-pbr > 0.7
BuildRequires: python-pbr < 1.0
Requires: python >= 2.6
Requires: python <= 2.7
Requires: python-argparse == 1.2.1
Requires: PyYAML >= 3.1.0
Requires: PyYAML <= 3.10
Requires: python-requests >= 2.1.0
Requires: python-requests <= 2.2.1
Requires: python-keystoneclient >= 1:0.10.0
Requires: python-keystoneclient <= 1:1.1.0
Requires: python-cliff >= 1.7.0
Requires: python-cliff <= 1.9.0
Requires: python-six >= 1.7.0
Requires: python-six <= 1.9.0
%description
Summary: Console utility for working with fuel rest api
%prep
%setup -n %{unmangled_name}-%{version}
%build
python setup.py build
%install
python setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES
%clean
rm -rf $RPM_BUILD_ROOT
%files -f INSTALLED_FILES
%defattr(-,root,root)

View File

@ -1,39 +0,0 @@
%define name python-tasklib
%define unmangled_name tasklib
%define version 6.0.0
%define release 1
Name: %{name}
Summary: Fuel tasklib
Version: %{version}
Release: %{release}
License: GPLv2
Source0: %{unmangled_name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
URL: http://github.com/Mirantis
BuildRequires: python-setuptools
Requires: python-argparse
Requires: python-daemonize
Requires: python-yaml
%description
Medium between configuration management providers and user.
For plagability, control and simple interface.
%prep
%setup -n %{unmangled_name}-%{version}
%build
python setup.py build
%install
python setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES
%clean
rm -rf $RPM_BUILD_ROOT
%files -f INSTALLED_FILES
%defattr(-,root,root)

View File

@ -1,30 +0,0 @@
%define srcname nailgun-mcagents
Name: ruby21-nailgun-mcagents
Summary: MCollective Agents
Version: 6.0.0
Release: 1
License: GPLv2
Source0: %{srcname}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}
Requires: ruby21-mcollective >= 2.2
URL: http://mirantis.com
%description
MCollective agents
%prep
%setup -c -n %{srcname}-%{version}
%install
mkdir -p %{buildroot}/usr/libexec/mcollective/mcollective/agent/
cp * %{buildroot}/usr/libexec/mcollective/mcollective/agent/
%clean
rm -rf %{buildroot}
%files
/usr/libexec/mcollective/mcollective/agent/*
%changelog
* Mon May 6 2013 Mirantis Product <product@mirantis.com> - 0.1.0-1
- Version 0.1.0

View File

@ -1,81 +0,0 @@
%define rbname astute
%define version 6.0.0
%define release 1
%global gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
%global geminstdir %{gemdir}/gems/%{gemname}-%{version}
%define gembuilddir %{buildroot}%{gemdir}
Summary: Orchestrator for OpenStack deployment
Name: ruby21-rubygem-%{rbname}
Version: %{version}
Release: %{release}
Group: Development/Ruby
License: Distributable
URL: http://fuel.mirantis.com
Source0: %{rbname}-%{version}.gem
# Make sure the spec template is included in the SRPM
BuildRoot: %{_tmppath}/%{name}-%{version}-root
Requires: ruby >= 2.1
Requires: ruby21-rubygem-activesupport = 3.0.10
Requires: ruby21-rubygem-mcollective-client = 2.4.1
Requires: ruby21-rubygem-symboltable = 1.0.2
Requires: ruby21-rubygem-rest-client = 1.6.7
Requires: ruby21-rubygem-popen4 = 0.1.2
Requires: ruby21-rubygem-amqp = 1.4.1
Requires: ruby21-rubygem-raemon = 0.3.0
Requires: ruby21-rubygem-net-ssh = 2.8.0
Requires: ruby21-rubygem-net-ssh-gateway = 1.2.0
Requires: ruby21-rubygem-net-ssh-multi = 1.2.0
Requires: openssh-clients
BuildRequires: ruby >= 2.1
BuildArch: noarch
Provides: ruby21(Astute) = %{version}
%description
Deployment Orchestrator of Puppet via MCollective. Works as a library or from
CLI.
%prep
%setup -T -c
%build
%install
%{__rm} -rf %{buildroot}
mkdir -p %{gembuilddir}
gem install --local --install-dir %{gembuilddir} --force %{SOURCE0}
mkdir -p %{buildroot}%{_bindir}
mv %{gembuilddir}/bin/* %{buildroot}%{_bindir}
rmdir %{gembuilddir}/bin
install -d -m 750 %{buildroot}%{_sysconfdir}/astute
cat > %{buildroot}%{_bindir}/astuted <<EOF
#!/bin/bash
ruby -r 'rubygems' -e "gem 'astute', '>= 0'; load Gem.bin_path('astute', 'astuted', '>= 0')" -- \$@
EOF
install -d -m 755 %{buildroot}%{_localstatedir}/log/astute
%clean
%{__rm} -rf %{buildroot}
%files
%defattr(-, root, root)
%{gemdir}/gems/%{rbname}-%{version}/bin/*
%{gemdir}/gems/%{rbname}-%{version}/lib/*
%{gemdir}/gems/%{rbname}-%{version}/spec/*
%{gemdir}/gems/%{rbname}-%{version}/examples/*
%dir %attr(0750, naily, naily) %{_sysconfdir}/%{rbname}
%dir %attr(0755, naily, naily) %{_localstatedir}/log/%{rbname}
%config(noreplace) %{_bindir}/astuted
%doc %{gemdir}/doc/astute-6.0.0
%{gemdir}/cache/astute-6.0.0.gem
%{gemdir}/specifications/astute-6.0.0.gemspec
%changelog

View File

@ -1,43 +0,0 @@
%define name shotgun
%define version 6.0.0
%define release 1
Summary: Shotgun package
Name: %{name}
Version: %{version}
Release: %{release}
URL: http://mirantis.com
Source0: %{name}-%{version}.tar.gz
License: Apache
Group: Development/Libraries
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
Prefix: %{_prefix}
BuildRequires: python-setuptools
BuildArch: noarch
Requires: postgresql
Requires: python-fabric >= 1.10.0
Requires: python-argparse
Requires: tar
Requires: gzip
Requires: bzip2
Requires: openssh-clients
Requires: xz
%description
Shotgun package
%prep
%setup -n %{name}-%{version}
%build
python setup.py build
%install
python setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES
%clean
rm -rf $RPM_BUILD_ROOT
%files -f INSTALLED_FILES
%defattr(-,root,root)

View File

@ -111,7 +111,7 @@ sudo apt-get -y install build-essential make git $GEMPKG debootstrap createrepo
python-setuptools yum yum-utils libmysqlclient-dev isomd5sum bc \
python-nose libvirt-bin python-ipaddr python-paramiko python-yaml \
python-pip kpartx extlinux unzip genisoimage syslinux debmirror \
lrzip python-daemon python-dev
lrzip python-daemon python-dev libparse-debcontrol-perl reprepro
sudo gem install bundler -v 1.2.1
sudo gem install builder
sudo pip install xmlbuilder jinja2 pbr

View File

@ -1,24 +0,0 @@
.PHONY: all puppet
all: puppet
########################
# PUPPET ARTIFACT
########################
puppet: $(ARTS_DIR)/$(PUPPET_ART_NAME)
$(ARTS_DIR)/$(PUPPET_ART_NAME): $(BUILD_DIR)/puppet/$(PUPPET_ART_NAME)
$(ACTION.COPY)
PUPPET_DEP_FILE:=$(call find-files,$(DEPS_DIR_CURRENT)/$(PUPPET_ART_NAME))
ifdef PUPPET_DEP_FILE
$(BUILD_DIR)/puppet/$(PUPPET_ART_NAME): $(PUPPET_DEP_FILE)
$(ACTION.COPY)
else
$(BUILD_DIR)/puppet/$(PUPPET_ART_NAME): \
$(BUILD_DIR)/repos/fuellib.done \
$(call find-files,$(BUILD_DIR)/repos/fuellib/deployment/puppet)
mkdir -p $(@D)
tar czf $@ -C $(BUILD_DIR)/repos/fuellib/deployment puppet
endif

55
regenerate_ubuntu_repo.sh Executable file
View File

@ -0,0 +1,55 @@
#!/bin/bash
# Copyright 2014 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# This script will rebuild local ubuntu mirror.
# Based on the method described here:
# http://troubleshootingrange.blogspot.com/2012/09/hosting-simple-apt-repository-on-centos.html
# Example:
# regenerate_ubuntu_repo /path/to/ubuntu/repo precise
REPO_PATH=$1
REPONAME=$2
BINDIR=${REPO_PATH}/dists/${REPONAME}/main
package_deb=${BINDIR}/binary-amd64/Packages
release_header=`head -8 ${REPO_PATH}/dists/${REPONAME}/Release`
cd ${REPO_PATH}
echo "Regenerating Ubuntu local mirror..."
# Scan *.deb packages
dpkg-scanpackages -a amd64 pool/main > $package_deb 2>/dev/null
gzip -9c $package_deb > ${package_deb}.gz
# Generate release file
cd ${REPO_PATH}/dists/${REPONAME}
echo "$release_header" > Release
# Generate hashes
c1=(MD5Sum: SHA1: SHA256: SHA512:)
c2=(md5 sha1 sha256 sha512)
i=0
while [ $i -lt ${#c1[*]} ]; do
echo ${c1[i]} >> Release
for hashme in `find main -type f \( -name "Package*" -o -name "Release*" \)`; do
chash=`openssl dgst -${c2[$i]} ${hashme}|cut -d" " -f 2`
size=`stat -c %s ${hashme}`
echo " ${chash} ${size} ${hashme}" >> Release
done
i=$(( $i + 1));
done

View File

@ -32,8 +32,19 @@ endef
$(eval $(call build_repo,nailgun,$(NAILGUN_REPO),$(NAILGUN_COMMIT),$(NAILGUN_GERRIT_URL),$(NAILGUN_GERRIT_COMMIT)))
$(eval $(call build_repo,python-fuelclient,$(PYTHON_FUELCLIENT_REPO),$(PYTHON_FUELCLIENT_COMMIT),$(PYTHON_FUELCLIENT_GERRIT_URL),$(PYTHON_FUELCLIENT_GERRIT_COMMIT)))
$(eval $(call build_repo,astute,$(ASTUTE_REPO),$(ASTUTE_COMMIT),$(ASTUTE_GERRIT_URL),$(ASTUTE_GERRIT_COMMIT)))
$(eval $(call build_repo,fuellib,$(FUELLIB_REPO),$(FUELLIB_COMMIT),$(FUELLIB_GERRIT_URL),$(FUELLIB_GERRIT_COMMIT)))
$(eval $(call build_repo,ostf,$(OSTF_REPO),$(OSTF_COMMIT),$(OSTF_GERRIT_URL),$(OSTF_GERRIT_COMMIT)))
$(eval $(call build_repo,fuel-library,$(FUELLIB_REPO),$(FUELLIB_COMMIT),$(FUELLIB_GERRIT_URL),$(FUELLIB_GERRIT_COMMIT)))
$(eval $(call build_repo,fuel-ostf,$(OSTF_REPO),$(OSTF_COMMIT),$(OSTF_GERRIT_URL),$(OSTF_GERRIT_COMMIT)))
$(BUILD_DIR)/repos/fuel-main.done:
ln -s $(SOURCE_DIR) $(BUILD_DIR)/repos/fuel-main
$(ACTION.TOUCH)
$(BUILD_DIR)/repos/repos.done: $(BUILD_DIR)/repos/fuel-main.done $(BUILD_DIR)/repos/fuel-library6.1.done
#FIXME(aglarendil): make repos generation uniform
$(BUILD_DIR)/repos/fuel-library6.1.done: $(BUILD_DIR)/repos/fuel-library.done
ln -s $(BUILD_DIR)/repos/fuel-library $(BUILD_DIR)/repos/fuel-library6.1
$(ACTION.TOUCH)
$(BUILD_DIR)/repos/repos.done:
version_yaml=$(BUILD_DIR)/repos/version.yaml; \

View File

@ -4,13 +4,32 @@ name=Mirantis mirror
baseurl=file://$(LOCAL_MIRROR_CENTOS_OS_BASEURL)
gpgcheck=0
enabled=1
priority=1
endef
define yum_upstream_repo
[upstream]
name=Upstream mirror
baseurl=$(SANDBOX_MIRROR_CENTOS_UPSTREAM_OS_BASEURL)
gpgcheck=0
priority=2
[upstream-updates]
name=Upstream mirror
baseurl=$(SANDBOX_MIRROR_CENTOS_UPDATES_OS_BASEURL)
gpgcheck=0
priority=2
endef
define yum_epel_repo
[epel]
name=epel mirror
baseurl=$(SANDBOX_MIRROR_EPEL_OS_BASEURL)
gpgcheck=0
priority=3
endef
define sandbox_yum_conf
[main]
cachedir=$(SANDBOX)/cache
keepcache=0
debuglevel=6
debuglevel=2
logfile=$(SANDBOX)/yum.log
exclude=*.i686.rpm
exactarch=1
@ -22,7 +41,7 @@ pluginconfpath=$(SANDBOX)/etc/yum/pluginconf.d
reposdir=$(SANDBOX)/etc/yum.repos.d
endef
SANDBOX_PACKAGES:=bash
SANDBOX_PACKAGES:=bash yum
define SANDBOX_UP
echo "Starting SANDBOX up"
@ -32,6 +51,8 @@ $(sandbox_yum_conf)
EOF
cp /etc/resolv.conf $(SANDBOX)/etc/resolv.conf
cat > $(SANDBOX)/etc/yum.repos.d/base.repo <<EOF
$(yum_upstream_repo)
$(yum_epel_repo)
$(yum_local_repo)
EOF
sudo rpm -i --root=$(SANDBOX) `find $(LOCAL_MIRROR_CENTOS_OS_BASEURL) -name "centos-release*rpm" | head -1` || \
@ -50,3 +71,85 @@ sudo umount $(SANDBOX)/proc || true
sudo umount $(SANDBOX)/dev || true
endef
define apt_sources_list
#Upstream Ubuntu mirrors
deb $(MIRROR_UBUNTU_METHOD)://$(MIRROR_UBUNTU)$(MIRROR_UBUNTU_SUFFIX) $(UBUNTU_RELEASE) main universe multiverse restricted
deb $(MIRROR_UBUNTU_METHOD)://$(MIRROR_UBUNTU)$(MIRROR_UBUNTU_SUFFIX) $(UBUNTU_RELEASE)-updates main universe multiverse restricted
deb $(MIRROR_UBUNTU_METHOD)://$(MIRROR_UBUNTU)$(MIRROR_UBUNTU_SUFFIX) $(UBUNTU_RELEASE)-security main universe multiverse restricted
#MOS mirrors
deb $(MIRROR_UBUNTU_METHOD)://$(MIRROR_BASE)/ubuntu $(PRODUCT_NAME)$(PRODUCT_VERSION) main restricted
deb $(MIRROR_UBUNTU_METHOD)://$(MIRROR_BASE)/ubuntu $(PRODUCT_NAME)$(PRODUCT_VERSION)-security main restricted
deb $(MIRROR_UBUNTU_METHOD)://$(MIRROR_BASE)/ubuntu $(PRODUCT_NAME)$(PRODUCT_VERSION)-proposed main restricted
deb $(MIRROR_UBUNTU_METHOD)://$(MIRROR_BASE)/ubuntu $(PRODUCT_NAME)$(PRODUCT_VERSION)-updates main restricted
deb $(MIRROR_UBUNTU_METHOD)://$(MIRROR_BASE)/ubuntu $(PRODUCT_NAME)$(PRODUCT_VERSION)-holdback main restricted
#Extra repositories
$(if $(EXTRA_DEB_REPOS),$(subst |,$(newline)deb ,deb $(EXTRA_DEB_REPOS)))
endef
define apt_preferences
Package: *
Pin: origin download.mirantis.com
Pin-Priority: 1001
Package: *
Pin: release o=Mirantis, n=$(UBUNTU_RELEASE)
Pin-Priority: 1101
# to install packages from unmerged fuel-infra requests
Package: *
Pin: release l=$(UBUNTU_RELEASE)-fuel-$(PRODUCT_VERSION)-stable*
Pin-Priority: 1101
Package: *
Pin: release o=Open Build Service $(UBUNTU_RELEASE)-fuel-$(PRODUCT_VERSION)-stable*
Pin-Priority: 1101
endef
define SANDBOX_UBUNTU_UP
echo "SANDBOX_UBUNTU_UP: start"
mkdir -p $(SANDBOX_UBUNTU)
mkdir -p $(SANDBOX_UBUNTU)/usr/sbin
cat > $(SANDBOX_UBUNTU)/usr/sbin/policy-rc.d <<EOF
#!/bin/sh
# suppress services start in the staging chroots
exit 101
EOF
chmod 755 $(SANDBOX_UBUNTU)/usr/sbin/policy-rc.d
mkdir -p $(SANDBOX_UBUNTU)/etc/init.d
touch $(SANDBOX_UBUNTU)/etc/init.d/.legacy-bootordering
echo "Running debootstrap"
sudo debootstrap --no-check-gpg --arch=$(UBUNTU_ARCH) $(UBUNTU_RELEASE) $(SANDBOX_UBUNTU) http://$(MIRROR_UBUNTU)$(MIRROR_UBUNTU_SUFFIX)
sudo cp /etc/resolv.conf $(SANDBOX_UBUNTU)/etc/resolv.conf
echo "Generating utf8 locale"
sudo chroot $(SANDBOX_UBUNTU) /bin/sh -c 'locale-gen en_US.UTF-8; dpkg-reconfigure locales'
echo "Preparing directory for chroot local mirror"
sudo mkdir -p $(SANDBOX_UBUNTU)/etc/apt/preferences.d/
echo "Generating pinning file for Ubuntu SandBox"
cat > $(BUILD_DIR)/mirror/ubuntu/preferences << EOF
$(apt_preferences)
EOF
sudo cp $(BUILD_DIR)/mirror/ubuntu/preferences $(SANDBOX_UBUNTU)/etc/apt/preferences.d/
echo "Configuring apt sources.list"
cat > $(BUILD_DIR)/mirror/ubuntu/sources.list << EOF
$(apt_sources_list)
EOF
sudo cp $(BUILD_DIR)/mirror/ubuntu/sources.list $(SANDBOX_UBUNTU)/etc/apt/
echo "Allowing using unsigned repos"
sudo mkdir -p /etc/apt/apt.conf.d/
echo "APT::Get::AllowUnauthenticated 1;" | sudo tee $(SANDBOX_UBUNTU)/etc/apt/apt.conf.d/02mirantis-unauthenticated
echo "Updating apt package database"
sudo chroot $(SANDBOX_UBUNTU) bash -c "(mkdir -p '$${TEMP}'; mkdir -p /tmp/user/0)"
sudo chroot $(SANDBOX_UBUNTU) apt-get update
echo "Installing additional packages: $(SANDBOX_DEB_PKGS)"
sudo chroot $(SANDBOX_UBUNTU) apt-get dist-upgrade --yes
test -n "$(SANDBOX_DEB_PKGS)" && sudo chroot $(SANDBOX_UBUNTU) apt-get install --yes $(SANDBOX_DEB_PKGS)
echo "SANDBOX_UBUNTU_UP: done"
endef
define SANDBOX_UBUNTU_DOWN
if mountpoint -q $(SANDBOX_UBUNTU)/proc; then sudo umount $(SANDBOX_UBUNTU)/proc; fi
sudo umount $(SANDBOX_UBUNTU)/tmp/apt || true
endef

View File

@ -1,3 +1,6 @@
#TEMP fixme
%define repo_name fuel-main
%define name fuel-image
%define version 6.0.0
%define release 1
@ -7,7 +10,7 @@ Name: %{name}
Version: %{version}
Release: %{release}
URL: http://mirantis.com
Source0: %{name}-%{version}.tar.gz
Source0: %{repo_name}-%{version}.tar.gz
License: Apache
Group: Development/Libraries
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
@ -31,19 +34,15 @@ Requires: xz
Fuel-image package
%prep
rm -f build_ubuntu_image.py
rm -f create_separate_images.sh
tar -xzf %{SOURCE0}
%setup -cq -n %{name}-%{version}
%build
%install
cd $RPM_BUILD_DIR
install -p -D -m 755 build_ubuntu_image.py %{buildroot}%{_bindir}/build_ubuntu_image.py
install -p -D -m 755 create_separate_images.sh %{buildroot}%{_bindir}/create_separate_images.sh
install -p -D -m 755 %{_builddir}/%{name}-%{version}/image/ubuntu/build_on_masternode/build_ubuntu_image.py %{buildroot}%{_bindir}/build_ubuntu_image.py
install -p -D -m 755 %{_builddir}/%{name}-%{version}/image/ubuntu/build_on_masternode/create_separate_images.sh %{buildroot}%{_bindir}/create_separate_images.sh
%post
ln -s build_ubuntu_image.py %{_bindir}/fuel-image
ln -s %{_bindir}/build_ubuntu_image.py %{_bindir}/fuel-image
%postun
rm -f %{_bindir}/fuel-image