/[pdpsoft]/nl.nikhef.pdp.fetchcrl/tags/fetch-crl-3.0.10-1/Makefile
ViewVC logotype

Annotation of /nl.nikhef.pdp.fetchcrl/tags/fetch-crl-3.0.10-1/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2277 - (hide annotations) (download)
Mon Apr 11 06:54:34 2011 UTC (10 years, 7 months ago) by davidg
Original Path: nl.nikhef.pdp.fetchcrl/trunk/Makefile
File size: 4605 byte(s)
Moved fetch-crl to seprarate repo tree

1 davidg 1758 #
2     # @(#)$Id$
3     # Makefile for fetch-crl3
4     # David Groep, Nikhef <davidg@nikhef.nl>
5     #
6    
7     NAME=$(shell echo *.spec | sed 's/\.spec//')
8     VERSION=$(shell egrep '^Version:' ${NAME}.spec | colrm 1 9)
9     RELEASE=${NAME}-${VERSION}
10     PATCHLEVEL=$(shell egrep '^Release:' ${NAME}.spec | colrm 1 9 | sed -e 's/%.*//' )
11     RPMTOPDIR=$(shell rpm --eval '%_topdir')
12     PREFIX=/usr
13     ETC=/etc
14     CACHE=/var/cache
15     FILES=fetch-crl fetch-crl.8 fetch-crl-cron.cron fetch-crl-cron.init fetch-crl-boot.init fetch-crl.cnf fetch-crl.cnf.example NOTICE LICENSE README CHANGES fetch-crl.spec Makefile
16     # source files that will constitute fetch-crl as a single file, with the primary perl script first
17     SOURCEFILES=fetch-crl3.pl CRL.pm CRLWriter.pm ConfigTiny.pm FCLog.pm OSSL.pm TrustAnchor.pm base64.pm
18    
19     all: configure
20    
21     tar: clean configure fetch-crl
22     -rm -rf /var/tmp/${RELEASE} /var/tmp/${RELEASE}-buildroot
23     -mkdir /var/tmp/${RELEASE}
24     cp -r ${FILES} /var/tmp/${RELEASE}
25 davidg 1807 -chmod -R u+rw /var/tmp/${RELEASE}
26 davidg 1758 cd /var/tmp/ ; tar cvfz ${RELEASE}.tar.gz --exclude=CVS \
27 davidg 1807 --exclude='*~' --exclude='#*#' --exclude='20*' ${RELEASE}
28 davidg 1758 cp /var/tmp/${RELEASE}.tar.gz .
29    
30     #####################################################################
31     # Create substitution script
32     ####################################################################
33     #
34     # This target reads the config file and creates a shell script which
35     # can substitute variables of the form @VAR@ for all config
36     # variables VAR.
37    
38     config.sh: Makefile $(_test_dep) config.mk
39     @cp /dev/null makefile.tmp
40     @echo include config.mk >>makefile.tmp
41     @echo dumpvars: >>makefile.tmp
42     @cat config.mk | \
43     perl >>makefile.tmp -e 'my $$fmt = "\t\@echo \"-e \\\"s\@%s\@\$$(%s)g\\\" \\\\\"" ; while (<>) { $$v{$$1}=1 if /^([A-Za-z0-9_]+)\s*:?=.*$$/; } map { printf "$$fmt >>config.sh\n", $$_, $$_; } sort(keys(%v)); print "\n"; '
44     @echo '#!/bin/sh' >config.sh
45     @echo 'sed \' >>config.sh
46     @$(MAKE) -f makefile.tmp dumpvars >/dev/null
47     @echo ' -e "s/\@MSG\@/ ** Generated file : do not edit **/"'>>config.sh
48     @chmod oug+x config.sh
49     @rm makefile.tmp
50    
51     ####################################################################
52     # Configure
53     ####################################################################
54    
55     fetch-crl: $(SOURCEFILES)
56     cat $(SOURCEFILES) > $@ && chmod +x $@
57    
58     %:: %.cin config.sh
59     @echo configuring $@ ...
60     @rm -f $@ ; cp $< $@
61     @./config.sh <$< >$@ ; chmod oug-w $@
62    
63     %.$(MANSECT):: %.$(MANSECT).man.cin
64     @echo creating $@ ...
65     @./config.sh <$< >$@ ; chmod oug-w $@
66    
67     configure: $(shell find . -name \*\.cin 2>/dev/null | sed -e 's/.cin//' || echo)
68    
69     install: configure
70 davidg 2202 mkdir -p $(ETC)
71     mkdir -p $(PREFIX)
72     mkdir $(PREFIX)/sbin
73     mkdir $(PREFIX)/share
74     mkdir $(PREFIX)/share/doc
75     mkdir $(PREFIX)/share/doc/$(RELEASE)
76     mkdir $(PREFIX)/share/man
77     mkdir $(PREFIX)/share/man/man8
78     install -m755 fetch-crl $(PREFIX)/sbin/fetch-crl
79     install -m644 fetch-crl-cron.cron $(PREFIX)/share/doc/$(RELEASE)/fetch-crl-cron.cron
80     install -m644 fetch-crl-cron.init $(PREFIX)/share/doc/$(RELEASE)/fetch-crl-cron.init
81     install -m644 fetch-crl-boot.init $(PREFIX)/share/doc/$(RELEASE)/fetch-crl-boot.init
82     install -m644 fetch-crl.8 $(PREFIX)/share/man/man8/fetch-crl.8
83     install -m644 fetch-crl.cnf $(ETC)/fetch-crl.conf
84 davidg 1878 install -m644 fetch-crl.cnf.example $(PREFIX)/share/doc/$(RELEASE)/fetch-crl.conf.example
85 davidg 1758 install -m644 README $(PREFIX)/share/doc/$(RELEASE)/README
86     install -m644 NOTICE $(PREFIX)/share/doc/$(RELEASE)/NOTICE
87     install -m644 LICENSE $(PREFIX)/share/doc/$(RELEASE)/LICENSE
88     install -m644 CHANGES $(PREFIX)/share/doc/$(RELEASE)/CHANGES
89     mkdir -p $(CACHE)/fetch-crl && chmod 0700 $(CACHE)/fetch-crl
90    
91     rpm: tar
92     rpmbuild -ta ${RELEASE}.tar.gz
93     @if [ -f ${RPMTOPDIR}/SRPMS/${NAME}-${VERSION}-${PATCHLEVEL}.src.rpm ] ; then \
94     mv ${RPMTOPDIR}/SRPMS/${NAME}*-${VERSION}-${PATCHLEVEL}.src.rpm . ; \
95     fi
96     @if [ -f ${RPMTOPDIR}/RPMS/i386/${NAME}-${VERSION}-${PATCHLEVEL}.i386.rpm ] ; then \
97     mv ${RPMTOPDIR}/RPMS/i386/${NAME}*-${VERSION}-${PATCHLEVEL}.i386.rpm . ; \
98     fi
99     @if [ -f ${RPMTOPDIR}/RPMS/i686/${NAME}-${VERSION}-${PATCHLEVEL}.i686.rpm ] ; then \
100     mv ${RPMTOPDIR}/RPMS/i686/${NAME}*-${VERSION}-${PATCHLEVEL}.i686.rpm . ; \
101     fi
102     @if [ -f ${RPMTOPDIR}/RPMS/noarch/${NAME}-${VERSION}-${PATCHLEVEL}.noarch.rpm ] ; then \
103     mv ${RPMTOPDIR}/RPMS/noarch/${NAME}*-${VERSION}-${PATCHLEVEL}.noarch.rpm . ; \
104     fi
105     @echo DO NOT FORGET TO SIGN THE RPM WITH rpm --resign ${NAME}*-${VERSION}-${PATCHLEVEL}.noarch.rpm
106    
107     clean:
108     -rm -rf *.tar.gz *.rpm fetch-crl config.sh fetch-crl.spec

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28