Skip to content

Commit

Permalink
Added phpMyAdmin-4.8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
stefaang committed Jan 21, 2019
1 parent efc9418 commit f1669d3
Show file tree
Hide file tree
Showing 14 changed files with 191 additions and 1 deletion.
6 changes: 5 additions & 1 deletion build_and_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ PACKAGE=$1
docker run -it -v $(pwd):/wdpksrc wdpk /bin/bash -c "cd wdpk/$PACKAGE; ./build.sh; chown -R 1000:1000 ../../packages/$PACKAGE"

# find latest package
PRODUCT="PR4100" # TODO: use env
if [ -z "$3" ]; then
PRODUCT="PR4100" # TODO: use env
else
PRODUCT="$3"
fi

BINARY=$(find -name "*$PRODUCT*$PACKAGE*.bin" | sort | head -n1)
echo "Created $BINARY"
Expand Down
5 changes: 5 additions & 0 deletions wdpk/phpMyAdmin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# phpMyAdmin

Latest version of myPhpAdmin with MySQL 5.4 support is 4.0.10.20.

No longer support since April 1 2017!
3 changes: 3 additions & 0 deletions wdpk/phpMyAdmin/admin.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CREATE USER admin@'localhost' IDENTIFIED BY 'admin';
GRANT ALL ON *.* TO admin@'localhost' IDENTIFIED BY 'admin' WITH GRANT OPTION;
FLUSH PRIVILEGES;
17 changes: 17 additions & 0 deletions wdpk/phpMyAdmin/apkg.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Package: phpMyAdmin
Packager: phpMyAdmin
Email: [email protected]
Homepage: http://www.phpmyadmin.net/home_page/index.php
AddonShowName: phpMyAdmin
AddonIndexPage: index.php
AddonUsedPort: 80
InstDepend:
InstConflict:
StartDepend:
StartConflict:
Description: An open source, browser-based tool written in PHP that helps with the administration of MySQL and is often used as both an editor and administration assist tool for sites and some content management systems, such as WordPress.
Version: 1.04
Icon: phpMyAdmin.png
MinFWVer:
MaxFWVer:
IndividualFlag:
5 changes: 5 additions & 0 deletions wdpk/phpMyAdmin/before_apkg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

# DO NOT REMOVE!!
# This is for APKG Joomla backward compatibility(version 1.00).
# backup config files SHOULD BE wrote into preinst.sh, and this JUST for APKG Joomla backward compatibility.
26 changes: 26 additions & 0 deletions wdpk/phpMyAdmin/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh

APP_NAME="$(basename $(pwd))"
DATE="$(date +"%m%d%Y")"
CWD="$(pwd)"
VERSION="$(awk '/Version/{print $NF}' apkg.rc)"

echo "Building ${APP_NAME} version ${VERSION}"

MODELS="WDMyCloudEX4 WDMyCloudEX2 WDMyCloudMirror WDMyCloud WDMyCloudEX4100 WDMyCloudDL4100 WDMyCloudEX2100 WDMyCloudDL2100 WDMyCloudMirrorGen2 MyCloudEX2Ultra MyCloudPR4100 MyCloudPR2100"

for model in $MODELS; do
../../mksapkg -E -s -m $model > /dev/null
done

echo "Move binaries"

RELEASE_DIR="../../packages/${APP_NAME}"
mkdir -p "${RELEASE_DIR}"
find .. -maxdepth 1 -name "*.bin*" -exec rename 's#\('$DATE'\)##' {} \;
mv ../*.bin "${RELEASE_DIR}"

echo "Bundle sources"
SRC_TAR="${RELEASE_DIR}/${APP_NAME}_src_${VERSION}.tar.gz"
tar -czf $SRC_TAR .

7 changes: 7 additions & 0 deletions wdpk/phpMyAdmin/clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
path=$1
APKG_WWW_DIR="/var/www/phpMyAdmin"

# remove link
rm -rf ${APKG_WWW_DIR} 2> /dev/null

14 changes: 14 additions & 0 deletions wdpk/phpMyAdmin/init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

path=$1
APKG_WWW_DIR="/var/www/phpMyAdmin"
APKG_MODULE_WEB_DIR="phpMyAdmin-4.0.10.20-all-languages"
APKG_ICON_FILE_NAME="phpMyAdmin.png"
APKG_MULTI_LANG_DESC_XML="desc.xml"

#remove link
rm -rf $APKG_WWW_DIR 2> /dev/null

#create link
ln -sf $path/web/* ${APKG_WWW_DIR}

37 changes: 37 additions & 0 deletions wdpk/phpMyAdmin/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/sh

path_src=$1
path_des=$2

APKG_WWW_DIR="/var/www/phpMyAdmin"
APKG_MODULE="phpMyAdmin"
APKG_MODULE_WEB_DIR="phpMyAdmin-4.0.10.20-all-languages"
ARCHIVE="${APKG_MODULE_WEB_DIR}.zip"
APKG_MODULE_SettingFile="config.inc.php"
APKG_PATH=${path_des}/${APKG_MODULE}
APKG_BACKUP_PATH=${APKG_PATH}/../${APKG_MODULE}_backup

mv $path_src/${APKG_MODULE} $path_des

# setup secure downloads
if [ ! -e /etc/ssl/cert.pem ]; then
curl --remote-name --time-cond cacert.pem https://curl.haxx.se/ca/cacert.pem
mv cacert.pem /etc/ssl/cert.pem
fi

# download phpMyAdmin from the official website
cd ${APKG_PATH}
/usr/bin/wget https://files.phpmyadmin.net/phpMyAdmin/4.0.10.20/$ARCHIVE

# extract
unzip $ARCHIVE
rm $ARCHIVE

# restore config files if they are saved in preinst.sh (or before_apkg.sh)
if [ -d ${APKG_BACKUP_PATH} ] ; then
#copy setting file
cp -af ${APKG_BACKUP_PATH}/${APKG_MODULE_SettingFile} ${APKG_PATH}/${APKG_MODULE_WEB_DIR}/
rm -rf ${APKG_BACKUP_PATH}
else
mysql --user=root --password=XP4VddgD0zd8IbKQ < $path_des/phpMyAdmin/admin.sql
fi
26 changes: 26 additions & 0 deletions wdpk/phpMyAdmin/preinst.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh

path_src=$1

APKG_PATH=$1
APKG_WWW_DIR="/var/www/phpMyAdmin"
APKG_MODULE="phpMyAdmin"
APKG_MODULE_WEB_DIR="phpMyAdmin-4.0.10.20"
APKG_MODULE_SettingFile="config.inc.php"
APKG_BACKUP_PATH=${APKG_PATH}/../${APKG_MODULE}_backup
#stop daemon

#remove link
rm -rf $APKG_WWW_DIR 2> /dev/null

# backup config files and users settings
if [ ! -d ${APKG_BACKUP_PATH} ] ; then
mkdir -p ${APKG_BACKUP_PATH}
fi
# copy config to tmp dir
cp -af $APKG_PATH/${APKG_MODULE_WEB_DIR}/${APKG_MODULE_SettingFile} ${APKG_BACKUP_PATH}

#cmd on reinstall

#copy file to installed directory

23 changes: 23 additions & 0 deletions wdpk/phpMyAdmin/remove.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh

path=$1
APKG_PATH=$1
APKG_WWW_DIR="/var/www/phpMyAdmin"
APKG_MODULE="phpMyAdmin"
APKG_MODULE_WEB_DIR="phpMyAdmin-4.0.10.20"
APKG_MODULE_SettingFile="config.inc.php"
APKG_BACKUP_PATH=${APKG_PATH}/../${APKG_MODULE}_backup

#stop daemon

#remove link
rm -rf $APKG_WWW_DIR

#remove mysql user
if [ ! -d ${APKG_BACKUP_PATH} ] ; then
mysql --user=root --password=XP4VddgD0zd8IbKQ < $path/del_admin.sql
fi

#remove intstalled directory
rm -rf $path

10 changes: 10 additions & 0 deletions wdpk/phpMyAdmin/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
path=$1
APKG_WWW_DIR="/var/www/phpMyAdmin/"
APKG_MODULE_WEB_DIR="phpMyAdmin-4.0.10.20-all-languages"
#start daemon
rm -rf $APKG_WWW_DIR 2> /dev/null
ln -sf $path/$APKG_MODULE_WEB_DIR/* $APKG_WWW_DIR

#cmd on start daemon

13 changes: 13 additions & 0 deletions wdpk/phpMyAdmin/stop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh
path=$1
APKG_WWW_DIR="/var/www/phpMyAdmin"
APKG_MODULE_WEB_DIR="phpMyAdmin-4.0.10.20-all-languages"
APKG_ICON_FILE_NAME="phpMyAdmin.png"
APKG_MULTI_LANG_DESC_XML="desc.xml"

# stop daemon
rm -rf $APKG_WWW_DIR

# re-add the icon
mkdir ${APKG_WWW_DIR}
ln -s $path/web/* ${APKG_WWW_DIR}
Binary file added wdpk/phpMyAdmin/web/phpMyAdmin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f1669d3

Please sign in to comment.