]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - build/rpm/Makefile
Undoes mod: xfs-cmds:slinx:120772a
[thirdparty/xfsprogs-dev.git] / build / rpm / Makefile
1 #
2 # Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
3 #
4 # This program is free software; you can redistribute it and/or modify it
5 # under the terms of version 2 of the GNU General Public License as
6 # published by the Free Software Foundation.
7 #
8 # This program is distributed in the hope that it would be useful, but
9 # WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11 #
12 # Further, this software is distributed without any warranty that it is
13 # free of the rightful claim of any third person regarding infringement
14 # or the like. Any license provided herein, whether implied or
15 # otherwise, applies only to this software file. Patent licenses, if
16 # any, provided herein do not apply to combinations of this program with
17 # other software, or any other product whatsoever.
18 #
19 # You should have received a copy of the GNU General Public License along
20 # with this program; if not, write the Free Software Foundation, Inc., 59
21 # Temple Place - Suite 330, Boston MA 02111-1307, USA.
22 #
23 # Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
24 # Mountain View, CA 94043, or:
25 #
26 # http://www.sgi.com
27 #
28 # For further information regarding this notice, see:
29 #
30 # http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
31 #
32
33 TOPDIR = ../..
34 TREEROOT = $(shell cd ${TOPDIR}; pwd)
35 include $(TOPDIR)/include/builddefs
36
37 SPECF = $(PKG_NAME).spec
38 LDIRT = $(PKG_NAME)*.rpm $(SPECF) rpmmacros rpm-*.rc $(TOPDIR)/files*.rpm
39
40 LSRCFILES = macros.template $(SPECF).in rpm-2.rc.template
41
42 default install install-dev :
43
44 include $(BUILDRULES)
45
46 # generate a binary rpm file
47 dist : default $(SPECF) rpm-$(RPM_VERSION).rc
48 $(RPM) -ba --rcfile ./rpm-$(RPM_VERSION).rc $(SPECF)
49
50 # Because rpm prior to v.2.90 does not support macros and old style config
51 # is not supported by rpm v.3, we have to resort to such ugly hacks
52 ifneq ($(RPM_VERSION),2)
53 rpm-$(RPM_VERSION).rc : rpmmacros
54 sed -e '/^macrofiles:/s|~/.rpmmacros|rpmmacros|' </usr/lib/rpm/rpmrc >$@
55
56 rpmmacros : macros.template
57 @sed -e 's|%topdir%|$(TREEROOT)|g' < $< > $@
58 else
59 rpm-2.rc: rpm-2.rc.template
60 @sed -e 's|%topdir%|$(TOPDIR)|g' < $< > $@
61 endif
62
63 .PHONY: $(SPECF)
64 ${SPECF} : ${SPECF}.in
65 sed -e's|@pkg_name@|$(PKG_NAME)|g' \
66 -e's|@pkg_version@|$(PKG_VERSION)|g' \
67 -e's|@pkg_release@|$(PKG_RELEASE)|g' \
68 -e's|@pkg_distribution@|$(PKG_DISTRIBUTION)|g' \
69 -e's|@pkg_builder@|$(PKG_BUILDER)|g' \
70 -e's|@build_root@|$(DIST_ROOT)|g' \
71 -e'/^BuildRoot: *$$/d' \
72 -e's|@pkg_var_dir@|$(PKG_VAR_DIR)|g' \
73 -e's|@pkg_share_dir@|$(PKG_SHARE_DIR)|g' \
74 -e's|@pkg_log_dir@|$(PKG_LOG_DIR)|g' \
75 -e's|@pkg_doc_dir@|$(PKG_DOC_DIR)|g' \
76 -e's|@pkg_man_dir@|$(PKG_MAN_DIR)|g' \
77 -e's|@pkg_tmp_dir@|$(PKG_TMP_DIR)|g' \
78 -e's|@make@|$(MAKE)|g' < $< > $@