mirror of
https://github.com/SuperBFG7/ympd
synced 2024-12-24 10:00:27 +00:00
Fix: simplified packaging
This commit is contained in:
parent
9272b69c9f
commit
4961daa6a3
51
PKGBUILD
51
PKGBUILD
@ -1,7 +1,6 @@
|
||||
# Maintainer: K. Loz <cultofrobots [at] protonmail [dot] com>
|
||||
# Based on jcorporation's myMPD mkrelease.sh
|
||||
# Maintainer: Juergen Mang <mail [at] jcgames [dot] de>
|
||||
# Website: https://github.com/jcorporation/myMPD
|
||||
# PKGBUILD Based on mympd-archphile by Mike Andonov <info [at] archphile [dot] org>
|
||||
# PKGBUILD Based on https://github.com/CultofRobots/archphile-custom/tree/master/mympd
|
||||
|
||||
pkgname=mympd
|
||||
_pkgname=myMPD
|
||||
@ -12,7 +11,7 @@ arch=('x86_64' 'armv7h' 'aarch64')
|
||||
url="http://github.org/jcorporation/myMPD"
|
||||
license=('GPL')
|
||||
depends=('libmpdclient' 'openssl')
|
||||
makedepends=('cmake' 'git')
|
||||
makedepends=('cmake')
|
||||
optdepends=()
|
||||
provides=()
|
||||
conflicts=()
|
||||
@ -21,49 +20,6 @@ install=contrib/archlinux.install
|
||||
source=("https://github.com/jcorporation/${_pkgname}/archive/v${pkgver}.tar.gz")
|
||||
sha256sums=('SKIP')
|
||||
|
||||
prepare() {
|
||||
export java=$(which java 2> /dev/null)
|
||||
|
||||
if [ -f ${srcdir}/${_pkgname}-${pkgver}/dist/buildtools/closure-compiler.jar ] && [ "$java" != "$NULL" ]
|
||||
then
|
||||
echo "Minifying javascript"
|
||||
[ ${srcdir}/${_pkgname}-${pkgver}/htdocs/js/player.js -nt ${srcdir}/${_pkgname}-${pkgver}/dist/htdocs/js/player.min.js ] && \
|
||||
java -jar ${srcdir}/${_pkgname}-${pkgver}/dist/buildtools/closure-compiler.jar ${srcdir}/${_pkgname}-${pkgver}/htdocs/js/player.js > ${srcdir}/${_pkgname}-${pkgver}/dist/htdocs/js/player.min.js
|
||||
[ ${srcdir}/${_pkgname}-${pkgver}/htdocs/js/mympd.js -nt ${srcdir}/${_pkgname}-${pkgver}/dist/htdocs/js/mympd.min.js ] && \
|
||||
java -jar ${srcdir}/${_pkgname}-${pkgver}/dist/buildtools/closure-compiler.jar ${srcdir}/${_pkgname}-${pkgver}/htdocs/js/mympd.js > ${srcdir}/${_pkgname}-${pkgver}/dist/htdocs/js/mympd.min.js
|
||||
[ ${srcdir}/${_pkgname}-${pkgver}/htdocs/sw.js -nt ${srcdir}/${_pkgname}-${pkgver}/dist/htdocs/sw.min.js ] && \
|
||||
java -jar ${srcdir}/${_pkgname}-${pkgver}/dist/buildtools/closure-compiler.jar ${srcdir}/${_pkgname}-${pkgver}/htdocs/sw.js > ${srcdir}/${_pkgname}-${pkgver}/dist/htdocs/sw.min.js
|
||||
else
|
||||
echo "${srcdir}/${_pkgname}-${pkgver}/dist/buildtools/closure-compiler.jar not found, using non-minified files"
|
||||
[ ${srcdir}/${_pkgname}-${pkgver}/htdocs/js/player.js -nt ${srcdir}/${_pkgname}-${pkgver}/dist/htdocs/js/player.min.js ] && \
|
||||
cp ${srcdir}/${_pkgname}-${pkgver}/htdocs/js/player.js ${srcdir}/${_pkgname}-${pkgver}/dist/htdocs/js/player.min.js
|
||||
[ ${srcdir}/${_pkgname}-${pkgver}/htdocs/js/mympd.js -nt ${srcdir}/${_pkgname}-${pkgver}/dist/htdocs/js/mympd.min.js ] && \
|
||||
cp ${srcdir}/${_pkgname}-${pkgver}/htdocs/js/mympd.js ${srcdir}/${_pkgname}-${pkgver}/dist/htdocs/js/mympd.min.js
|
||||
[ ${srcdir}/${_pkgname}-${pkgver}/htdocs/sw.js -nt ${srcdir}/${_pkgname}-${pkgver}/dist/htdocs/sw.min.js ] && \
|
||||
cp ${srcdir}/${_pkgname}-${pkgver}/htdocs/sw.js ${srcdir}/${_pkgname}-${pkgver}/dist/htdocs/sw.min.js
|
||||
fi
|
||||
|
||||
if [ -f ${srcdir}/${_pkgname}-${pkgver}/dist/buildtools/closure-stylesheets.jar ] && [ "$java" != "$NULL" ]
|
||||
then
|
||||
echo "Minifying stylesheets"
|
||||
[ ${srcdir}/${_pkgname}-${pkgver}/htdocs/css/mympd.css -nt ${srcdir}/${_pkgname}-${pkgver}/dist/htdocs/css/mympd.min.css ] && \
|
||||
java -jar ${srcdir}/${_pkgname}-${pkgver}/dist/buildtools/closure-stylesheets.jar --allow-unrecognized-properties ${srcdir}/${_pkgname}-${pkgver}/htdocs/css/mympd.css > ${srcdir}/${_pkgname}-${pkgver}/dist/htdocs/css/mympd.min.css
|
||||
else
|
||||
echo "${srcdir}/${_pkgname}-${pkgver}/dist/buildtools/closure-stylesheets.jar not found, using non-minified files"
|
||||
[ ${srcdir}/${_pkgname}-${pkgver}/htdocs/css/mympd.css -nt ${srcdir}/${_pkgname}-${pkgver}/dist/htdocs/css/mympd.min.css ] && \
|
||||
cp ${srcdir}/${_pkgname}-${pkgver}/htdocs/css/mympd.css ${srcdir}/${_pkgname}-${pkgver}/dist/htdocs/css/mympd.min.css
|
||||
fi
|
||||
|
||||
echo "Replacing javascript and stylesheets with minified files"
|
||||
sed -e 's/mympd\.css/mympd\.min\.css/' -e 's/mympd\.js/mympd\.min\.js/' ${srcdir}/${_pkgname}-${pkgver}/htdocs/index.html > ${srcdir}/${_pkgname}-${pkgver}/dist/htdocs/index.html
|
||||
sed -e 's/mympd\.css/mympd\.min\.css/' -e 's/player\.js/player\.min\.js/' ${srcdir}/${_pkgname}-${pkgver}/htdocs/player.html > ${srcdir}/${_pkgname}-${pkgver}/dist/htdocs/player.html
|
||||
sed -i -e 's/mympd\.css/mympd\.min\.css/' -e 's/mympd\.js/mympd\.min\.js/' -e 's/player\.js/player\.min\.js/' ${srcdir}/${_pkgname}-${pkgver}/dist/htdocs/sw.min.js
|
||||
sed -i -e 's/\/sw\.js/\/sw\.min\.js/' ${srcdir}/${_pkgname}-${pkgver}/dist/htdocs/js/mympd.min.js
|
||||
echo "Minifying html"
|
||||
perl -i -pe 's/^\s*//gm; s/\s*$//gm' ${srcdir}/${_pkgname}-${pkgver}/dist/htdocs/index.html
|
||||
perl -i -pe 's/^\s*//gm; s/\s*$//gm' ${srcdir}/${_pkgname}-${pkgver}/dist/htdocs/player.html
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "${srcdir}/${_pkgname}-${pkgver}"
|
||||
|
||||
@ -80,4 +36,3 @@ package() {
|
||||
install -Dm644 "${srcdir}/${_pkgname}-${pkgver}/contrib/mympd.service" "$pkgdir/usr/lib/systemd/system/mympd.service"
|
||||
/usr/share/mympd/crcert.sh
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package myMPD
|
||||
#
|
||||
# (c) 2018 Juergen Mang <mail@jcgames.de
|
||||
# (c) 2018 Juergen Mang <mail@jcgames.de>
|
||||
|
||||
Name: myMPD
|
||||
Version: 4.2.1
|
||||
@ -102,5 +102,5 @@ fi
|
||||
/var/lib/mympd
|
||||
|
||||
%changelog
|
||||
* Wed Sep 17 2018 Juergen Mang <mail@jcgames.de> - master
|
||||
* Fri Sep 21 2018 Juergen Mang <mail@jcgames.de> - master
|
||||
- Version from master
|
||||
|
4
dist/htdocs/js/mympd.min.js
vendored
4
dist/htdocs/js/mympd.min.js
vendored
@ -40,8 +40,8 @@ function(a){"BUTTON"==a.target.nodeName&&("Add all to queue"==a.target.innerText
|
||||
app.current.tab,app.current.view,"0/"+app.current.filter+"/"+this.value)},!1);document.getElementById("searchqueuetag").addEventListener("click",function(a){"BUTTON"==a.target.nodeName&&appGoto(app.current.app,app.current.tab,app.current.view,app.current.page+"/"+a.target.getAttribute("data-tag")+"/"+app.current.search)},!1);document.getElementById("search").addEventListener("submit",function(){return!1},!1);document.getElementById("searchqueue").addEventListener("submit",function(){return!1},!1);
|
||||
document.getElementById("searchstr").addEventListener("keyup",function(a){appGoto("Search",void 0,void 0,"0/"+app.current.filter+"/"+this.value)},!1);document.getElementById("BrowseDatabaseByTagDropdown").addEventListener("click",function(a){"BUTTON"==a.target.nodeName&&appGoto(app.current.app,app.current.tab,a.target.getAttribute("data-tag"),"0/"+app.current.filter+"/"+app.current.search)},!1);document.getElementsByTagName("body")[0].addEventListener("click",function(a){a=document.getElementsByClassName("popover");
|
||||
for(var b=0;b<a.length;b++)a[b].remove()},!1);dragAndDropTable("QueueList");dragAndDropTable("BrowsePlaylistsDetailList");window.addEventListener("hashchange",appRoute,!1);window.addEventListener("focus",function(){sendAPI({cmd:"MPD_API_PLAYER_STATE"},parseState)},!1);document.addEventListener("keydown",function(a){if("INPUT"!=a.target.tagName){switch(a.which){case 37:clickPrev();break;case 39:clickNext();break;case 32:clickPlay();break;default:return}a.preventDefault()}},!1);"serviceWorker"in navigator&&
|
||||
"https"==document.URL.substring(0,5)&&window.addEventListener("load",function(){navigator.serviceWorker.register("/sw.min.js",{scope:"/"}).then(function(a){console.log("ServiceWorker registration successful with scope: ",a.scope);a.update()},function(a){console.log("ServiceWorker registration failed: ",a)})});window.addEventListener("beforeinstallprompt",function(a){a.preventDefault();deferredPrompt=a});window.addEventListener("beforeinstallprompt",function(a){a.preventDefault();deferredPrompt=a;domCache.btnAdd.classList.remove("hide")});
|
||||
domCache.btnAdd.addEventListener("click",function(a){domCache.btnAdd.classList.add("hide");deferredPrompt.prompt();deferredPrompt.userChoice.then(function(a){"accepted"===a.outcome?console.log("User accepted the A2HS prompt"):console.log("User dismissed the A2HS prompt");deferredPrompt=null})});window.addEventListener("appinstalled",function(a){console.log("myMPD installed as app")})}
|
||||
"https"==document.URL.substring(0,5)&&window.addEventListener("load",function(){navigator.serviceWorker.register("/sw.min.js",{scope:"/"}).then(function(a){console.log("ServiceWorker registration successful with scope: ",a.scope);a.update()},function(a){console.log("ServiceWorker registration failed: ",a)})});window.addEventListener("beforeinstallprompt",function(a){a.preventDefault();deferredPrompt=a});window.addEventListener("beforeinstallprompt",function(a){a.preventDefault();deferredPrompt=a;
|
||||
domCache.btnAdd.classList.remove("hide")});domCache.btnAdd.addEventListener("click",function(a){domCache.btnAdd.classList.add("hide");deferredPrompt.prompt();deferredPrompt.userChoice.then(function(a){"accepted"===a.outcome?console.log("User accepted the A2HS prompt"):console.log("User dismissed the A2HS prompt");deferredPrompt=null})});window.addEventListener("appinstalled",function(a){console.log("myMPD installed as app")})}
|
||||
function dragAndDropTable(a){var b=document.getElementById(a).getElementsByTagName("tbody")[0];b.addEventListener("dragstart",function(a){"TR"==a.target.nodeName&&(a.target.classList.add("opacity05"),a.dataTransfer.setDragImage(a.target,0,0),a.dataTransfer.effectAllowed="move",a.dataTransfer.setData("Text",a.target.getAttribute("id")),dragEl=a.target.cloneNode(!0))},!1);b.addEventListener("dragleave",function(a){a.preventDefault();var b=a.target;"TD"==a.target.nodeName&&(b=a.target.parentNode);"TR"==
|
||||
b.nodeName&&b.classList.remove("dragover")},!1);b.addEventListener("dragover",function(a){a.preventDefault();for(var c=b.getElementsByClassName("dragover"),e=c.length,f=0;f<e;f++)c[f].classList.remove("dragover");c=a.target;"TD"==a.target.nodeName&&(c=a.target.parentNode);"TR"==c.nodeName&&c.classList.add("dragover");a.dataTransfer.dropEffect="move"},!1);b.addEventListener("dragend",function(a){for(var c=b.getElementsByClassName("dragover"),e=c.length,f=0;f<e;f++)c[f].classList.remove("dragover");
|
||||
document.getElementById(a.dataTransfer.getData("Text"))&&document.getElementById(a.dataTransfer.getData("Text")).classList.remove("opacity05")},!1);b.addEventListener("drop",function(c){c.stopPropagation();c.preventDefault();var d=c.target;"TD"==c.target.nodeName&&(d=c.target.parentNode);var e=document.getElementById(c.dataTransfer.getData("Text")).getAttribute("data-songpos"),f=d.getAttribute("data-songpos");document.getElementById(c.dataTransfer.getData("Text")).remove();dragEl.classList.remove("opacity05");
|
||||
|
@ -10,7 +10,7 @@
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
<meta name="theme-color" content="#343a40">
|
||||
<link href="/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="/css/mympd.css" rel="stylesheet">
|
||||
<link href="/css/mympd.min.css" rel="stylesheet">
|
||||
<link href="/assets/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon">
|
||||
<link rel="manifest" href="/mympd.webmanifest">
|
||||
<link rel="apple-touch-icon" href="/assets/appicon-167.png">
|
||||
@ -833,6 +833,6 @@
|
||||
</div>
|
||||
|
||||
<script src="/js/bootstrap-native-v4.min.js"></script>
|
||||
<script src="/js/mympd.js"></script>
|
||||
<script src="/js/mympd.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -550,7 +550,7 @@ function appInit() {
|
||||
|
||||
if ('serviceWorker' in navigator && document.URL.substring(0, 5) == 'https') {
|
||||
window.addEventListener('load', function() {
|
||||
navigator.serviceWorker.register('/sw.js', {scope: '/'}).then(function(registration) {
|
||||
navigator.serviceWorker.register('/sw.min.js', {scope: '/'}).then(function(registration) {
|
||||
// Registration was successful
|
||||
console.log('ServiceWorker registration successful with scope: ', registration.scope);
|
||||
registration.update();
|
||||
|
@ -7,7 +7,7 @@
|
||||
<meta name="author" content="mail@jcgames.de">
|
||||
<title>myMPD: Local Player</title>
|
||||
<link href="css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="css/mympd.css" rel="stylesheet">
|
||||
<link href="css/mympd.min.css" rel="stylesheet">
|
||||
<link href="assets/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
|
||||
@ -29,6 +29,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<script type="text/javascript" src="js/player.js"></script>
|
||||
<script type="text/javascript" src="js/player.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
12
mkclean.sh
12
mkclean.sh
@ -3,8 +3,16 @@ rm -rf release
|
||||
rm -rf debug
|
||||
rm -rf debian/tmp
|
||||
rm -f debian/files
|
||||
rm -f htdocs/js/bootstrap-native-v4.min.js
|
||||
rm -f htdocs/css/bootstrap.min.css
|
||||
|
||||
rm -f htdocs/library
|
||||
rm -f htdocs/pics
|
||||
|
||||
rm -f htdocs/sw.min.js
|
||||
rm -f htdocs/js/mympd.min.js
|
||||
rm -f htdocs/js/player.min.js
|
||||
rm -f htdocs/js/bootstrap-native-v4.min.js
|
||||
|
||||
rm -f htdocs/css/mympd.min.css
|
||||
rm -f htdocs/css/bootstrap.min.css
|
||||
|
||||
find ./ -name \*~ -delete
|
||||
|
10
mkdebug.sh
10
mkdebug.sh
@ -1,7 +1,11 @@
|
||||
#/bin/sh
|
||||
[ -e $PWD/htdocs/sw.min.js ] || ln -s $PWD/htdocs/sw.js $PWD/htdocs/sw.min.js
|
||||
[ -e $PWD/htdocs/js/mympd.min.js ] || ln -s $PWD/htdocs/js/mympd.js $PWD/htdocs/js/mympd.min.js
|
||||
[ -e $PWD/htdocs/js/player.min.js ] || ln -s $PWD/htdocs/js/player.js $PWD/htdocs/js/player.min.js
|
||||
[ -e $PWD/htdocs/js/bootstrap-native-v4.min.js ] || ln -s $PWD/dist/htdocs/js/bootstrap-native-v4.js $PWD/htdocs/js/bootstrap-native-v4.min.js
|
||||
|
||||
cp dist/htdocs/js/bootstrap-native-v4.js htdocs/js/bootstrap-native-v4.min.js
|
||||
cp dist/htdocs/css/bootstrap.min.css htdocs/css/
|
||||
[ -e $PWD/htdocs/css/mympd.min.css ] || ln -s $PWD/htdocs/css/mympd.css $PWD/htdocs/css/mympd.min.css
|
||||
[ -e $PWD/htdocs/css/bootstrap.min.css ] || ln -s $PWD/dist/htdocs/css/bootstrap.min.css $PWD/htdocs/css/bootstrap.min.css
|
||||
|
||||
echo "Trying to link musicdir to library"
|
||||
if [ -f /etc/mpd.conf ]
|
||||
@ -13,7 +17,7 @@ else
|
||||
fi
|
||||
|
||||
echo "Linking pics directory"
|
||||
[ -e htdocs/pics ] || ln -s /var/lib/mympd/pics htdocs/
|
||||
[ -e $PWD/htdocs/pics ] || ln -s /var/lib/mympd/pics htdocs/
|
||||
|
||||
[ -d debug ] || mkdir debug
|
||||
cd debug
|
||||
|
11
mkrelease.sh
11
mkrelease.sh
@ -32,14 +32,11 @@ else
|
||||
cp htdocs/css/mympd.css dist/htdocs/css/mympd.min.css
|
||||
fi
|
||||
|
||||
echo "Replacing javascript and stylesheets with minified files"
|
||||
sed -e 's/mympd\.css/mympd\.min\.css/' -e 's/mympd\.js/mympd\.min\.js/' htdocs/index.html > dist/htdocs/index.html
|
||||
sed -e 's/mympd\.css/mympd\.min\.css/' -e 's/player\.js/player\.min\.js/' htdocs/player.html > dist/htdocs/player.html
|
||||
sed -i -e 's/mympd\.css/mympd\.min\.css/' -e 's/mympd\.js/mympd\.min\.js/' -e 's/player\.js/player\.min\.js/' dist/htdocs/sw.min.js
|
||||
sed -i -e 's/\/sw\.js/\/sw\.min\.js/' dist/htdocs/js/mympd.min.js
|
||||
echo "Minifying html"
|
||||
perl -i -pe 's/^\s*//gm; s/\s*$//gm' dist/htdocs/index.html
|
||||
perl -i -pe 's/^\s*//gm; s/\s*$//gm' dist/htdocs/player.html
|
||||
[ htdocs/index.html -nt dist/htdocs/index.html ] && \
|
||||
perl -pe 's/^\s*//gm; s/\s*$//gm' htdocs/index.html > dist/htdocs/index.html
|
||||
[ htdocs/player.html -nt dist/htdocs/player.html ] && \
|
||||
perl -pe 's/^\s*//gm; s/\s*$//gm' htdocs/player.html > dist/htdocs/player.html
|
||||
|
||||
echo "Compiling and installing mympd"
|
||||
[ -d release ] || mkdir release
|
||||
|
Loading…
Reference in New Issue
Block a user