Blob Blame History Raw
Name:		arduino
Epoch:		1
Version:	1.6.4
Release:	2%{?dist}
Summary:	An IDE for Arduino-compatible electronics prototyping platforms
Group:		Development/Tools
License:	GPLv2+ and LGPLv2+ and CC-BY-SA
URL:		http://www.arduino.cc/

# There are a lot of binaries in the "source" tarball.
# These binaries are removed in the prep section of the SPEC file.
Source0:	https://github.com/arduino/Arduino/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz

BuildArch:	noarch

BuildRequires:	java-devel >= 1:1.8.0
BuildRequires:	jpackage-utils ant ant-apache-regexp desktop-file-utils ecj jna
BuildRequires:	jmdns jsemver apache-commons-net apache-commons-codec git
BuildRequires:	apache-commons-compress apache-commons-exec apache-commons-lang3
BuildRequires:	apache-commons-logging jsch guava jackson-annotations jssc
BuildRequires:	bouncycastle-pg jackson-databind jackson-module-mrbean
BuildRequires:	objectweb-asm
Requires:	java >= 1:1.8.0
Requires:	xorg-x11-fonts-Type1 ecj jna zenity perl polkit ecj jna
Requires:	jmdns jsemver apache-commons-net apache-commons-codec git
Requires:	apache-commons-compress apache-commons-exec apache-commons-lang3
Requires:	apache-commons-logging jsch guava jackson-annotations jssc
Requires:	bouncycastle-pg jackson-databind jackson-module-mrbean
Requires:	objectweb-asm astyle-devel

# This patch skips the init process for OSX platforms.
Patch0:		arduino-macosx.patch
# Turns off all network downloads in build
Patch1:		arduino-no-network.patch
# Redirects Arduino to system avr-gcc and avrdude utilities
Patch2:		arduino-use-system-avrdude.patch
Patch3:		arduino-add-to-groups.patch
Patch4:		arduino-script.patch

%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 contains an IDE that can be used to develop and upload code
to the micro-controller.

%package -n %{name}-core
Summary:	Files required for compiling code for Arduino-compatible micro-controllers
Group:		Development/Tools
Requires:	avr-gcc avr-gcc-c++ avr-libc avrdude


%description -n %{name}-core
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 contains the core files required to compile and upload
Arduino code.


%package -n %{name}-doc
Summary:	Documentation for the Arduino micro-controller platform
Group:		Development/Tools
Requires:	avr-gcc avr-gcc-c++ avr-libc avrdude


%description -n %{name}-doc
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 contains reference documentation.


%prep
%setup -q -n Arduino-%{version}
# The "extra" wifi components are licensed non-free and do not fall under the
# "firmware" execption.
rm -rf hardware/arduino/avr/firmwares/wifishield
rm -rf libraries/WiFi/extras
# As mentioned earlier, binary forms are removed here.
find -type d \( -name macosx -o -name windows \) -print0 | xargs -0 rm -rf
find -name '*.tgz' -delete
find -name '*.tar.gz' -delete
find -name '*.elf' -delete
find -name '*.class' -delete
find -name '*.jar' -delete
find -name '*.so' -delete
find -name '*.hex' -delete

%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1

echo -e "\n# By default, don't notify the user of a new upstream version." \
        "\n# https://bugzilla.redhat.com/show_bug.cgi?id=773519" \
        "\nupdate.check=false" \
    >> build/shared/lib/preferences.txt

build-jar-repository -p -s arduino-core/lib/ apache-commons-codec \
apache-commons-compress apache-commons-exec apache-commons-lang3 \
apache-commons-logging apache-commons-net bcpg bcprov jackson-core \
jackson-databind jackson-module-mrbean jmdns jsch jsemver jssc guava \
objectweb-asm jackson-annotations

build-jar-repository -p -s app/lib/ guava apache-commons-logging \
jakarta-commons-httpclient jsch apache-commons-lang3 jssc jsemver

touch app/test/cc/arduino/packages/contributions/library_index.json

%build
pushd build
ant
echo %{version} | ant dist
mv linux/%{name}*.tar.xz linux/%{name}-%{version}.tar.xz
tar -xf linux/%{name}-%{version}.tar.xz
popd

%install
cd build/%{name}-%{version}

mkdir -p $RPM_BUILD_ROOT%{_bindir}
cp -a arduino $RPM_BUILD_ROOT%{_bindir}/

mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}
cp -a hardware lib libraries examples $RPM_BUILD_ROOT/%{_datadir}/%{name}/
rm $RPM_BUILD_ROOT%{_datadir}/%{name}/lib/*.jar
rm -r $RPM_BUILD_ROOT%{_datadir}/%{name}/hardware/tools

%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}
cp -a ../../license.txt ../../README.md $RPM_BUILD_ROOT/%{_pkgdocdir}/

# Requested upstream in http://github.com/arduino/Arduino/pull/4:
find $RPM_BUILD_ROOT -type f -iname *.jpg -or -iname *.java -or -iname *.pde -or -iname *.h -or -iname *.cpp -or -iname *.c -or -iname *.txt -or -iname makefile -or -iname key*.txt -or -iname pref*.txt | xargs chmod -x;

cp -a lib/arduino-core.jar lib/pde.jar $RPM_BUILD_ROOT%{_datadir}/%{name}/

mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}
mv $RPM_BUILD_ROOT%{_datadir}/%{name}/hardware/%{name}/avr/boards.txt \
   $RPM_BUILD_ROOT%{_datadir}/%{name}/hardware/%{name}/avr/programmers.txt \
   $RPM_BUILD_ROOT%{_datadir}/%{name}/lib/preferences.txt \
   $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/
ln -s %{_sysconfdir}/%{name}/boards.txt \
   $RPM_BUILD_ROOT%{_datadir}/%{name}/hardware/%{name}/boards.txt
ln -s %{_sysconfdir}/%{name}/programmers.txt \
   $RPM_BUILD_ROOT%{_datadir}/%{name}/hardware/%{name}/programmers.txt
ln -s %{_sysconfdir}/%{name}/preferences.txt \
   $RPM_BUILD_ROOT%{_datadir}/%{name}/lib/preferences.txt
ln -s %{_libdir}/libastyle.so \
   $RPM_BUILD_ROOT%{_datadir}/%{name}/lib/libastylej.so

desktop-file-install --dir=${RPM_BUILD_ROOT}%{_datadir}/applications ../linux/dist/%{name}.desktop

mkdir -p $RPM_BUILD_ROOT%{_datadir}/mime/packages
cp -a ../linux/dist/mime.xml $RPM_BUILD_ROOT%{_datadir}/mime/packages/%{name}.xml

for dir in ../shared/icons/*; do
    if [ -d $dir ]
    then
        size=`basename $dir`
        mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/$size/apps
        cp $dir/apps/%{name}.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/$size/apps/
    fi
done

mkdir -p $RPM_BUILD_ROOT%{_libexecdir}
cp -a ../linux/dist/%{name}-add-groups $RPM_BUILD_ROOT%{_libexecdir}/

mkdir -p $RPM_BUILD_ROOT%{_datadir}/polkit-1/actions
cp -a ../linux/dist/cc.arduino.add-groups.policy $RPM_BUILD_ROOT%{_datadir}/polkit-1/actions

mkdir -p $RPM_BUILD_ROOT%{_datadir}/appdata
cp -a ../linux/dist/appdata.xml $RPM_BUILD_ROOT%{_datadir}/appdata/%{name}.appdata.xml

%files
%{_bindir}/*
%{_datadir}/%{name}/*.jar
%{_datadir}/%{name}/lib/*
%exclude %{_datadir}/%{name}/lib/version.txt
%{_datadir}/applications/%{name}.desktop
%{_datadir}/mime/packages/%{name}.xml
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%{_datadir}/polkit-1/actions/cc.arduino.add-groups.policy
%{_libexecdir}/%{name}-add-groups
%{_datadir}/appdata/%{name}.appdata.xml

%post
/usr/bin/update-desktop-database &> /dev/null || :
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
/bin/touch --no-create %{_datadir}/mime/packages &>/dev/null || :

%postun
/usr/bin/update-desktop-database &> /dev/null || :
if [ $1 -eq 0 ] ; then
    /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    /bin/touch --no-create %{_datadir}/mime/packages &>/dev/null || :
    /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
    /usr/bin/update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || :
fi

%posttrans
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
/usr/bin/update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || :

%files -n %{name}-doc
%{_pkgdocdir}/

%files -n %{name}-core
%license license.txt
%doc README.md
%dir %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/boards.txt
%config(noreplace) %{_sysconfdir}/%{name}/programmers.txt
%config(noreplace) %{_sysconfdir}/%{name}/preferences.txt
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/examples/
%{_datadir}/%{name}/hardware/
%{_datadir}/%{name}/libraries/
%dir %{_datadir}/%{name}/lib
%{_datadir}/%{name}/lib/version.txt

%changelog
* Fri Dec 25 2015 Dennis Chen <barracks510@gmail.com> - 1:1.6.4-2
- Update dependencies list to include newly packaged JSSC.

* Fri Dec 25 2015 Dennis Chen <barracks510@gmail.com> - 1:1.6.4-1
- Update to 1.6.4 and refactor most of the patches and spec file.

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:1.0.6-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Thu Apr  9 2015 Peter Oliver <rpm@mavit.org.uk> - 1:1.0.6-2
- Passing the --directory argument to `git apply` is no longer required.

* Mon Apr  6 2015 Peter Oliver <rpm@mavit.org.uk> - 1:1.0.6-1
- Update to 1.0.6.

* Tue Jul 08 2014 Rex Dieter <rdieter@fedoraproject.org> 1:1.0.5-8
- optimize mimeinfo scriptlet

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:1.0.5-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Sun Dec 29 2013 Peter Oliver <rpm@mavit.org.uk> - 1:1.0.5-6
- Associate .ino files with the Arduino IDE.

* Thu Nov  7 2013 Peter Oliver <rpm@mavit.org.uk> - 1:1.0.5-5
- Force update of icon cache so that icon appears straight away.
- Add appdata.xml.

* Mon Aug  5 2013 Peter Oliver <rpm@mavit.org.uk> - 1:1.0.5-4
- Unversion documentation directory.

* Mon Aug  5 2013 Peter Oliver <rpm@mavit.org.uk> - 1:1.0.5-3
- Add arduino-build-platform.patch to allow building on ARM (rhbz 991988).

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:1.0.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Thu May 23 2013 Peter Oliver <rpm@mavit.org.uk> - 1:1.0.5-1
- Update to 1.0.5.
- Remove bug891556.patch.
- Remove wifishield firmware for now, until I figure out whether it's
  reasonable/permissible to include.

* Sat Feb 16 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 1:1.0.1-4
- own /etc/arudino and /usr/share/arduino (bug 911931)

* Mon Feb 04 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 1:1.0.1-3
- ino needs to know the arduino version (bug 905681)

* Fri Feb 01 2013 T.C. Hollingsworth <tchollingsworth@gmail.com>
- define __AVR_LIBC_DEPRECATED_ENABLE__ (bug 891556)

* Sun Jul 22 2012 Peter Oliver <rpm@mavit.org.uk> - 1:1.0.1-1
- Update to 1.0.1.
- Compress source with xz.

* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:1.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Fri May  4 2012 Peter Oliver <rpm@mavit.org.uk> - 1:1.0-4
- Pass version number to "ant build" (fixes #815079).

* Sat Jan 14 2012 Peter Oliver <rpm@mavit.org.uk> - 1:1.0-3
- Change the default preferences so that we don't notify the user that a
  new upstream version has been released (#773519).

* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:1.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Mon Jan  2 2012 Peter Oliver <rpm@mavit.org.uk> - 1:1.0-2
- Add arduino-no-avrdude64.patch to prevent copying of (for us,
  unbundled) avrdude64.

* Mon Jan  2 2012 Peter Oliver <rpm@mavit.org.uk> - 1:1.0-1
- Update to 1.0 (#753103).
- Drop arduino-use-system-avrdude.patch and arduino-boards-txt.patch,
  since they're no-longer needed.
- Move preferences.txt to /etc.

* Mon Sep 12 2011 Peter Oliver <rpm@mavit.org.uk> - 0022-5
- Treat boards.txt and programmers.txt as config files (#726135).
- Make building with "fedpkg local" work.

* Fri Jul 15 2011 Peter Oliver <rpm@mavit.org.uk> - 0022-4
- Include missing examples (#722351).

* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0022-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Fri Dec 31 2010 Peter Oliver <rpm@mavit.org.uk> - 0022-2
- Prompt the user if they are not a member of the required groups,
  rather than failing silently.

* Thu Dec 30 2010 Peter Oliver <rpm@mavit.org.uk> - 0022-1
- Update to 0022 release (#666309).
- Use the new upstream source tarball rather than git.
- Drop oro requirement and related patch, since it is no-longer used.

* Fri Dec 17 2010 Peter Oliver <rpm@mavit.org.uk> - 0021-2
- Patch boards.txt to use the "arduino" programmer type for Uno boards,
  allowing Fedora's version of avrdude to work with these boards.

* Thu Oct  7 2010 Peter Oliver <rpm@mavit.org.uk> - 0021-1
- New upstream release 0021.
- Add patch for new upstream icons.
- Override device scan in RXTX to allow use of Arduino Uno.

* Mon Sep 20 2010 Peter Oliver <rpm@mavit.org.uk> - 0019-6
- Explictly mention documentation with doc macro.
- Move reference documentation into -doc package.

* Thu Sep  9 2010 Peter Oliver <rpm@mavit.org.uk> - 0019-5
- Add missing BuildRequires.
- Use build-jar-repository to locate java libraries to build against.
- Eliminate cross-package symlinks.

* Wed Sep  8 2010 Peter Oliver <rpm@mavit.org.uk> - 0019-4
- Make sure all jars are removed from the source bundle.
- Add missing documentation.

* Tue Sep  7 2010 Peter Oliver <rpm@mavit.org.uk> - 0019-3
- Split into two packages, making the IDE optional to install.
- Build during the build phase not the install phase.
- More dependencies.

* Mon Sep  6 2010 Peter Oliver <rpm@mavit.org.uk> - 0019-2
- Expanded dependencies.

* Sun Sep  5 2010 Peter Oliver <rpm@mavit.org.uk> - 0019-1
- Initial version.  Based in part on the Debian package.