[Spice-devel] [spice-html5] Add the ability to build an rpm.
Jeremy White
jwhite at codeweavers.com
Fri Feb 8 11:17:14 PST 2013
Signed-off-by: Jeremy White <jwhite at codeweavers.com>
---
.gitignore | 1 +
Makefile | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++
spice-html5.spec.in | 38 ++++++++++++++++++++++++++++
3 files changed, 109 insertions(+)
create mode 100644 .gitignore
create mode 100644 Makefile
create mode 100644 spice-html5.spec.in
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..33491a5
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+spice-html5.spec
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..791c8f2
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,70 @@
+# Copyright (C) 2012 by Jeremy P. White <jwhite at codeweavers.com>
+#
+# This file is part of spice-html5.
+#
+# spice-html5 is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# spice-html5 is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with spice-html5. If not, see <http://www.gnu.org/licenses/>.
+#
+
+DESTDIR := $(if $(DESTDIR),$(DESTDIR),/)
+datadir := $(if $(datadir),$(datadir),$(DESTDIR)/usr/share)
+sysconfdir := $(if $(sysconfdir),$(sysconfdir),$(DESTDIR)/etc)
+tag := $(if $(tag),$(tag),HEAD)
+
+ifndef version
+ version = $(shell git describe $(tag)| grep spice-html5 | sed 's/^spice-html5-//')
+endif
+
+source_for_rpm = $(HOME)/rpmbuild/SOURCES/spice-html5-$(version).tar.gz
+
+.PHONY: usage spice-html5.spec rpm tar gittar local git install
+
+usage:
+ @echo "This project does not normally need to be built. See the README."
+ @echo " "
+ @echo "This Makefile is mostly used for creating RPM packages, which you"
+ @echo "can do by invoking 'make local' to use the current working directory,"
+ @echo "or 'make git' to use the latest git HEAD."
+ @echo "You can specify an alternate source tarball like this:"
+ @echo " make source=/my/alternate/source local"
+ @echo "You can specifcy a specific git tag like this:"
+ @echo " make tag=my_specific_tag git"
+ @echo "Results generally go in ~/rpmbuild"
+
+spice-html5.spec:
+ sed -e "s/VERSION/$(version)/" < spice-html5.spec.in > spice-html5.spec
+
+tar:
+ if [ "$(source)x" = "x" ] ; then \
+ tar -czf $(source_for_rpm) --exclude=.git --transform='s!^!spice-html5-$(version)/!' * ; \
+ else \
+ cp $(source) $(source_for_rpm) ; \
+ fi
+
+gittar:
+ if [ "$(source)x" = "x" ] ; then \
+ git archive --output=$(source_for_rpm) --prefix=spice-html5-$(version)/ $(tag) ; \
+ else \
+ cp $(source) $(source_for_rpm) ; \
+ fi
+
+rpm: spice-html5.spec
+ rpmbuild -ba spice-html5.spec
+
+local: tar rpm
+
+git: gittar rpm
+
+install:
+ install -D apache.conf $(sysconfdir)/httpd/conf.d/spice-html5.conf
+ find . \( -iname '*.html' -or -iname '*.js' -or -iname '*.css' \) -exec install --mode=644 -D {} $(datadir)/spice-html5/{} \;
diff --git a/spice-html5.spec.in b/spice-html5.spec.in
new file mode 100644
index 0000000..e2b8db6
--- /dev/null
+++ b/spice-html5.spec.in
@@ -0,0 +1,38 @@
+Name: spice-html5
+Version: VERSION
+Release: 1%{?dist}
+Summary: Pure Javascript SPICE client
+
+License: GPLv3
+URL: http://www.spice-space.org
+Source0: http://www.spice-space.org/download/spice-html5/spice-html5-VERSION.tar.gz
+
+BuildArch: noarch
+Packager: Jeremy White <jwhite at codeweavers.com>
+
+%description
+spice-html5 is a Javascript SPICE client. This includes a simple html
+page to enable a login, and the client itself. It includes a configuration
+file for Apache, but should work with any web server.
+
+%prep
+%setup -q
+
+
+%build
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%make_install
+
+
+%files
+%defattr(-,root,root)
+%config(noreplace) %{_sysconfdir}/httpd/conf.d/*.conf
+%{_datadir}/spice-html5
+%doc COPYING README TODO
+
+
+%changelog
+* Fri Feb 8 2013 Jeremy White <jwhite at codeweavers.com> 0.1.0-1
+- Initial version for packaging.
--
1.7.10.4
More information about the Spice-devel
mailing list