-
Notifications
You must be signed in to change notification settings - Fork 84
/
Makefile
35 lines (29 loc) · 1.09 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# HARDENING SCRIPT MAKEFILE
# Description: Makefile
# License: GPL (see COPYING)
# Copyright: Red Hat Consulting, Aug 2014
# Author: Frank Caviggia <fcaviggi (at) redhat.com>
PKGNAME=hardening-script
VERSION=$(shell awk '/PKG_VERSION/ { print $$3 }' $(PKGNAME).spec)
RELEASE=$(shell awk '/PKG_RELEASE/ { print $$3 }' $(PKGNAME).spec)
BDIR=`pwd`
default: local
install:
mkdir -p $(INSTROOT)
tar xzfp $(PKGNAME)-$(VERSION).tar.gz -C $(INSTROOT)
rpm: local
@mkdir -p /tmp/$(PKGNAME)-$(VERSION)/opt/hardening-script/
@cp -a $(BDIR)/* /tmp/$(PKGNAME)-$(VERSION)/opt/hardening-script
@cd /tmp/$(PKGNAME)-$(VERSION);tar -czSpf /tmp/$(PKGNAME)-$(VERSION).tar.gz .
@mv /tmp/$(PKGNAME)-$(VERSION).tar.gz $(BDIR)
@rm -rf /tmp/$(PKGNAME)*
@mkdir -p /tmp/$(PKGNAME)-$(VERSION)
@cp -a $(BDIR)/* /tmp/$(PKGNAME)-$(VERSION)
@cd /tmp;tar -czSpf /tmp/$(PKGNAME)-$(VERSION).tar.gz ./$(PKGNAME)-$(VERSION)
@rpmbuild -ta /tmp/$(PKGNAME)-$(VERSION).tar.gz
local: clean
@rm -rf /tmp/$(PKGNAME)*
@rm -f $(BDIR)/$(PKGNAME)-$(VERSION).tar.gz
clean:
@rm -rf /tmp/$(PKGNAME)*
@rm -f $(BDIR)/$(PKGNAME)-$(VERSION).tar.gz