diff --git a/.gitignore b/.gitignore index 2acafa1f..d64fdf8a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ .git *.swp *.swo +calamari-clients*.tar.gz **/.sass-cache **/.tmp **/dist diff --git a/Makefile b/Makefile index 416b1e67..90f163d8 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,11 @@ BPTAG ?= "" DEBEMAIL ?= dan.mick@inktank.com ARCH ?= x86_64 +TSCOMMIT=$(shell git log -n1 --pretty=format:"%ct.%h") +SUSE_PKG=calamari-clients-$(VERSION)+git.$(TSCOMMIT) +SUSE_DEST=/srv/www/calamari +SUSE_TAR=$(SUSE_PKG).tar.gz + DISTNAMEVER=calamari-clients_$(VERSION) PKGDIR=calamari-clients-$(VERSION) TARNAME = ../$(DISTNAMEVER).tar.gz @@ -120,6 +125,24 @@ install: build tar xvfz $(BUILD_PRODUCT_TGZ); \ fi +# Does build-real (thus requiring grunt, bower and compass be installed), +# then packs everything into a tarball like the install target above, +# except it's created in the .tmp subdirectory of the source tree, and +# packed with a name in the form: +# calamari-clients-1.2+git.1406029226.d2b9ccc.tar.bz", +# i.e. the commit timestamp and hash are included in the tarball name. +# Note: the directory structure here is /srv/www/calamari, to follow +# SUSE packaging conventions for web apps. +suse-tarball: build-real + rm -rf .tmp + mkdir -p .tmp/$(SUSE_PKG)$(SUSE_DEST)/content + for d in $(UI_SUBDIRS); do \ + instdir=$$(basename $$d); \ + $(INSTALL) -d .tmp/$(SUSE_PKG)$(SUSE_DEST)/content/$$instdir; \ + cp -rp $$d/dist/* .tmp/$(SUSE_PKG)$(SUSE_DEST)/content/$$instdir; \ + done; + ( cd .tmp ; tar cvfz ../$(SUSE_TAR) $(SUSE_PKG) ) + dist: @echo "making dist tarball in $(TARNAME)" for d in $(UI_SUBDIRS); do \ diff --git a/calamari-clients.suse.spec b/calamari-clients.suse.spec new file mode 100644 index 00000000..fb8fdef7 --- /dev/null +++ b/calamari-clients.suse.spec @@ -0,0 +1,48 @@ +# +# SUSE spec file for package calamari-clients +# +# Note that the SUSE build for calamari-clients requires that someone has +# already generated a suitable tarball from the source tree by invoking +# `make suse-tarball`. This will result in a tarball named similar to +# calamari-clients-X.Y+git.TIMESTAMP.COMMIT.tar.gz. Don't bother with +# `make rpm`, just use build.opensuse.org with this spec file and the +# appropriate tarball. +# +# NOTE: You will have to edit the Version tag in this spec file to match +# your tarball, once you've checked them in to the build service. +# + +Name: calamari-clients +Version: 1.2+git.TIMESTAMP.COMMIT +Release: 0 +License: MIT +Summary: Calamari GUI front-end components +Url: http://ceph.com/ +Group: System/Filesystems +Source0: %{name}-%{version}.tar.gz +# Need BuildRequires calamari-server to avoid rpmlint warning about no package +# owning /srv/www/calamari (other than that it serves no actual purpose at build +# time). +BuildRequires: calamari-server +BuildRequires: fdupes +Requires: calamari-server +BuildArch: noarch +%description +Contains the JavaScript GUI content for the Calamari frontend components + (dashboard, login screens, administration screens) + +%prep +%setup -q %{name}-%{version} + +%build +# Nothing to do here, this relies on a prebuilt tarball + +%install +cp -a srv %{buildroot}/ +%fdupes %{buildroot}/srv/www/calamari/content + +%files -n calamari-clients +%defattr(-,root,root,-) +/srv/www/calamari/content + +%changelog