Lahmizzar Muinela
2014-03-09 fba4b32268522ece0edb6305110e75dcc66eee58
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#!/bin/bash
 
# Copyright (C) 1997 - 2014 devXive - research and development
#
# The scriptfile is licensed 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.
#
# The content of static vars and/or static echo output is licensed under the
# devXive Proprietary Use License (http://devxive.com/legal/license)
#
# Author:  devXive, Lahmizzar Muinela
# Email:   support@devxive.com
# Twitter: @devxive
# Website: http://devxive.com
#
#
# Description:
# Simple script to build an appropriate language manifest
#
# How to use
# ./create update 4.2.0b4 2013-12-06 (Fetch Updates from transifex first, then create the install file)
# ./create 4.2.0b4 2013-12-06 (Create the install file from the existing/current languages folder)
#
# This script is invoked by the build script, located in the root dir of this repo
 
sourcePath=$(realpath .)
 
setUpdate="$1"
setVersion="$2"
setDate="$3"
 
if [[ "$1" != "update" && "$1" != "noupdate" ]]
    then
      echo 'Please use update or noupdate or add option --help to get more informations'
    exit 1 
  fi
 
if [[ "$1" != "" && "$2" == "" ]]
    then
        echo 'Please set a version number or add option --help to get more informations'
        exit 1 
    fi
 
if [[ "$3" == "" ]]
    then
        setDate=$(date +"%Y-%m-%d")
    echo "Using $setDate as build date"
    fi
 
version=$setVersion
creationDate=$setDate
 
if [[ "$1" == "update" ]]
    then
    $sourcePath/builder/pull $version
  fi
 
tempDir="$sourcePath/pkg_projectfork_languages"
fileName="pkg_projectfork_languages.xml"
 
rm -rf "$tempDir"
mkdir "$tempDir"
 
touch "$tempDir/$fileName"
 
cp -r $sourcePath/languages $tempDir
cp -r $sourcePath/archive/installer $tempDir
cp $sourcePath/archive/install.script.php $tempDir
 
file="$tempDir/pkg_projectfork_languages.xml"
 
echo '<?xml version="1.0" encoding="UTF-8"?>' >> "$file"
echo '<extension type="package" version="2.5" method="upgrade">' >> "$file"
echo '    <name>Projectfork Language Pack Installer</name>' >> "$file"
echo '    <packagename>projectfork_languages</packagename>' >> "$file"
echo "    <creationDate>$creationDate</creationDate>" >> "$file"
echo '    <author>Projectfork Translation Team</author>' >> "$file"
echo '    <authorEmail>support@projectfork.net</authorEmail>' >> "$file"
echo '    <authorUrl>http://www.projectfork.net</authorUrl>' >> "$file"
echo '    <copyright>(C) 2012 - 2014 by the Projectfork Translation Team. All rights reserved.</copyright>' >> "$file"
echo "    <version>$version</version>" >> "$file"
echo '    <updateable>fullupdate</updateable>' >> "$file"
echo '    <license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>' >> "$file"
echo '    <description></description>' >> "$file"
echo '' >> "$file"
echo '    <scriptfile>install.script.php</scriptfile>' >> "$file"
echo '' >> "$file"
echo '    <files folder="languages">' >> "$file"
echo '    </files>' >> "$file"
echo '' >> "$file"
echo '    <!-- Extension Update Specification -->' >> "$file"
echo '    <updateservers>' >> "$file"
echo '        <server type="extension" priority="1" name="PF4 Translation Update Server">https://raw.github.com/projectfork/Translations/master/archive/update.xml</server>' >> "$file"
echo '    </updateservers>' >> "$file"
echo '</extension>' >> "$file"
 
# zip build in build script
# zip -r $sourcePath/archive/zips/lang_pf4_$version.zip $tempDir/*
# rm -rf "$tempDir"