Summary: Sample packaging scripts

This is a manual merge of the maven-to-rpm branch. This commits show how an RPM
package can be built without waf. The current version only builds the management
server rpm and some related rpms like setup. The main missing items are agent rpm and
the awsapi rpm. But it should at least show how to use maven and packaging.

Several small tweaks are put into the client/pom.xml to make sure that the war
has all items required to run as a standalone war.
This commit is contained in:
Hugo Trippaers 2012-10-30 16:31:36 +01:00
parent f65b268a2e
commit 4572bc0685
8 changed files with 673 additions and 2 deletions

View File

@ -164,7 +164,7 @@
</fileset> </fileset>
</copy> </copy>
<copy <copy
todir="${basedir}/target/generated-webapp/WEB-INF/lib/scripts"> todir="${basedir}/target/generated-webapp/WEB-INF/classes/scripts">
<fileset dir="${basedir}/../scripts" /> <fileset dir="${basedir}/../scripts" />
</copy> </copy>
<copy <copy
@ -191,7 +191,49 @@
</filterreader> </filterreader>
</filterchain> </filterchain>
</copy> </copy>
<copy overwrite="true" file="../console-proxy/dist/systemvm.iso" todir="${basedir}/target/generated-webapp/WEB-INF/lib/vms"/> <copy overwrite="true" todir="${basedir}/target/generated-webapp/WEB-INF/classes">
<fileset dir="${basedir}/tomcatconf">
<include name="*.in" />
</fileset>
<globmapper from="*.in" to="*" />
<filterchain>
<filterreader classname="org.apache.tools.ant.filters.ReplaceTokens">
<param type="propertiesfile" value="${basedir}/../build/replace.properties" />
</filterreader>
</filterchain>
</copy>
<copy overwrite="true" todir="${basedir}/target/utilities/bin">
<fileset dir="${basedir}/../setup/bindir">
<include name="*.in" />
</fileset>
<globmapper from="*.in" to="*" />
<filterchain>
<filterreader classname="org.apache.tools.ant.filters.ReplaceTokens">
<param type="propertiesfile" value="${basedir}/../build/replace.properties" />
</filterreader>
</filterchain>
</copy>
<copy overwrite="true" todir="${basedir}/target/utilities/bin">
<fileset dir="${basedir}/bindir">
<include name="*.in" />
</fileset>
<globmapper from="*.in" to="*" />
<filterchain>
<filterreader classname="org.apache.tools.ant.filters.ReplaceTokens">
<param type="propertiesfile" value="${basedir}/../build/replace.properties" />
</filterreader>
</filterchain>
</copy>
<copy overwrite="true" todir="${basedir}/target/utilities/scripts/db">
<fileset dir="${basedir}/../setup/db">
<include name="**/*" />
</fileset>
<filterchain>
<filterreader classname="org.apache.tools.ant.filters.ReplaceTokens">
<param type="propertiesfile" value="${basedir}/../build/replace.properties" />
</filterreader>
</filterchain>
</copy>
</target> </target>
</configuration> </configuration>
</execution> </execution>
@ -213,6 +255,39 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<!-- there are the jasypt libs requires by some of the python scripts -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.5.1</version>
<executions>
<execution>
<id>copy</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.jasypt</groupId>
<artifactId>jasypt</artifactId>
<version>1.9.0</version>`
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/pythonlibs</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>org.jasypt</groupId>
<artifactId>jasypt</artifactId>
<version>1.8</version>`
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/pythonlibs</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins> </plugins>
<pluginManagement> <pluginManagement>
<plugins> <plugins>

View File

@ -0,0 +1,98 @@
#!/bin/bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.
# chkconfig: 35 99 10
# description: Cloud Agent
# WARNING: if this script is changed, then all other initscripts MUST BE changed to match it as well
. /etc/rc.d/init.d/functions
whatami=cloud-external-ipallocator
# set environment variables
SHORTNAME="$whatami"
PIDFILE=/var/run/"$whatami".pid
LOCKFILE=/var/lock/subsys/"$SHORTNAME"
LOGFILE=/var/log/cloud/ipallocator/ipallocator.log
PROGNAME="External IPAllocator"
unset OPTIONS
[ -r /etc/sysconfig/"$SHORTNAME" ] && source /etc/sysconfig/"$SHORTNAME"
DAEMONIZE=/usr/bin/cloud-daemonize
PROG=/usr/bin/cloud-external-ipallocator.py
OPTIONS=8083
start() {
echo -n $"Starting $PROGNAME: "
if hostname --fqdn >/dev/null 2>&1 ; then
daemon --check=$SHORTNAME --pidfile=${PIDFILE} "$DAEMONIZE" \
-n "$SHORTNAME" -p "$PIDFILE" -l "$LOGFILE" "$PROG" $OPTIONS
RETVAL=$?
echo
else
failure
echo
echo The host name does not resolve properly to an IP address. Cannot start "$PROGNAME". > /dev/stderr
RETVAL=9
fi
[ $RETVAL = 0 ] && touch ${LOCKFILE}
return $RETVAL
}
stop() {
echo -n $"Stopping $PROGNAME: "
killproc -p ${PIDFILE} $SHORTNAME # -d 10 $SHORTNAME
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f ${LOCKFILE} ${PIDFILE}
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status -p ${PIDFILE} $SHORTNAME
RETVAL=$?
;;
restart)
stop
sleep 3
start
;;
condrestart)
if status -p ${PIDFILE} $SHORTNAME >&/dev/null; then
stop
sleep 3
start
fi
;;
*)
echo $"Usage: $whatami {start|stop|restart|condrestart|status|help}"
RETVAL=3
esac
exit $RETVAL

View File

@ -0,0 +1,107 @@
#!/bin/bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.
#
# cloud-management This shell script takes care of starting and stopping Tomcat
#
# chkconfig: - 80 20
#
### BEGIN INIT INFO
# Provides: tomcat6
# Required-Start: $network $syslog
# Required-Stop: $network $syslog
# Default-Start:
# Default-Stop:
# Description: Release implementation for Servlet 2.5 and JSP 2.1
# Short-Description: start and stop tomcat
### END INIT INFO
#
# - originally written by Henri Gomez, Keith Irwin, and Nicolas Mailhot
# - heavily rewritten by Deepak Bhole and Jason Corley
#
if [ -r /etc/rc.d/init.d/functions ]; then
. /etc/rc.d/init.d/functions
fi
if [ -r /lib/lsb/init-functions ]; then
. /lib/lsb/init-functions
fi
NAME="$(basename $0)"
stop() {
SHUTDOWN_WAIT="30"
count="0"
if [ -f /var/run/cloud-management.pid ]; then
pid=`cat /var/run/cloud-management.pid`
kill $pid &>/dev/null
until [ "$(ps --pid $pid | grep -c $pid)" -eq "0" ] || \
[ "$count" -gt "$SHUTDOWN_WAIT" ]
do
sleep 1
let count="${count}+1"
done
if [ "$(ps --pid $pid | grep -c $pid)" -eq "0" ]; then
log_success_msg "Stopping cloud-management:"
else
log_failure_msg "Stopping cloud-management:"
fi
else
echo "Cannot find PID file of Cloud-management"
log_failure_msg "Stopping cloud-management:"
fi
}
set_ulimit() {
fd_limit=`ulimit -n`
if [ "$fd_limit" != "4096" ]; then
user=`whoami`
if [ $user == "root" ]; then
ulimit -n 4096
fi
fi
}
handle_pid_file() {
if [ "$1" -ne 0 ] ; then
echo "The pid file locates at /var/run/cloud-management.pid and lock file at /var/lock/subsys/cloud-management.
Starting cloud-management will take care of them or you can manually clean up."
fi
}
# See how we were called.
case "$1" in
status)
status ${NAME}
RETVAL=$?
handle_pid_file $RETVAL
;;
stop)
stop
;;
restart)
stop
set start
set_ulimit
. /etc/rc.d/init.d/tomcat6
;;
*)
set_ulimit
. /etc/rc.d/init.d/tomcat6
esac
exit $RETVAL

View File

@ -0,0 +1,23 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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 file is loaded in /etc/init.d/vmopsmanagement
# ATM we only do two things here:
dummy=1 ; export TOMCAT_CFG=/etc/cloud/management/tomcat6.conf ; . /etc/cloud/management/tomcat6.conf
#--------------------------

View File

@ -0,0 +1,278 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.
%define __os_install_post %{nil}
%global debug_package %{nil}
# DISABLE the post-percentinstall java repacking and line number stripping
# we need to find a way to just disable the java repacking and line number stripping, but not the autodeps
Name: cloud
Summary: CloudStack IaaS Platform
#http://fedoraproject.org/wiki/PackageNamingGuidelines#Pre-Release_packages
%if "%{?_prerelease}" != ""
%define _maventag %{_ver}-SNAPSHOT
Release: %{_rel}%{dist}
%else
%define _maventag %{_ver}
Release: %{_rel}%{dist}
%endif
Version: %{_ver}
License: Apache License 2.0
Vendor: Apache CloudStack <cloudstack-dev@incubator.apache.org>
Packager: Apache CloudStack <cloudstack-dev@incubator.apache.org>
Group: System Environment/Libraries
# FIXME do groups for every single one of the subpackages
Source0: %{name}-%{_maventag}.tgz
BuildRoot: %{_tmppath}/%{name}-%{_maventag}-%{release}-build
BuildRequires: java-1.6.0-openjdk-devel
BuildRequires: tomcat6
BuildRequires: ws-commons-util
BuildRequires: jpackage-utils
BuildRequires: gcc
BuildRequires: glibc-devel
BuildRequires: /usr/bin/mkisofs
BuildRequires: MySQL-python
#BuildRequires: maven => 3.0.0
%description
CloudStack is a highly-scalable elastic, open source,
intelligent IaaS cloud implementation.
%package management-server
Summary: CloudStack management server UI
Requires: tomcat6
Requires: java >= 1.6.0
Requires: python
Requires: bash
Requires: bzip2
Requires: gzip
Requires: unzip
Requires: /sbin/mount.nfs
Requires: openssh-clients
Requires: nfs-utils
Requires: wget
Requires: mysql-connector-java
Requires: ws-commons-util
Requires: jpackage-utils
Requires: sudo
Requires: /sbin/service
Requires: /sbin/chkconfig
Requires: /usr/bin/ssh-keygen
Requires: mkisofs
Requires: MySQL-python
Requires: python-paramiko
Requires: ipmitool
Requires: %{name}-setup = %{_ver}
Group: System Environment/Libraries
%description management-server
The CloudStack management server is the central point of coordination,
management, and intelligence in CloudStack.
%package setup
Summary: CloudStack database setup scripts
Requires: java >= 1.6.0
Requires: python
Requires: MySQL-python
Requires: %{name}-python = %{_ver}
Group: System Environment/Libraries
%description setup
The scripts and commands used to setup and configure the database
%package python
Summary: CloudStack Python library
# FIXME nuke the archdependency
Requires: python
Group: System Environment/Libraries
%description python
The CloudStack Python library contains a few Python modules that the
CloudStack uses.
%prep
echo Doing CloudStack build
%setup -q -n %{name}-%{_maventag}
%build
# this fixes the /usr/com bug on centos5
%define _localstatedir /var
%define _sharedstatedir /var/lib
cp packaging/centos63/replace.properties build/replace.properties
echo VERSION=%{_maventag} >> build/replace.properties
echo PACKAGE=%{name} >> build/replace.properties
mvn package -Dsystemvm
%install
[ ${RPM_BUILD_ROOT} != "/" ] && rm -rf ${RPM_BUILD_ROOT}
mkdir -p ${RPM_BUILD_ROOT}%{_bindir}
mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/%{name}/setup
mkdir -p ${RPM_BUILD_ROOT}/usr/share/%{name}/management/
ln -sf /usr/share/tomcat6/bin ${RPM_BUILD_ROOT}/usr/share/%{name}/management/bin
ln -sf /etc/cloud/management ${RPM_BUILD_ROOT}/usr/share/%{name}/management/conf
ln -sf /usr/share/tomcat6/lib ${RPM_BUILD_ROOT}/usr/share/%{name}/management/lib
ln -sf /var/log/cloud/management ${RPM_BUILD_ROOT}/usr/share/%{name}/management/logs
ln -sf /var/cache/cloud/management/temp ${RPM_BUILD_ROOT}/usr/share/%{name}/management/temp
ln -sf /var/cache/cloud/management/work ${RPM_BUILD_ROOT}/usr/share/%{name}/management/work
mkdir -p ${RPM_BUILD_ROOT}/usr/share/%{name}/management/webapps/client
mkdir -p ${RPM_BUILD_ROOT}/var/log/%{name}/management
mkdir -p ${RPM_BUILD_ROOT}/var/log/%{name}/agent
mkdir -p ${RPM_BUILD_ROOT}/var/log/%{name}/awsapi
mkdir -p ${RPM_BUILD_ROOT}/var/log/%{name}/ipallocator
mkdir -p ${RPM_BUILD_ROOT}/var/cache/%{name}/management/work
mkdir -p ${RPM_BUILD_ROOT}/var/cache/%{name}/management/temp
mkdir -p ${RPM_BUILD_ROOT}/var/lib/%{name}/mnt
mkdir -p ${RPM_BUILD_ROOT}/var/lib/%{name}/management
mkdir -p ${RPM_BUILD_ROOT}/etc/%{name}/management
mkdir -p ${RPM_BUILD_ROOT}/etc/%{name}/management/Catalina/localhost/client
mkdir -p ${RPM_BUILD_ROOT}/etc/rc.d/init.d
mkdir -p ${RPM_BUILD_ROOT}/etc/sysconfig
mkdir -p ${RPM_BUILD_ROOT}/etc/%{name}/management/Catalina/localhost/client
install -D client/target/utilities/bin/* ${RPM_BUILD_ROOT}%{_bindir}
install -D console-proxy/dist/systemvm.iso ${RPM_BUILD_ROOT}/usr/share/%{name}/management/webapps/client/WEB-INF/classes/vms/systemvm.iso
install -D console-proxy/dist/systemvm.zip ${RPM_BUILD_ROOT}/usr/share/%{name}/management/webapps/client/WEB-INF/classes/vms/systemvm.zip
cp -r client/target/utilities/scripts/db/* ${RPM_BUILD_ROOT}%{_datadir}/%{name}/setup
cp -r client/target/cloud-client-ui-4.1.0-SNAPSHOT/* ${RPM_BUILD_ROOT}/usr/share/%{name}/management/webapps/client
for name in db.properties log4j-cloud.xml tomcat6-nonssl.conf tomcat6-ssl.conf server-ssl.xml server-nonssl.xml \
catalina.policy catalina.properties db-enc.properties classpath.conf tomcat-users.xml web.xml ; do
mv ${RPM_BUILD_ROOT}/usr/share/%{name}/management/webapps/client/WEB-INF/classes/$name \
${RPM_BUILD_ROOT}/etc/%{name}/management/$name
done
mv ${RPM_BUILD_ROOT}/usr/share/%{name}/management/webapps/client/WEB-INF/classes/context.xml \
${RPM_BUILD_ROOT}/etc/%{name}/management/Catalina/localhost/client
mkdir -p ${RPM_BUILD_ROOT}/usr/lib/python2.6/site-packages/
cp -r python/lib/cloudutils ${RPM_BUILD_ROOT}/usr/lib/python2.6/site-packages/
cp -r cloud-cli/cloudtool ${RPM_BUILD_ROOT}/usr/lib/python2.6/site-packages/
install python/lib/cloud_utils.py ${RPM_BUILD_ROOT}/usr/lib/python2.6/site-packages/cloud_utils.py
install cloud-cli/cloudapis/cloud.py ${RPM_BUILD_ROOT}/usr/lib/python2.6/site-packages/cloudapis.py
install python/bindir/cloud-external-ipallocator.py ${RPM_BUILD_ROOT}%{_bindir}/
install -D client/target/pythonlibs/jasypt-1.9.0.jar ${RPM_BUILD_ROOT}%{_javadir}/jasypt-1.9.0.jar
install -D client/target/pythonlibs/jasypt-1.8.jar ${RPM_BUILD_ROOT}%{_javadir}/jasypt-1.8.jar
install -D packaging/centos63/cloud-ipallocator.rc ${RPM_BUILD_ROOT}/etc/rc.d/init.d/%{name}-ipallocator
install -D packaging/centos63/cloud-management.rc ${RPM_BUILD_ROOT}/etc/rc.d/init.d/%{name}-management
install -D packaging/centos63/cloud-management.sysconfig ${RPM_BUILD_ROOT}/etc/sysconfig/%{name}-management
chmod 770 ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/management/Catalina
chmod 770 ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/management/Catalina/localhost
chmod 770 ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/management/Catalina/localhost/client
chmod 770 ${RPM_BUILD_ROOT}%{_sharedstatedir}/%{name}/mnt
chmod 770 ${RPM_BUILD_ROOT}%{_sharedstatedir}/%{name}/management
chmod 770 ${RPM_BUILD_ROOT}%{_localstatedir}/cache/%{name}/management/work
chmod 770 ${RPM_BUILD_ROOT}%{_localstatedir}/cache/%{name}/management/temp
chmod 770 ${RPM_BUILD_ROOT}%{_localstatedir}/log/%{name}/management
chmod 770 ${RPM_BUILD_ROOT}%{_localstatedir}/log/%{name}/agent
chmod -R ugo+x ${RPM_BUILD_ROOT}/usr/share/%{name}/management/webapps/client/WEB-INF/classes/scripts
%clean
[ ${RPM_BUILD_ROOT} != "/" ] && rm -rf ${RPM_BUILD_ROOT}
%preun management-server
/sbin/service %{name}-management stop || true
if [ "$1" == "0" ] ; then
/sbin/chkconfig --del %{name}-management > /dev/null 2>&1 || true
/sbin/service %{name}-management stop > /dev/null 2>&1 || true
fi
%pre management-server
id %{name} > /dev/null 2>&1 || /usr/sbin/useradd -M -c "CloudStack unprivileged user" \
-r -s /bin/sh -d %{_sharedstatedir}/%{name}/management %{name}|| true
# set max file descriptors for cloud user to 4096
sed -i /"cloud hard nofile"/d /etc/security/limits.conf
sed -i /"cloud soft nofile"/d /etc/security/limits.conf
echo "cloud hard nofile 4096" >> /etc/security/limits.conf
echo "cloud soft nofile 4096" >> /etc/security/limits.conf
rm -rf %{_localstatedir}/cache/%{name}
# user harcoded here, also hardcoded on wscript
%post management-server
if [ "$1" == "1" ] ; then
/sbin/chkconfig --add %{name}-management > /dev/null 2>&1 || true
/sbin/chkconfig --level 345 %{name}-management on > /dev/null 2>&1 || true
fi
if [ ! -f %{_datadir}/%{name}/management/webapps/client/WEB-INF/classes/scripts/scripts/vm/hypervisor/xenserver/vhd-util ] ; then
echo Please download vhd-util from http://download.cloud.com.s3.amazonaws.com/tools/vhd-util and put it in
echo %{_datadir}/%{name}/management/webapps/client/WEB-INF/classes/scripts/vm/hypervisor/xenserver/
fi
#No default permission as the permission setup is complex
%files management-server
%defattr(-,root,root,-)
%doc LICENSE
%doc NOTICE
%dir %attr(0770,root,%{name}) %{_sysconfdir}/%{name}/management/Catalina
%dir %attr(0770,root,%{name}) %{_sysconfdir}/%{name}/management/Catalina/localhost
%dir %attr(0770,root,%{name}) %{_sysconfdir}/%{name}/management/Catalina/localhost/client
%dir %{_datadir}/%{name}/management
%dir %attr(0770,root,%{name}) %{_sharedstatedir}/%{name}/mnt
%dir %attr(0770,%{name},%{name}) %{_sharedstatedir}/%{name}/management
%dir %attr(0770,root,%{name}) %{_localstatedir}/cache/%{name}/management
%dir %attr(0770,root,%{name}) %{_localstatedir}/cache/%{name}/management/work
%dir %attr(0770,root,%{name}) %{_localstatedir}/cache/%{name}/management/temp
%dir %attr(0770,root,%{name}) %{_localstatedir}/log/%{name}/management
%dir %attr(0770,root,%{name}) %{_localstatedir}/log/%{name}/agent
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}-management
%config(noreplace) %{_sysconfdir}/%{name}/management
%config(noreplace) %attr(0640,root,%{name}) %{_sysconfdir}/%{name}/management/db.properties
%config(noreplace) %{_sysconfdir}/%{name}/management/log4j-%{name}.xml
%config(noreplace) %{_sysconfdir}/%{name}/management/tomcat6-nonssl.conf
%config(noreplace) %{_sysconfdir}/%{name}/management/tomcat6-ssl.conf
%attr(0755,root,root) %{_initrddir}/%{name}-management
%attr(0755,root,root) %{_bindir}/%{name}-setup-management
%attr(0755,root,root) %{_bindir}/%{name}-update-xenserver-licenses
%{_datadir}/%{name}/management/*
%files setup
%attr(0755,root,root) %{_bindir}/%{name}-setup-databases
%attr(0755,root,root) %{_bindir}/%{name}-migrate-databases
%attr(0755,root,root) %{_bindir}/%{name}-set-guest-password
%attr(0755,root,root) %{_bindir}/%{name}-set-guest-sshkey
%attr(0755,root,root) %{_bindir}/%{name}-sysvmadm
%attr(0755,root,root) %{_bindir}/%{name}-setup-encryption
%dir %{_datadir}/%{name}/setup
%{_datadir}/%{name}/setup/*.sql
%{_datadir}/%{name}/setup/db/*.sql
%{_datadir}/%{name}/setup/*.sh
%{_datadir}/%{name}/setup/server-setup.xml
%{_javadir}/jasypt-1.9.0.jar
%{_javadir}/jasypt-1.8.jar
%doc LICENSE
%doc NOTICE
%files python
%defattr(0644,root,root,0755)
%{_prefix}/lib*/python*/site-packages/%{name}*
%attr(0755,root,root) %{_bindir}/cloud-external-ipallocator.py
%attr(0755,root,root) %{_initrddir}/cloud-ipallocator
%dir %attr(0770,root,root) %{_localstatedir}/log/%{name}/ipallocator
%doc LICENSE
%doc NOTICE
%changelog
* Fri Oct 03 2012 Hugo Trippaers <hugo@apache.org> 4.1.0
- new style spec file

View File

@ -0,0 +1,29 @@
#!/bin/bash
CWD=`pwd`
RPMDIR=$CWD/../../dist/rpmbuild
VERSION=`(cd ../../; mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version) | grep -v '^\['`
if echo $VERSION | grep SNAPSHOT ; then
REALVER=`echo $VERSION | cut -d '-' -f 1`
DEFVER="-D_ver $REALVER"
DEFPRE="-D_prerelease 1"
DEFREL="-D_rel SNAPSHOT"
else
DEFVER="-D_ver $REALVER"
DEFPRE=
DEFREL=
fi
mkdir -p $RPMDIR/SPECS
mkdir -p $RPMDIR/SOURCES/cloud-$VERSION
(cd ../../; tar -c --exclude .git --exclude dist . | tar -C $RPMDIR/SOURCES/cloud-$VERSION -x )
(cd $RPMDIR/SOURCES/; tar -czf cloud-$VERSION.tgz cloud-$VERSION)
cp cloud.spec $RPMDIR/SPECS
(cd $RPMDIR; rpmbuild -ba SPECS/cloud.spec "-D_topdir $RPMDIR" "$DEFVER" "$DEFREL" "$DEFPRE" )

View File

@ -0,0 +1,61 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.
DBUSER=cloud
DBPW=cloud
DBROOTPW=
MSLOG=vmops.log
APISERVERLOG=api.log
DBHOST=localhost
MSMNTDIR=/mnt
COMPONENTS-SPEC=components-premium.xml
AWSAPILOG=awsapi.log
REMOTEHOST=localhost
AGENTCLASSPATH=
AGENTLOG=/var/log/cloud/agent/agent.log
AGENTLOGDIR=/var/log/cloud/agent/
AGENTSYSCONFDIR=/etc/cloud/agent
APISERVERLOG=/var/log/cloud/management/apilog.log
AWSAPILOG=/var/log/cloud/awsapi/awsapi.log
BINDIR=/usr/bin
COMMONLIBDIR=/usr/share/java
CONFIGUREVARS=
DEPSCLASSPATH=
DOCDIR=
IPALOCATORLOG=/var/log/cloud/management/ipallocator.log
JAVADIR=/usr/share/java
LIBEXECDIR=/usr/libexec
LOCKDIR=/var/lock
MSCLASSPATH=
MSCONF=/etc/cloud/management
MSENVIRON=/usr/share/cloud/management
MSLOG=/var/log/cloud/management/management-server.log
MSLOGDIR=/var/log/cloud/management/
MSMNTDIR=/var/lib/cloud/mnt
MSUSER=cloud
PIDDIR=/var/run
PLUGINJAVADIR=
PREMIUMJAVADIR=
PYTHONDIR=/usr/lib/python2.6/site-packages/
SERVERSYSCONFDIR=/etc/sysconfig
SETUPDATADIR=/usr/share/cloud/setup
SYSCONFDIR=/etc/sysconfig
SYSTEMCLASSPATH=
SYSTEMJARS=
USAGECLASSPATH=
USAGELOG=/var/log/cloud/usage
USAGESYSCONFDIR=/etc/sysconfig