2014-08-26 16:26:25 -04:00
SHELL = /bin/sh
2014-08-28 20:47:32 +00:00
PKGNAME = stack_blackbox
2014-08-26 16:26:25 -04:00
all :
@echo 'Menu:'
2014-11-17 15:38:03 +00:00
@echo ' make packages Make RPM packages'
2015-01-27 10:39:30 +00:00
@echo ' make install (incomplete)'
2014-08-26 16:26:25 -04:00
install :
@echo 'To install, copy the files from bin to somewhere in your PATH.'
@echo 'Or, if you use RPMs, "make packages" and install the result.'
2014-08-28 20:47:32 +00:00
2014-11-17 15:38:03 +00:00
# The default package type is RPM.
packages : packages -rpm
2015-02-03 12:18:01 -05:00
#
# MacPorts builds
#
2015-02-03 12:34:15 -05:00
# To test:
# rm -rf /tmp/foo ; mkdir -p /tmp/foo;make packages-macports DESTDIR=/tmp/foo;find /tmp/foo -ls
2015-02-03 12:18:01 -05:00
# Make mk_macports.vcs_blackbox.txt from mk_rpm_fpmdir.stack_blackbox.txt:
tools/mk_macports.vcs_blackbox.txt : tools /mk_rpm_fpmdir .stack_blackbox .txt
2015-02-03 12:34:15 -05:00
sed -e 's@/usr/blackbox/bin/@bin/@g' -e '/profile.d-usrblackbox.sh/d' <tools/mk_rpm_fpmdir.stack_blackbox.txt >$@
check-destdir :
i f n d e f D E S T D I R
$( error DESTDIR is undefined)
e n d i f
2015-02-03 12:18:01 -05:00
# MacPorts expects to run: make packages-macports DESTDIR=${destroot}
2015-02-03 12:34:15 -05:00
packages-macports : tools /mk_macports .vcs_blackbox .txt check -destdir
2015-02-03 12:18:01 -05:00
mkdir -p $( DESTDIR) /bin
2015-02-03 12:34:15 -05:00
cd tools && ./mk_macports mk_macports.vcs_blackbox.txt
2015-02-03 12:18:01 -05:00
2014-11-17 15:38:03 +00:00
#
# RPM builds
#
packages-rpm :
2015-01-29 16:43:26 -05:00
cd tools && PKGRELEASE = " $$ {PKGRELEASE} " PKGDESCRIPTION = "Safely store secrets in git/hg/svn repos using GPG encryption" ./mk_rpm_fpmdir stack_blackbox mk_rpm_fpmdir.stack_blackbox.txt
2014-11-17 15:38:03 +00:00
packages-rpm-debug :
2014-08-28 20:47:32 +00:00
@echo BUILD:
@PKGRELEASE= 99 make packages
@echo ITEMS TO BE PACKAGED:
find ~/rpmbuild-$( PKGNAME) /installroot -type f
@echo ITEMS ACTUALLY IN PACKAGE:
@rpm -qpl $$ ( cat ~/rpmbuild-$( PKGNAME) /bin-packages.txt)
2014-11-17 15:38:03 +00:00
local-rpm :
2014-08-28 20:47:32 +00:00
@PKGRELEASE= 1 make packages
-@sudo rpm -e $( PKGNAME)
sudo rpm -i $$ ( cat ~/rpmbuild-$( PKGNAME) /bin-packages.txt)
2014-11-17 15:38:03 +00:00
lock-rpm :
2014-08-28 20:47:32 +00:00
sudo yum versionlock add $( PKGNAME)
2014-11-17 15:38:03 +00:00
unlock-rpm :
2014-08-28 20:47:32 +00:00
sudo yum versionlock clear
2014-08-29 20:21:02 +00:00
2014-11-17 15:38:03 +00:00
# Add other package types here.
#
# System Test:
#
2014-11-02 08:39:12 -05:00
confidence :
@if [ [ -e ~/.gnupg ] ] ; then echo ERROR: '~/.gnupg should not exist. If it does, bugs may polute your .gnupg configuration. If the code has no bugs everything will be fine. Do you feel lucky?' ; false ; fi
2014-11-05 16:47:15 +00:00
@if which >/dev/null gpg-agent ; then pkill gpg-agent ; rm -rf /tmp/tmp.* ; fi
@export PATH = ~/gitwork/blackbox/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin ;
2014-10-14 15:10:05 +00:00
cd ~/gitwork/blackbox && tools/confidence_test.sh
2014-11-05 16:47:15 +00:00
@if which >/dev/null gpg-agent ; then pkill gpg-agent ; fi
@if [ [ -e ~/.gnupg ] ] ; then echo ERROR: '~/.gnupg was created which means the scripts might be poluting GnuPG configuration. Fix this bug.' ; false ; fi