[gnome-weather] Add infrastructure to build RPMS



commit 5bf716f4fce5019f97d68e703c61429e127cafc2
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Wed Jan 1 17:55:26 2014 +0100

    Add infrastructure to build RPMS
    
    Applications should be shipped by upstream, not by distributions.
    Ideally, that would be done with some form of bundle, but until
    those are possible, RPMs are good too.
    
    This is where the full namespacing shows its strenght: because
    everything is "org.gnome.Weather.Application", it's impossible
    to have file conflicts with distribution packages (except for
    gnome-weather itself), and there is no need for downstream patches.

 Makefile.am                        |   25 ++++++++++++++-
 org.gnome.Weather.Application.spec |   58 ++++++++++++++++++++++++++++++++++++
 2 files changed, 81 insertions(+), 2 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 2ebdb74..d0d3d2e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -17,8 +17,29 @@ MAINTAINERCLEANFILES = \
        $(srcdir)/missing \
        $(srcdir)/mkinstalldirs
 
-GITIGNOREFILES = m4/
+GITIGNOREFILES = .anjuta .anjuta_sym_db.db m4/ rpms/
 
 distdir = $(PACKAGE_TARNAME)-$(VERSION)
 
--include $(top_srcdir)/git.mk
+rpmdefines = \
+       --define "_name $(PACKAGE_NAME)" \
+       --define "_version $(PACKAGE_VERSION)" \
+       --define "_distdir $(PACKAGE_TARNAME)" \
+       --define "_sourcedir $(abs_builddir)" \
+       --define "_specdir $(abs_srcdir)" \
+       --define "_builddir $(abs_builddir)/rpms" \
+       --define "_srcrpmdir $(abs_builddir)/rpms" \
+       --define "_rpmdir $(abs_builddir)/rpms"
+
+rpm: dist
+       @rm -fR $(builddir)/rpms
+       @mkdir $(builddir)/rpms
+       env -i PATH=/usr/bin/:/bin SHELL=$(SHELL) HOSTNAME=$${HOSTNAME} HOME=$${HOME} \
+       rpmbuild $(rpmdefines) -ba $(srcdir)/$(PACKAGE_NAME).spec
+
+clean-local:
+       rm -fR $(builddir)/rpms
+
+EXTRA_DIST = $(PACKAGE_NAME).spec
+
+include $(top_srcdir)/git.mk
diff --git a/org.gnome.Weather.Application.spec b/org.gnome.Weather.Application.spec
new file mode 100644
index 0000000..a71de78
--- /dev/null
+++ b/org.gnome.Weather.Application.spec
@@ -0,0 +1,58 @@
+Name:          %{_name}
+Version:       %{_version}
+Release:       1%{?dist}
+Summary:       GNOME Weather
+
+License:       GPLv2+ and LGPLv2+ and MIT and CC-BY and CC-BY-SA
+URL:           http://wiki.gnome.org/Apps/Weather
+Source0:        %{_distdir}-%{version}.tar.xz
+BuildArch:      x86_64 i686
+
+%description
+A small application that allows you to monitor the current weather
+conditions for your city, or anywhere in the world and to access
+updated forecasts, up to 7 days, provided by various internet services.
+
+%prep
+%setup -q -n %{_distdir}-%{version}
+
+%build
+%configure --disable-static
+make %{?_smp_mflags}
+
+%install
+make install DESTDIR=$RPM_BUILD_ROOT
+find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
+rm -fR $RPM_BUILD_ROOT/%{_bindir}
+desktop-file-edit $RPM_BUILD_ROOT/%{_datadir}/applications/%{name}.desktop \
+    --set-key=X-AppInstall-Package --set-value=%{name}
+
+%find_lang %{name}
+
+%check
+desktop-file-validate $RPM_BUILD_ROOT/%{_datadir}/applications/%{name}.desktop
+
+%post
+touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
+
+%postun
+if [ $1 -eq 0 ] ; then
+    glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
+    touch --no-create %{_datadir}/icons/hicolor &>/dev/null
+    gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
+fi
+
+%posttrans
+glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
+gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
+
+%files -f %{name}.lang
+%doc NEWS COPYING
+%{_datadir}/appdata/%{name}.appdata.xml
+%{_datadir}/applications/%{name}.desktop
+%{_datadir}/dbus-1/services/%{name}.service
+%{_datadir}/glib-2.0/schemas/%{name}.gschema.xml
+%{_datadir}/gnome-shell/search-providers/%{name}.search-provider.ini
+%{_datadir}/icons/hicolor/*/apps/%{name}.png
+%{_datadir}/%{name}/
+%{_libdir}/%{name}/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]