Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r5419 - in branches/new-structure-with-base2/ps-mdm-ls/packaging: . rpm

Subject: perfsonar development work

List archive

perfsonar: r5419 - in branches/new-structure-with-base2/ps-mdm-ls/packaging: . rpm


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r5419 - in branches/new-structure-with-base2/ps-mdm-ls/packaging: . rpm
  • Date: Tue, 15 Dec 2009 08:58:48 -0500

Author: trzaszcz
Date: 2009-12-15 08:58:48 -0500 (Tue, 15 Dec 2009)
New Revision: 5419

Modified:
branches/new-structure-with-base2/ps-mdm-ls/packaging/package.conf
branches/new-structure-with-base2/ps-mdm-ls/packaging/package.sh

branches/new-structure-with-base2/ps-mdm-ls/packaging/rpm/perfsonar-java-xml-ls.specs
Log:
packaging enhancement

Modified: branches/new-structure-with-base2/ps-mdm-ls/packaging/package.conf
===================================================================
--- branches/new-structure-with-base2/ps-mdm-ls/packaging/package.conf
2009-12-15 12:56:32 UTC (rev 5418)
+++ branches/new-structure-with-base2/ps-mdm-ls/packaging/package.conf
2009-12-15 13:58:48 UTC (rev 5419)
@@ -2,17 +2,10 @@
# Config for package.sh script
#

-VERSION="1.4.1"
+#
+# important for correct build of RPM package ! (must be the same as in .spec
file)

-# ---------------------------------------------------------
-# Directories - do not change
-# ---------------------------------------------------------
+RPM_VERSION="1.4.1"

-BASEDIR=".."
-WEBAPPS="$BASEDIR/packaging/webapps"
-SERVICE="perfsonar-java-xml-ls"
-SERVICEDIR="$WEBAPPS/$SERVICE"
-LIB="$SERVICEDIR/WEB-INF/lib"
-CONF="$SERVICEDIR/WEB-INF/classes/perfsonar/conf"
+SERVICE_NAME="perfsonar-java-xml-ls"

-WARFILE="geant2-java-xml-ls.war"

Modified: branches/new-structure-with-base2/ps-mdm-ls/packaging/package.sh
===================================================================
--- branches/new-structure-with-base2/ps-mdm-ls/packaging/package.sh
2009-12-15 12:56:32 UTC (rev 5418)
+++ branches/new-structure-with-base2/ps-mdm-ls/packaging/package.sh
2009-12-15 13:58:48 UTC (rev 5419)
@@ -4,40 +4,47 @@
. package.conf


-do_clean() {
-
- echo "[ ] CLEAN UP"
- rm -rfv $BASEDIR/packaging/temp
-
+do_clean_up() {
+ echo " CLEAN UP"
+ rm -rf temp
+ rm -rf target
+ echo
+ echo
}

#
-# -----------------------------------------------------------------------
-# structure of the unzipped war file
-# -----------------------------------------------------------------------
+# build project using maven
+# 1) build project using maven
+# 2) unzip .war into webapps directory
#
do_structure() {
- echo "[ ] PREPARE STRUCTURE"
- echo "[ ] Remove old $SERVICEDIR"
+ echo " CREATE STRUCT"
+

rm -rfv temp/webapps
mkdir temp
mkdir temp/webapps

- cd $BASEDIR
+ cd ..
mvn clean install -o -P production
echo "war built"
pwd
- unzip target/perfsonar-java-xml-ls.war -d
packaging/temp/webapps/perfsonar-java-xml-ls
+ unzip target/$SERVICE_NAME.war -d packaging/temp/webapps/$SERVICE_NAME
echo "war unziped"

echo "done !"
+ echo
+ echo
}

-
+#
+# create debian structure
+# 1)create directories deb{debian,build}
+# 2)copy required configuration files for deb-packaging
+#
do_deb_struct() {

- echo "[ ] Do DEB struct"
+ echo " CREATE DEB STRUCT"

echo "[ ] Removing old deb"
rm -rfv packaging/temp/deb
@@ -48,25 +55,49 @@

echo "[ ] Copying package files"
cp -v packaging/deb/* packaging/temp/deb/debian
+ echo
+ echo
}

-create_deb_package() {
+
+#
+# build debian package
+#
+build_deb_package() {
+
+ echo " CREATE DEB"
+
cd packaging/temp/deb
sudo dpkg-buildpackage -d
+ echo
+ echo
}

-clean_after_deb_packaging(){
+#
+# remove unnecessary files, copy *.deb package do target folder
+#
+cleanup_after_deb_packaging(){
+
cd ../..
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() {
- echo "[ ] Do RPM struct"
-
+
+ echo " CREATE RPM STRUCT"
+
cd packaging

rm -rfv temp/rpm
@@ -77,29 +108,50 @@

cd temp/webapps

- LSVER=$(ls | grep perfsonar-java-xml-ls)
- ln -sv $LSVER perfsonar-java-xml-ls-$VERSION
+ LSVER=$(ls | grep $SERVICE_NAME)
+ ln -sv $LSVER $SERVICE_NAME-$RPM_VERSION
echo "[ ] TAR"
- tar -czhf perfsonar-java-xml-ls-$VERSION.tar.gz
perfsonar-java-xml-ls-$VERSION
+ tar -czhf $SERVICE_NAME-$RPM_VERSION.tar.gz $SERVICE_NAME-$RPM_VERSION
cd ..

echo "[ ] Copy tarball into SOURCES"
pwd
- mv -v webapps/perfsonar-java-xml-ls-$VERSION.tar.gz rpm/rpmbuild/SOURCES
+ mv -v webapps/$SERVICE_NAME-$RPM_VERSION.tar.gz rpm/rpmbuild/SOURCES

echo "[ ] Copy RPM .specs file"
cp -v ../rpm/perfsonar-java-xml-ls.specs rpm/rpmbuild
+ echo
+ echo
}

-create_rpm_package() {
+#
+# build debian package
+#
+build_rpm_package() {
+ echo " CREATE RPM PACKAGE"
cd rpm
- sudo rpmbuild -bb rpmbuild/perfsonar-java-xml-ls.specs
+ sudo rpmbuild -bb rpmbuild/$SERVICE_NAME.specs
+ echo
+ echo
}

+#
+# remove unnecessary files, copy *.deb package do target folder
+#
+cleanup_after_rpm_packaging(){
+ cd ../..
+ file=$(find temp/rpm/rpmbuld/RPMS/noarch -regex ".+\.rpm$")
+ mkdir target
+ cp $file target
+ sudo rm -rf temp
+ echo
+ echo
+}

+
case "$1" in
clean)
- do_clean
+ do_clean_up
;;
structure)
do_structure
@@ -107,29 +159,17 @@
deb)
do_structure
do_deb_struct
- create_deb_package
- clean_after_deb_packaging
+ build_deb_package
+ cleanup_after_deb_packaging
;;
rpm)
do_structure
do_rpm_struct
- create_rpm_package
+ build_rpm_package
+ cleanup_after_rpm_packaging
;;
- all)
- do_clean
- do_structure
- do_war
- do_deb_struct
- do_rpm_struct
- show_debinfo
- show_rpminfo
- ;;
- info)
- show_debinfo
- show_rpminfo
- ;;
*)
- echo "Usage: $0 clean|structure|deb|rpm|all" >&2
+ echo "Usage: $0 clean|deb|rpm" >&2
exit 3
;;
esac

Modified:
branches/new-structure-with-base2/ps-mdm-ls/packaging/rpm/perfsonar-java-xml-ls.specs
===================================================================
---
branches/new-structure-with-base2/ps-mdm-ls/packaging/rpm/perfsonar-java-xml-ls.specs
2009-12-15 12:56:32 UTC (rev 5418)
+++
branches/new-structure-with-base2/ps-mdm-ls/packaging/rpm/perfsonar-java-xml-ls.specs
2009-12-15 13:58:48 UTC (rev 5419)
@@ -1,6 +1,6 @@
%define prefix /usr/lib/perfsonar/services/%{name}

-Name: ps-mdm-ls
+Name: perfsonar-java-xml-ls
Version: 2.0
License: Modified BSD
Release: 1
@@ -16,7 +16,7 @@


%description
-perfSONAR Round Robin Database
+perfSONAR Lookup Service based on psBase2






  • perfsonar: r5419 - in branches/new-structure-with-base2/ps-mdm-ls/packaging: . rpm, svnlog, 12/15/2009

Archive powered by MHonArc 2.6.16.

Top of Page