This repository has been archived by the owner on Jan 12, 2022. It is now read-only.
forked from lloyd/browserid-keysigner
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add RPM build and a Makefile with some hooks for our CI env
- Loading branch information
Showing
4 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/node_modules | ||
*~ | ||
npm-debug.log | ||
rpmbuild |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |