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 ...@@ -6,9 +6,7 @@ Copyright: 2016, Akira Ohgaki
License: GPL-3+ License: GPL-3+
---- Download Linux packages from:
Download Linux packages:
https://www.linux-apps.com/p/1136805/ https://www.linux-apps.com/p/1136805/
......
# Maintainer: Akira Ohgaki <akiraohgaki@gmail.com> # Maintainer: Akira Ohgaki <akiraohgaki@gmail.com>
pkgname=xdgurl pkgname=xdgurl
pkgver=1.0.0 pkgver=1.0.1
pkgrel=1 pkgrel=1
pkgdesc="An install helper program for desktop stuff." pkgdesc="An install helper program for desktop stuff."
arch=('i686' 'x86_64') arch=('i686' 'x86_64')
url="https://github.com/xdgurl/xdgurl" url="https://github.com/xdgurl/xdgurl"
license=('GPL3') license=('GPL3')
depends=('tk') depends=('tk')
#source=("$pkgname-$pkgver.tar.gz") #source=("https://github.com/xdgurl/xdgurl/archive/release-$pkgver.tar.gz")
source=("$pkgname.tar.gz") source=("$pkgname.tar.gz")
md5sums=() #autofill using updpkgsums md5sums=() #autofill using updpkgsums
package() { build() {
#cd "$pkgname-$pkgver" #cd "$pkgname-release-$pkgver"
cd $pkgname cd $pkgname
make
}
install -D -m 755 "src/$pkgname.py" "$pkgdir/usr/bin/$pkgname" package() {
install -D -m 644 "src/$pkgname.desktop" "$pkgdir/usr/share/applications/$pkgname.desktop" #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 Summary: An install helper program for desktop stuff
Name: xdgurl Name: xdgurl
Version: 1.0.0 Version: 1.0.1
Release: 1%{?dist} Release: 1%{?dist}
License: GPLv3+ License: GPLv3+
Group: Applications/Internet Group: Applications/Internet
URL: https://github.com/xdgurl/xdgurl 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 Requires: tkinter, python3-tkinter
%description %description
An install helper program for desktop stuff. An install helper program for desktop stuff.
%prep
#%%autosetup -n %{name}-release-%{version}
%autosetup -n %{name}
%build %build
install -D -m 755 xdgurl/src/xdgurl.py $RPM_BUILD_ROOT/%{_bindir}/xdgurl %define debug_package %{nil}
install -D -m 644 xdgurl/src/xdgurl.desktop $RPM_BUILD_ROOT/%{_datadir}/applications/xdgurl.desktop make
%install
make DESTDIR="%{buildroot}" prefix="/usr" install
%files %files
%defattr(-,root,root) %defattr(-,root,root)
%{_bindir}/xdgurl %{_bindir}/%{name}
%{_datadir}/applications/xdgurl.desktop %{_datadir}/applications/%{name}.desktop
%clean
rm -rf %{buildroot}
%changelog %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 * Wed Jul 06 2016 Akira Ohgaki <akiraohgaki@gmail.com> - 1.0.0-1
- Initial release - 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 xdgurl (1.0.0-0ubuntu1) xenial; urgency=low
* Initial release * Initial release
......
...@@ -3,9 +3,8 @@ ...@@ -3,9 +3,8 @@
%: %:
dh $@ dh $@
override_dh_auto_build: override_dh_auto_install:
install -D -m 755 ../../src/xdgurl.py usr/bin/xdgurl make DESTDIR="$(CURDIR)/debian/tmp" prefix="/usr" install
install -D -m 644 ../../src/xdgurl.desktop usr/share/applications/xdgurl.desktop
override_dh_shlibdeps: override_dh_shlibdeps:
# ignore # ignore
...@@ -31,7 +31,6 @@ else: ...@@ -31,7 +31,6 @@ else:
import tkMessageBox import tkMessageBox
class XdgUrl: class XdgUrl:
"""Core class of xdgurl"""
def __init__(self, xdg_url=''): def __init__(self, xdg_url=''):
self.xdg_url = xdg_url self.xdg_url = xdg_url
...@@ -310,46 +309,9 @@ class XdgUrl: ...@@ -310,46 +309,9 @@ class XdgUrl:
else: else:
raise Exception('Incorrect XDG-URL ' + self.xdg_url) 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(): def main():
program = 'xdgurl' program = 'xdgurl'
version = '1.0.0' version = '1.0.1'
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
prog=program, prog=program,
...@@ -365,13 +327,6 @@ def main(): ...@@ -365,13 +327,6 @@ def main():
args = parser.parse_args() args = parser.parse_args()
if args.xdg_url: if args.xdg_url:
"""
core = XdgUrl(args.xdg_url)
window = Tkinter.Tk()
app = XdgUrlApp(window, core)
app.mainloop()
"""
core = XdgUrl(args.xdg_url) core = XdgUrl(args.xdg_url)
if sys.version_info.major >= 3: if sys.version_info.major >= 3:
window = tkinter.Tk() window = tkinter.Tk()
...@@ -404,6 +359,8 @@ def main(): ...@@ -404,6 +359,8 @@ def main():
tkinter.messagebox.showerror(program, info_text + '\n\n' + message + '\n' + str(e)) tkinter.messagebox.showerror(program, info_text + '\n\n' + message + '\n' + str(e))
else: else:
tkMessageBox.showerror(program, info_text + '\n\n' + message + '\n' + str(e)) tkMessageBox.showerror(program, info_text + '\n\n' + message + '\n' + str(e))
return str(e) # stderr and exit code 1
else: else:
message = 'Download successfull' message = 'Download successfull'
if core.meta['command'] == 'install': if core.meta['command'] == 'install':
...@@ -414,7 +371,7 @@ def main(): ...@@ -414,7 +371,7 @@ def main():
tkinter.messagebox.showinfo(program, message) tkinter.messagebox.showinfo(program, message)
else: else:
tkMessageBox.showinfo(program, message) tkMessageBox.showinfo(program, message)
sys.exit() return 0
if __name__ == '__main__': 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