Skip to content
This repository has been archived by the owner on Jan 12, 2022. It is now read-only.

Commit

Permalink
add RPM build and a Makefile with some hooks for our CI env
Browse files Browse the repository at this point in the history
  • Loading branch information
fetep committed Jun 8, 2012
1 parent 94b1f37 commit d81cd1d
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,3 +1,4 @@
/node_modules
*~
npm-debug.log
rpmbuild
17 changes: 17 additions & 0 deletions Makefile
@@ -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
44 changes: 44 additions & 0 deletions scripts/browserid-certifier.spec
@@ -0,0 +1,44 @@
%define _rootdir /opt/certifier

Name: browserid-certifier
Version: 0.2012.05.25
Release: 1%{?dist}
Summary: BrowserID Certifier
Packager: Pete Fritchman <petef@mozilla.com>
Group: Development/Libraries
License: MPL 2.0
URL: https://github.com/mozilla/browserid-certifier
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 Certifier: process to sign certificates.

%prep
%setup -q -c -n browserid-certifier

%build
npm install
export PATH=$PWD/node_modules/.bin:$PATH

%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{_rootdir}
for f in bin lib *.json; do
cp -rp $f %{buildroot}%{_rootdir}/
done
mkdir -p %{buildroot}%{_rootdir}/config

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%{_rootdir}

%changelog
* Fri Jun 8 2012 Pete Fritchman <petef@mozilla.com>
- Initial version
32 changes: 32 additions & 0 deletions scripts/rpmbuild.sh
@@ -0,0 +1,32 @@
#!/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-certifier.tar.gz .

set +e

export GIT_REVISION=$(git log -1 --oneline)

rpmbuild --define "_topdir $PWD/rpmbuild" \
-ba scripts/browserid-certifier.spec
rc=$?
if [ $rc -eq 0 ]; then
ls -l $PWD/rpmbuild/RPMS/*/*.rpm
else
echo "$progname: failed to build certifier RPM (rpmbuild rc=$rc)" >&2
fi

exit $rc

0 comments on commit d81cd1d

Please sign in to comment.