Commit 1c537910 authored by akiraohgaki's avatar akiraohgaki Committed by GitHub
Browse files

Merge pull request #14 from xdgurl/development

1.0.1
parents dff3a00b b3ca06fe
SHELL = /bin/sh
TARGET = xdgurl
srcdir = ./src
DESTDIR =
prefix = /usr/local
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
datadir = $(prefix)/share
INSTALL = install
INSTALL_PROGRAM = $(INSTALL) -D -m 755
INSTALL_DATA = $(INSTALL) -D -m 644
RM = rm -f
.PHONY: all rebuild build clean install uninstall
all: rebuild ;
rebuild: clean build ;
build: $(TARGET) ;
clean:
$(RM) ./$(TARGET)
install: build
$(INSTALL_PROGRAM) ./$(TARGET) $(DESTDIR)$(bindir)/$(TARGET)
$(INSTALL_DATA) $(srcdir)/$(TARGET).desktop $(DESTDIR)$(datadir)/applications/$(TARGET).desktop
uninstall:
$(RM) $(DESTDIR)$(bindir)/$(TARGET)
$(RM) $(DESTDIR)$(datadir)/applications/$(TARGET).desktop
$(TARGET):
# Just copy for now
install -m 755 $(srcdir)/$(TARGET).py ./$(TARGET)
......@@ -6,9 +6,7 @@ Copyright: 2016, Akira Ohgaki
License: GPL-3+
----
Download Linux packages:
Download Linux packages from:
https://www.linux-apps.com/p/1136805/
......
# Maintainer: Akira Ohgaki <akiraohgaki@gmail.com>
pkgname=xdgurl
pkgver=1.0.0
pkgver=1.0.1
pkgrel=1
pkgdesc="An install helper program for desktop stuff."
arch=('i686' 'x86_64')
url="https://github.com/xdgurl/xdgurl"
license=('GPL3')
depends=('tk')
#source=("$pkgname-$pkgver.tar.gz")
#source=("https://github.com/xdgurl/xdgurl/archive/release-$pkgver.tar.gz")
source=("$pkgname.tar.gz")
md5sums=() #autofill using updpkgsums
package() {
#cd "$pkgname-$pkgver"
build() {
#cd "$pkgname-release-$pkgver"
cd $pkgname
make
}
install -D -m 755 "src/$pkgname.py" "$pkgdir/usr/bin/$pkgname"
install -D -m 644 "src/$pkgname.desktop" "$pkgdir/usr/share/applications/$pkgname.desktop"
package() {
#cd "$pkgname-release-$pkgver"
cd $pkgname
make DESTDIR="$pkgdir" prefix="/usr" install
}
#!/bin/sh
cd `dirname $0`
tar -czvf /tmp/xdgurl.tar.gz ../../../xdgurl
mv /tmp/xdgurl.tar.gz ./
updpkgsums
makepkg -s
#!/bin/sh
cd `dirname $0`
build_ubuntu() {
mkdir ./build
cp -r ../src ./build/
cp ../Makefile ./build/
cp -r ./ubuntu/debian ./build/
cd ./build
debuild -uc -us -b
}
build_fedora() {
tar -czvf /tmp/xdgurl.tar.gz ../../xdgurl
mkdir -p ./build/SOURCES
mkdir -p ./build/SPECS
mv /tmp/xdgurl.tar.gz ./build/SOURCES/
cp ./fedora/xdgurl.spec ./build/SPECS/
rpmbuild --define '_topdir '`pwd`'/build' -bb ./build/SPECS/xdgurl.spec
}
build_arch() {
tar -czvf /tmp/xdgurl.tar.gz ../../xdgurl
mkdir ./build
mv /tmp/xdgurl.tar.gz ./build/
cp ./arch/PKGBUILD ./build/
cd ./build
updpkgsums
makepkg -s
}
if [ $1 ] && [ $1 = 'ubuntu' ]; then
build_ubuntu
elif [ $1 ] && [ $1 = 'fedora' ]; then
build_fedora
elif [ $1 ] && [ $1 = 'arch' ]; then
build_arch
else
echo 'sh build.sh [ubuntu|fedora|arch]'
fi
#!/bin/sh
cd `dirname $0`
mkdir -p ~/rpmbuild/BUILD
mkdir -p ~/rpmbuild/SPECS
cp -r ../../../xdgurl ~/rpmbuild/BUILD/
cp xdgurl.spec ~/rpmbuild/SPECS/
rpmbuild -bb ~/rpmbuild/SPECS/xdgurl.spec
Summary: An install helper program for desktop stuff
Name: xdgurl
Version: 1.0.0
Version: 1.0.1
Release: 1%{?dist}
License: GPLv3+
Group: Applications/Internet
URL: https://github.com/xdgurl/xdgurl
Source0: xdgurl.tar.gz
#Source0: https://github.com/xdgurl/xdgurl/archive/release-%{version}.tar.gz
Source0: %{name}.tar.gz
Requires: tkinter, python3-tkinter
%description
An install helper program for desktop stuff.
%prep
#%%autosetup -n %{name}-release-%{version}
%autosetup -n %{name}
%build
install -D -m 755 xdgurl/src/xdgurl.py $RPM_BUILD_ROOT/%{_bindir}/xdgurl
install -D -m 644 xdgurl/src/xdgurl.desktop $RPM_BUILD_ROOT/%{_datadir}/applications/xdgurl.desktop
%define debug_package %{nil}
make
%install
make DESTDIR="%{buildroot}" prefix="/usr" install
%files
%defattr(-,root,root)
%{_bindir}/xdgurl
%{_datadir}/applications/xdgurl.desktop
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%clean
rm -rf %{buildroot}
%changelog
* Fri Jul 15 2016 Akira Ohgaki <akiraohgaki@gmail.com> - 1.0.1-1
- Clean successfull message
- Return exit code
* Wed Jul 06 2016 Akira Ohgaki <akiraohgaki@gmail.com> - 1.0.0-1
- Initial release
#!/bin/sh
cd `dirname $0`
debuild -uc -us -b
#fakeroot debian/rules clean
xdgurl (1.0.1-0ubuntu1) xenial; urgency=low
* Clean successfull message
* Return exit code
-- Akira Ohgaki <akiraohgaki@gmail.com> Fri, 15 Jul 2016 18:55:06 +0000
xdgurl (1.0.0-0ubuntu1) xenial; urgency=low
* Initial release
......
......@@ -3,9 +3,8 @@
%:
dh $@
override_dh_auto_build:
install -D -m 755 ../../src/xdgurl.py usr/bin/xdgurl
install -D -m 644 ../../src/xdgurl.desktop usr/share/applications/xdgurl.desktop
override_dh_auto_install:
make DESTDIR="$(CURDIR)/debian/tmp" prefix="/usr" install
override_dh_shlibdeps:
# ignore
......@@ -31,7 +31,6 @@ else:
import tkMessageBox
class XdgUrl:
"""Core class of xdgurl"""
def __init__(self, xdg_url=''):
self.xdg_url = xdg_url
......@@ -310,46 +309,9 @@ class XdgUrl:
else:
raise Exception('Incorrect XDG-URL ' + self.xdg_url)
'''
class XdgUrlApp(Tkinter.Frame):
"""Confirmation dialog for xdgurl"""
def __init__(self, master=None, core=None):
Tkinter.Frame.__init__(self, master)
self.pack()
self.core = core
self.master.title('xdgurl')
self.master.geometry('300x120')
self.create_widget()
def create_widget(self):
execute_text = 'Download'
if self.core.meta['command'] == 'install':
execute_text = 'Install'
info_label = Tkinter.Label(self, text=execute_text + ': ' + self.core.meta['filename'])
info_label.pack(padx=10, pady=5, anchor=Tkinter.W)
message_label = Tkinter.Label(self, text='Do you want to continue?')
message_label.pack(padx=10, pady=5, anchor=Tkinter.W)
execute_button = Tkinter.Button(self, text=execute_text, command=self.execute)
execute_button.pack(padx=5, pady=10, side=Tkinter.RIGHT)
quit_button = Tkinter.Button(self, text='Cancel', command=self.quit)
quit_button.pack(padx=5, pady=10, side=Tkinter.RIGHT)
def execute(self):
self.core.execute()
sys.exit()
def quit(self):
sys.exit()
'''
def main():
program = 'xdgurl'
version = '1.0.0'
version = '1.0.1'
parser = argparse.ArgumentParser(
prog=program,
......@@ -365,13 +327,6 @@ def main():
args = parser.parse_args()
if args.xdg_url:
"""
core = XdgUrl(args.xdg_url)
window = Tkinter.Tk()
app = XdgUrlApp(window, core)
app.mainloop()
"""
core = XdgUrl(args.xdg_url)
if sys.version_info.major >= 3:
window = tkinter.Tk()
......@@ -404,6 +359,8 @@ def main():
tkinter.messagebox.showerror(program, info_text + '\n\n' + message + '\n' + str(e))
else:
tkMessageBox.showerror(program, info_text + '\n\n' + message + '\n' + str(e))
return str(e) # stderr and exit code 1
else:
message = 'Download successfull'
if core.meta['command'] == 'install':
......@@ -414,7 +371,7 @@ def main():
tkinter.messagebox.showinfo(program, message)
else:
tkMessageBox.showinfo(program, message)
sys.exit()
return 0
if __name__ == '__main__':
main()
sys.exit(main())
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment