Examples

Bootstrapping

This is needed to get ready for the rest of anvils stages by installing anvils python dependencies so that anvil can correctly run using said dependencies.

$ sudo ./smithy --bootstrap

Terminal recording: http://showterm.io/effa75ea631777a2e74a0/

Preparing

This stage does the download of the source repositories, analysis of dependencies, download of missing dependencies and building of source repositories and missing dependencies into source rpms.

$ ./smithy -a prepare

Terminal recording: http://showterm.io/12c29e87094f128d945fa/

Building

This is the stage responsible for translating the previously prepared source rpms into installable rpms (of the non-source type). The output of this phase is two repositories, one with the dependencies and one with the rpms for the openstack components themselves.

$ sudo ./smithy -a build

Terminal recording: http://showterm.io/2fee38794dcf536ccd437/

Packaging

To see the packages built (after prepare has finished).

$ ls /home/harlowja/openstack/deps/rpmbuild/SPECS/ | cat
 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
openstack-deps.spec
pylint.spec
pyparsing.spec
python-babel.spec
python-cheetah.spec
python-cinderclient.spec
python-cinder.spec
python-cliff.spec
python-cliff-tablib.spec
python-cmd2.spec
python-colorama.spec
python-coverage.spec
python-crypto.spec
python-decorator.spec
python-discover.spec
python-docutils.spec
python-extras.spec
python-fixtures.spec
python-glanceclient.spec
python-glance.spec
python-hp3parclient.spec
python-httplib2.spec
python-jinja2.spec
python-jsonpatch.spec
python-jsonpointer.spec
python-jsonschema.spec
python-keystoneclient.spec
python-keystone.spec
python-ldap.spec
python-logilab-astng.spec
python-logilab-common.spec
python-lxml.spec
python-markdown.spec
python-markupsafe.spec
python-mimeparse.spec
python-netaddr.spec
python-nose-exclude.spec
python-nosehtmloutput.spec
python-nose.spec
python-nosexcover.spec
python-novaclient.spec
python-nova.spec
python-openstack-nose-plugin.spec
python-oslo-config.spec
python-pam.spec
python-pastedeploy.spec
python-pep8.spec
python-prettytable.spec
python-pygments.spec
python-pysqlite.spec
python-neutronclient.spec
python-repoze-lru.spec
python-routes.spec
python-setuptools-git.spec
python-setuptools.spec
python-sphinx.spec
python-sqlalchemy-migrate.spec
python-sqlalchemy.spec
python-subunit.spec
python-tablib.spec
python-tempita.spec
python-termcolor.spec
python-testrepository.spec
python-testtools.spec
python-unittest2.spec
python-warlock.spec
python-webob.spec
python-wsgiref.spec
python-xattr.spec
$ cat openstack-deps.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
Name: openstack-deps
Version: 2013.6.3
Release: 0
License: Apache 2.0
Summary: OpenStack dependencies
BuildArch: noarch

Requires: MySQL-python
Requires: avahi
Requires: coreutils
Requires: curl
Requires: dnsmasq
Requires: dnsmasq-utils
Requires: ebtables
Requires: fuse
Requires: gawk
Requires: git
Requires: guestfish
Requires: iptables
Requires: iputils
Requires: iscsi-initiator-utils
Requires: kpartx
Requires: libguestfs
Requires: libguestfs-mount
Requires: libguestfs-tools
Requires: libvirt
Requires: libvirt-client
Requires: libvirt-python
Requires: libxml2-devel
Requires: libxslt-devel
Requires: lsof
Requires: mlocate
Requires: mysql
Requires: mysql-server
Requires: openssh-server
Requires: parted
Requires: postgresql-devel
Requires: psmisc
Requires: python
Requires: python-devel
Requires: python-distutils-extra
Requires: python-setuptools
Requires: qemu-img
Requires: qemu-kvm
Requires: rabbitmq-server
Requires: sqlite
Requires: sqlite-devel
Requires: sudo
Requires: tcpdump
Requires: unzip
Requires: vconfig
Requires: wget

%description


%pre

# rabbitmq-server
service qpidd stop 2>/dev/null || true
chkconfig qpidd off 2>/dev/null || true


%files

$ cat python-nova.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
%define pkg_name nova
%define version 2013.1
%define unmangled_version 2013.1
%define unmangled_version 2013.1
%define release 1

Summary: cloud computing fabric controller
Name: python-nova
Epoch: 2
Version: %{version}
Release: %{release}
Source0: %{pkg_name}-%{unmangled_version}.tar.gz
License: UNKNOWN
Group: Development/Libraries
BuildRoot: %{_tmppath}/%{pkg_name}-%{version}-%{release}-buildroot
Prefix: %{_prefix}
BuildArch: noarch
Vendor: OpenStack <nova@lists.launchpad.net>
Requires:  python-sqlalchemy >= 0.7.8 python-sqlalchemy < 0.7.99 python-cheetah >= 2.4.4 python-amqplib >= 0.6.1 python-anyjson >= 0.2.4 python-argparse python-boto python-eventlet >= 0.9.17 python-kombu >= 1.0.4 python-lxml >= 2.3 python-routes >= 1.12.3 python-webob = 1.2.3 python-greenlet >= 0.3.1 python-pastedeploy >= 1.5 python-paste python-sqlalchemy-migrate >= 0.7.2 python-netaddr >= 0.7.6 python-suds >= 0.4 python-paramiko python-pyasn1 python-babel >= 0.9.6 python-iso8601 >= 0.1.4 python-httplib2 python-setuptools-git >= 0.4 python-cinderclient >= 2:1.0.1 python-neutronclient >= 2:2.2 python-neutronclient < 2:3 python-glanceclient >= 2:0.5 python-glanceclient < 2:2 python-keystoneclient >= 2:0.2 python-stevedore >= 0.7 python-websockify < 0.4 python-oslo-config >= 2:1.1
Url: http://www.openstack.org/

%description
UNKNOWN

%prep
%setup -n %{pkg_name}-%{unmangled_version} -n %{pkg_name}-%{unmangled_version}

%build
python setup.py build

%install
python setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES
abspath_installed_files=$(readlink -f INSTALLED_FILES)
(
    cd $RPM_BUILD_ROOT
    for i in usr/*/python*/site-packages/* usr/bin/*; do
        if [ -e "$i" ]; then
            sed -i "s@/$i/@DELETE_ME@" "$abspath_installed_files"
            echo "/$i"
        fi
    done
    if [ -d usr/man ]; then
        rm -rf usr/share/man
        mkdir -p usr/share
        mv usr/man usr/share/
        sed -i "s@/usr/man/@DELETE_ME@" "$abspath_installed_files"
        for i in usr/share/man/*; do
            echo "/$i/*"
        done
    fi
) >> GATHERED_FILES
{ sed '/^DELETE_ME/d' INSTALLED_FILES; cat GATHERED_FILES; } | sort -u > INSTALLED_FILES.tmp
mv -f INSTALLED_FILES{.tmp,}


%clean
rm -rf $RPM_BUILD_ROOT

%files -f INSTALLED_FILES
%defattr(-,root,root)