Blob Blame History Raw
Name:                gpick
Version:             0.2.5 
Release:             9%{?dist}
Summary:             Advanced color picker

License:             BSD
URL:                 http://code.google.com/p/gpick/
Source0:             http://gpick.googlecode.com/files/%{name}_%{version}.tar.gz

BuildRequires:       scons
BuildRequires:       boost-devel
BuildRequires:       pkgconfig(lua)
BuildRequires:       pkgconfig(dbus-glib-1)
BuildRequires:       pkgconfig(gtk+-2.0)
BuildRequires:       flex
BuildRequires:       expat-devel
BuildRequires:       gettext-devel
BuildRequires:       desktop-file-utils 

%description
Advanced color picker

%prep
%setup -q -n %{name}_%{version}

# Delete external libraries and only use system dependencies to build GPick
rm -rf extern
echo "INTERNAL_EXPAT=False" >> user-config.py
echo "INTERNAL_LUA=False" >> user-config.py
echo "LOCALEDIR=\"%{_datadir}/locale\"" >> user-config.py

%build
scons %{?_smp_mflags} CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" LDFLAGS="%{optflags}"

%install
export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags}"
export LDFLAGS="%{optflags}"

scons install DESTDIR=%{buildroot}/%{_prefix}
desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop

# Register as an application to be visible in the software center
#
# NOTE: It would be *awesome* if this file was maintained by the upstream
# project, translated and installed into the right place during `make install`.
#
# See http://www.freedesktop.org/software/appstream/docs/ for more details.
#
mkdir -p $RPM_BUILD_ROOT%{_datadir}/appdata
cat > $RPM_BUILD_ROOT%{_datadir}/appdata/%{name}.appdata.xml <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2014 Ryan Lerch <rlerch@redhat.com> -->
<!--
BugReportURL: https://code.google.com/p/gpick/issues/detail?id=117
SentUpstream: 2014-06-14
-->
<application>
  <id type="desktop">gpick.desktop</id>
  <metadata_license>CC0-1.0</metadata_license>
  <summary>Advanced color picker and color palette creator</summary>
  <description>
    <p>
      Gpick is an application that allows you to sample any color from anywhere
      on the desktop, and use it to create palettes (i.e. collections of colors)
      for use in graphic design applications.
      Gpick also has other features that help in the creation of color palettes,
      such as: the ability to create a palette from an imported image, automatic
      naming of colors, and a scheme generator.
      Color palettes generated in Gpick can be exported many different formats,
      including: Inkscape/Gimp Palettes (*.gpl), Adobe Swatch Exchange (*.ase),
      and Alias/WaveFront Material (*.mtl).
    </p>
  </description>
  <url type="homepage">https://code.google.com/p/gpick/</url>
  <url type="bugtracker">https://code.google.com/p/gpick/issues/list</url>
  <screenshots>
    <screenshot type="default">http://wiki.gpick.googlecode.com/hg/images/main-page-gpick-screenshot.png</screenshot>
  </screenshots>
  <!-- FIXME: change this to an upstream email address for spec updates
  <updatecontact>someone_who_cares@upstream_project.org</updatecontact>
   -->
</application>
EOF

%find_lang %{name}

%files -f %{name}.lang
%doc %{_docdir}/%{name}/copyright
%{_bindir}/%{name}
%{_datadir}/%{name}
%{_datadir}/appdata/%{name}.appdata.xml
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
%{_mandir}/man1/%{name}.1.*

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

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

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

%changelog
* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 0.2.5-9
- Rebuilt for GCC 5 C++11 ABI change

* Thu Mar 26 2015 Richard Hughes <rhughes@redhat.com> - 0.2.5-8
- Add an AppData file for the software center

* Mon Jan 26 2015 Petr Machata <pmachata@redhat.com> - 0.2.5-7
- Rebuild for boost 1.57.0

* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.5-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

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

* Fri May 23 2014 Petr Machata <pmachata@redhat.com> - 0.2.5-4
- Rebuild for boost 1.55.0

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

* Tue Jul 30 2013 Petr Machata <pmachata@redhat.com> - 0.2.5-2
- Rebuild for boost 1.54.0

* Wed May 15 2013 Tom Callaway <spot@fedoraproject.org> - 0.2.5-1
- update to 0.2.5, lua 5.2

* Sat Apr 13 2013 Luya Tshimbalanga <luya@fedoraproject.org> - 0.2.4-4
- Updated spec based Packaging review (rhbz #913367)

* Wed Feb 20 2013 Luya Tshimbalanga <luya@fedoraproject.org> - 0.2.4-2
- Adherance to Fedora Packaging guideline

* Sat Sep 01 2012 Alexis Lameire <alexisis-pristontale@hotmail.com> - 0.2.4-1
- initial release