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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2511 - (hide annotations) (download)
Wed Apr 18 13:54:40 2012 UTC (9 years, 7 months ago) by davidg
Original Path: nl.nikhef.pdp.fetchcrl/trunk/Makefile
File size: 5115 byte(s)
add tentative suse

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 2511 cd /var/tmp/ ; perl -pe '/^Req/ and s/chkconfig/aaa_base/g' < ${RELEASE}/fetch-crl.spec > ${RELEASE}/fetch-crl.spec.suse ; mv ${RELEASE}/fetch-crl.spec.suse ${RELEASE}/fetch-crl.spec ; tar cvfz ${RELEASE}.suse.tar.gz --exclude=CVS \
29     --exclude='*~' --exclude='#*#' --exclude='20*' ${RELEASE}
30 davidg 1758 cp /var/tmp/${RELEASE}.tar.gz .
31 davidg 2511 cp /var/tmp/${RELEASE}.suse.tar.gz .
32 davidg 1758
33     #####################################################################
34     # Create substitution script
35     ####################################################################
36     #
37     # This target reads the config file and creates a shell script which
38     # can substitute variables of the form @VAR@ for all config
39     # variables VAR.
40    
41     config.sh: Makefile $(_test_dep) config.mk
42     @cp /dev/null makefile.tmp
43     @echo include config.mk >>makefile.tmp
44     @echo dumpvars: >>makefile.tmp
45     @cat config.mk | \
46     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"; '
47     @echo '#!/bin/sh' >config.sh
48     @echo 'sed \' >>config.sh
49     @$(MAKE) -f makefile.tmp dumpvars >/dev/null
50     @echo ' -e "s/\@MSG\@/ ** Generated file : do not edit **/"'>>config.sh
51     @chmod oug+x config.sh
52     @rm makefile.tmp
53    
54     ####################################################################
55     # Configure
56     ####################################################################
57    
58     fetch-crl: $(SOURCEFILES)
59     cat $(SOURCEFILES) > $@ && chmod +x $@
60    
61     %:: %.cin config.sh
62     @echo configuring $@ ...
63     @rm -f $@ ; cp $< $@
64     @./config.sh <$< >$@ ; chmod oug-w $@
65    
66     %.$(MANSECT):: %.$(MANSECT).man.cin
67     @echo creating $@ ...
68     @./config.sh <$< >$@ ; chmod oug-w $@
69    
70     configure: $(shell find . -name \*\.cin 2>/dev/null | sed -e 's/.cin//' || echo)
71    
72     install: configure
73 davidg 2202 mkdir -p $(ETC)
74     mkdir -p $(PREFIX)
75 davidg 2316 mkdir -p $(PREFIX)/sbin
76     mkdir -p $(PREFIX)/share
77     mkdir -p $(PREFIX)/share/doc
78     mkdir -p $(PREFIX)/share/doc/$(RELEASE)
79     mkdir -p $(PREFIX)/share/man
80     mkdir -p $(PREFIX)/share/man/man8
81 davidg 2202 install -m755 fetch-crl $(PREFIX)/sbin/fetch-crl
82     install -m644 fetch-crl-cron.cron $(PREFIX)/share/doc/$(RELEASE)/fetch-crl-cron.cron
83     install -m644 fetch-crl-cron.init $(PREFIX)/share/doc/$(RELEASE)/fetch-crl-cron.init
84     install -m644 fetch-crl-boot.init $(PREFIX)/share/doc/$(RELEASE)/fetch-crl-boot.init
85     install -m644 fetch-crl.8 $(PREFIX)/share/man/man8/fetch-crl.8
86     install -m644 fetch-crl.cnf $(ETC)/fetch-crl.conf
87 davidg 1878 install -m644 fetch-crl.cnf.example $(PREFIX)/share/doc/$(RELEASE)/fetch-crl.conf.example
88 davidg 1758 install -m644 README $(PREFIX)/share/doc/$(RELEASE)/README
89     install -m644 NOTICE $(PREFIX)/share/doc/$(RELEASE)/NOTICE
90     install -m644 LICENSE $(PREFIX)/share/doc/$(RELEASE)/LICENSE
91     install -m644 CHANGES $(PREFIX)/share/doc/$(RELEASE)/CHANGES
92     mkdir -p $(CACHE)/fetch-crl && chmod 0700 $(CACHE)/fetch-crl
93    
94     rpm: tar
95     rpmbuild -ta ${RELEASE}.tar.gz
96 davidg 2511 rpmbuild -ta -D "dist .suse" ${RELEASE}.suse.tar.gz
97 davidg 1758 @if [ -f ${RPMTOPDIR}/SRPMS/${NAME}-${VERSION}-${PATCHLEVEL}.src.rpm ] ; then \
98     mv ${RPMTOPDIR}/SRPMS/${NAME}*-${VERSION}-${PATCHLEVEL}.src.rpm . ; \
99     fi
100     @if [ -f ${RPMTOPDIR}/RPMS/i386/${NAME}-${VERSION}-${PATCHLEVEL}.i386.rpm ] ; then \
101     mv ${RPMTOPDIR}/RPMS/i386/${NAME}*-${VERSION}-${PATCHLEVEL}.i386.rpm . ; \
102     fi
103     @if [ -f ${RPMTOPDIR}/RPMS/i686/${NAME}-${VERSION}-${PATCHLEVEL}.i686.rpm ] ; then \
104     mv ${RPMTOPDIR}/RPMS/i686/${NAME}*-${VERSION}-${PATCHLEVEL}.i686.rpm . ; \
105     fi
106     @if [ -f ${RPMTOPDIR}/RPMS/noarch/${NAME}-${VERSION}-${PATCHLEVEL}.noarch.rpm ] ; then \
107     mv ${RPMTOPDIR}/RPMS/noarch/${NAME}*-${VERSION}-${PATCHLEVEL}.noarch.rpm . ; \
108 davidg 2511 mv ${RPMTOPDIR}/RPMS/noarch/${NAME}*-${VERSION}-${PATCHLEVEL}.suse.noarch.rpm . ; \
109 davidg 1758 fi
110     @echo DO NOT FORGET TO SIGN THE RPM WITH rpm --resign ${NAME}*-${VERSION}-${PATCHLEVEL}.noarch.rpm
111    
112     clean:
113     -rm -rf *.tar.gz *.rpm fetch-crl config.sh fetch-crl.spec

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