add script for generate license.html 39/67739/1 accepted/tizen/mobile/20160428.082128 submit/tizen/20160428.075138
authorHyungGi Lee <hyunggi.lee@samsung.com>
Thu, 28 Apr 2016 06:58:18 +0000 (15:58 +0900)
committerHyungGi Lee <hyunggi.lee@samsung.com>
Thu, 28 Apr 2016 06:58:18 +0000 (15:58 +0900)
Change-Id: Iac5244afd197436560a5ef6d4868178c413f1203

mobile.yaml
scripts/mobile-license.post [new file with mode: 0644]

index ee4deb0..a424c4f 100644 (file)
@@ -78,6 +78,7 @@ Wayland:
         - mobile-bluetooth
         - mobile-mbr-3parts
         - mobile-user
+        - mobile-license
     Repos: []
     NoChrootScripts:
         - buildname
@@ -119,6 +120,7 @@ Wayland-64:
         - mobile-bluetooth
         - mobile-mbr-3parts
         - mobile-user
+        - mobile-license
     Repos: []
     NoChrootScripts:
         - buildname
@@ -161,6 +163,7 @@ Emulator32-wayland:
         - mobile-web-framework
         - mobile-bluetooth
         - mobile-user
+        - mobile-license
     Repos: []
     NoChrootScripts:
         - buildname
@@ -203,6 +206,7 @@ Emulator64-wayland:
         - mobile-web-framework
         - mobile-bluetooth
         - mobile-user
+        - mobile-license
     Repos: []
     NoChrootScripts:
         - buildname
diff --git a/scripts/mobile-license.post b/scripts/mobile-license.post
new file mode 100644 (file)
index 0000000..5f7103e
--- /dev/null
@@ -0,0 +1,50 @@
+#!/bin/sh
+echo "############### mobile-license.post ################"
+
+LICENSE_DIR=/usr/share/license
+LICENSE_FILE=/usr/share/license.html
+MD5_TEMP_FILE=/usr/share/temp_license_md5
+
+if [[ -f $LICENSE_FILE ]]; then
+        rm -f $LICENSE_FILE
+fi
+
+LICENSE_LIST=`ls $LICENSE_DIR`
+
+if [[ -f $MD5_TEMP_FILE ]]; then
+        rm -f $MD5_TEMP_FILE
+fi
+
+cd $LICENSE_DIR
+
+for INPUT in $LICENSE_LIST; do
+        if [[ -f $INPUT ]]; then
+                md5sum $INPUT >> $MD5_TEMP_FILE
+        fi
+done
+
+MD5_LIST=`cat $MD5_TEMP_FILE|awk '{print $1}'|sort -u`
+
+echo "<html>" >> $LICENSE_FILE
+echo "<head>" >> $LICENSE_FILE
+echo "<meta name=\"viewport\" content=\"initial-scale=1.0\">" >> $LICENSE_FILE
+echo "</head>" >> $LICENSE_FILE
+echo "<body>" >> $LICENSE_FILE
+echo "<xmp>" >> $LICENSE_FILE
+
+for INPUT in $MD5_LIST; do
+        PKG_LIST=`cat $MD5_TEMP_FILE|grep $INPUT|awk '{print $2}'`
+        PKG_NAME=`echo $PKG_LIST|awk '{print $1}'`
+
+        echo "$PKG_LIST :" >> $LICENSE_FILE
+        cat $PKG_NAME >> $LICENSE_FILE
+        echo  >> $LICENSE_FILE
+        echo  >> $LICENSE_FILE
+        echo  >> $LICENSE_FILE
+done
+
+echo "</xmp>" >> $LICENSE_FILE
+echo "</body>" >> $LICENSE_FILE
+echo "</html>" >> $LICENSE_FILE
+
+rm -rf $LICENSE_DIR/* $MD5_TEMP_FILE