diff --git a/Makefile b/Makefile index 9a242f4..224162b 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ -Appname:=sailfish-python +Appname:=$(shell cat appname.txt) prefix:=/usr -temp:=/tmp/make +temp:=/tmp/fpm builddir:=./build sdkpath:=$(HOME)/SailfishOS dependencies:=-d libsailfishapp-launcher -d python3-base -d pyotherside-qml-plugin-python3-qt5 @@ -12,7 +12,7 @@ jolla_wifi_ip:=Jolla all: clean build-tmp rpm-virt rpm-jolla -make-jolla: build-tmp rpm-jolla send-jolla +make-jolla-usb: build-tmp rpm-jolla send-jolla make-jolla-wifi: build-tmp rpm-jolla send-jolla-wifi make-jolla-ap: build-tmp rpm-jolla send-jolla-ap make-virt: build-tmp rpm-virt send-virt @@ -30,32 +30,36 @@ build-tmp: install -m 755 ./dat/$(Appname).sh $(temp)/usr/bin/$(Appname) rpm-virt: - cd $(temp);fpm -f -s dir -t rpm $(dependencies) -p $(CURDIR)/$(Appname)-$(arch).rpm -n $(Appname) -a $(arch) --prefix / * + cd $(temp);fpm -f -s dir -t rpm $(dependencies) -p $(CURDIR)/$(rpmname) -n $(Appname) -a $(arch) --prefix / * rpm-jolla: arch:=noarch rpm-jolla: - cd $(temp);fpm -f -s dir -t rpm $(dependencies) -p $(CURDIR)/$(Appname)-$(arch).rpm -n $(Appname) -a $(arch) --prefix / * + cd $(temp);fpm -f -s dir -t rpm $(dependencies) -p $(CURDIR)/$(rpmname) -n $(Appname) -a $(arch) --prefix / * send-virt: - rsync -vrp --rsh='ssh -p2223 -i $(sdkpath)/vmshare/ssh/private_keys/SailfishOS_Emulator/root' ./$(Appname)-$(arch).rpm root@localhost:/home/nemo/Downloads - ssh -p2223 -i $(sdkpath)/vmshare/ssh/private_keys/SailfishOS_Emulator/root root@localhost pkcon install-local -y /home/nemo/Downloads/$(Appname)-$(arch).rpm + rsync -vrp --rsh='ssh -p2223 -i $(sdkpath)/vmshare/ssh/private_keys/SailfishOS_Emulator/root' ./$(rpmname) root@localhost:/tmp + ssh -p2223 -i $(sdkpath)/vmshare/ssh/private_keys/SailfishOS_Emulator/root root@localhost pkcon install-local -y /tmp/$(rpmname) "&&" rm /tmp/$(rpmname) send-jolla-wifi: arch:=noarch send-jolla-wifi: - rsync -vrp ./$(Appname)-$(arch).rpm root@$(jolla_wifi_ip):/home/nemo/Downloads - ssh root@$(jolla_wifi_ip) pkcon install-local -y /home/nemo/Downloads/$(Appname)-$(arch).rpm + rsync -vrp ./$(rpmname) root@$(jolla_wifi_ip):/tmp + ssh root@$(jolla_wifi_ip) pkcon install-local -y /tmp/$(rpmname) "&&" rm /tmp/$(rpmname) + send-jolla-ap: arch:=noarch send-jolla-ap: jolla_wifi_ip:=192.168.1.1 send-jolla-ap: - rsync -vrp ./$(Appname)-$(arch).rpm root@$(jolla_wifi_ip):/home/nemo/Downloads - ssh root@$(jolla_wifi_ip) pkcon install-local -y /home/nemo/Downloads/$(Appname)-$(arch).rpm + rsync -vrp ./$(rpmname) root@$(jolla_wifi_ip):/tmp + ssh root@$(jolla_wifi_ip) pkcon install-local -y /tmp/$(rpmname) "&&" rm /tmp/$(rpmname) + send-jolla: arch:=noarch send-jolla: - rsync -vrp ./$(Appname)-$(arch).rpm root@$(jolla_usb_ip):/home/nemo/Downloads - ssh root@$(jolla_usb_ip) pkcon install-local -y /home/nemo/Downloads/$(Appname)-$(arch).rpm + rsync -vrp ./$(Appname)-$(arch).rpm root@$(jolla_usb_ip):/tmp + ssh root@$(jolla_usb_ip) pkcon install-local -y /tmp/$(Appname)-$(arch).rpm "&&" rm /tmp/$(Appname)-$(arch).rpm + clean: rm -rf $(temp) rm -rf $(builddir) + rm -rf ./$(rpmname) diff --git a/dat/sailfish-python.desktop b/dat/sailfish-python.desktop index 6304c03..f127049 100644 --- a/dat/sailfish-python.desktop +++ b/dat/sailfish-python.desktop @@ -1,6 +1,6 @@ [Desktop Entry] Type=Application X-Nemo-Application-Type=silica-qt5 -Name=Scanner +Name=sailfish-python Icon=icon-launcher-component-gallery -Exec=sailfish-qml sailfish-scanner +Exec=sailfish-qml sailfish-python diff --git a/renamep.py b/renamep.py index 6c9217a..efbddcb 100755 --- a/renamep.py +++ b/renamep.py @@ -14,12 +14,17 @@ os.rename("./qml/"+oldname+".qml","./qml/"+newname+".qml") os.rename("./dat/"+oldname+".desktop","./dat/"+newname+".desktop") os.rename("./dat/"+oldname+".sh","./dat/"+newname+".sh") -makefile=open("./Makefile","r") -maketxt=makefile.read() -makefile.close() -makefile=open("./Makefile","w") -makefile.write(re.sub("Appname:="+oldname,"Appname:="+newname,maketxt)) -makefile.close() +def replaceInFile(oldname,newname,filename): + makefile=open(filename,"r") + maketxt=makefile.read() + makefile.close() + makefile=open(filename,"w") + makefile.write(re.sub("Appname:="+oldname,"Appname:="+newname,maketxt)) + makefile.close() + +for filename in ["./Makefile","./dat/"+newname+".desktop"]: + replaceInFile(oldname,newname,filename) + namefile=open("./appname.txt","w") namefile.write(newname+"\n") diff --git a/sailfish-python-noarch.rpm b/sailfish-python-noarch.rpm deleted file mode 100644 index 494f594..0000000 Binary files a/sailfish-python-noarch.rpm and /dev/null differ