From 2fe3808b6ba6a2094389df89e8afa2e0063b67ae Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Oct 29 2016 11:49:48 +0000 Subject: Update to a later snapshot --- diff --git a/.gitignore b/.gitignore index 346856b..5ea3435 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ /minipro-0-0107a7a.tar.gz /minipro-0-d6dee16.tar.gz /minipro-0.0.1-60dda45.tar.gz +/minipro-0.1-484abde.tar.gz diff --git a/0001-Revert-Using-PREFIX-instead-of-the-DESTDIR-confusion.patch b/0001-Revert-Using-PREFIX-instead-of-the-DESTDIR-confusion.patch new file mode 100644 index 0000000..45fbdad --- /dev/null +++ b/0001-Revert-Using-PREFIX-instead-of-the-DESTDIR-confusion.patch @@ -0,0 +1,42 @@ +From b3030921147c47dadd312887c4879eb2391e7492 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Sat, 29 Oct 2016 13:35:45 +0200 +Subject: [PATCH] Revert "Using $PREFIX instead of the $DESTDIR confusion." + +This is mostly wrong. DESTDIR is conventionally used to override the +install root when doing an out-of-tree install (such as on a package +build), while PREFIX denotes the actual install tree (e.g. /usr vs. +/usr/local). + +Also the commit changed the udev rules dir to /etc, which is meant for +*user* configuration, not configuration shipped with a package. + +A commit that adds PREFIX properly will follow. + +This reverts commit 455dd5b5b135eb99f2717d68ad8b1b8cbab97c32. +--- + Makefile | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +diff --git a/Makefile b/Makefile +index f7627c5..eadd571 100644 +--- a/Makefile ++++ b/Makefile +@@ -9,13 +9,11 @@ TESTS=$(wildcard tests/test_*.c); + OBJCOPY=objcopy + VERSION=0.1 + +-PREFIX = /usr/local +- + DIST_DIR = $(MINIPRO)-$(VERSION) +-BIN_DIR = $(PREFIX)/bin/ +-UDEV_RULES_DIR = /etc/udev/rules.d/ +-MAN_DIR = $(PREFIX)/share/man/man1/ +-COMPLETIONS_DIR = /etc/bash_completion.d/ ++BIN_DIR=$(DESTDIR)/usr/bin/ ++UDEV_RULES_DIR=$(DESTDIR)/usr/lib/udev/rules.d/ ++MAN_DIR=$(DESTDIR)/usr/share/man/man1/ ++COMPLETIONS_DIR=$(DESTDIR)/etc/bash_completion.d/ + + libusb_CFLAGS = `pkg-config --cflags libusb-1.0` + libusb_LIBS = `pkg-config --libs libusb-1.0` diff --git a/0001-write_page_ram-fix-a-typo.patch b/0001-write_page_ram-fix-a-typo.patch new file mode 100644 index 0000000..cd17d86 --- /dev/null +++ b/0001-write_page_ram-fix-a-typo.patch @@ -0,0 +1,22 @@ +From e9953f8f8b57261ebfc74c5474a77e47aaf6d35e Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Thu, 18 Dec 2014 14:45:37 +0100 +Subject: [PATCH] write_page_ram: fix a typo + +--- + main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/main.c b/main.c +index abce416..8638c2e 100644 +--- a/main.c ++++ b/main.c +@@ -202,7 +202,7 @@ void write_page_ram(minipro_handle_t *handle, unsigned char *buf, unsigned int t + device_t *device = handle->device; + + int blocks_count = size / device->write_buffer_size; +- if(size % device->read_buffer_size != 0) { ++ if(size % device->write_buffer_size != 0) { + blocks_count++; + } + diff --git a/0002-Install-the-bash-completion-files-in-to-a-proper-loc.patch b/0002-Install-the-bash-completion-files-in-to-a-proper-loc.patch new file mode 100644 index 0000000..d73c703 --- /dev/null +++ b/0002-Install-the-bash-completion-files-in-to-a-proper-loc.patch @@ -0,0 +1,23 @@ +From 38f5c60819b9ce216faaed06f2b60b54f8349087 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Sat, 29 Oct 2016 13:38:34 +0200 +Subject: [PATCH] Install the bash completion files in to a proper location + +/etc is for user configuration, not configuration shipped with a package. +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index eadd571..e355a49 100644 +--- a/Makefile ++++ b/Makefile +@@ -13,7 +13,7 @@ DIST_DIR = $(MINIPRO)-$(VERSION) + BIN_DIR=$(DESTDIR)/usr/bin/ + UDEV_RULES_DIR=$(DESTDIR)/usr/lib/udev/rules.d/ + MAN_DIR=$(DESTDIR)/usr/share/man/man1/ +-COMPLETIONS_DIR=$(DESTDIR)/etc/bash_completion.d/ ++COMPLETIONS_DIR=$(DESTDIR)/usr/share/bash_completion.d/ + + libusb_CFLAGS = `pkg-config --cflags libusb-1.0` + libusb_LIBS = `pkg-config --libs libusb-1.0` diff --git a/0002-msg_init-the-memory-size-is-4-octets.patch b/0002-msg_init-the-memory-size-is-4-octets.patch new file mode 100644 index 0000000..d0d7393 --- /dev/null +++ b/0002-msg_init-the-memory-size-is-4-octets.patch @@ -0,0 +1,26 @@ +From 3e266273f2b1483ca0fdecbd4b06c45677922169 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Sat, 29 Oct 2016 13:25:49 +0200 +Subject: [PATCH] msg_init: the memory size is 4 octets + +Without this the memory size would be clamped to zero for >64k devices. +This caused SST28SF040A not ot be erased completely. I guess most chips +such as microcontrollers don't really care about the size since they can +be erased all at once. +--- + minipro.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/minipro.c b/minipro.c +index e6fc9a8..cdd1f6b 100644 +--- a/minipro.c ++++ b/minipro.c +@@ -54,7 +54,7 @@ static void msg_init(unsigned char *out_buf, unsigned char cmd, device_t *device + format_int(&(out_buf[9]), device->opts3, 2, MP_LITTLE_ENDIAN); + + out_buf[11] = icsp; +- format_int(&(out_buf[12]), device->code_memory_size, 2, MP_LITTLE_ENDIAN); ++ format_int(&(out_buf[12]), device->code_memory_size, 4, MP_LITTLE_ENDIAN); + } + + static unsigned int msg_transfer(minipro_handle_t *handle, unsigned char *buf, int length, int direction) { diff --git a/0003-Use-PREFIX-to-override-install-location.patch b/0003-Use-PREFIX-to-override-install-location.patch new file mode 100644 index 0000000..80ff155 --- /dev/null +++ b/0003-Use-PREFIX-to-override-install-location.patch @@ -0,0 +1,32 @@ +From bc31cbc0820b9a4a543381202187c5a5ae73caf9 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Sat, 29 Oct 2016 13:39:52 +0200 +Subject: [PATCH] Use $PREFIX to override install location + +Based on 455dd5b5b by David Griffith . +--- + Makefile | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/Makefile b/Makefile +index e355a49..2162ef2 100644 +--- a/Makefile ++++ b/Makefile +@@ -9,11 +9,13 @@ TESTS=$(wildcard tests/test_*.c); + OBJCOPY=objcopy + VERSION=0.1 + ++PREFIX=/usr/local ++ + DIST_DIR = $(MINIPRO)-$(VERSION) +-BIN_DIR=$(DESTDIR)/usr/bin/ +-UDEV_RULES_DIR=$(DESTDIR)/usr/lib/udev/rules.d/ +-MAN_DIR=$(DESTDIR)/usr/share/man/man1/ +-COMPLETIONS_DIR=$(DESTDIR)/usr/share/bash_completion.d/ ++BIN_DIR=$(DESTDIR)$(PREFIX)/bin/ ++UDEV_RULES_DIR=$(DESTDIR)$(PREFIX)/lib/udev/rules.d/ ++MAN_DIR=$(DESTDIR)$(PREFIX)/share/man/man1/ ++COMPLETIONS_DIR=$(DESTDIR)$(PREFIX)/share/bash_completion.d/ + + libusb_CFLAGS = `pkg-config --cflags libusb-1.0` + libusb_LIBS = `pkg-config --libs libusb-1.0` diff --git a/minipro.spec b/minipro.spec index 9fa44ad..4816d5b 100644 --- a/minipro.spec +++ b/minipro.spec @@ -1,9 +1,9 @@ -%global commit 60dda45cb4f8b3cebb91cec0cbb0c4195b99485f +%global commit 484abde7d924404f5bb30ebc66a80d93b5a65c3e %global shortcommit %(c=%{commit}; echo ${c:0:7}) Name: minipro -Version: 0.0.1 -Release: 2%{?dist} +Version: 0.1 +Release: 1.20161029git%{shortcommit}%{?dist} Summary: Utility for MiniPro TL866A/TL866/CS programmer Group: System Environment/Base @@ -13,6 +13,12 @@ License: GPLv2+ URL: https://github.com/vdudouyt/minipro Source0: https://github.com/vdudouyt/minipro/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz +Patch0: https://github.com/lkundrak/minipro/commit/e9953f8.patch#/0001-write_page_ram-fix-a-typo.patch +Patch1: https://github.com/lkundrak/minipro/commit/3e26627.patch#/0002-msg_init-the-memory-size-is-4-octets.patch +Patch2: https://github.com/lkundrak/minipro/commit/b303092.patch#/0001-Revert-Using-PREFIX-instead-of-the-DESTDIR-confusion.patch +Patch3: https://github.com/lkundrak/minipro/commit/38f5c60.patch#/0002-Install-the-bash-completion-files-in-to-a-proper-loc.patch +Patch4: https://github.com/lkundrak/minipro/commit/bc31cbc.patch#/0003-Use-PREFIX-to-override-install-location.patch + BuildRequires: pkgconfig(libusb-1.0) Requires: udev Requires: /usr/bin/srec_cat @@ -25,6 +31,11 @@ various BIOSes and EEPROMs). %prep %setup -q -n %{name}-%{commit} +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 %build @@ -32,7 +43,7 @@ make %{?_smp_mflags} CFLAGS='%{optflags}' %install -make install DESTDIR=%{buildroot} \ +make install PREFIX=%{buildroot}%{_prefix} \ COMPLETIONS_DIR=%{buildroot}%{_datadir}/bash-completion/completions @@ -56,6 +67,9 @@ udevadm trigger --subsystem-match=usb --attr-match=idVendor=04d8 --attr-match=id %changelog +* Sat Oct 29 2016 Lubomir Rintel - 0.1-1.20161029git484abde +- Update to a later snapshot + * Thu Feb 04 2016 Fedora Release Engineering - 0.0.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild diff --git a/sources b/sources index b1d807b..b6b0b11 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -d5ad4301afaafde2789359e1d246bc03 minipro-0.0.1-60dda45.tar.gz +cf854be1350de90e2a4e722ebddb83a7 minipro-0.1-484abde.tar.gz