forked from matteocorti/check_ssl_cert
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (38 loc) · 1.35 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
36
37
38
39
40
41
42
43
44
45
46
PLUGIN=check_ssl_cert
VERSION=`cat VERSION`
DIST_DIR=$(PLUGIN)-$(VERSION)
DIST_FILES=AUTHORS COPYING ChangeLog INSTALL Makefile NEWS README.md TODO VERSION $(PLUGIN) $(PLUGIN).spec COPYRIGHT ${PLUGIN}.1 test
YEAR=`date +"%Y"`
dist: version_check copyright_check
rm -rf $(DIST_DIR) $(DIST_DIR).tar.gz
mkdir $(DIST_DIR)
cp -r $(DIST_FILES) $(DIST_DIR)
tar cfz $(DIST_DIR).tar.gz $(DIST_DIR)
tar cfj $(DIST_DIR).tar.bz2 $(DIST_DIR)
install:
mkdir -p $(DESTDIR)
install -m 755 $(PLUGIN) $(DESTDIR)
mkdir -p ${MANDIR}/man1
install -m 644 ${PLUGIN}.1 ${MANDIR}/man1/
version_check:
grep -q "VERSION\ *=\ *[\'\"]*$(VERSION)" $(PLUGIN)
grep -q "^%define\ version\ *$(VERSION)" $(PLUGIN).spec
grep -q -- "- $(VERSION)-" $(PLUGIN).spec
grep -q "\"$(VERSION)\"" $(PLUGIN).1
grep -q "${VERSION}" NEWS
echo "Version check: OK"
copyright_check:
grep -q "(c) Matteo Corti, 2007-$(YEAR)" README.md
grep -q "Copyright (c) 2007-$(YEAR) Matteo Corti" COPYRIGHT
grep -q "Copyright (c) 2007-$(YEAR) Matteo Corti <matteo@corti.li>" $(PLUGIN)
echo "Copyright year check: OK"
clean:
rm -f *~
rm -rf rpmroot
test: dist
( export SHUNIT2="$$(pwd)/shunit2/shunit2" && cd test && ./unit_tests.sh )
rpm: dist
mkdir -p rpmroot/SOURCES rpmroot/BUILD
cp $(DIST_DIR).tar.gz rpmroot/SOURCES
rpmbuild --define "_topdir `pwd`/rpmroot" -ba check_ssl_cert.spec
.PHONY: install clean test rpm