From 9ad2c858ce2980461d23e65b5ce702fe4e1b3edc Mon Sep 17 00:00:00 2001 From: Simon John Date: Mon, 30 Dec 2013 16:07:36 +0000 Subject: [PATCH 1/3] Added package directory with RPM SPECfile (and instructions!) Linked to issue #144 Tested on Fedora 18, works fine except the ard-reset-arduino manpage displays [1m and [0m around some headings, might be a bug in help2man 1.41.2 as it works fine on Debian with 1.43.3, will try CentOS/OEL 6.5 next. I didn't update the changelog as I didn't know what the new development version is going to be. --- package/README.md | 19 ++++++++++++++ package/arduino-mk.spec | 55 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 package/README.md create mode 100644 package/arduino-mk.spec diff --git a/package/README.md b/package/README.md new file mode 100644 index 0000000..1798444 --- /dev/null +++ b/package/README.md @@ -0,0 +1,19 @@ +# How to compile an RPM + +From the top-level Arduino-Makefile directory you've checked out of github, run the following to create a compressed tarball using the naming conventions required by rpmbuild: + + git archive --prefix=arduino-mk-1.1.0/ --format=tar -o ../arduino-mk-1.1.0.tar.gz -v HEAD | gzip + +If you don't already have a rpmbuild setup (e.g. you've not installed the SRPM) you will need to create the directories: + + mkdir -p ~/rpmbuild/{SOURCES,SPECS} + +Then copy the tarball and specfile into place: + + cp ../arduino-mk-1.1.0.tar.gz ~/rpmbuild/SOURCES/ + cp package/arduino-mk.spec ~/rpmbuild/SPECS/ + +Then compile. This will create a binary and source RPM: + + cd ~/rpmbuild/SPECS/ + rpmbuild -ba arduino-mk.spec diff --git a/package/arduino-mk.spec b/package/arduino-mk.spec new file mode 100644 index 0000000..1a7f3d3 --- /dev/null +++ b/package/arduino-mk.spec @@ -0,0 +1,55 @@ +Name: arduino-mk +Version: 1.1.0 +Release: 1%{dist} +Summary: Program your Arduino from the command line +Packager: Simon John +URL: https://github.com/sudar/Arduino-Makefile +Source: %{name}-%{version}.tar.gz +Group: Development/Tools +License: LGPLv2+ +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildArch: noarch +Requires: arduino-core, perl-Device-SerialPort +BuildRequires: arduino-core, perl-Device-SerialPort, help2man + +%description +Arduino is an open-source electronics prototyping platform based on +flexible, easy-to-use hardware and software. It's intended for artists, +designers, hobbyists, and anyone interested in creating interactive +objects or environments. + +This package will install a Makefile to allow for CLI programming of the +Arduino platform. + +%prep +%setup -q + +%install +mkdir -p %{buildroot}/%{_datadir}/arduino +mkdir -p %{buildroot}/%{_bindir} +mkdir -p %{buildroot}/%{_mandir}/man1 +mkdir -p %{buildroot}/%{_docdir}/%{name}/examples +install -m 755 -d %{buildroot}/%{_docdir}/%{name} +install -m 755 -d %{buildroot}/%{_docdir}/%{name}/examples +for dir in `find examples -type d` ; do install -m 755 -d %{buildroot}/%{_docdir}/%{name}/$dir ; done +for file in `find examples -type f ! -name .gitignore` ; do install -m 644 $file %{buildroot}/%{_docdir}/%{name}/$file ; done +install -m 644 %{name}/*.mk %{buildroot}/%{_datadir}/arduino +install -m 644 %{name}/licence.txt %{buildroot}/%{_docdir}/%{name} +install -m 755 bin/ard-reset-arduino %{buildroot}/%{_bindir}/ard-reset-arduino +help2man %{buildroot}/%{_bindir}/ard-reset-arduino -n "Reset Arduino board" -s 1 -m "Arduino CLI Reset" --version-string=%{version} -N -o %{buildroot}/%{_mandir}/man1/ard-reset-arduino.1 + +%clean +rm -rf %{buildroot} + +%files +%defattr(-,root,root,-) +%{_bindir}/ard-reset-arduino +%{_mandir}/man1/ard-reset-arduino.1* +%{_datadir}/arduino/*.mk +%doc %{_docdir}/%{name}/licence.txt +%docdir %{_docdir}/%{name}/examples +%{_docdir}/%{name}/examples + +%changelog +* Mon Dec 30 2013 Simon John +- Initial release. From 371377e0ac473cd2ef3ea1dec1c65bb7662501a0 Mon Sep 17 00:00:00 2001 From: Simon John Date: Mon, 30 Dec 2013 19:36:42 +0000 Subject: [PATCH 2/3] moved to better directory layout --- {package => packaging/fedora}/README.md | 0 {package => packaging/fedora}/arduino-mk.spec | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {package => packaging/fedora}/README.md (100%) rename {package => packaging/fedora}/arduino-mk.spec (100%) diff --git a/package/README.md b/packaging/fedora/README.md similarity index 100% rename from package/README.md rename to packaging/fedora/README.md diff --git a/package/arduino-mk.spec b/packaging/fedora/arduino-mk.spec similarity index 100% rename from package/arduino-mk.spec rename to packaging/fedora/arduino-mk.spec From 4e2b945dd1991f37d3f0b2ceb3bd54c020658bc1 Mon Sep 17 00:00:00 2001 From: Simon John Date: Mon, 30 Dec 2013 20:07:22 +0000 Subject: [PATCH 3/3] Changed documentation to use new path, also added dependency info. Tested on Fedora 20 - help2man still a bit iffy --- packaging/fedora/README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packaging/fedora/README.md b/packaging/fedora/README.md index 1798444..dbd6334 100644 --- a/packaging/fedora/README.md +++ b/packaging/fedora/README.md @@ -1,6 +1,10 @@ # How to compile an RPM -From the top-level Arduino-Makefile directory you've checked out of github, run the following to create a compressed tarball using the naming conventions required by rpmbuild: +First install the dependencies as root: + + yum install arduino-core perl-Device-SerialPort help2man rpm-build + +From the top-level Arduino-Makefile directory you've checked out of github, run the following (as unprivileged user) to create a compressed tarball using the naming conventions required by rpmbuild: git archive --prefix=arduino-mk-1.1.0/ --format=tar -o ../arduino-mk-1.1.0.tar.gz -v HEAD | gzip @@ -8,10 +12,10 @@ If you don't already have a rpmbuild setup (e.g. you've not installed the SRPM) mkdir -p ~/rpmbuild/{SOURCES,SPECS} -Then copy the tarball and specfile into place: +Then copy the tarball and specfile into those directories: cp ../arduino-mk-1.1.0.tar.gz ~/rpmbuild/SOURCES/ - cp package/arduino-mk.spec ~/rpmbuild/SPECS/ + cp packaging/fedora/arduino-mk.spec ~/rpmbuild/SPECS/ Then compile. This will create a binary and source RPM: