Permalink
Browse files

add RPM build and a Makefile with some hooks for our CI env

  • Loading branch information...
1 parent d28e2f2 commit 6ae1a913cad882178706fed1bd268fe5ba488329 @fetep fetep committed Jun 2, 2012
Showing with 105 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +17 −0 Makefile
  3. +54 −0 scripts/browserid-bigtent.spec
  4. +33 −0 scripts/rpmbuild.sh
View
@@ -1,4 +1,5 @@
node_modules
+rpmbuild
server/config/certificate.pem
server/config/certrequest.csr
server/config/local.json
View
@@ -0,0 +1,17 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+clean:
+ rm -rf node_modules rpmbuild
+
+npm:
+ npm install
+
+rpm: npm
+ scripts/rpmbuild.sh
+
+test: npm
+ npm test
+
+jenkins_build: clean npm test rpm
@@ -0,0 +1,54 @@
+%define _rootdir /opt/bigtent
+
+Name: browserid-bigtent
+Version: 0.2012.05.25
+#Release: 1%{?dist}_%{svnrev}
+Release: 1%{?dist}
+Summary: BrowserID BigTent server
+Packager: Pete Fritchman <petef@mozilla.com>
+Group: Development/Libraries
+License: MPL 2.0
+URL: https://github.com/mozilla/browserid-bigtent
+Source0: %{name}.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+AutoReqProv: no
+Requires: openssl nodejs
+BuildRequires: gcc-c++ git jre make npm openssl-devel expat-devel
+
+%description
+BrowserID BigTent: server providing proxy IdP authentication.
+
+%prep
+%setup -q -c -n browserid-bigtent
+
+%build
+npm install
+export PATH=$PWD/node_modules/.bin:$PATH
+#./locale/compile-mo.sh locale/
+#./locale/compile-json.sh locale/ resources/static/i18n/
+#env CONFIG_FILES=$PWD/config/l10n-all.json scripts/compress
+#rm -r resources/static/build resources/static/test
+echo "$GIT_REVISION" > static/ver.txt
+#echo "locale svn r$SVN_REVISION" >> resources/static/ver.txt
+
+%install
+rm -rf %{buildroot}
+mkdir -p %{buildroot}%{_rootdir}/server
+for f in server/{bin,lib,views,*.js}; do
+ cp -rp $f %{buildroot}%{_rootdir}/server/
+done
+for f in node_modules static; do
+ cp -rp $f %{buildroot}%{_rootdir}/
+done
+mkdir -p %{buildroot}%{_rootdir}/config
+
+%clean
+rm -rf %{buildroot}
+
+%files
+%defattr(-,root,root,-)
+%{_rootdir}
+
+%changelog
+* Fri Jun 1 2012 Pete Fritchman <petef@mozilla.com>
+- Initial version
View
@@ -0,0 +1,33 @@
+#!/bin/bash
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+set -e
+
+progname=$(basename $0)
+
+cd $(dirname $0)/.. # top level of the checkout
+
+mkdir -p rpmbuild/SOURCES rpmbuild/SPECS rpmbuild/SOURCES
+rm -rf rpmbuild/RPMS rpmbuild/SOURCES/browserid
+
+tar --exclude rpmbuild --exclude .git \
+ --exclude var -czf \
+ $PWD/rpmbuild/SOURCES/browserid-bigtent.tar.gz .
+
+set +e
+
+export GIT_REVISION=$(git log -1 --oneline)
+#export SVN_REVISION=$(svn info locale/ | sed -n -e "s,^Revision: ,,p")
+
+rpmbuild --define "_topdir $PWD/rpmbuild" \
+ --define "svnrev $SVN_REVISION" -ba scripts/browserid-bigtent.spec
+rc=$?
+if [ $rc -eq 0 ]; then
+ ls -l $PWD/rpmbuild/RPMS/*/*.rpm
+else
+ echo "$progname: failed to build bigtent RPM (rpmbuild rc=$rc)" >&2
+fi
+
+exit $rc

0 comments on commit 6ae1a91

Please sign in to comment.