blob: b520cdeb5d7a4362ed8d180ca00da0356b095fce (
plain)
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
###############################################################################
# Makefile for fedora-doc-common packaging
# Created by: Paul W. Frields <stickster@gmail.com>
# License: GPL
# Copyright 2005 Paul W. Frields
###############################################################################
DOCBASE = fedora-doc-common
######################################################
# Some packaging specific vars
VERSION = 0.1
RELEASE = cvs$(shell date +"%Y%m%d")
DATE = $(shell date +"%Y-%m-%d")
NOW = $(shell date +"%a %b %e %Y")
SPECIN = ../docs-common/packaging/$(DOCBASE).spec
DOCSPEC = $(shell rpm ${RPMFLAGS} --eval '%{_specdir}')/$(DOCBASE).spec
DOCSRCTAR = $(shell rpm ${RPMFLAGS} --eval '%{_sourcedir}')/$(DOCBASE)-$(RELEASE).src.tar.gz
TITLE = Fedora Documentation Project Shared Files
######################################################
# Some RPM flags...
######################################################
RPMFLAGS = --define "docbase $(DOCBASE)" \
--define "version $(VERSION)" \
--define "release $(RELEASE)" \
--define "_topdir $(PWD)/rpmbuild"
RPM = rpm ${RPMFLAGS}
######################################################
clean:
rm -rf $(DOCBASE)*.rpm
rm -rf $(PWD)/rpmbuild
update: clean
cvs update
rpm: update
#
# Make RPM-compliant tarball of source XML and other stuff
mkdir $(DOCBASE)-$(RELEASE)
find . -maxdepth 1 -type d \( \
-name 'bin' -o \
-name 'common' -o \
-name 'css' -o \
-name 'images' -o \
-name 'packaging' -o \
-name 'stylesheet-images' -o \
-name 'xsl' \) | xargs -i \
find {} -maxdepth 1 -type f ! \( \
-name '.*' -o -name '*~' -o \
-name '*.svg' -o -name '*.eps' \) | \
cpio -pamdv $(DOCBASE)-$(RELEASE)
# include Makefile.common for use in offline FDP doc building
cp Makefile.common $(DOCBASE)-$(RELEASE)
#
# Make RPM build tree; don't rely on local user's setup
mkdir -p rpmbuild/{BUILD,RPMS/noarch,SOURCES,SPECS,SRPMS}
tar -zcvf $(DOCSRCTAR) $(DOCBASE)-$(RELEASE)
cp $(SPECIN) $(DOCSPEC)
rm -rf $(DOCBASE)-$(RELEASE)/
#
# Make rpmlint happy with a changelog entry
# FIXME: Maybe more magic would make this stickier; pity
# I'm no magician...
sed 's/\(%changelog\)/\1\n* $(NOW) Fedora Docs Project <fedora-docs-list@redhat.com> - $(VERSION)-$(RELEASE)\n- Update to $(RELEASE)\n/' \
$(SPECIN) > $(DOCSPEC)
#
# Do the build...
#
rpmbuild -bb $(RPMFLAGS) $(DOCSPEC)
mv $(shell ${RPM} --eval '%{_rpmdir}')/noarch/*.rpm .
rpmbuild --clean --rmsource $(RPMFLAGS) $(DOCSPEC)
rm -rf $(shell ${RPM} --eval '%{_topdir}')
|