perfsonar-dev - [pS-dev] [GEANT/SA2/ps-java-services] r5745 - trunk/geant2-java-sql-ma/packaging
Subject: perfsonar development work
List archive
[pS-dev] [GEANT/SA2/ps-java-services] r5745 - trunk/geant2-java-sql-ma/packaging
Chronological Thread
- From:
- To:
- Subject: [pS-dev] [GEANT/SA2/ps-java-services] r5745 - trunk/geant2-java-sql-ma/packaging
- Date: Wed, 8 Sep 2010 15:41:06 +0100
Author: psnc.pikusa
Date: 2010-09-08 15:41:05 +0100 (Wed, 08 Sep 2010)
New Revision: 5745
Added:
trunk/geant2-java-sql-ma/packaging/package.sh
Log:
Added script to build packages
Added: trunk/geant2-java-sql-ma/packaging/package.sh
===================================================================
--- trunk/geant2-java-sql-ma/packaging/package.sh
(rev 0)
+++ trunk/geant2-java-sql-ma/packaging/package.sh 2010-09-08 14:41:05
UTC (rev 5745)
@@ -0,0 +1,200 @@
+
+#!/bin/sh
+#author: Slawomir Trzaszczka
<>
+#update: Piotr Pikusa
<>
+
+CURR_DIR=$(pwd)
+RPM_VERSION="3.3"
+RPM_SPEC_NAME="ps-mdm-rrd-ma.specs"
+
+SERVICE_NAME="geant2-java-sql-ma"
+OLD_NAME="perfsonar-java-sql-ma"
+
+
+do_clean_up() {
+
+ echo " CLEAN UP"
+ cd $CURR_DIR
+ sudo rm -rf temp
+ sudo rm -rf target
+ echo
+
+}
+
+#
+# build project using maven
+# 1) build project using maven
+# 2) unzip .war into webapps directory
+#
+do_structure() {
+
+ echo " CREATE STRUCT"
+
+ cd $CURR_DIR
+ rm -rfv temp
+ mkdir temp
+ mkdir temp/webapps
+ pwd
+ echo "done !"
+ echo
+ echo
+
+}
+
+#
+# create debian structure
+# 1)create directories deb{debian,build}
+# 2)copy required configuration files for deb-packaging
+#
+do_deb_struct() {
+
+ cd $CURR_DIR
+ echo " CREATE DEB STRUCT"
+ echo "[ ] Removing old deb"
+ rm -rfv temp/deb
+ mkdir -v temp/deb
+ mkdir -v temp/deb/debian
+ mkdir -v temp/deb/build
+ mkdir -v temp/deb/doc
+ mkdir -v temp/deb/samples
+ mkdir -v temp/deb/build/$SERVICE_NAME
+ echo " Copying build/geant2-java-sql-ma to temp/deb/build"
+ cp -av ../build/$SERVICE_NAME/* temp/deb/build/$SERVICE_NAME/
+ echo " Copying doc file"
+ cp -v ../doc/* temp/deb/doc/
+ echo " Copying samples file"
+ cp -v ../samples/* temp/deb/samples/
+ echo "[ ] Copying package files"
+ cp -v deb/* temp/deb/debian
+ echo
+ echo
+
+}
+
+
+#
+# build debian package
+#
+build_deb_package() {
+
+ cd $CURR_DIR
+ echo " CREATE DEB"
+
+ cd temp/deb
+ sudo dpkg-buildpackage
+ echo
+ echo
+}
+
+#
+# remove unnecessary files, copy *.deb package do target folder
+#
+cleanup_after_deb_packaging(){
+
+ cd $CURR_DIR
+ file=$(find temp -regex ".+\.deb$")
+ mkdir target
+ cp $file target
+ sudo rm -rf temp
+ echo
+ echo
+}
+
+#
+# create rpm structure
+# 1)create directories rpm/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS,TMP}
+# 2)tar.gz project
+# 3)copy tar.gz to SOURCES directory
+# 4)copy required configuration file for deb-packaging
+#
+do_rpm_struct() {
+
+ cd $CURR_DIR;
+ echo " CREATE RPM STRUCT"
+ rm -rfv temp/rpm
+ mkdir temp/rpm
+ mkdir -pv temp/rpm/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS,TMP}
+ echo "[ ] Create temp structure for tgz source file"
+ mkdir temp/$SERVICE_NAME-$RPM_VERSION
+ mkdir temp/$SERVICE_NAME-$RPM_VERSION/build
+ mkdir temp/$SERVICE_NAME-$RPM_VERSION/doc
+ mkdir temp/$SERVICE_NAME-$RPM_VERSION/samples
+ cp -vr ../build/* temp/$SERVICE_NAME-$RPM_VERSION/build
+ cp -vr ../doc/* temp/$SERVICE_NAME-$RPM_VERSION/doc
+ cp -vr ../samples/* temp/$SERVICE_NAME-$RPM_VERSION/samples
+
+ echo "[ ] TAR"
+ cd temp
+ tar -czhf $SERVICE_NAME-$RPM_VERSION.tar.gz $SERVICE_NAME-$RPM_VERSION
+ cd ..
+ echo "[ ] Copy tarball into SOURCES"
+ pwd
+ mv -v temp/$SERVICE_NAME-$RPM_VERSION.tar.gz temp/rpm/rpmbuild/SOURCES
+ rm -rf temp/$SERVICE_NAME-$RPM_VERSION
+ rm -rf temp/$SERVICE_NAME-$RPM_VERSION.tar.gz
+
+ echo "[ ] Copy RPM .specs file"
+ cp -v rpm/$RPM_SPEC_NAME temp/rpm/rpmbuild/
+ echo
+ echo
+}
+
+#
+# build rpm package
+#
+build_rpm_package() {
+
+ echo " CREATE RPM PACKAGE"
+ cd $CURR_DIR
+ cd temp/rpm/rpmbuild
+ rpmbuild -bb $RPM_SPEC_NAME
+ echo
+ echo
+
+}
+
+#
+# remove unnecessary files, copy *.deb package do target folder
+#
+cleanup_after_rpm_packaging(){
+
+ cd $CURR_DIR
+ file=$(find temp/rpm/rpmbuild/RPMS/noarch -regex ".+\.rpm$")
+ mkdir target
+ cp $file target
+ rm -rf temp
+ echo
+ echo
+
+}
+
+
+
+case "$1" in
+ clean)
+ do_clean_up
+ ;;
+ structure)
+ do_structure
+ ;;
+ deb)
+ do_clean_up
+ do_structure
+ do_deb_struct
+ build_deb_package
+ #cleanup_after_deb_packaging
+ ;;
+ rpm)
+ do_clean_up
+ do_structure
+ do_rpm_struct
+ build_rpm_package
+ cleanup_after_rpm_packaging
+ ;;
+ *)
+ echo "Usage: $0 clean|deb|rpm" >&2
+ exit 3
+ ;;
+esac
+
+: exit 0
Property changes on: trunk/geant2-java-sql-ma/packaging/package.sh
___________________________________________________________________
Name: svn:executable
+ *
- [pS-dev] [GEANT/SA2/ps-java-services] r5745 - trunk/geant2-java-sql-ma/packaging, svn-noreply, 09/08/2010
Archive powered by MHonArc 2.6.16.