Blob Blame History Raw
#
# spec file for package josm

%global svn_revision 10327


Name:           josm
Version:        0
Release:        0.78.%{svn_revision}svn%{?dist}
Summary:        An editor for  OpenStreetMap (OSM)
Group:          Applications/Internet
License:        GPLv2+
URL:            http://josm.openstreetmap.de/
# The source for this package was pulled from upstream's vcs.  Use the
# following commands to generate the tarball:
#  svn export -r $SVNREV https://josm.openstreetmap.de/svn/release/trunk josm-0
#  tar -czvf josm-0.$SVNREVsvn.tar.gz josm-0
Source0:        %{name}-%{version}.%{svn_revision}svn.tar.gz
Source1:        %{name}
Source2:        %{name}-generate-tarball.sh
#Source built using the following commands : ./josm-generate-tarball.sh 3751

#patch to remove metadata-extractor and signpost-core of final jar
Patch1:         %{name}-%{version}-add_classpath.patch

#remove call to "svn info" and fix in build.xml revision and commit date
Patch2:         %{name}-%{version}-remove_svn_call.patch


BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildArch:      noarch
BuildRequires:  jpackage-utils
BuildRequires:  desktop-file-utils
BuildRequires:  ant
BuildRequires:  java-devel >= 1:1.7.0
BuildRequires:  gettext
BuildRequires:  javacc
BuildRequires:  signpost-core >= 1.2.1.1
BuildRequires:  metadata-extractor2 >= 2.6.4
BuildRequires:  svgsalamander
BuildRequires:  apache-commons-codec
BuildRequires:  apache-commons-compress
BuildRequires:  apache-commons-jcs-core
BuildRequires:  gnu-getopt
BuildRequires:  jsonp
%if 0%{?fedora}
BuildRequires:  libappstream-glib
%endif
Requires:       java >= 1:1.7.0
Requires:       jpackage-utils
Requires:       hicolor-icon-theme
Requires:       metadata-extractor2 >= 2.6.4
Requires:       ant
Requires:       signpost-core >= 1.2.1.1
Requires:       svgsalamander
Requires:       gnu-getopt
Requires:       xmpcore
Requires:       apache-commons-compress
Requires:       apache-commons-codec
Requires:       apache-commons-jcs-core
Requires:       jsonp


%description
JOSM is an editor for OpenStreetMap (OSM) written in Java
Currently it supports loading stand alone GPX track data from the OSM database,
loading and editing existing nodes, ways, metadata tags and relations.

OpenStreetMap is a project aimed squarely at creating and providing
free geographic data such as street maps to anyone who wants them.
The project was started because most maps you think of as free actually
have legal or technical restrictions on their use, holding back people
from using them in creative, productive or unexpected ways.

%package javadoc
Summary:        Javadocs for %{name}
Group:          Documentation
Requires:       %{name} = %{version}-%{release}
Requires:       jpackage-utils

%description javadoc
This package contains the API documentation for %{name}.

%prep
%setup -q
%patch1 -p1
%patch2 -p1

find . -name '*.jar' -exec rm -f '{}' \;
find . -name '*.class' -exec rm -f '{}' \;

# removing signpost source files and include signpost-core in buildrequires and requires
rm -rf ./src/oauth
# removing metadata-extractor and svgSalamander sources files and include metadata-extractor and svgSalamander dependencies
rm -rf ./src/com
# removing gnu-getopt from sources and include it as dependencie
rm -rf ./src/gnu
# removing jsonp from sources and include it as dep
rm -rf ./src/org/glassfish
# removing apache-commons-compress and jcs
rm -rf ./src/org/apache/commons/compress
#rm -rf ./src/org/apache/commons/jcs

# removing jsonp
rm -rf ./src/javax

mkdir -p lib
build-jar-repository -s lib \
metadata-extractor2-2 \
signpost-core \
svgsalamander \
commons-codec \
ant \
gnu-getopt \
apache-commons-compress \
jsonp \
apache-commons-jcs-core

ln -s $(build-classpath javacc) tools/javacc.jar

iconv -f iso8859-15 -t utf-8 CONTRIBUTION > CONTRIBUTION.conv && mv -f CONTRIBUTION.conv CONTRIBUTION

%build
ant javadoc
ant


%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{_javadir}

mkdir -p %{buildroot}%{_javadocdir}/%{name}
cp -rp javadoc  \
%{buildroot}%{_javadocdir}/%{name}

install -p -m 644 dist/%{name}-custom.jar %{buildroot}%{_javadir}/%{name}.jar

install -Dp -m 755 %SOURCE1 %{buildroot}%{_bindir}/%{name}

install -d %{buildroot}%{_datadir}/icons/hicolor/128x128/apps
install -p -m 644 images/logo.png %{buildroot}%{_datadir}/icons/hicolor/128x128/apps/%{name}.png

install -Dp -m 644 linux/tested/usr/share/man/man1/%{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1

%if 0%{?fedora}
install -Dp -m 644 linux/tested/usr/share/appdata/%{name}.appdata.xml %{buildroot}/%{_datadir}/appdata/%{name}.appdata.xml
%endif

desktop-file-install --dir=%{buildroot}%{_datadir}/applications/ linux/tested/usr/share/applications/%{name}.desktop

%if 0%{?fedora}
appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/appdata/%{name}.appdata.xml
%endif

%clean
rm -rf %{buildroot}

%post
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :

%postun
if [ $1 -eq 0 ] ; then
    touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi

%posttrans
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :

%files
%defattr(-,root,root,-)
%doc README LICENSE CONTRIBUTION gpl-2.0.txt gpl-3.0.txt
%{_mandir}/man1/%{name}.1.gz
%{_javadir}/%{name}.jar
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/128x128/apps/%{name}.png
%if 0%{?fedora}
%{_datadir}/appdata/%{name}.appdata.xml
%endif

%files javadoc
%defattr(-,root,root,-)
%{_javadocdir}/%{name}



%changelog
* Sun Jun 19 2016 Cédric OLIVIER <cedric.olivier@free.fr> 0-0.78.10327svn
- Update to 10327 svn revision

* Mon Mar 21 2016 Cédric OLIVIER <cedric.olivier@free.fr> 0-0.77.9979svn
- Update to 9979 svn revision

* Sat Mar 12 2016 Cédric OLIVIER <cedric.olivier@free.fr> 0-0.76.9963svn
- Update to 9963 svn revision

* Mon Feb 29 2016 Cédric OLIVIER <cedric.olivier@free.fr> 0-0.75.9900svn
- Update to 9900 svn revision

* Mon Feb 15 2016 Cédric OLIVIER <cedric.olivier@free.fr> 0-0.74.9329svn
- Update Requirement (#1308516)

* Wed Feb 10 2016 Cédric OLIVIER <cedric.olivier@free.fr> 0-0.73.9329svn
- Update classpath in josm launcher

* Tue Feb 09 2016 Cédric OLIVIER <cedric.olivier@free.fr> 0-0.72.9329svn
- unset executable bits on appdata file

* Tue Feb 09 2016 Cédric OLIVIER <cedric.olivier@free.fr> 0-0.71.9329svn
- Remove jsonp from source

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.70.9329svn
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Sat Jan 16 2016 Matěj Cepl <mcepl@redhat.com> - 0-0.69.9329svn
- Update to 9329 svn revision (#1299047)

* Thu Dec 03 2015 Cédric OLIVIER <cedric.olivier@free.fr> 0-0.69.9060svn
- Update to 9060 svn revision

* Sun Oct 25 2015 Cédric OLIVIER <cedric.olivier@free.fr> 0-0.68.8800svn
- Update to 8800 svn revision

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

* Tue Mar 3 2015 Cédric OLIVIER <cedric.olivier@free.fr> 0-0.66.8109svn
- Update to 8109 svn revision

* Thu Feb 12 2015 Cédric OLIVIER <cedric.olivier@free.fr> 0-0.65.7995svn
- Update to 7995 svn revision

* Sat Jan 24 2015 Cédric OLIVIER <cedric.olivier@free.fr> 0-0.64.7906svn
- Fix bug in launcher

* Sat Jan 17 2015 Cédric OLIVIER <cedric.olivier@free.fr> 0-0.63.7906svn
- Adding dependency apache-commons-compress

* Sat Jan 17 2015 Cédric OLIVIER <cedric.olivier@free.fr> 0-0.62.7906svn
- Update to 7906 svn revision

* Wed Dec 24 2014 Cédric OLIVIER <cedric.olivier@free.fr> 0-0.61.7777svn
- Update to 7777 svn revision

* Mon Nov 17 2014 Cédric OLIVIER <cedric.olivier@free.fr> 0-0.60.7643svn
- Include appdata

* Mon Oct 27 2014 Cédric OLIVIER <cedric.olivier@free.fr> 0-0.59.7643svn
- Change commons-codec to apache-commons-codec

* Sat Oct 25 2014 Cédric OLIVIER <cedric.olivier@free.fr> 0-0.58.7643svn
- Update to 7643 svn revision

* Thu Oct 02 2014 Cédric OLIVIER <cedric.olivier@free.fr> 0-0.57.7588svn
- Fix bug with geolocal picture import

* Tue Sep 30 2014 Cédric OLIVIER <cedric.olivier@free.fr> 0-0.56.7588svn
- Update to 7588 svn revision

* Tue Sep 02 2014 Cédric OLIVIER <cedric.olivier@free.fr> 0-0.55.7480svn
- Update to 7480 svn revision

* Fri Aug 01 2014 Cédric OLIVIER <cedric.olivier@free.fr> 0-0.54.7347svn
- Update to 7347 svn revision