Skip to Content.
Sympa Menu

perfsonar-dev - [GEANT/SA2/ps-java-services] r5474 - branches/new-structure-with-base2/ps-mdm-ls/packaging

Subject: perfsonar development work

List archive

[GEANT/SA2/ps-java-services] r5474 - branches/new-structure-with-base2/ps-mdm-ls/packaging


Chronological Thread 
  • From:
  • To:
  • Subject: [GEANT/SA2/ps-java-services] r5474 - branches/new-structure-with-base2/ps-mdm-ls/packaging
  • Date: Mon, 1 Feb 2010 10:33:56 GMT

Author: psnc.trzaszczka
Date: 2010-02-01 10:33:56 +0000 (Mon, 01 Feb 2010)
New Revision: 5474

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

Modified: branches/new-structure-with-base2/ps-mdm-ls/packaging/package.conf
===================================================================
--- branches/new-structure-with-base2/ps-mdm-ls/packaging/package.conf
2010-02-01 09:48:30 UTC (rev 5473)
+++ branches/new-structure-with-base2/ps-mdm-ls/packaging/package.conf
2010-02-01 10:33:56 UTC (rev 5474)
@@ -5,6 +5,8 @@
#
# important for correct build of RPM package ! (must be the same as in .spec
file)

+
+CURR_DIR=$(pwd)
RPM_VERSION="2.0"
RPM_SPEC_NAME="perfsonar-java-xml-ls.specs"


Modified: branches/new-structure-with-base2/ps-mdm-ls/packaging/package.sh
===================================================================
--- branches/new-structure-with-base2/ps-mdm-ls/packaging/package.sh
2010-02-01 09:48:30 UTC (rev 5473)
+++ branches/new-structure-with-base2/ps-mdm-ls/packaging/package.sh
2010-02-01 10:33:56 UTC (rev 5474)
@@ -5,11 +5,13 @@


do_clean_up() {
+
echo " CLEAN UP"
- rm -rf temp
- rm -rf target
- echo
- echo
+ cd $CURR_DIR
+ rm -rf temp
+ rm -rf target
+ echo
+
}

#
@@ -18,23 +20,22 @@
# 2) unzip .war into webapps directory
#
do_structure() {
+
echo " CREATE STRUCT"

-
- rm -rfv temp/webapps
+ cd $CURR_DIR
+ rm -rfv temp
mkdir temp
mkdir temp/webapps

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

echo "done !"
echo
echo
+
}

#
@@ -43,20 +44,19 @@
# 2)copy required configuration files for deb-packaging
#
do_deb_struct() {
-
- echo " CREATE 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
+ echo "[ ] Copying package files"
+ cp -v deb/* temp/deb/debian
+ echo
+ echo

- echo "[ ] Removing old deb"
- rm -rfv packaging/temp/deb
- mkdir -v packaging/temp
- mkdir -v packaging/temp/deb
- mkdir -v packaging/temp/deb/debian
- mkdir -v packaging/temp/deb/build
-
- echo "[ ] Copying package files"
- cp -v packaging/deb/* packaging/temp/deb/debian
- echo
- echo
}


@@ -64,10 +64,11 @@
# build debian package
#
build_deb_package() {
-
+
+ cd $CURR_DIR
echo " CREATE DEB"

- cd packaging/temp/deb
+ cd temp/deb
sudo dpkg-buildpackage -d
echo
echo
@@ -78,7 +79,7 @@
#
cleanup_after_deb_packaging(){

- cd ../..
+ cd $CURR_DIR
file=$(find temp -regex ".+\.deb$")
mkdir target
cp $file target
@@ -96,31 +97,24 @@
#
do_rpm_struct() {

- echo " CREATE RPM STRUCT"
-
- cd packaging
-
- rm -rfv temp/rpm
- mkdir temp/rpm
- mkdir -pv temp/rpm/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS,TMP}
-
- echo "[ ] Create symbolic link and create tar archive"
-
- cd temp/webapps
-
- LSVER=$(ls | grep $SERVICE_NAME)
- ln -sv $LSVER $SERVICE_NAME-$RPM_VERSION
- echo "[ ] TAR"
- tar -czhf $SERVICE_NAME-$RPM_VERSION.tar.gz $SERVICE_NAME-$RPM_VERSION
- cd ..
-
- echo "[ ] Copy tarball into SOURCES"
- pwd
- mv -v webapps/$SERVICE_NAME-$RPM_VERSION.tar.gz rpm/rpmbuild/SOURCES
-
- echo "[ ] Copy RPM .specs file"
- cp -v ../rpm/$RPM_SPEC_NAME rpm/rpmbuild
- echo
+ 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 symbolic link and create tar archive"
+ cd temp/webapps
+ LSVER=$(ls | grep $SERVICE_NAME)
+ ln -sv $LSVER $SERVICE_NAME-$RPM_VERSION
+ echo "[ ] TAR"
+ tar -czhf $SERVICE_NAME-$RPM_VERSION.tar.gz $SERVICE_NAME-$RPM_VERSION
+ cd ..
+ echo "[ ] Copy tarball into SOURCES"
+ pwd
+ mv -v webapps/$SERVICE_NAME-$RPM_VERSION.tar.gz rpm/rpmbuild/SOURCES
+ echo "[ ] Copy RPM .specs file"
+ cp -v ../rpm/$RPM_SPEC_NAME rpm/rpmbuild
+ echo
echo
}

@@ -128,27 +122,33 @@
# build debian package
#
build_rpm_package() {
+
echo " CREATE RPM PACKAGE"
- cd rpm
+ cd $CURR_DIR
+ cd temp/rpm
rpmbuild -bb rpmbuild/$RPM_SPEC_NAME
echo
echo
+
}

#
# remove unnecessary files, copy *.deb package do target folder
#
cleanup_after_rpm_packaging(){
- cd ../..
+
+ 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
@@ -157,12 +157,14 @@
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



  • [GEANT/SA2/ps-java-services] r5474 - branches/new-structure-with-base2/ps-mdm-ls/packaging, svn-noreply, 02/01/2010

Archive powered by MHonArc 2.6.16.

Top of Page