rename_package.sh 962 Bytes
Newer Older
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1
2
#! /bin/sh

3
4
5
6
# Usage rename_package.sh <new_name> <ABI>
#  new_name should be a string
#  ABI should be an integer, between 0 and 4

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
7
OLD_NAME=org.videolan.vlc
8
NEW_NAME=org.videolan.vlc.$1
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
9

10
11
echo $NEW_NAME $2

12
sed -i.orig -e "s/versionCode\(.*\)0\"/versionCode\1$2\"/" vlc-android/AndroidManifest.xml
13

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
14
15
OLD_PATH=$(echo $OLD_NAME |sed 's/\./\//g')
NEW_PATH=$(echo $NEW_NAME |sed 's/\./\//g')
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
16

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
17
18
19
20
mv vlc-android/src/${OLD_PATH} vlc-android/src/tmp
mkdir -p vlc-android/src/${OLD_PATH}
mv vlc-android/src/tmp vlc-android/src/${NEW_PATH}

21
22
23
find vlc-android \( -name "*.xml" -o -name "*.java" -o -name "*.cfg" -o -name "*.aidl" \) -print0 | xargs -0 sed -i.orig "s/${OLD_NAME}/${NEW_NAME}/g"
find vlc-android \( -name "*.c" \) -print0 | xargs -0 sed -i.orig "s,${OLD_PATH},${NEW_PATH},g"
sed -i.orig "s,${OLD_PATH},${NEW_PATH},g" Makefile
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
24

25
find vlc-android/jni -type f -print0 | xargs -0  sed -i.orig "s,$(echo $OLD_NAME |sed 's/\./_/g'),$(echo $NEW_NAME |sed 's/\./_/g'),g"